Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Load (or reload) controller from js code (another controller) call it's init function
function load(controllerName, query) { var url = controllerName + ".html"; require(['js/' + controllerName + '/'+ controllerName + 'Controller'], function(controller) { basicInfo = new BasicInfo() controller.init(basicInfo, query); $('.tab-link').each(function(index) { if ($(this).attr('href') == url) $(this).addClass('active'); else $(this).removeClass('active'); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initilizeController(){\n }", "function initController() {\n }", "function initiateController() {\n window.extensions.KJSLINT.Panels.Command.Controller.init();\n }", "function initController() {\r\n loadProjects();\r\n }", "function initController(){\n loadCountries();\n }", "function initController(){\n var home=document.querySelector(\".home\");\n controller=Controller(home);\n controller.init();\n controller.setOnButtonClickedListener(onButtonClicked);\n }", "function initializeController() {\n }", "function initializeController() {\n }", "setController(initController) {\n this.controller = initController;\n }", "setController(initController) {\n this.controller = initController;\n }", "function loadController(controllerName, callback){\r\n currentControllerName = controllerName;\r\n if(controllers[controllerName]!=undefined) {\r\n // console.log(\"controller already loaded\");\r\n callback();\r\n return;\r\n }\r\n\r\n controllers[controllerName] = null;\r\n var filePath = defaultRoute.baseUrl + \"/controllers/\" + controllerName + \".js\";\r\n var script = document.createElement(\"script\");\r\n script.type=\"text/javascript\";\r\n script.src = filePath;\r\n script.onload = function(){\r\n registerController(controllerName);\r\n callback();\r\n }\r\n document.head.appendChild(script);\r\n// var script = $('<script type=\"text/javascript\" src=\"'+ filePath\r\n// +'\"></script>');\r\n// script.get(0).load = callback;\r\n// $(document.body).append(script);\r\n }", "function init() {\r\n // Set up the items that are needed for the controller to run\r\n }", "function init() {\n\tself=new AdminController();\n}", "function InitController()\n {\n trc.schema.controller._init();\n }", "function MainController() {\n\n }", "init() {\n if (document.body) {\n const { body } = document;\n const controller = body.getAttribute('data-controller');\n const action = body.getAttribute('data-action');\n\n if (controller) {\n this.execAction(controller, 'init');\n this.execAction(controller, action);\n }\n }\n }", "function init() {\n\t\"use strict\";\n\tconsole.log(\"init() called\");\n\n\tDemoScriptsController.checkDemoScripts();\n\n\t$('#bottomPanel').bottomPanel('init');\n\t$(\"#topBarIcons\").topBarIconsPlugin('init');\n\n\t$('#properties').library(\"init\");\n\t$('#properties').library('setAlphabetVisible', false);\n\n\t$(\"#libraryButton\").click(function() {\n\t\tPropertiesController.initializeLibrary();\n\t});\n\n\t$('#loadConfigButton').on('click', function() {\n\t\tScriptController.loadScript();\n\t});\n\n\t$('#saveConfigButton').on('click', function() {\n\t\tScriptController.saveScript();\n\t});\n\n\t$('#runConfigButton').on('click', function() {\n\t\tScriptController.runScript();\n\t});\n\n\t$('#clearConsoleBtn').on('click', function() {\n\t\t$('#ambConsole').empty();\n\t});\n\n\t//Simulator init\n\tSimulator.ambConsole = $('#ambConsole');\n\n\t// editor init - not used due to TIVI-2181\n\t// editor = ace.edit(\"textArea\");\n\t// editor.setTheme(\"ace/theme/ambiance\");\n\t// editor.getSession().setMode(\"ace/mode/javascript\");\n\n\t// vehicle init\n\tvehicle = new Vehicle(PropertiesController.wsStart, PropertiesController.wsError, \"ws://localhost:23001\");\n}", "initControllers() {\n\t\tnew BlockController(this.app);\n\t}", "function _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }", "function applicationLoaded() {\n initiateController();\n }", "function ViewController() {}", "function initialize() {\n $scope.isBrowser = true; //util.isBrowser();\n loadAllAppFiles();\n\n var div = document.getElementById('cc.base1');\n var ccBase = new LoadingCtrl(div);\n ccBase.initialize();\n ccBase.invalid();\n\n var divPartical = document.getElementById('cc.base2');\n var ccPartical = new ParticalCtrl(divPartical);\n ccPartical.initialize();\n ccPartical.invalid();\n\n var I18nRes = {\n \"HELLO\": 'HELLO',\n \"template.WELCOME\": {\n Key: 'template.WELCOME',\n Params: { name: $scope.Eugene.name },\n },\n };\n\n $scope.I18nRes = Object.keys(I18nRes).map(function(key) {\n return I18nRes[key];\n });\n\n testOOP();\n }", "_initializeControllers()\n {\n this._controllerContextMenu = new ControllerContextMenu();\n this._controllerModal = new ControllerModal();\n this._controllerProject = new ControllerProject();\n this._controllerResource = new ControllerResource();\n this._controllerRunJob = new ControllerRunJob();\n this._controllerWorkflow = new ControllerWorkflow();\n this._controllerWorkflowBuilder = new ControllerWorkflowBuilder();\n this._controllerWorkflowRun = new ControllerWorkflowRun();\n\n }", "function initclient() {\n\tvar model=new RemoteModel();\n\tvar view=new UserView();\n\tvar controller=new Controller(model,view);\n\tmodel.init();\n\tgeid('userinterface').innerHTML=\"client initialized\";\n\tgeid('title').innerHTML=\"IOktopus v0.35 growing...\";\n}", "function load(controllerName, query) {\n console.log('app/controller/'+ controllerName + 'Controller');\n require(['app/controller/'+ controllerName + 'Controller'], function(controller) {\n controller.init(query);\n });\n }", "init() {\n // Action to execute on load of the app\n }", "function Controller(){} //Extends Class (at bottom of page).", "function ViewController(){}//Extends Controller (at bottom of page).", "function _init() {\n vm.loading = true;\n vm.success = false;\n vm.errmsg = null;\n _loadHome();\n }", "function Controller() { }", "constructor() {\n this.controller = new Controller();\n this._initialized = false;\n }", "init() {\n this.reset();\n this.load();\n }", "function load(controllerName, query) {\n\t\trequire(['js/' + controllerName + 'Controller'], function(controller) {\n\t\t\tcontroller.init(query);\n\t\t});\n\t\t//history.pushState(null, null, document.URL);\n\t\t/*history.pushState(null, null, \"#\");\n\t\twindow.addEventListener(\"popstate\",function(e) { \n\t\t //history.pushState(null, null, document.URL);\n\t\t\thistory.pushState(null, null, \"#\");\n\t\t}, false);*/\n\t}", "function init(vew) {\n\n // the view this controller is controlling\n view = vew;\n\n // put the view in an initial state\n view.init();\n }", "function init() {\r\n alertify.parent(document.body);\r\n console.log(\"init()s'est executée\");\r\n\r\n doAjax(ajaxTarget + \"?level=\" + level + \"&red=\"+ red +\"&blue=\"+blue,ajaxCallback, 0, 0);\r\n\r\n alerteTemp();\r\n\r\n //désatvier le controller\r\n $(\".autoside\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n $(\".manuside\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n $(\".barre\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n $(\".mode\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n\r\n document.getElementById('automatiqueMode').disabled = true;\r\n document.getElementById('manualMode').disabled = true;\r\n\r\n }", "function bootstrap() {\n MODULE.Controller.init(MODULE.Model, MODULE.View);\n }", "function load_controller(url, callback) {\n\t\tvar controller_done, interface_source;\n\t\t\n\t\t// When both the interface_data and the controller are loaded, then combine them and render\n\t\t// the interface.\n\t\tfunction check_done() {\n\t\t\tif (!controller_done || interface_source === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(interface_source);\n\t\t}\n\n\t\t// Check to see if we need to load the remote interface or not.\n\t\tif (loaded_urls[url] === undefined) {\n\t\t\tloaded_urls[url] = true;\n\n\t\t\t// Load the controller from the server\n\t\t\t$.ajax({\n\t\t\t\ttype: \"GET\",\n\t\t\t\turl: url,\n\t\t\t\tsuccess: function () {\n\t\t\t\t\tcontroller_done = true;\n\t\t\t\t\tcheck_done();\n\t\t\t\t},\n\t\t\t\tdataType: \"script\",\n\t\t\t\tcache : false\n\t\t\t});\n\n\t\t\t// Load the interface and parse it\n\t\t\t$.ajax({\n\t\t\t\ttype: \"GET\",\n\t\t\t\turl: url.replace(/\\.js$/, '.tci'),\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\tinterface_source_cache[url] = data;\n\t\t\t\t\tinterface_source = data;\n\t\t\t\t\tcheck_done();\n\t\t\t\t},\n\t\t\t\tdataType: \"text\",\n\t\t\t\tcache: false\n\t\t\t});\n\t\t} else {\n\t\t\tinterface_source = interface_source_cache[url];\n\t\t\tcontroller_done = true;\n\t\t\tcheck_done();\n\t\t}\n\t}", "setupController(controller , model ){ \n controller.set('webapidata4',model.resultO);\n }", "init_pre() {\n prop.airport = airport;\n\n this.airlineController = new AirlineController();\n this.aircraftController = new AircraftController();\n\n window.airlineController = this.airlineController;\n window.aircraftController = this.aircraftController;\n }", "init() {\n\t\tthis.#activateNew('Loading');\n\t}", "function _init () {\n $log.debug('AboutController init');\n\n // ...\n }", "public function Init(element: Object, args: Object, controller: Object, debug: Object) {\n\t\t\ttry {\n\t\t\t\t// save global variables\n\t\t\t\tthis.debug = debug;\n\t\t\t\tthis.controller = controller;\n\t\t\t\tthis.content = controller.RenderEngine.Content;\n\t\t\t\t// check pre-conditions\n\t\t\t\tPreConditions();\n\t\t\t\t// start when the UI is ready\n\t\t\t\tvar StartDelegate: VoidDelegate = InitializeComponent;\n\t\t\t\tcontent.Dispatcher.BeginInvoke(DispatcherPriority.Background, StartDelegate);\n\t\t\t} catch (ex: Exception) {\n\t\t\t\tConfirmDialog.ShowErrorDialog(\"Script\", ex);\n\t\t\t}\n\t\t}", "onload() {\n this.init();\n }", "function init() {\n logger.info('init called');\n showAdminDashboard();\n $.app_config_window.init();\n}", "function init() {\n\t$('#navbar-collapse-main').collapse({\n\t\t'toggle' : false\n\t});\n\n\t// -- Gestion des liens entre pages --\n\t$(\"a[href^='#'].page-link\").click(function() {\n\t\trouter_page($(this).prop(\"href\"));\n\t});\n\n\t// -- Page debug --\n\t$(\"#debug_refresh\").click(debug);\n\t// Config\n\tvar myTextarea = document.querySelector(\"#debug_config_editor\");\n\teditor = new CodeMirror(myTextarea, {\n\t\tlineNumbers : true,\n\t\tlineWrapping : true,\n\t\tmode : {\n\t\t\tname : \"javascript\",\n\t\t\tjson : true\n\t\t},\n\t\textraKeys : {\n\t\t\t\"Ctrl-S\" : function(cm) {\n\t\t\t\tconfig_save_cb();\n\t\t\t}\n\t\t}\n\t});\n\t$(\"#debug_config_save\").click(config_save_cb);\n\n\t// -- Initialisation de la page --\n\treset();\n\t$.get(\"/api/config\", _init_cb);\n}", "function initModules() {\n model_store = new Soapify.model_store();\n vc_navbar = new Soapify.viewcontroller_navbar();\n vc_info = new Soapify.viewcontroller_info();\n vc_map = new Soapify.viewcontroller_map(model_store);\n vc_contact = new Soapify.viewcontroller_contact();\n }", "function init(){}", "function main($scope, mainFactory, loadMainController) {\n\t console.log(loadMainController);\n\t $scope.main = \"This is main page\";\n\t mainFactory.say();\n\t}", "setupController(controller , model ){ \n controller.set('webapidataf2',model.resultA); \n }", "init() {\n\n this.assignPlayer();\n gameView.init(this);\n gameView.hide();\n scoreBoardView.init(this);\n registerView.init(this);\n this.registerSW();\n }", "function initControllers() {\n Subscription.appModule.controller(\"UserInvitationCtrl\", UserInvitationCtrl).controller(\"PackageSelectionCtrl\", PackageSelectionCtrl);\n }", "function Controller() {\n\n }", "function Controller() {\n \n }", "function Controller() {\n \n }", "_setup() {\n this._controller.setup();\n }", "function _init() {\n window.alert(\"admin ctrl works\");\n }", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function load() {\n\t\t// Load external resources then proceed with init.\n\t\t//require([\"cog1/ext/glMatrix.js\",\"cog1/exercise.js\"], init(createSceneFkt););\n\t\t//require([\"cog1/ext/glMatrix.js\"], function() { init(createSceneFkt); });\n\t\tinit();\n\t}", "function _init() {\r\n $sc['_name'] = CONTROLLER_NAME;\r\n\r\n //Set page title\r\n $hs.$scope.setTitle([\r\n characterInfo['serverName'],\r\n '->',\r\n characterInfo['characterName']\r\n ].join(' '));\r\n\r\n //Set up character and server names and stats\r\n $sc['serverName'] = characterInfo['serverName'];\r\n $sc['character'] = characterInfo;\r\n\r\n //Set up chart\r\n $sc['chart'] = _setUpChart(characterInfo);\r\n\r\n //Set up pagination\r\n $sc['pagination'] = _setUpPagination(characterInfo['status'], 10);\r\n\r\n //Search...\r\n $sc['search'] = _search;\r\n }", "function initializeController() {\n fetchClassificationCategories() ;\n }", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function MainController() {\n\n var self = this;\n\n //\n _.extend(self, {\n });\n\n\n }", "function initSwitch() {\n\n // Load first page into container\n loadPage(\"home_onlineChoiceView.html\");\n}", "init (controller) {\n this.controller = controller\n this.originalRunTreeFunction = controller.runTree\n\n if (this.storeMutations) {\n this.initialModelString = JSON.stringify(controller.model.get())\n }\n\n window.addEventListener('cerebral2.debugger.changeModel', (event) => {\n controller.model.set(event.detail.path, event.detail.value)\n controller.flush()\n })\n window.addEventListener('cerebral2.debugger.remember', (event) => {\n if (!this.storeMutations) {\n console.warn('Cerebral Devtools - You tried to time travel, but you have turned of storing of mutations')\n }\n this.remember(event.detail)\n })\n window.addEventListener('cerebral2.debugger.reset', (event) => {\n this.reset()\n })\n // When debugger responds a client ping\n window.addEventListener('cerebral2.debugger.pong', this.sendInitial)\n // When debugger pings the client\n window.addEventListener('cerebral2.debugger.ping', this.sendInitial)\n\n const event = new window.CustomEvent('cerebral2.client.message', {\n detail: JSON.stringify({type: 'ping'})\n })\n window.dispatchEvent(event)\n\n this.watchExecution()\n }", "function MainController(\n $log\n ) {\n var main = this;\n\n /**\n * A function for Jessica to make a change to.\n */\n function jessica() {\n $log.debug(\"TODO\");\n }\n\n /**\n * A function for KP to make a change to.\n */\n function kp() {\n $log.debug(\"TODO\");\n }\n\n /**\n * A function for John to make a change to.\n */\n function john() {\n $log.debug(\"TODO\");\n }\n\n /**\n * This function only exists to prevent everyone from modifying the same area in code.\n *\n * TODO - remove this once everyone has submitted a code change\n */\n function training() {\n jessica();\n kp();\n john();\n }\n\n $log.debug(\"Main Controller loaded\", main);\n\n training();\n }", "function main() {\n\n // Step 1: Load Your Model Data\n // The default code here will load the fixtures you have defined.\n // Comment out the preload line and add something to refresh from the server\n // when you are ready to pull data from your server.\n <%= class_name %>.server.preload(<%= class_name %>.FIXTURES) ;\n\n // TODO: refresh() any collections you have created to get their records.\n // ex: <%= class_name %>.contacts.refresh() ;\n\n // Step 2: Instantiate Your Views\n // The default code just activates all the views you have on the page. If\n // your app gets any level of complexity, you should just get the views you\n // need to show the app in the first place, to speed things up.\n SC.page.awake() ;\n\n // Step 3. Set the content property on your primary controller.\n // This will make your app come alive!\n\n // TODO: Set the content property on your primary controller\n // ex: <%= class_name %>.contactsController.set('content',<%= class_name %>.contacts);\n\n}", "function initModal(){\n setModalControllerData('languages', $scope.languages);\n setModalControllerData('services', $scope.services);\n setModalControllerData('softwares', $scope.softwares);\n }", "function IndexController() {\n initHbbtv();\n setRedButtonTimeout();\n window.onkeydown = redButtonCreateAppEventHandler;\n}", "initializing () {\n require('./actions/init')(this)\n }", "function init()\n{\n //initalize the application\n meDominance='';\n reset();\n //setFrameUrl('header','header.htm');\n //setFrameUrl('left','selectdomleft.htm');\n //setFrameUrl('right','selectdomright.htm');\n\n blnInitCalled=true;\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}", "load(){\n\n\t\tfor(var moduleName in this.ControllerManifest){\n\n\t\t\tLog.info(\"Loading app module {}\", moduleName);\n\n\t\t\tvar thisModuleManifest = this.ControllerManifest[moduleName];\n\t\t\t\n\t\t\tvar moduleFileName = thisModuleManifest.file || $.concat(\".\", moduleName + \"Module\", \"js\");\n\t\t\tvar ModuleObject = false;\n\n\t\t\ttry{\n\t\t\t\tModuleObject = require(__CONFIG.paths.modules + \"/\" + moduleFileName);\n\t\t\t}catch(e){\n\t\t\t\tLog.error(\"Can't include file of module {}\", moduleName, e);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._validatePayloadSchema(moduleName, this.ControllerManifest[moduleName].methods);\n\t\t\tthis.Prototypes[moduleName.toLowerCase()] = {\n\t\t\t\tobject : ModuleObject,\n\t\t\t\tmanifest : this.ControllerManifest[moduleName]\n\t\t\t}\t\t\t\n\t\t}\n\t\tLog.info(\"__________________________ INITIALISED. APP RUNNING. __________________________ \");\n\t}", "function init(){\n\n }", "function init() {\n\t\tdemobo.setController( {\n\t\t\turl : ui.controllerUrl\n\t\t});\n\t\t// your custom demobo input event dispatcher\n\t\tdemobo.mapInputEvents( {\n\t\t\t'playPauseButton' : playPause,\n\t\t\t'playButton' : playPause,\n\t\t\t'pauseButton' : playPause,\n\t\t\t'loveButton' : love,\n\t\t\t'spamButton' : ban,\n\t\t\t'nextButton' : next,\n\t\t\t'channelTab' : sendStationList,\n\t\t\t'stationItem' : chooseStation,\n\t\t\t'volumeSlider' : setVolume,\n\t\t\t'demoboVolume' : onVolume,\n\t\t\t'demoboApp' : function() {\n\t\t\t\trefreshController();\n\t\t\t\thideDemobo();\n\t\t\t}\n\t\t});\n\t\tshowDemobo();\n\t\tsetupSongUpdateListener();\n\t}", "function initialize() {\n $.get(\"views/AdminHomePage.html\")\n .done(setup)\n .fail(error);\n }", "function initInnerPageController() {\n\t\t/*populate location array*/\n\t\t/*vm.model.locationArr = custportalGetSetService.getLocalityObj();*/\n\t\tvar obj = custportalGetSetService.getPhysioId();\n\t\t// If obj found undefined, then we will wait for 100 ms and will try to init inner page controller again\n\t\tif(obj == undefined) {\n\t\t\tconsole.log(\"waiting in initInnerPageController\");\n\t\t\t$timeout(function() {\n\t\t\t\tvm.method.initInnerPageController();\n\t\t\t}, 100);\n\t\t\treturn;\n\t\t}\n\t\tvm.model.physiotherapyId = obj.physioId;\n\t\tvm.model.apptCost = obj.apptCost;\n\t\tvm.model.selectedLocation = \"Choose Location\";\n\t\tvm.model.timeslot = \"Select Time\";\n\t\tlocalmethods.initDatePicker();\n\t\tlocalmethods.initLocalities();\n\t\t$timeout(function() {\n\t\t\tif($scope.$parent.cpc.scrolltodivName == 'physiotherapy') {\n\t\t\t\tvar element = document.getElementById(\"physiotherapy\");\n\t element.scrollIntoView();\n\t\t\t}\n\t\t}, 200);\n\t\t\n\t}", "function initModal(){\n setModalControllerData('languages', $scope.languages);\n setModalControllerData('services', $scope.services);\n setModalControllerData('softwares', $scope.softwares);\n setModalControllerData('engineeringCategories', $scope.engineeringCategories);\n }", "function init(model){\n\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 }", "function init() {\r\n\t// Get the template views from the server to better separate views from model\r\n\t// They're loaded before the document is actually ready for better performance\r\n\tvar signInTemplate = $(\"<div>\").load(\"templates/signIn.html\");\r\n\tvar signUpTemplate = $(\"<div>\").load(\"templates/signUp.html\");\r\n\r\n\t// Get the properties according to the URL's \"lan\" parameter\r\n\tloadProperties(language);\r\n\r\n\t$(document).ready(function() {\r\n\t\t// Populate the templates according to the configuration and URL data\r\n\t\tpopulateBasePage();\r\n\t\tsignInTemplate = populateSignInTemplate(signInTemplate);\r\n\t\tsignUpTemplate = populateSignUpTemplate(signUpTemplate);\r\n\r\n\t\t// Put the templates in the document\r\n\t\t$(\"#wrap\").append(signInTemplate);\r\n\t\t$(\"#wrap\").append(signUpTemplate);\r\n\r\n\t\t// Prepare the modals to close when the required conditions are met\r\n\t\tprepareModals();\r\n\t});\r\n}", "init(){\n }", "init(){\n\n\n }", "function init() {\n vm.loaded = 0;\n\n if (type == 'followers') loadFollowers();\n else if (type == 'following') loadFollowing();\n }", "function myCountryController() {\n\n}", "function init() {\n\t\t// Loads a script\n\t\tvar loadScript = function(path) {\n\t\t var headID = document.getElementsByTagName('head')[0];\n\t\t var newScript = document.createElement('script');\n\t\t newScript.type = 'text/javascript';\n\t\t newScript.src = path;\n\t\t headID.appendChild(newScript);\n\t\t};\n\n\n\t\tMessenger.storeData('originalLocation', location.hash);\n\t Messenger.storeData('server', server);\n\t Messenger.storeData('extVersion', extVersion);\n\t Messenger.storeData('combinedPath', combinedPath);\n\t if (typeof devRealtimeServer !== 'undefined') {\n\t \tMessenger.storeData('devRealtimeServer', devRealtimeServer);\n\t }\n\n\n\t // Load the initialization script\n\t loadScript(server + combinedPath + 'combined-' + extVersion + '.js');\n\t }", "function init()\n{\n}", "function init()\n{\n}", "function init()\n{\n}", "init() {\n this.addAdditionnalScripts();\n }", "function loadInpage() {\n // check if already initialized - just in case these scripts were loaded multiple times\n var bootstrapper = new _bootstrap_bootstrap__WEBPACK_IMPORTED_MODULE_0__[\"BootstrapInPage\"]();\n bootstrapper.initialize();\n _quick_edit_quick_e__WEBPACK_IMPORTED_MODULE_8__[\"QuickE\"].start();\n /** this enhances the $2sxc client controller with stuff only needed when logged in */\n if (!_interfaces_window_in_page__WEBPACK_IMPORTED_MODULE_6__[\"windowInPage\"].$2sxc.system)\n _interfaces_window_in_page__WEBPACK_IMPORTED_MODULE_6__[\"windowInPage\"].$2sxc.system = new _system__WEBPACK_IMPORTED_MODULE_9__[\"SystemUpgrader\"]();\n /** Connect DNN action mapper to this module instance */\n _interfaces_window_in_page__WEBPACK_IMPORTED_MODULE_6__[\"windowInPage\"].$2sxcActionMenuMapper = function (moduleId) {\n return new _dnn__WEBPACK_IMPORTED_MODULE_3__[\"DnnActionMenu\"](moduleId);\n };\n}", "function init ( id ){\r\n try{\r\n isEditor = (window.parent.location.href.indexOf('editor') != -1) ? true : false;\r\n } catch(e){\r\n }\r\n\r\n // Set enable for auto play for media elements\r\n EM.Media.toggleEnabled( true );\r\n\r\n /*** Set listeners ***/\r\n $(window).on('presentationObjectReady', setPlayerSidebarButtons);\r\n $(window).on('presentationObjectReady', setPlayerGUIbyDevice);\r\n\r\n // scene-manager is done and the scene is ready to be played\r\n $(window).on('sceneReady', sceneIsReady);\r\n\r\n if (isEditor) {\r\n \r\n $(window).one('sceneReady', function () {\r\n try {\r\n window.parent.postMessage('playerReady', '*');\r\n } catch (e) {\r\n console.log(e);\r\n //TODO send error to logger in server;\r\n }\r\n });\r\n }\r\n\r\n // perform action when hash changes\r\n $(window).on('hashchange', stateCalled);\r\n\r\n // Implement slide settings if exist on $currentSlide\r\n $('#scene').on('transitionStart', checkSlideAutoplay);\r\n $('#scene').on('transitionDone', checkSlideScroll);\r\n\r\n // Player control\r\n $('.playButton').on('click', playWrap);\r\n $('.leftButton').on('click', prev);\r\n $('.rightButton').on('click', next);\r\n $('.voiceButton').on('click', voiceControl);\r\n $('.sectionsButton').on('click', sectionsScreen);\r\n $('.fullscreenButton').on('click', fullScreen);\r\n\r\n // Share popup\r\n $('.replay').on('click', rewind);\r\n\r\n // Set keyboard control listener\r\n $(window).on('keydown', onKeyPress);\r\n\r\n // Init the Scene\r\n EM.scenemanager.init( id );\r\n }" ]
[ "0.73674774", "0.7237928", "0.71068484", "0.70868456", "0.6924114", "0.68932307", "0.6882001", "0.6882001", "0.6791715", "0.6791715", "0.66455775", "0.66058433", "0.6590782", "0.65319896", "0.6509792", "0.6448334", "0.6419772", "0.63552946", "0.6332596", "0.6319235", "0.6312936", "0.62946475", "0.6285104", "0.615472", "0.615425", "0.61517197", "0.6151271", "0.61422276", "0.6096087", "0.60958487", "0.60772187", "0.607165", "0.60571164", "0.60556", "0.60369045", "0.6018529", "0.59915876", "0.5989392", "0.5978359", "0.59343493", "0.5928", "0.5883676", "0.58772105", "0.58699006", "0.58656037", "0.5865319", "0.5839713", "0.5781591", "0.5763056", "0.57622343", "0.5761272", "0.5748215", "0.5739714", "0.5739714", "0.5726634", "0.5710525", "0.57049334", "0.5700653", "0.5692811", "0.568657", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56780446", "0.56776977", "0.5672616", "0.5659062", "0.56488466", "0.56435245", "0.5636746", "0.562257", "0.56189615", "0.56186444", "0.5618094", "0.56173056", "0.5607922", "0.56040347", "0.5601649", "0.5600379", "0.5591336", "0.5582875", "0.55743676", "0.5554135", "0.5553058", "0.55529207", "0.55519545", "0.5550098", "0.55478275", "0.554324", "0.554324", "0.554324", "0.5541629", "0.5540801", "0.55395615" ]
0.59068936
41
Register button clicked run this function, ajax post to controllers.LaunchController.loginUser via routes
function btnRegisterSubmit_click(){ var id = $('#signin-id-input').val(); var email =$('#signin-email-input').val(); var pwd = $('#signin-pwd-input').val(); var repwd = $('#signin-repwd-input').val(); if(id.length!=0 && email.length!=0 && pwd.length!=0 && repwd.length!=0){ ///Email format validation check by regular expression var regex = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/; if (regex.test($('#signin-email-input').val()) === false) { alert("유효하지 않은 E-mail입니다. 다시 입력하세요."); $('#signin-email-input').val(""); } else { if(pwd != repwd){ alert("정확히 다시 입력하세요."); $('#signin-repwd-input').val(""); } else{ var obj = new Object(); obj.type = "signin"; obj.id = id; obj.email=email; obj.pwd = pwd; var jsonString = JSON.stringify(obj); $.ajax({ type : 'POST', crossOrigin: true, url : "/login", data : obj, success : function(e) { $('#signin-id-input').val(""); $('#signin-email-input').val(""); $('#signin-pwd-input').val(""); $('#signin-repwd-input').val(""); window.location.replace("/main"); // if register success, load main.scala.html (dashboard) check controller.PageController.main } }); } } } else{ alert("모든 값을 입력하세요.") $('#registerfrm').submit(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register() {\n $.post(\"AJAX/register-user.cshtml\",\n {\n username: username,\n email: email,\n password: password\n },\n (data, status) => {\n console.log(\"\\nData:\\n\" + data + \"\\nStatus:\\n\" + status);\n \n });\n}", "function loginClick() {\n\t username = $(\"#userName\").val();\n\t password = $(\"#password\").val();\n\t getRememberMestatus();\n\t var params = {\"username\":username,\"password\":password};\n\t var callerId = \"login\";\n\t var url = \"/logon\";\n\t reqManager.sendPost(callerId, url, params, loginSuccessHandler, loginErrorHandler, null);\n\t}", "register() {\n this.jquery(\"#register\").on(\"click\", function (event) {\n event.preventDefault();\n navigateTo(\"/sign\");\n });\n }", "function loginButton(){\n\tfunction getUser(userData) {\n \t$.get(\"/api/\", userData, function(data){\n \t\tconsole.log(data);\n \t\t//ensure all the retreived data is saved in the session\n \t\tsessionStorage.setItem('userId', data[0].id);\n \t\tsessionStorage.setItem('userfName', data[0].fName);\n\t\t\tsessionStorage.setItem('userlName', data[0].lName);\n\t\t\tsessionStorage.setItem('userCompany', data[0].company);\n\t\t\tsessionStorage.setItem('userEmail', data[0].email);\n\t\t\tsessionStorage.setItem('userPassword', data[0].password);\n \t})\n \t.then(changeURL);\n \t \n \t}\n \t//verify user information is entered correctly\n \tif($('#userEmail').val() == \"\" || $('#userPassword').val() == \"\"){\n \t\talert('Some information is missing from the form. Please make sure all information is filled out fully.');\n \t}else{\n\t\tgetUser({\n\t\t\taction: 'login',\n\t\t\temail: $('#userEmail').val(),\n\t\t\tpassword: $('#userPassword').val()\n\t\t});\n\t}\n}", "function registerUser(){\n var username = $('.username').val();\n var password = $('.password').val();\n\n $.post('/Controllers/Register.php', { username: username, password: password }, function(response) {\n // registered\n if(response.registered) {\n // redirect to login\n location.href = '/login.php';\n } else {\n // display error\n $('.errorMessage').html(response.errorMessage);\n }\n }, 'json');\n}", "function signUpUser(email, password, pet_types, pet_names) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n pet_types: pet_types,\n pet_names: pet_names\n }).then(function (data) {\n window.location.replace('/');\n // If there's an error, handle it by throwing up a boostrap alert\n\n //hide or empty the add member button and the new member form after creating a member\n\n $(\"button#newMembers\").hide();\n\n\n\n\n }).catch(handleLoginErr);\n\n }", "function signInAuth() {\n $('.loginRegister').on('click', '.signingInAcc', function(event) {\n event.preventDefault();\n const username = $('.usernameLogIn').val();\n const password = $('.passwordLogIn').val();\n postAuthLogin(username, password);\n });\n}", "function registerNewUserController() {\n attachEventListener([DOMelements.mainContent], 'submit', [registerSubmitEvent]);\n appState.registeredClickEvents.registerForm = true;\n}", "function registerLogin(email, password) {\n console.log(email, password)\n const body = {\n email: email,\n password: password\n }\n $.post(\"/api/login/register\", body)\n .then(function (res) {\n console.log(res)\n window.localStorage.setItem(\"user_id\", res.id);\n window.location.href = \"/inventory\"\n });\n }", "function submitUser(User) {\n $.post(\"/api/users/\", User, function() {\n window.location.href = \"/welcome\";\n });\n }", "function register(){\n var url = '/auth/reg';\n var login = $('#login').val();\n if (login.length == 0){\n Materialize.toast('Введите имя пользователя', 4000);\n return;\n }\n\n var password = $('#password').val();\n if (password.length == 0){\n Materialize.toast('Введите пароль', 4000);\n return;\n }\n\n $.ajax({\n type: 'POST',\n url: url,\n data:{\n login: login,\n password: password,\n csrfmiddlewaretoken:$('input[name=csrfmiddlewaretoken]').val()\n },\n success:function () {\n location.reload();\n }\n })\n }", "function signIn() {\n\tconsole.log(\"Sign In Button Pressed.\");\n\tvar name = $(\"input:text[name=signInName]\").val().trim();\n\tvar pass = $(\"input:password[name=signInPassword]\").val().trim();\n\n\tvar userInfo = {\n\t\tsignInName: name,\n\t\tsignInPassword: pass\n\t}\n\n\t//=-=-=-=-=-=-=-=\n\t$.post(\"/api/user/login\", userInfo)\n .then(function(data){\n \tconsole.log(\"Sent user info: \" + userInfo);\n \tif (data.error)\n \t\t$(\"input:text[name=signInName]\").val(data.error);\n\n \tif (data.success)\n \t\twindow.location = data.redirectTo;\n });\n\t//=-=-=-=-=-=-=-=\n}", "function register(){\n\t$.get(\"RegisterServlet\", {\n\t\tuserName : $('#email').val(),\n\t\tpassword : $('#password').val()\n\t},function(){\n\t\twindow.location.replace(\"login.html\");\n\t});\n}", "function handleSignupAction(event) {\n event.preventDefault();\n\n // Grab all the fields on the login Card\n var $name = $($pt.signupCard.field.name);\n var $email = $($pt.signupCard.field.email);\n var $loginId = $($pt.signupCard.field.loginId);\n var $password = $($pt.signupCard.field.password);\n var $hidePass = $($pt.signupCard.field.hidePass);\n var $status = $($pt.signupCard.field.errorStatus);\n var signupData = {};\n\n $status.empty();\n\n // Formulate data to store\n signupData.name = $name.val().trim();\n signupData.email = $email.val().trim();\n signupData.loginId = $loginId.val().trim();\n signupData.password = $password.val().trim();\n\n // Check to make sure we don't have blank one\n if (signupData.name === \"\" ||\n signupData.email === \"\" ||\n signupData.loginId === \"\" ||\n signupData.password === \"\") {\n\n $status.append(alertBar + \"All fields are required !\" + alertEnd);\n return false;\n }\n\n // Add an empty avatar for now.\n signupData.avatar = \"\";\n signupData.notify = 0;\n\n // Build the JSON urlHost to check if loginId already exist\n var urlHost = $pt.server.db + \"/users\";\n urlHost += \"?loginId=\" + signupData.loginId;\n\n // TODO: Perform AJAX to check data here\n $.ajax({\n url: urlHost,\n dataType: \"json\",\n method: \"GET\",\n success: function (result) {\n // result is an array if it return\n if (result.length === 0) {\n // We have no duplicate, allow the user to signup\n // WS to add the user signup\n var urlHost = $pt.server.db + \"/users\";\n\n // Call ajax to save the signupData\n $.ajax({\n url: urlHost,\n dataType: \"json\",\n method: \"POST\",\n data: signupData,\n success: function (result) {\n // Clear up the signup form page data\n $status.empty();\n $name.val(\"\");\n $email.val(\"\");\n $loginId.val(\"\");\n $password.val(\"\").attr(\"type\", \"text\");\n $hidePass.prop(\"checked\", false);\n // Close the signup modal\n $($pt.signupCard.handle).modal(\"hide\");\n\n // Call processSuccessLogin to log the user in\n // result is an object, wrap it in array\n processSuccessLogin([result]);\n },\n error: function (result) {\n console.log(\"ajax error post signup \" + result.status);\n }\n });\n } else if (result.length >= 1) {\n // We have duplicate.\n $status.append(alertBar +\"LoginId existed. Choose a different loginId\" +alertEnd);\n return false;\n }\n },\n error: function (result) {\n console.log(\"ajax error \" + result.status);\n }\n });\n\n }", "function ajaxregister()\n {\n var details = $('#register').serialize();\n var url=\"../registration/add_user.php\";\n\n $.post(url,details,function(data){\n $('#register').html(data);\n //show the ajax login button\n $('#ajax_login').show();\n\n });\n }", "function postLoginForm(){\n $.post({\n url: index + \"users/login\",\n data: {email: $('#useremail').val(), password: $('#userpassword').val()},\n success: function(data){\n setApiToken(data.api_token, $('#useremail').val());\n $('#loggedin').text(\"logged in as \" + $('#useremail').val());\n $('#status').text(\"Logout\");\n $('#newmodal').modal('hide');\n checkStatus()\n },\n error: function(data){\n var error = data;\n $('#userformerrors').html(\"<p class=\\\"bg-danger\\\">\" + data.responseJSON.error + \"</p>\");\n }\n })\n }", "function loginAndInsert(){\n\t\t\n\t$.confirm({\n\t\ttype: 'blue',\n\t title: 'Login servicio de Etiquetas QR',\n\t content: '' +\n\t '<form action=\"\" class=\"formName\">' +\n\t '<div class=\"form-group\">' +\n\t '<label>Usuario</label> <i class=\"fas fa-user\" style=\"color:grey;\"></i>' +\n\t '<input type=\"text\" id=\"user\" placeholder=\"Usuario\" class=\"name form-control\" required />' +\n\t '</div>' +\n\t '<div class=\"form-group\">' +\n\t '<label>Password</label> <i class=\"fas fa-lock\" style=\"color:grey;\"></i>' +\n\t '<input type=\"password\" id=\"password\" placeholder=\"Pass\" class=\"name form-control\" required />' +\n\t '</div>' +\n\t '</form>',\n\t buttons: {\n\t formSubmit: {\n\t text: 'Login',\n\t btnClass: 'btn-blue',\n\t action: function () {\n\t \t\n\t \t//\t\tAjax call\n\t \t\t\tvar user = document.getElementById(\"user\").value;\n\t \t\t\tvar password = document.getElementById(\"password\").value;\n\t \t\t\t\n\t \t\t\tvar xhr = new XMLHttpRequest();\n\t \t\t\tvar url = \"/rest/pet/admin\"; //For Webapp-runner must go this root /rest/pet/insert\n\t \t\t\n\t \t\t\t//Send the proper header information along with the request\n\t \t\t\txhr.onreadystatechange = function() {//Call a function when the state changes.\n\t \t\t\t if(xhr.readyState == 4 && xhr.status == 200) {\n\t \t\t\t \n\t \t\t\t \tif(xhr.responseText == \"true\"){\n\t \t\t\t\n/* Start insertPet() */\t \t\t\t \t\t\n\t \t\t\t \t\tconsole.log(\"Hola mundo\");\n\t \t\t\t \t\tvar raze = document.getElementById(\"raze\");\n\t \t\t\t \t\tvar name = document.getElementById(\"name\");\n\t \t\t\t \t\tvar age = document.getElementById(\"age\");\n\t \t\t\t \t\tvar ownerName = document.getElementById(\"ownerName\");\n\t \t\t\t \t\tvar ownerLastname = document.getElementById(\"ownerLastname\");\n\t \t\t\t \t\tvar ownerDni = document.getElementById(\"ownerDni\");\n\t \t\t\t \t\tvar street1 = document.getElementById(\"street1\");\n\t \t\t\t \t\tvar phone1 = document.getElementById(\"phone1\");\n\t \t\t\t \t\tvar phone2 = document.getElementById(\"phone2\");\n\t \t\t\t \t\tvar email = document.getElementById(\"email\");\n\t \t\t\t \t\tvar facebook = document.getElementById(\"facebook\");\n\t \t\t\t \t\tvar instagram = document.getElementById(\"instagram\");\n\t \t\t\t \t\tvar dateAntiRabicVaccine = document.getElementById(\"dateAntiRabicVaccine\");\n\t \t\t\t \t\tvar datePolivalentVaccine = document.getElementById(\"datePolivalentVaccine\");\n\t \t\t\t \t\tvar dateSextupleVaccine = document.getElementById(\"dateSextupleVaccine\");\n\t \t\t\t \t\tvar dateOctupleVaccine = document.getElementById(\"dateOctupleVaccine\");\n\t \t\t\t \t\tvar clinicHistory = document.getElementById(\"clinicHistory\");\n\t \t\t\t \t\tvar illness = document.getElementById(\"illness\");\n\t \t\t\t \t\tvar medicated = document.getElementById(\"medicated\");\n\t \t\t\t \t\tvar status = document.getElementById(\"status\");\n\t \t\t\t \t\tvar subscription = document.getElementById(\"subscription\");\n\t \t\t\t \t\t\n\t \t\t\t \t\tvar xhr1 = new XMLHttpRequest();\n\t \t\t\t \t\tvar url = \"/rest/pet/insert\"; //For Webapp-runner must go this root /rest/pet/insert\n\n\t \t\t\t \t\t//Send the proper header information along with the request\n\t \t\t\t \t\txhr1.onreadystatechange = function() {//Call a function when the state changes.\n\t \t\t\t \t\t if(xhr1.readyState == 4 && xhr1.status == 200) {\n\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\n\t\t\t\t\t\t\t\t\t\t/* On Controllers page to show QR tag generated */\n\t \t\t\t \t\t \tvar createImage = document.createElement(\"img\");\n\t \t\t\t \t\t \tvar divResult = document.getElementById(\"qrResult\");\t \t\n\t \t\t\t \t\t \tvar attribute = document.createAttribute(\"src\");\n\t \t\t\t \t\t \tattribute.value = \"data:image/png;base64, \"+xhr1.responseText;\n\t \t\t\t \t\t \tcreateImage.setAttributeNode(attribute);\n\t \t\t\t \t\t \tdivResult.appendChild(createImage);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$.alert(\"<body><content><div><img src='data:image/png;base64, \"+xhr1.responseText+\"'></img></div></content></body>\");\n\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\t \tvar link = document.createElement(\"a\");\n//\t \t\t\t \t\t \tvar hrefAttribute = document.createAttribute(\"href\");\n//\t \t\t\t \t\t \threfAttribute.value = \"google.com.ar\";\n//\t \t\t\t \t\t \tlink.setAttributeNode(hrefAttribute);\n//\t \t\t\t \t\t \tlink.setAttribute('download', name+'_'+ownerName+'_'+ownerLastname+'_'+'.jpg');\n//\t \t\t\t \t\t \tlink.setAttribute('target', '_blank');\n//\t \t\t\t \t\t \t\n//\t \t\t\t \t\t \tvar button = document.createElement(\"button\");\n//\n//\t \t\t\t \t\t \tvar classAttribute = document.createAttribute(\"class\");\n//\t \t\t\t \t\t \tclassAttribute.value = \"btn btn-primary\";\n//\t \t\t\t \t\t \tbutton.setAttributeNode(classAttribute);\n//\t \t\t\t \t\t \tbutton.setAttribute(\"id\", \"download\");\n//\t \t\t\t \t\t \t\n//\t \t\t\t \t\t \tvar download = document.getElementById(\"download\");\n//\t \t\t\t \t\t \t\n//\t \t\t\t \t\t \tbutton.innerHTML = \"Descarga\";\n//\t \t\t\t \t\t \tvar downloadButtonDiv = document.getElementById(\"downloadButtonDiv\");\n//\t \t\t\t \t\t \tdownloadButtonDiv.appendChild(button);\n//\t \t\t\t \t\t \t\n//\t \t\t\t \t\t \tbutton.appendChild(link);\n\t \t\t\t \t\t \t\n\t \t\t\t \t\t \t\n\t \t\t\t \t\t }\n\t \t\t\t \t\t}\n\t \t\t\t \t\txhr1.open(\"POST\", url, true);\n\t \t\t\t \t\txhr1.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t \t\t\t \t\txhr1.send(\"user=\"+user+\"&raze=\"+raze.value+\"&name=\"+name.value+\"&age=\"+age.value+\"&ownerName=\"+ownerName.value+\"&ownerLastname=\"+ownerLastname.value+\"&ownerDni=\"+ownerDni.value+\"&street1=\"+street1.value+\"&phone1=\"+phone1.value+\"&phone2=\"+phone2.value+\"&email=\"+email.value+\"&facebook=\"+facebook.value+\"&instagram=\"+instagram.value+\"&dateAntiRabicVaccine=\"+dateAntiRabicVaccine.value+\"&datePolivalentVaccine=\"+datePolivalentVaccine.value+\"&dateSextupleVaccine=\"+dateSextupleVaccine.value+\"&dateOctupleVaccine=\"+dateOctupleVaccine.value+\"&clinicHistory=\"+clinicHistory.value+\"&illness=\"+illness.value+\"&medicated=\"+medicated.value+\"&status=\"+status.value+\"&subscription=\"+subscription.value);\n\n\t \t\t\t \t}else{\n\t\t\t \t$.alert({type: 'red',\n\t\t\t \t\t\t title:'Error de logueo ',\n\t\t\t \t\t\t content:\"El usuario o password parecen no ser correctos, Si usted es un usuario nuevo comuniquese a <a href='mailto:[email protected]'>[email protected]</a> \"});\n\t\t\t \t\t\n\t\t\t \t}\t\n\t \t\t\t }\n\t \t\t\t}\n\t \t\t\txhr.open(\"POST\", url, true);\n\t \t\t\txhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t \t\t\txhr.send(\"user=\"+user+\"&password=\"+password);\n\t \t//\t\tAjax Call\n\t \t/* End insertPet() */\n\t \t\t\t\n\t\t }\n\t \n\t },\n\t cancel: function () {\n\t //close\n\t },\n\t },\n\t onContentReady: function () {\n\t // bind to events\n\t var jc = this;\n\t this.$content.find('form').on('submit', function (e) {\n\t // if the user submits the form by pressing enter in the field.\n\t e.preventDefault();\n\t jc.$$formSubmit.trigger('click'); // reference the button and click it\n\t });\n\t }\n\t});\n}", "function signInSetup() {\n\n // Set the sign in button on-click function\n $('#login').submit(function(event) {\n\n event.preventDefault();\n\n // Get the data from form\n let formData = $('#login').serialize();\n\n // Send post AJAX\n $.post('/signIn', formData, function(data) {\n window.location.replace('/dashboard');\n })\n\n .fail(function(response) {\n alert(response.responseText);\n });\n\n return false;\n })\n}", "function registerUser(e){\n $('#alert').alert();\n e.preventDefault();\n var name = $(e.target).find('input[name=\"name\"]'); \n var password = $(e.target).find('input[name=\"password\"]');\n $.post(registerUrl, {\n name: name.val(),\n password: password.val() ,\n }).done(function( data ) {\n name.val('');\n password.val('');\n userAlert('success', 'User successfully registered. Welcome!');\n $('#registerModal').modal('hide')\n });\n}", "_handleLogin() {\n if (this.$.loginForm.validate()) {\n let loginPostObj = { phoneNumber: parseInt(this.$.username.value), password: this.$.password.value };\n this.$.loginForm.reset();\n this.action = 'list';\n this._makeAjax('http://10.117.189.147:9090/foreignexchange/login', 'post', loginPostObj);\n }\n }", "function user_login(){\n\t\t\n\t\tvar userName = document.getElementById(\"loginName\").value;\n\t\t\n\t\tvar password = document.getElementById(\"loginPassword\").value;\n\t\tif(userName==null || userName.length==0){\n\t\t\talert(\"Please enter the user name\");\n\t\t\treturn false;\n\t\t}\n\t\tif(password==null || password.length==0){\n\t\t\talert(\"Please enter the password\");\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\tvar req_data = \"requestId=Login&userName=\"+userName+\"&password=\"+password;\n\t\t$.ajax({\n\t\t\turl : \"/Pool4u/DispatcherServlet\",\n\t\t\tcache : false,\n\t\t\tdataType : \"JSON\",\n\t\t\ttype : \"POST\",\n\t\t\tdata : req_data,\n\t\t\tsuccess : function(result) {\n\t\t\t\tvar parsedResponse = $.parseJSON(result);\n\t\t\t\tif (parsedResponse.status == \"SUCCESS\") {\n\t\t\t\t\twindow.location = parsedResponse.url;\n\t\t\t\t} else {\n\t\t\t\t\tvar errorCode = parsedResponse.errorCode;\n\t\t\t\t\t// UserName does not exists. Show register screen\n\t\t\t\t\tif (errorCode == 1005) {\n\t\t\t\t\t\t$(\"#login_div #error_message\").html(\"User does not exist. Please Register<br/>\");\n\t\t\t\t\t}\n\t\t\t\t\t// Password is wrong. \n\t\t\t\t\telse if (errorCode == 1004) {\n\t\t\t\t\t\t$(\"#login_div #error_message\").html(\"Invalid Password<br/>\");\n\t\t\t\t\t}\n\t\t\t\t\t// User not verified\n\t\t\t\t\telse if (errorCode == 1006) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tshow_auth(\"login\");\n\t\t\t\t\t\t$(\"#authorization_box_login #login_auth_error\").html(\"User not confirmed. Enter confirmation code below<br/>\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (errorCode == 1007) {\n\t\t\t\t\t\t$(\"#login_div #error_message\").html(\"User not active. Please contact administrator at [email protected] to activate your account!<br/>\");\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 loginUser(email, password) {\n $.post(\"/api/login\", {\n email: email,\n password: password\n })\n .then(() => {\n\n\n window.location.replace(\"/members\");\n // If there's an error, log the error\n })\n .catch(err => {\n console.log(err);\n });\n }", "function registerSignIn() {\n\t/* Set up the request by specifying the correct API endpoint,\n\tgrabbing the unique csrf token and collecting the data we\n\twould like to send to the API */\n\tconst productActionURL = ('/signIn/');\n\tconst securityToken = getCSRFToken('csrftoken');\n\tconst productData = {employeeID: getEmployeeID(), employeePassword: getEmployeePassword()};\n\n\t// As per the comment in apiRequest.js, we need to use the POST verb to create a new database record\n\tajaxPost(productActionURL, productData, securityToken, (callbackResponse) => {\n\n\t// Use the status code stored in our callbackResponse to see if the request was successful\n\tif (isSuccessResponse(callbackResponse)) {\n\t\tdisplayMessage('The product was successfully added.', 'success');\n\t\tdocument.getElementById('employeeID').value = '';\n\t\tdocument.getElementById('employeePassword').value = ''\n\t}\n\n\t// Use the status code stored in our callbackResponse to see if the request failed\n\tif (isErrorResponse(callbackResponse)){\n\t\tdisplayMessage('The request to add a product was denied.', 'failed');\n\t}\n});\n\n}", "function login() {\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: \"http://localhost:8181/fabric/security/token\",\n dataType: \"json\",\n data: '{\"username\":\"' + getElementByIdValue(\"username\") + '\", \"password\":\"' + getElementByIdValue(\"password\") + '\"}',\n success: function () {\n authenticated = true;\n $('#loginbox').hide(\"slow\");\n updateTable();\n }\n });\n }", "function login(){\n dispatch(findUser(document.getElementById('email').value,document.getElementById('password').value));\n }", "function logInUserController() {\n attachEventListener([DOMelements.loginForm], 'submit', [loginSubmitEvent]);\n}", "function signUpUser(username, password) {\n $.post(\"/api/signup\", {\n username: username,\n password: password\n }).then(function(data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a boostrap alert\n }).catch(handleLoginErr);\n }", "function doLogin (event) {\n\tdisableLoginInput();\n\t\n\t// get email\n\tvar email = document.getElementById('loginEmail').value;\n\t// get password\n\tvar password = document.getElementById('loginPassword').value;\n\t\n\t// construct the data to POST to /api/login\n\tvar dataString = 'email=' + email + '&password=' + password;\n\t$.ajax({\n\t type: 'POST',\n\t url: '/api/login',\n\t data: dataString,\n\t success: login_response,\n\t dataType: 'text'\n\t});\n}", "register(){\n\t\tvar that = this;\n\t\t$.post(\"/api/register\", \n\t\t\tthis.user\n\t\t\t, function(data) {\n\t\t\t\tif(data.auth.error){\n\t\t\t\t\tthat.loginerror = data.auth.error;\n\t\t\t\t}else{\n\t\t\t\t\tthat.$cookies.put('authtoken', data.auth.uid);\n\t\t\t\t\tthat.$cookies.put('username', data.auth.name);\n\t\t\t\t\tthat.$window.location.href = '/#';\n\t\t\t\t}\n\t\t\t\t\n\t\t}).fail(function(error){\n\t\t\tthat.loginerror = error.responseText;\n\t\t\tthat.$scope.$apply();\n\t\t}).done(function( data ) {\n\t\t\tif(data.auth.error){\n\t\t\t\talert( \"Signup Failed with error: \" + data.auth.error );\n\t\t\t} \n\t\t});\n\t}", "function clickLogIn() {\n\tvar email = ($('.email-login').find('input[type=email]')).val();\n\tvar password = ($('.email-login').find('input[type=password]')).val();\n\t\n\t$.ajax({\n\t\turl: '\\/login\\/signin',\n\t\tmethod: 'POST',\n\t\tdata: {email, password}\n\t}).done(function(jsondata) {\n\t\twindow.location.href = jsondata.redirect;\n\t}).fail(function() {\n\t\talert(\"Invalid Login Credentials\");\n\t});\n}", "function register(){\n\t$.ajax({ \n\t\tmethod: \"POST\", \n\t\turl: \"/api/register/\",\n\t\tdata: {\n\t\t\tuserName: $(\"#user_register\").val(),\n\t\t\tuserPassword: $(\"#password_register\").val(),\n\t\t\tuserEmail: $(\"#email_register\").val()\n\t\t}\n\t}).done(function(data){\n\t\tconsole.log(\"Got back:\"+JSON.stringify(data));\n\t\tif(\"error\" in data){\n\t\t\tconsole.log(data[\"error\"]);\n\t\t\twindow.alert(data[\"error\"]);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"User Registered: \"+JSON.stringify(data));\n\t\t\t$(\"#ui_register\").hide();\n\t\t\t$(\"#ui_login\").show();\n\t\t}\n\t});\n}", "function loginUser(email, password) {\n\n $.post(\"/api/login\", {\n email: email,\n password: password\n\n }).then(function (data) {\n currentUserEmail = email; \n console.log(currentUserEmail);\n // get the logged in user id first so we can use it to post events related to that user. \n $.get(\"/api/users/\" + currentUserEmail, function (data) {\n var users = data;\n console.log(users);\n currentUserId = users.id;\n console.log(currentUserId);\n });\n //empty the model body and create a new <p> to close the model. \n $(\".modal-body\").empty();\n $(\".modal-body\").text(\"Login successfull! Close this model and continue with adding or browsing for available events!\") \n //window.location.replace('/');\n // If there's an error, log the error\n }).catch(function (err) {\n console.log(err);\n });\n\n }", "function handleLoginButton() {\n // select main area class div with inputs and on click and look for nav-login link run e\n $(\".main-area\").on(\"click\", \".nav-login\", function(e) {\n console.log(\"Login button clicked\");\n // stop page from submitting\n e.preventDefault();\n // excute display login function\n displayLoginPage();\n });\n}", "function signUpAuth() {\n $('.loginRegister').on('click', '.signingUpNewAccount', function(event) {\n event.preventDefault();\n const username = $('.usernameSignUp').val();\n const password = $('.passwordSignUp').val();\n const firstname = $('.firstnameSignUp').val();\n const lastname = $('.lastnameSignUp').val();\n const email = $('.emailSignUp').val();\n $.ajax({\n type: 'POST',\n url: '/api/users',\n data: JSON.stringify({\n \"username\": username,\n \"password\": password,\n \"firstName\": firstname,\n \"lastName\": lastname,\n \"email\": email\n }),\n dataType: 'json',\n contentType: \"application/json\",\n error: error => {\n console.log(error);\n $('.loginError').text(`${error.responseJSON.location}: ${error.responseJSON.message}`);\n }\n })\n .done(function(json){\n postAuthLogin(username, password);\n });\n });\n}", "function signup() {\n const data = {\n username: $('#username').val(),\n password: $('#password').val(),\n isAdmin: 0\n };\n\n $.ajax({\n url: \"../../backend/api/create-user.php\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(data),\n method: 'POST',\n success: function (data, textStatus, jqXHR) {\n loginBtn.html('Submit').attr('disabled', false);\n if (textStatus === 'success') {\n // Save to Local Storage\n sessionStorage.setItem('message', 'Account created successfully');\n location.href = 'login.html'\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n loginBtn.html('Submit').attr('disabled', false);\n if (errorThrown === 'Bad Request') {\n toastr.error('User Exists');\n } else {\n toastr.error('Unknown error occured');\n }\n }\n })\n }", "function loginUser(email, password) {\n $.post(\"/api/login\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n })\n .catch(err => {\n // If there's an error, log the error\n console.log(err);\n });\n }", "function submitUserLogin() {\n $(\"#user_login_form\").submit(function(event){\n if (!validFields(\"login\")) return;\n event.preventDefault(); //prevent default action \n var post_url = $(this).attr(\"action\"); //get form action url\n var request_method = $(this).attr(\"method\");\n var main_url = \"/frontend/src/main.html\";\n var form_data = {\n \t\tname:$(\"#username\").val(), \n \t\tpass:$(\"#password\").val()\n };\n console.log(post_url);\n $.ajax({\n type: request_method,\n contentType: \"application/json\",\n url: post_url,\n data: JSON.stringify(form_data),\n dataType: 'json',\n cache: false,\n timeout: 60000,\n success: function (data, textStatus, xhr) {\n console.log(\"success\");\n localStorage.uid = data.entity.id;\n localStorage.jwt = xhr.getResponseHeader('JWT_TOKEN_HEADER');\n \t$(location).attr(\"href\", main_url);\n },\n error: function (e) {\n \tconsole.log(\"fail\");\n \tconsole.log(e);\n \talert(\"Login failed, please try again.\");\n }\n });\n });\n}", "function myrunwayLogin(){\r\n $(\"#signin\").on(\"click\", function(){\r\n $('#login').click();\r\n\r\n if (!$(\"#username\").val()) {\r\n sap.messageBox.showMsg(sapLang.getText(\"110001\"));\r\n $(\"#username\").focus();\r\n } else if (!$(\"#password\").val()) {\r\n sap.messageBox.showMsg(sapLang.getText(\"110002\"));\r\n $(\"#password\").focus();\r\n } else {\r\n var signInObj = {};\r\n signInObj.snsProvider = \"DEFAULT\";\r\n signInObj.snsAccount = $(\"#username\").val();\r\n signInObj.password = $(\"#password\").val();\r\n signInObj.isMyRunwayLogin = \"true\";\r\n var reqData = JSON.stringify({SignInVO: signInObj});\r\n signinMyRunway(reqData);\r\n $(\"#share\").hide(); \r\n }\r\n \r\n return false;\r\n });\r\n \r\n $(document).on('keypress', function(e) {\r\n if(e.keyCode == 13 && !$(\"#login\").hasClass(\"hidden\")) {\r\n $(\"#signin\").click();\r\n }\r\n });\r\n }", "function signUpUser(userInfo) {\n $.post(\"/api/signup\", {\n firstName: userInfo.firstName,\n lastName: userInfo.lastName,\n email: userInfo.email,\n password: userInfo.password\n }).then(function(data) {\n window.location.reload();\n console.log(\"signed up\");\n }).catch(handleLoginErr);\n }", "function signIn() {\n $('#form-signin').on('submit', function(event){\n event.preventDefault();\n $.ajax({\n url:`${url}/user/signin?loginVia=website`,\n method:'POST',\n data: {\n email: $('#inputEmail').val(),\n password: $('#inputPassword').val(),\n loginVia: 'website'\n }\n })\n .done(response => {\n notif('top-end', 'success', 'Sign in Success');\n localStorage.setItem('token', response.token);\n user._id = response.userId;\n user.name = response.userName;\n isSignIn();\n })\n .fail(response => {\n notif('top-end', 'error', response.responseJSON.err)\n }) \n })\n}", "function login(e) {\n e.preventDefault();\n let data = {\n email: emailLogin.value,\n password: passwordLogin.value,\n };\n http\n .post(`${url}/users/login`, data)\n .then((res) => {\n let usertoken = {\n headers: {\n Authorization: `Bearer ${res.token}`,\n },\n };\n userRequest(usertoken);\n taskRequest(usertoken);\n sessionStorage.setItem(\"token\", res.token);\n })\n .catch((err) => console.log(err));\n // registrationForm.classList.add(\"hidden\");\n loginForm.classList.add(\"hidden\");\n}", "function performLogin() {\n $.ajax({\n type: \"POST\",\n url: rootPath + \"login\",\n data: $('.form-login').serialize(),\n dataType: \"text\",\n success: function (e) {\n if (e == \"success\") {\n // log in successful\n window.location.href = rootPath + \"news\";\n } else {\n // display log in error\n $('#login-password').val('');\n $('#alert-container').empty().append(e);\n $('#login-password').focus();\n }\n },\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n if (XMLHttpRequest.readyState == 4) {\n // HTTP error\n $('#alert-container').empty().append(\"<strong>Network error: Please check your internet connection.</strong>\");\n }\n else if (XMLHttpRequest.readyState == 0) {\n // Network error\n $('#alert-container').empty().append(\"<strong>Network error: Please check your internet connection.</strong>\");\n }\n else {\n $('#alert-container').empty().append(\"<strong>An unexpected error occurred.</strong>\");\n }\n }\n });\n }", "function validaLogin() {\n $.post(\n base_url + \"Welcome/validaLogin\",\n {},\n function (pagina, datos) {\n //Carga archivos de respuestas que provengan de validaLogin\n $(\"#content\").html(pagina, datos);\n\n $(\".menuUsuario\").hide();\n $(\".menuUsuario\").fadeIn(1000).delay(1000);\n $(\".menuAdministrador\").hide();\n $(\".menuAdministrador\").fadeIn(1000).delay(1000);\n\n $(\"#btnIniciar\").button().click(function () {\n //Se llama a la funcion login\n botonLogin();\n });\n $(\"#btn_salir\").click(function () {\n salir();\n });\n });\n}", "function login(event){\n var userName = loginForm.userName.value;\n var password = loginForm.password.value;\n\n\n console.dir(loginForm);\n event.preventDefault();\n\n // Validation \n if( userName == '' || userName == undefined ||\n password == '' || password == undefined){\n alert('Please enter valid cedentials');\n return;\n }\n\n var XHTTP = new XMLHttpRequest();\n XHTTP.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var userDetails = JSON.parse(this.response);\n if (userDetails.length) {\n localStorage.setItem(\"IsUserLoggedIn\",true);\n localStorage.setItem(\"userFirstName\", userDetails[0].firstName);\n localStorage.setItem(\"userLastName\", userDetails[0].lastName);\n localStorage.setItem(\"userID\", userDetails[0].id);\n localStorage.setItem(\"role\", userDetails[0].role);\n window.location.href = 'http://127.0.0.1:8887/';\n }else{\n alert('User not found!!');\n }\n }\n }\n\n XHTTP.open('GET', 'http://localhost:3000/Users?emailId=' + userName + '&password=' + password);\n XHTTP.send();\n}", "function loginSubmit() {\n loginController.login(\"username\", \"password\");\n}", "function loginUser(email, password) {\n $.post(\"/api/login\", {\n email: email,\n password: password\n }).then(function(data) {\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(function(err) {\n console.log(err);\n });\n }", "function loginUser(email, password) {\n\n $.post(\"/api/login\", {\n email: email,\n password: password\n }).done(function(data) {\n console.log('User logged in!\\n')\n window.location.replace(data);\n\n }).fail(function(err) {\n console.log(err);\n });\n\n }", "function submitRegistration() {\n $(\"#reg_form\").submit(function(event){\n if (!validFields(\"registration\")) return;\n event.preventDefault(); //prevent default action\n var post_url = $(this).attr(\"action\"); //get form action url\n var request_method = $(this).attr(\"method\");\n var main_url = \"/frontend/src/main.html\";\n var form_data = {\n \t\tname:$(\"#username\").val(),\n \t\tpass:$(\"#password\").val()\n };\n $.ajax({\n type: request_method,\n contentType: \"application/json\",\n url: post_url,\n data: JSON.stringify(form_data),\n dataType: 'json',\n cache: false,\n timeout: 60000,\n success: function (data, textStatus, xhr) {\n \tconsole.log(\"success\");\n console.log(data);\n localStorage.uid = data.id;\n localStorage.jwt = xhr.getResponseHeader('JWT_TOKEN_HEADER');\n \t$(location).attr(\"href\", main_url);\n },\n error: function (e) {\n console.log(\"fail\");\n console.log(e);\n \talert(\"The username is taken, please try a different username.\");\n }\n });\n });\n}", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(function(data) {\n //window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n location.assign(\"/login\");\n console.log(data);\n })\n .fail(handleLoginErr);\n }", "function createNewUser(){\n\n\tconsole.log(\"Click detected!\");\n\n\tvar newUsername = $('#usernamePick').val();\n\tvar newPassword = $('#passwordPick').val();\n\t//var newEmail = $('#emailPick').val();\n\n\tvar newUser = {\n\t\t\"username\": newUsername,\n\t\t\"password\": newPassword,\n\t\t\"email\": newEmail\n\t}\n\tconsole.log(\"new user!\");\n\t$.post('/', newUser, function(data){\n\t\t//console.log(newPost);\n\t})\n}", "function clickSignUp() {\n\tvar email = ($('.email-signup').find('input[type=email]')).val();\n\tvar password = (($('.email-signup').find('input[type=password]')).eq(0)).val();\n\tvar confirm = (($('.email-signup').find('input[type=password]')).eq(1)).val();\n\t\n\tif (password == confirm) {\n\t\t$.ajax({\n\t\t\turl: '\\/register',\n\t\t\tmethod: 'POST',\n\t\t\tdata: {email, password}\n\t\t}).done(function(jsondata) {\n\t\t\twindow.location.href = '/EditProfileHTML';\n\t\t}).fail(function (){\n\t\t\talert(\"Creation Error\");\n\t\t});\n\t}\n}", "function loginUser(email, password) {\n $.post(\"/api/login\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, log the error\n })\n }", "function signUpUser(username, email, password) {\n $.post(\"/users/signup\", {\n username: username,\n email: email,\n password: password\n }).then(function(data) {\n if (data.duplicateUser) {\n // Replace with Modal\n alert(\"Sorry, that username has been taken\");\n } else {\n window.location = data.redirect;\n }\n }).catch(function(err) {\n console.log(err);\n });\n }", "function submitUser(user) {\n $.post(\"/api/users\", user, function() {\n window.location.href = \"/concerts\";\n });\n }", "function registerDevice() {\n $.ajax({\n url: '/devices/register',\n type: 'POST',\n headers: { 'x-auth': window.localStorage.getItem(\"authToken\") }, \n contentType: 'application/json',\n data: JSON.stringify({ deviceId: $(\"#deviceId\").val() }), \n dataType: 'json'\n })\n .done(function (data, textStatus, jqXHR) {\n // Add new device to the device list\n $(\"#addDeviceForm\").before(\"<li class='collection-item'>ID: \" +\n $(\"#deviceId\").val() + \", APIKEY: \" + data[\"apikey\"] + \n \" <button id='ping-\" + $(\"#deviceId\").val() + \"' class='waves-effect waves-light btn'>Ping</button> \" +\n \"</li>\");\n $(\"#ping-\"+$(\"#deviceId\").val()).click(function(event) {\n pingDevice(event, device.deviceId);\n });\n hideAddDeviceForm();\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n let response = JSON.parse(jqXHR.responseText);\n $(\"#error\").html(\"Error: \" + response.message);\n $(\"#error\").show();\n }); \n}", "signIn() {\n\n if (this.$.form.validate()) {\n let phone = this.phone;\n let password = this.password;\n this.details = { mobile: phone, password: password }\n this.$.form.reset();\n this._makeAjax(`http://10.117.189.55:9090/admanagement/users/login`, \"post\", this.details);\n\n } else {\n this.$.blankForm.open();\n\n }\n }", "function onSubmit() {\n\n let userID = document.getElementById(\"userName\").value;\n let password = document.getElementById(\"password\").value;\n\n const url = '/login';\n $.post(url, {\n json_string: JSON.stringify({ userID: userID, password: password })\n });\n\n return false;\n}", "function loginUser(userData) {\n $.post(\"/api/login\", {\n email: userData.email,\n password: userData.password\n })\n .then(function(data) {\n window.location.replace(data);\n //if error log the error\n })\n .catch(function(err) {\n console.log(err);\n });\n }", "function submit() {\n const path = '/api/auth/login';\n\n\n let promise = dispatch(registerUser(path, inputs));\n promise\n .then((res) => {\n history.push('/');\n })\n .catch(err => {\n console.log(err);\n })\n }", "register(firstName, lastName, email, password){\n return $.post(\n this.REGISTRATION_URL,\n {\n user : {\n first_name: firstName,\n last_name: lastName,\n email: email,\n password: password\n }\n }\n );\n }", "function watchDemoBtn() {\n $('#demo-login').click(event => {\n const userData = {\n username: 'demouser1124',\n password: 'demopassword1124'\n };\n\n HTTP.loginUser({\n userData,\n onSuccess: res => {\n const authUser = res.user;\n authUser.jwtToken = res.jwtToken;\n CACHE.saveAuthenticatedUser(authUser);\n window.open('/user/hub.html', '_self');\n },\n onError: err => {\n $('#error-message').html(`\n <p>Your username and/or password were incorrect.</p>\n `);\n }\n });\n })\n}", "function signUpUser(username, password) {\n $.post(\"/api/signup\", {\n username: username,\n password: password\n })\n\n .then(function() {\n window.location.reload();\n\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleRegisterErr);\n}", "function registerSuccessFn() {\n\t\t\t\t\tAuthentication.login($scope.username, $scope.password)\n\t\t\t\t\t\t.then(function (response) {\n\t\t\t\t\t\t\tAuthentication.setAuthenticatedAccount(response.data);\n\t\t\t\t\t\t\twindow.location = '/#/users/' + response.data.username;\n\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t}", "function listenLoginButton() {\n $(\"#loginButton\").click(()=>{\n var password = $(\"#passwordInput\").val();\n login(password);\n });\n}", "function tologin(){\n const login_2 = document.getElementById('login_button_2');\n login_2.onclick = function(){\n const username = document.getElementById('luname').value;\n const password = document.getElementById('lpass').value;\n \n if (!username || !password){\n window.alert('Empty username or password!');\n return false;\n }\n const user = {\n \"username\" : username,\n \"password\" : password\n };\n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n };\n const method = 'POST'; \n const path = 'auth/login';\n\n api.makeAPIRequest(path, {\n method, headers,\n body: JSON.stringify(user),\n })\n .then(function (res){\n if (res[\"token\"]){\n window.alert('You are successfully logged in');\n window.localStorage.setItem('username', username);\n window.localStorage.setItem('token', res['token']);\n location.reload();\n }\n else{\n window.alert(res[\"message\"]);\n }\n });\n }\n}", "function loginUser() {\n $.ajax({\n url: \"https://hack-or-snooze.herokuapp.com/auth\",\n method: \"POST\",\n data: {\n data: {\n username: $username,\n password: $password\n }\n }\n })\n .then(function(response) {\n //storing username and token in localStorage to be used for later\n let $token = response.data.token;\n localStorage.setItem(\"username\", $username);\n localStorage.setItem(\"token\", $token);\n console.log(response, \"login successful!\");\n $(\".loginHeader\").text($username);\n //$(\"#signupForm\").toggleClass();\n //$(\"#loginForm\").toggleClass();\n $(\".signupHeader\").text(\"sign out\");\n\n //signout\n let $signoutButton = $(\".signupHeader\");\n $signoutButton.on(\"click\", function(e) {\n localStorage.clear();\n alert(\"signed out\");\n $(\".loginHeader\").text(\"login\");\n $(\".signupHeader\").text(\"sign up\");\n });\n })\n .catch(function() {\n alert(\"username or password don't match\");\n console.log(\"login failed!\");\n });\n }", "function userLogin(e){\r\n\t\te.preventDefault();\r\n\t\tvar $form = $('#user_create_access_token form');\r\n\t\ttest.data.login = $form.find('input[name = \"login\"]').val();\r\n\t\ttest.data.password = $form.find('input[name = \"password\"]').val();\r\n\t\tcreate_access_token(test.data.login, test.data.password)\r\n\t\t.pipe(function(){\r\n\t\t\treturn ajaxrequest({\r\n\t\t\t\ttype: 'GET',\r\n\t\t\t\turl: 'ebl/v3/registration/get_accesible_mandator_list',\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t});\r\n\t\t})\r\n\t\t.pipe(function(json){\r\n\t\t\tif(json.mandatorInfoList.length){\r\n\t\t\t\ttest.mandatorRequestStr = '/ebl/v3/' + json.mandatorInfoList[0].name;\r\n\t\t\t}\r\n\t\t\ttest.next();\r\n\t\t});\r\n\t}", "function register() {\n setLoading(true);\n fetch(\"https://password-reset-task3.herokuapp.com/users/signup\", {\n method: \"POST\",\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(v)\n })\n .then((res) => res.json())\n .then((data) => {\n console.log(\"-----SUCCESSFULL REGISTRATION------\", data);\n\n if (data.newuser.name) {\n afterlogin(\"Registration success !!!\");\n history.push(\"/login\");\n e.target.reset();\n }\n })\n .catch((err) => {\n console.log(\"err in registration !!!\", err.message);\n\n afterlogin(\"Error in Registration\");\n });\n }", "function loginUser(email, password) {\n $.post(\"/api/login\", {\n email: email,\n password: password\n }).then(function(data) {\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(function(err) {\n });\n }", "function loginUser(username, password) {\n $.post(\"api/user/login\", {\n username: username,\n password: password\n })\n .then(function() {\n console.log(\"Success!\")\n })\n .catch(function(err) {\n console.log(err);\n });\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function authUser(email, password, phone) {\n console.log(\"spot to hit \", url)\n $.post(url, {\n email: email,\n password: password,\n phone: phone\n }).then(function (data) {\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(handleAuthErr);\n }", "function loginUser(username, password) {\n $.post(\"/api/login\", {\n username: username,\n password: password\n })\n .then(function() {\n window.location.reload();\n // If there's an error, log the error\n })\n .catch(handleLoginErr);\n}", "function signUpUser(email, password, car_make, name, car_model, license_plate) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n car_make: car_make,\n name: name,\n car_model: car_model,\n license_plate: license_plate\n })\n .then(() => {\n window.location.replace(\"/login\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function loginGuest(){\n\t\n\tvar username_input = $(\"#guest-username-input\").val();\n\tif(username_input != \"\"){\n\t\tvar posting = $.post(usersURI + \"/add_guest\", {\n\t\t\tname : username_input\n\t\t});\n\t\tposting.done(function(data){\n\t\t\t//alert(JSON.stringify(data));\n\t\t\tsetLoggedInGuest(JSON.parse(JSON.stringify(data)));\n\t\t});\n\t} else {\n\t\t//Prompt to entere a name\n\t\t$(\"#guest-username-submit-button\").attr(\"data-content\",\"Enter a name\").popover(\"toggle\");\n\t\tsetTimeout(function(){\n\t\t\t$(\"#guest-username-submit-button\").popover(\"toggle\");\n\t\t}, 1000);\n\t}\n}", "function loginUser(email, password) {\n $.post(\"./api/login\", {\n email: email,\n password: password\n })\n .then(function(data) {\n window.location.replace(data);\n // Log error\n })\n .catch(function(err) {\n console.log(err);\n });\n }", "userRegistration() {\n let regUserName = document.querySelector(\"#regUserName\").value;\n let regEmail = document.querySelector(\"#regEmail\").value;\n let regPassword = document.querySelector(\"#regPassword\").value; // let regConfirmPassword = document.querySelector(\"#regUserName\").value\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"POST\",\n \"dataBaseObject\": {\n \"userName\": regUserName,\n \"email\": regEmail,\n \"password\": regPassword\n }\n }).then(_nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"embedItem\": `?userName=${regUserName}`\n }).then(user => {\n console.log(user);\n user.forEach(x => {\n sessionStorage.setItem(\"userId\", x.id); //hides NOMAD heading\n\n $(\".t-border\").hide(); //hides the form\n\n $(\".form\").hide(); //displays navigatin bar\n\n _dashboard.default.createNavBar();\n\n let userId = sessionStorage.getItem(\"userId\"); //console.log verifying that credentials match and user is logged in\n\n console.log(\"logged in as\" + \" \" + x.userName);\n console.log(\"your user ID is: \" + userId);\n });\n }));\n }", "function signUpUser(firstname, lastname, gender, dob, email, password) {\n $.post(\"/api/signup\", {\n firstname: firstname,\n lastname: lastname,\n gender: gender,\n dob: dob,\n email: email,\n password: password,\n }).then(function (data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a boostrap alert\n }).catch(handleLoginErr);\n }", "signIn() {\n\n if (this.$.form.validate()) {\n let phone = this.phone;\n let password = this.password;\n this.details = { mobile: phone, password: password }\n this.$.form.reset();\n this._makeAjax(`${baseUrl1}/akshayapathra/admins`, 'post', this.details);\n } else {\n\n }\n }", "function loginUser(username, password) {\n\n let user = {\n username: userName.val().trim(),\n password: passwordInput.val().trim()\n };\n\n $.ajax(\"/api/logins\", {\n type: \"POST\",\n data: user\n }).then(\n function () {\n console.log(\"created new member\");\n // Reload the page to get the updated list\n location.reload();\n document.location.href = \"/landing.html\";\n \n }).catch(handleLoginErr);\n \n // $.post(\"/api/logins\", {\n // data: user\n // }).then(function(data) {\n // // window.location.replace(data);\n // document.location.href = \"/landing.html\";\n \n // // If there's an error, log the error\n // }).catch(function(err) {\n // console.log(err);\n // });\n \n \n // let newUser = {\n // user_username: $(\"#username\").val().trim(),\n // password: $(\"#password-input\").val().trim(),\n // };\n \n // $.ajax(\"/api/music\", {\n // type: \"POST\",\n // data: newUser\n // }).then(\n // function () {\n // console.log(\"created new User\");\n // document.location.href = \"/landing.html\";\n // // Reload the page to get the updated list\n // // location.reload();\n // }).catch(function(err) {\n // console.log(err);\n // });\n\n\n }", "function SubmitAuthentication() {\n\n $.post(\"/Home/UserAuthentication\", $(\"#PostForm\").serialize(), function (data) {\n if (data.isSuccess === true) {\n\n document.location.href = \"/Home\";\n\n } else {\n\n document.getElementById(\"ErrorDisplay\").innerHTML = data.errorMessage;\n }\n \n }).fail(function (data) {\n\n if (data.status === 500) {\n document.getElementById(\"ErrorDisplay\").innerHTML = \"Не удалось подключиться к серверу\";\n }\n });\n\n}", "function signUpUser(user) {\n $.post(\"/api/signup\", user)\n .then(function() {\n window.location.replace(\"/dashboard\");\n\n })\n .catch(function(err) {\n console.log(err);\n });\n }", "function signUpUser(data) {\n $.post(\"/api/child_registration\", {\n data: JSON.stringify(data)\n })\n .then((res) => {\n if (res) {\n window.location.replace(\"/dashboard\");\n //is the request really happending sequencially\n }\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleSignUpErr);\n }", "function logindatas(){\r\n var username = document.getElementById(\"username\").value;\r\n var password = document.getElementById(\"password\").value;\r\n \r\n postData(\"http://localhost:8080/auth/login\", {username:username,password:password})\r\n .then(data => {\r\n location.assign(\"http://localhost:8080/homed.html\");\r\n })\r\n .catch((error)=>{\r\n console.log(error);\r\n })\r\n}", "function loginUser(e, data) {\n\t//Disable page refresh with preventDefault\n\t//preventDefault does have some weird behaviors\n\t//so it make cause some UI problems later\n\t//to avoid, use a div instead of a button or input\n\t//and do not submit\n\te.preventDefault();\n\n\t//map values to variables\n\tlet login = data.login[0];\n\tlet email = data.email;\n\tlet password = data.password;\n\n\t//call the graphQL endpoint with the given variables, since its an outside API call its a promise\n\tlogin({ variables: { email: email.value, password: password.value } })\n\t\t.then((res) => {\n\t\t\t//default prompt should display an error\n\t\t\tvar prompt = { title: 'Failed to Login', type: 'error' };\n\t\t\t//if logged in return true from the GRAPHQL API then change prompt\n\t\t\tif (res.data.login) {\n\t\t\t\tprompt = { title: 'Welcome back ' + res.data.login.email + '!', type: 'success' };\n\t\t\t}\n\n\t\t\t//function that calls UI component\n\t\t\tsweatAlert(prompt);\n\t\t})\n\t\t.catch((err) => {\n\t\t\t//This logs the error onto the console\n\t\t\tconsole.error(err + ' => LoginIn View : FAILED AT loginUser');\n\t\t\t//Displays error to user\n\t\t\tsweatAlert({ title: 'Internal Server Error', type: 'error' });\n\t\t});\n}", "function register(event) {\n event.preventDefault();\n\n userCredentials = {\n username: $name.val().trim(),\n email: $email.val().trim(),\n password: $password.val().trim()\n };\n\n console.log(\"register button clicked!\", userCredentials);\n window.location.href = \"/instruction\";\n if (\n userCredentials.username === \"\" ||\n userCredentials.email === \"\" ||\n userCredentials.password === \"\"\n ) {\n alert(\"Must provide name, email, and password\");\n } else {\n credentials(userCredentials);\n return true;\n }\n}", "function handleLoginAction(event) {\n event.preventDefault();\n //var $target = $(event.currentTarget);\n // Grab all the fields on the login Card\n var $loginId = $($pt.loginCard.field.loginId);\n var $password = $($pt.loginCard.field.password);\n var $revealPass = $($pt.loginCard.field.revealPass);\n var $error = $($pt.loginCard.field.errorStatus);\n\n // Fixed problem with multiple error appending to error\n $error.empty();\n if ($loginId.val().trim() === \"\" || $password.val().trim() === \"\") {\n // Empty login Information\n $error.append(alertBar + \"Either User or Password is empty\" + alertEnd);\n return false;\n }\n\n // Build the JSON urlHost\n var urlHost = $pt.server.db + \"/users\";\n urlHost += \"?loginId=\" + $loginId.val().trim();\n urlHost += \"&password=\" + $password.val().trim();\n\n // TODO: Perform AJAX to check data here\n $.ajax({\n url: urlHost,\n dataType: \"json\",\n method: \"GET\",\n success: function (result) {\n // result is an array if it return\n if (result.length === 0) {\n // Failed login\n $error.append(alertBar + \"Invalid Login Information\" + alertEnd);\n return false;\n } else if (result.length === 1) {\n // Clear input boxes\n $loginId.val(\"\");\n $password.val(\"\").attr(\"type\", \"password\");\n $revealPass.attr(\"checked\", false);\n\n // Close Bootstrap Login Modal\n $($pt.loginCard.handle).modal(\"hide\");\n // Then process the login with the result\n processSuccessLogin(result);\n }\n },\n error: function (result) {\n console.log(\"ajax error \" + result.status);\n }\n });\n }", "function loginUser (email, password) {\n $.post('/api/login', {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace('/movies');\n // If there's an error, log the error\n })\n .catch((err) => {\n console.log(err);\n });\n }", "function signUpUser(userData) {\n // $.post(\"/api/user/signup\", {\n $.post(\"/api/user/signup\", userData)\n .then(() => {\n console.log(\"User signed up successfully wait for approve\")\n window.location.replace(\"/user/signup\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(err=>{\n console.log(\"Err something went wrong try again \")\n });\n }", "function login()\n{\n\temail = document.getElementById(\"inputEmail\").value;\n\tpassword = document.getElementById(\"inputPassword\").value;\n\tmakeRequest('GET', \"http://138.197.7.194/api/users/?email=\" + email + \"&password=\" + password + \"&action=login\", null, true, userLoginResponse);\n\tevent.preventDefault();\n}", "function listenLogin() {\n\t$('.login-form').submit(event => {\n\t\tevent.preventDefault();\n\t\tlet userCreds = {\n \t\tusername: $(\".username\").val().toLowerCase(),\n \t\tpassword: $(\".password\").val()\n \t};\n\n \tlogin(userCreds);\n \t});\n\n}", "register(email, password) {\n // console.log(this.state);\n var email = this.state.email;\n var password = this.state.password;\n $.ajax({\n method: \"POST\",\n url: \"/SignUp1\",\n data: JSON.stringify({ email: email, password: password }),\n contentType: \"application/json\",\n success: (data) => {\n\n },\n error: (xhr) => {\n if (xhr.status == 201) {\n this.success(null, \"Created\", xhr);\n return;\n }\n },\n });\n\n window.location ='/'\n }", "function signup() {\n\n\tconsole.log(\"clicked\");\n\n\t//get values of form into variables\n\tvar firstname = $(\"#firstname\").val();\n\tvar lastname = $(\"#lastname\").val();\n\tvar email = $(\"#email1\").val();\n\tvar password = $(\"#password1\").val();\n\n\t//create data array\n\tvar dataString = {\"action\": \"signup\", \"firstname\": firstname, \"lastname\": lastname, \"email\": email, \"password\": password};\n\n\tconsole.log(dataString);\n\n\t// check for blank inputs\n\tif ($.trim(firstname).length == 0) {\n\t\tmyApp.alert(\"Name required\", \"Signup Failed\");\n\t} else if ($.trim(lastname).length == 0) {\n\t\tmyApp.alert(\"Surname required\", \"Signup Failed\");\n\t} else if ($.trim(email).length == 0) {\n\t\tmyApp.alert(\"Email required\", \"Signup Failed\");\n\t} else if ($.trim(password).length == 0) {\n\t\tmyApp.alert(\"Password required\", \"Signup Failed\");\n\t}\n\n\t// if none are blank, validate email address and continue - TBD - validateEmail() not working correctly\n\telse {\n\n\t\tconsole.log(\"input checked\");\n\n\t\t$.support.cors = true;\n\n\t\t//ajax post to server\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: server + \"/login.php\",\n\t\t\tdata: dataString,\n\t\t\tdataType: 'json',\n\t\t\tcrossDomain: true,\n\t\t\tcache: false,\n\n\t\t\tbeforeSend: function(data) {\n\t\t\t\t$(\"#signup\").val('Connecting...');\n\t\t\t\tconsole.log(\"connecting to server\");\n\t\t\t},\n\n\t\t\t//display success/fail message - put something in data on server\n\t\t\tsuccess: function(data, textString, xhr) {\n\t\t\t\tif (data.status == \"success\") {\n\t\t\t\t\t//localStorage should be changed to nativeStorage plugin\n\t\t\t\t\tlocalStorage.login = \"true\";\n\t\t\t\t\tlocalStorage.email = email;\n\t\t\t\t\tlocalStorage.id = data.id;\n\t\t\t\t\tlocalStorage.firstLogin = \"true\";\n\t\t\t\t\tconsole.log(\"redirecting...\");\n\t\t\t\t\tmainView.router.loadPage(\"swipe.html\");\n\t\t\t\t} else if (data.status == 'exist') {\n\t\t\t\t\tmyApp.alert(\"Account already exists\", \"Login Failed\");\n\t\t\t\t}\n\t\t\t},\n\n\t\t\terror: function(xhr, ajaxOptions, errorThrown) {\n\t\t\t\tconsole.log(xhr);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t\tmyApp.alert(\"Unknown error, please try again\", \"Login Failed\");\n\t\t\t},\n\n\t\t\tcomplete: function(data) {\n\t\t\t\tif (data.readyState == \"0\") {\n\t\t\t\t\tconsole.log(\"unsent\");\n\t\t\t\t} else if (data.readyState == \"4\") {\n\t\t\t\t\tconsole.log(\"done\");\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t});\n\t}\n\treturn false;\n}", "function login() {\n //Get error symbol\n let errorSymbol = document.getElementById(\"loginInvalid\");\n //Get username and password from form\n let username = document.getElementById(\"loginUsername\").value;\n let password = document.getElementById(\"loginPassword\").value;\n console.log(username + \" \" + password);\n //Send to server\n let params = {\n \"username\": username,\n \"password\": password\n };\n $.ajax({\n type: 'POST',\n url: api + \"/login\",\n data: params,\n dataType: \"text\",\n //If successful, pass token to dashboard\n success: function (resultData) {\n resultData = JSON.parse(resultData);\n window.location.href = \"/dashboard.html?t=\" + encodeURIComponent(resultData.token) + \"&uid=\" + resultData.user + \"&uname=\" + username;\n },\n //If unsuccessful show error\n error: function (data) {\n errorSymbol.className += \" d-block\";\n }\n });\n}", "function registerUser() {\r\n $(document).ready(function() \r\n {\r\n const Url ='https://3.20.221.122/api/signup.php';\r\n $('#sign-up').click(function()\r\n {\r\n var username = document.getElementById(\"sign-user\").value;\r\n var pass = document.getElementById(\"sign-password\").value;\r\n var confirmPass = document.getElementById(\"confirm-password\").value;\r\n\r\n if(is_email(username) && pwd_validation(pass) && pass == confirmPass )\r\n {\r\n $.ajax\r\n ({\r\n url: Url + '?username=' + username + '&password='+ pass,\r\n type: \"GET\",\r\n success: function(result)\r\n {\r\n if(result == 1)\r\n {\r\n alert(\"Username already exists\");\r\n \r\n }\r\n else if(result == 0)\r\n {\r\n alert(\"User Registered!\");\r\n }\r\n },\r\n \r\n error:function(error) \r\n {\r\n alert(`Error ${error}`)\r\n }\r\n \r\n })\r\n \r\n }\r\n else\r\n {\r\n alert(\"1. Username must be an email. \\r\\n2. Password must be 8-20 characters, at least one capital letter, at least one number and no spaces. \\r\\n3. All input fields cannot be empty.\\r\\n4. Confirm password must match the created password.\");\r\n }\r\n })\r\n\r\n }\r\n )\r\n}", "function onSubmitRegister(event){\r\n if(registerData.RegisterPassword===registerData.RegisterConfirmPassword){\r\n event.preventDefault()\r\n fetch('/register_admin',{\r\n method: 'post',\r\n headers: {'Content-Type':'application/json'},\r\n body: JSON.stringify({\r\n userName: registerData.RegisterUserName,\r\n password: registerData.RegisterPassword,\r\n ConfirmPassword: registerData.RegisterConfirmPassword\r\n })\r\n }).then(res => res.json())\r\n .then(user =>{\r\n if(user){ \r\n localStorage.setItem('Admin',registerData.RegisterUserName);\r\n // localStorage.setItem(`${registerData.RegisterUserName}`,JSON.stringify(registerData));\r\n handleClick() \r\n }else{\r\n window.alert(\"Something went wrong Try Again.\")\r\n }\r\n }) \r\n }else{\r\n window.alert(\"password Doesnt match.\")\r\n }\r\n }", "async handleRegistration(event) {\n try {\n\n //prevent actual submit and page refresh\n event.preventDefault();\n\n const userRepository = new UserRepository();\n\n const firstName = $(this).find(\"[name='register-firstname']\").val();\n const lastName = $(this).find(\"[name='register-lastname']\").val();\n const username = $(this).find(\"[name='register-username']\").val();\n const password = $(this).find(\"[name='register-password']\").val();\n const passwordRepeat = $(this).find(\"[name='register-passwordrepeat']\").val();\n\n if (!firstName || !lastName || !username || !password) {\n notificationManager.alert(\"warning\", \"Vul alle velden in!\");\n return false;\n }\n\n if (password.length < 6) {\n notificationManager.alert(\"warning\", \"Wachtwoord is te kort!\");\n return false;\n }\n\n if (password != passwordRepeat) {\n notificationManager.alert(\"warning\", \"Wachtwoorden komen niet overeen!\");\n return false;\n }\n\n const user = await userRepository.register(firstName.toLowerCase(), lastName.toLowerCase(), username.toLowerCase(), password);\n\n notificationManager.alert(\"success\", \"U bent geregistreerd!\");\n sessionManager.set(\"userID\", user.userID);\n location.reload();\n } catch (e) {\n (e.code === 401) ? notificationManager.alert(\"error\", e.reason) : console.log(e);\n }\n }", "function loginUser () {\n const username = document.getElementById(\"email\").value\n const password = document.getElementById(\"password\").value\n const userUrl = urlBase + 'user/' + username\n console.log(userUrl)\n const user = {\n 'username': username,\n 'password': password,\n }\n loginUrl = urlBase + 'user/login'\n generalPost(loginUrl, user)\n \n \n}", "function addUser(username, email, password) {\n // This post will sign the user up\n $.post(\"/api/users\", {\n username: username,\n email: email,\n password: password\n }).then(function (data) {\n // This post will run after the user has be signed up\n // and log the user in\n $.post(\"/api/login\", {\n email: email,\n password: password\n }).then(function (data) {\n // Send the user to the page they were going to before they\n // needed to sign up\n window.location.replace(data);\n });\n });\n }" ]
[ "0.69043005", "0.68930745", "0.68645704", "0.68081367", "0.67222464", "0.6681365", "0.6676987", "0.66297686", "0.6612458", "0.6563979", "0.65474725", "0.652968", "0.6506978", "0.65067965", "0.64755446", "0.6472516", "0.64688444", "0.64673007", "0.6453768", "0.64505726", "0.6431234", "0.64108926", "0.64099467", "0.6379453", "0.6369898", "0.63577753", "0.6341498", "0.6332945", "0.63214374", "0.6314473", "0.63143903", "0.6295278", "0.6274459", "0.62701505", "0.626961", "0.6259182", "0.62545395", "0.62501293", "0.6249187", "0.62461984", "0.62379533", "0.62354225", "0.62207997", "0.6216008", "0.6213504", "0.6209878", "0.6205932", "0.62022495", "0.6201436", "0.6197666", "0.61940044", "0.61912227", "0.61868054", "0.6178434", "0.6173881", "0.6169326", "0.61681825", "0.61581355", "0.61548495", "0.61486596", "0.61480653", "0.61465317", "0.61390275", "0.61301655", "0.61159354", "0.61148185", "0.6108359", "0.6105138", "0.61009765", "0.60934234", "0.6086314", "0.6086314", "0.6085059", "0.60761374", "0.6071342", "0.6068476", "0.60669416", "0.6055073", "0.6053765", "0.6053417", "0.6050912", "0.60472673", "0.6046474", "0.60455525", "0.6044526", "0.6042558", "0.60423243", "0.60414714", "0.6040511", "0.6039821", "0.60379624", "0.60375714", "0.6035873", "0.60309756", "0.60234463", "0.602275", "0.6017753", "0.6017672", "0.6017389", "0.60127443" ]
0.66911334
5
]]> loc du lieu
function myFunction() { var input, filter, table, tr, td, i, txtValue; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); table = document.getElementById("myTable"); tr = table.getElementsByTagName("tr"); for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td")[1]; if (td) { txtValue = td.textContent || td.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { tr[i].style.display = ""; } else { tr[i].style.display = "none"; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ea(){}", "private public function m246() {}", "replacerChangNiveau(){\n this.viderLaFile();\n this.cellule = this.jeu.labyrinthe.cellule(0,0);\n this.direction = 1;\n\t\t\t\tthis.vitesse = 0;\n }", "function simple(){\n aff('Exercice n°01 : Bienvenue');\n var name = 'loic';\n aff(`Bienvenue à vous -> ${name} !`);\n jump();\n}", "function Ha(){}", "private internal function m248() {}", "function comportement (){\n\t }", "function oi(){}", "protected internal function m252() {}", "function Interfaz(){}", "function mostraNotas(){}", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function IndicadorRangoEdad () {}", "function undici () {}", "function oi(a){this.Of=a;this.rg=\"\"}", "shortDescription(contenu){\n\t\tlet desc = contenu.slice(0, 250);\n\t\treturn desc + \" ...\";\n\t}", "decrire() \n {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "get informations() {\n return this.pseudo + ' (' + this.classe + ') a ' + this.sante + ' points de vie et est au niveau ' + this.niveau + '.'\n }", "function u$2(u,e){t$i`\n /*\n * ${e.name}\n * ${0===e.output?\"RenderOutput: Color\":1===e.output?\"RenderOutput: Depth\":3===e.output?\"RenderOutput: Shadow\":2===e.output?\"RenderOutput: Normal\":4===e.output?\"RenderOutput: Highlight\":\"\"}\n */\n `;}", "function lalalala() {\n\n}", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "function Rep() {\r\n}", "function pos_actuelle()\n {\n\treturn (joueurs[joueur_actuel].position);\n }", "function Pe(){}", "function Uc(){this.$d=[]}", "static get elvl_info() {return 0;}", "obtain(){}", "function l(){t={},u=\"\",w=\"\"}", "transient protected internal function m189() {}", "function Komunalne() {}", "afficherDescription() {\n return (\n this.nom\n + ' est '\n + this.couleur\n + ' pèse '\n + this.poids\n + ' grammes et mesure '\n + this.taille\n + ' centimètres.'\n );\n }", "function va(t,e){0}", "function $o(){}", "function el(a){this.$f=a;this.Pg=\"\";this.lm=new RegExp(this.Ca,\"g\")}", "function vU(a,b){this.Re=[];this.Uoa=a;this.Hna=b||null;this.jL=this.XD=!1;this.qs=void 0;this.z7=this.NPa=this.V6=!1;this.jV=0;this.Ld=null;this.a7=0}", "function Stack_Oliteral() {\r\n}", "function vi(a,b,c,d){this.type=a;this.name=b;this.A=c;this.qa=d;this.xb=[];this.align=-1;this.$a=!0}", "added(vrobject){}", "decrire() {\n return `${this.nom} a ${this.sante} points de vie et ${this.force} en force`; //ATTENTION: \"this\"\n //Une propriété dont la valeur est une fonction est appelée une méthode.\n }", "function wa(){}", "unsee() {}", "function cargarpista1 (){\n \n}", "condense(v, e) { }", "get introduction(){\n return(\n\tthis._introduction |\n\t \"Hello, my name is \" + this.name +\n\t \" and I am \" + this.age +\n\t \" years old!\"\n );\n }", "function sg(i, e){\n\n}", "function li(a){var b=mi;this.g=[];this.w=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}", "function li(a){var b=mi;this.g=[];this.w=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}", "transient private internal function m185() {}", "function Maisons(){\n \n }", "get upperLegTwist() {}", "function gi(t,e){0}", "function jeu_attaquerCible(me,cc,nocible,cible,cattaquante){\n\t\tif (cible!=null && cible!==\"undefined\"){\n\t\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+\"attaque cible carte \"+cible.nom);\n\t\t\n\t\t\tcible.DEF = cible.DEF-cattaquante.ATT;\n\t\t my_logger((me?PROMPT_ME:PROMPT_IA)+\" idCible = \"+cible.id+\"/\"+cible.nom);\n\t\t\n\t\t\t//SI def<0 => cimetiere\n\t\t\tif (cible.DEF<=0){\n\t\t\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+\" cible=\"+cible.nom+\" détruite, sovdef=\"+cible.sauvdef);\n\t\t\t\t//Placer la carte au cimetière\n\t\t\t\t//cible.etat= ETAT_CIM;\n\t\t\t\tcible.def=cible.sauvdef;\n\t\t\t\tposerCarteDansCimetiere(cible);\n\t\t\t\t\n\t\t\t\t//suppimer cicble du tableau\n\t\t\t\tif (cc){\n\t\t\t\t\tsupprimerCarteFromJeu(me,nocible);\n\t\t\t\t}else{\t\t\t\t\t\n\t\t\t\t\tsupprimerCarteFromAtt(me,nocible);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t// cibler l'ID des points de DEF\n\t\t\t\tseldef=\"#\"+cible.id+ \" #def\";\n\t\t\t\t$(seldef).html(cible.DEF);\n\t\t\t}\n\t\t} \n\t }", "function reglaSuperAvance(){\n\n}", "function sb(){this.pf=[]}", "function TMP() {\n return;\n }", "function uh(a){var b=vh;this.g=[];this.v=b;this.u=a||null;this.f=this.a=!1;this.c=void 0;this.l=this.w=this.i=!1;this.h=0;this.b=null;this.o=0}", "static get END() { return 6; }", "function vp(a,b){this.ee=[];this.wf=a;this.lf=b||null;this.sd=this.Uc=!1;this.Wb=void 0;this.Oe=this.Kf=this.ne=!1;this.he=0;this.Ua=null;this.oe=0}", "getNiveau()\r\n\t{\r\n\t\treturn this._niveau;\r\n\t}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.5652979", "0.5627189", "0.5595085", "0.5555951", "0.54523736", "0.5430987", "0.54224193", "0.53871244", "0.537434", "0.53690946", "0.53671944", "0.5349555", "0.5339269", "0.53140086", "0.5290455", "0.52744496", "0.52698827", "0.52632225", "0.52583313", "0.52569306", "0.52480334", "0.52480334", "0.52480334", "0.5240077", "0.5228175", "0.5224555", "0.5220649", "0.521397", "0.5202567", "0.51724386", "0.51627576", "0.5141921", "0.5135151", "0.51325536", "0.5126451", "0.5121419", "0.511392", "0.5099976", "0.5096217", "0.5095151", "0.5094651", "0.5086981", "0.5085247", "0.50670683", "0.5055093", "0.50380635", "0.5037469", "0.50311655", "0.50311655", "0.50205225", "0.5017695", "0.5016784", "0.5016344", "0.50149596", "0.49886733", "0.49849346", "0.4983399", "0.49774098", "0.4976518", "0.49753428", "0.49664745", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384", "0.4966384" ]
0.0
-1
GET request to the spacexdata api, grab out all the required data and store it in an array.
componentWillMount() { var launches = []; axios.get('https://api.spacexdata.com/v3/launches/past') .then((req) => { this.setState({"items": req.data}); req.data.forEach(obj => { var singleLaunch = {}; singleLaunch['launch_year'] = obj.launch_year; singleLaunch['mission_name'] = obj.mission_name; singleLaunch['launch_site_name'] = obj.launch_site.site_name_long; singleLaunch['payload_mass_kg'] = obj.rocket.second_stage.payloads[0].payload_mass_kg; singleLaunch['land_success'] = String(obj.rocket.first_stage.cores[0].land_success); launches = [...launches, singleLaunch]; }) this.setState({"items": launches}); }) .catch(err => { console.log(err) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getData(){\r\n\r\n \r\n //url of the site where the info comes from\r\n const Launches_URL = \"https://api.spacexdata.com/v2/launches/all\";\r\n \r\n let url = Launches_URL;\r\n\r\n \r\n \r\n \r\n //calling the method that will look through the retrieved info\r\n $.ajax({\r\n dataType: \"json\",\r\n url: url,\r\n data: null,\r\n success: jsonLoaded\r\n });\r\n\t}", "function getSpaceData() {\n\t//Define the url for the API call\n\tvar url = \"http://api.open-notify.org/astros.json\";\n\t$.ajax({\n\t\turl: url,\n\t\ttype: 'GET',\n\t\tdataType: 'jsonp',\n\t\terror: function(data){\n\t\t\tconsole.log(\"We got problems\");\n\t\t\tspaceData.apiData = {number: 0};\n\t\t\tspaceData.ready = true;\n\t\t},\n\t\tsuccess: function(data){\n\t\t\tconsole.log(\"WooHoo!\");\n\t\t\tconsole.log(data);\n\t\t\tspaceData.apiData = data;\n\t\t\tspaceData.ready = true;\n\t\t}\n\t});\n}", "getSpaceData() {\n this.spaceXData$ = this._spacexservice.getData(this.isLaunched, this.isLanded, this.launchYear);\n }", "function getData() {\n //use the number of records info from the first API call\n return rp(getNum)\n .then(function(ret) {\n // console.log(\"**from keys.js * totalSize = \" + ret.totalSize);\n //determine the number of API calls needed\n size = ret.totalSize;\n callNumber = Math.ceil(size / 200);\n var requestPromiseArray = [];\n for (j = 0; j < callNumber; j++) {\n //create the requestPromiseArray using a loop\n options = {\n method: 'GET',\n uri: 'https://api.salesforceiq.com/v2/lists/57114e10e4b0a3f93805ebc6/listitems?_start=' + URLcounter + '&_limit=200',\n headers: {\n 'Authorization': auth,\n 'Content-type': 'application/json'\n },\n json: true\n }\n if (!options.uri) {}\n //push each call result into the array\n requestPromiseArray.push(rp(options));\n URLcounter = URLcounter + 200;\n }\n //return all the API calls\n return Promise.all(requestPromiseArray); \n })\n .then(function(totalRecords) {\n //join the API calls into one array\n return totalRecords.reduce(function(initial, following) {\n return initial.concat(following.objects);\n }, []);\n })\n .catch(function(err) {\n console.log(\"error in API call\")\n });\n}", "function getData() {\n\tvar query = \"http://api.nytimes.com/svc/search/v2/articlesearch.json?q=\" + search + \"&api-key=\" + key;\n\trequest({\n\t\turl: query,\n\t\tjson: true\n\t}, \n\tfunction(error, response, data) {\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t\tvar urls = [];\n\t\tvar docs = data.response.docs;\n\t\tfor (var d in docs) {\n\t\t\turls.push(docs[d].web_url);\n\t\t}\n\t\tconsole.log(urls);\n\t});\n}", "function getData() {\n const apiName = 'sbrestapi';\n const path = '/alerts';\n const myInit = {\n // OPTIONAL\n headers: {}, // OPTIONAL\n };\n\n return API.get(apiName, path, myInit).catch(err => {\n console.log('There has been a problem with your fetch operation: ' + err);\n throw err;\n });\n}", "function getData() {\r\n\tvar apiURL = HAM.config.apiBaseURL + \r\n\t\t\t\"/object?apikey=\" + HAM.config.apiKey + \r\n\t\t\t\"&s=random&color=any&size=1&q=dimensions:*&fields=title,people,culture,dated,dimensions,colors,imagepermissionlevel,primaryimageurl\";\r\n\r\n\tvar xmlrequest = new XMLHttpRequest();\r\n\r\n\txmlrequest.onreadystatechange = function() {\r\n\t\tif (this.readyState == 4) {\r\n\t\t\tif (this.status == 200) {\r\n\t\t\t\tcurrent = JSON.parse(this.responseText);\r\n\t\t\t\tprocessData(current);\r\n\t\t\t} else {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\t\t\r\n\txmlrequest.open(\"GET\", apiURL, true);\r\n\txmlrequest.send();\r\n\r\n\txmlrequest = null;\r\n\tapiURL = null;\r\n}", "function get_data() {}", "function getData(request) {\n //resetAuth();\n var cc = DataStudioApp.createCommunityConnector();\n console.log(JSON.stringify(request));\n var requestedFields = [];\n var backupRequestedFields = [];\n \n for(var i = 0; i < request.fields.length; i++){\n requestedFields.push(request.fields[i].name);\n backupRequestedFields.push(request.fields[i].name);\n }\n \n console.log(JSON.stringify(requestedFields));\n\n try {\n \n var apiResponse = fetchDataFromApi(request, requestedFields);\n var combinedData = reformatData(apiResponse, request, backupRequestedFields);\n var data = getFormattedData(combinedData, backupRequestedFields);\n \n } catch (e) {\n \n console.log(\"Error\" + e);\n cc.newUserError()\n .setDebugText(\"Error fetching data from API. Exception details: \" + e)\n .setText(\n \"The connector has encountered an unrecoverable error. Please try again later.\"\n )\n .throwException();\n \n }\n \n \n console.log(\"data: \" + JSON.stringify(data))\n return data;\n}", "function getObjectData() {\n\n // console.log(\"Running getObjectData\");\n\n if (dbConnection) {\n\n var dbo = dbConnection;\n dbo\n .collection(\"stats\")\n .find(\n { name: \"lists\" },\n { projection: { _id: 0, objects: 1 } }\n )\n .toArray(function (err, result) {\n if (result && result[0] && result[0]['objects']) {\n var objectList = result[0]['objects'];\n } else {\n var objectList = [];\n }\n for (object of objectList) {\n objectApiCall(object)\n }\n if (err) throw err;\n });\n }\n\n}", "function getdata() {\n\n var url = `/data`;\n\n d3.json(url).then(function(xx) {\n\n data = []\n // xx.slice(s, e)\n globaldata = xx;\n unfiltered = xx;\n actual = [], minute = []\n \n makedata();\n})\n}", "async function getSysSpace() {\r\n const response = await fetch('http://68.7.7.158:8989/api/diskspace?apikey=*************************');\r\n const json = await response.json();\r\n return [json[0].freeSpace, json[0].totalSpace];\r\n}", "function requestAlphaVantageData(symbol) {\n var alpha = \"https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=974UTD95QA2DV3Y5\";\n var http = new XMLHttpRequest();\n http.open(\"GET\", quandl, true);\n http.onreadystatechange = function () {\n if (http.readyState == 4 && http.status == 200) {\n var response = JSON.parse(http.responseText);\n console.log(response);\n }\n }\n http.send();\n }", "function getData () {\n return requestService.getTop()\n .then(response => {\n return parser.parseBody(response);\n })\n}", "async getStock() {\n const response = await fetch(\n `https://www.alphavantage.co/query?function=${this.timeFrame}&symbol=${\n this.symbol\n }&interval=${this.interval}&apikey=${this.apiKey}`\n );\n\n const responseData = await response.json();\n return responseData;\n }", "function getData() {\n setSpinner(true);\n var url = config.baseUrl + \"AircraftList.json?lat=\" + userPosition.coords.latitude + \"&lng=\" + userPosition.coords.longitude + \"&fDstL=0&fDstU=\" + config.range;\n httpGetAsync(url, onSuccessGetData, onErrorGetData)\n }", "getDaily() {\n this.url = this.baseURL + \"?api_key=\" + this.key;\n return this.fetchSpaceStuff();\n }", "function getEntries() {\n return db.get(\"data_entries_point\").value();\n}", "async function getData(){\n\tlet full = baseURL+city.value+apiKey;\n\tconst request = await fetch(full);\n\ttry{\n\t\tconst gotData = await request.json();\t\t\n\t\treturn gotData;\n\t}\n\tcatch(error){\n\t\tconsole.log('error' + error)\n\t}\n}", "function getData() {\n let covidApiEndpoint = 'https://disease.sh/v3/covid-19/countries/?q=yesterday';\n\n httpRequest(covidApiEndpoint, storeData);\n}", "function get_data_in_array () {\n\n return $.ajax({\n url: lrg_search_terms_file,\n dataType: \"text\"\n })\n .error(function (xhRequest, ErrorText, thrownError) {\n console.log('xhRequest: ' + xhRequest + \"\\n\");\n console.log('ErrorText: ' + ErrorText + \"\\n\");\n console.log('thrownError: ' + thrownError + \"\\n\");\n })\n .then(function(data) {\n var data_array = data.split('\\n');\n console.log(\"DATA ARRAY LENGTH: \"+data_array.length);\n return data_array;\n });\n}", "function getData(){\n// new request\nvar req = new XMLHttpRequest();\n\n// open request with zendesk account name\nreq.open(\"GET\", \"https://gabruapparel.zendesk.com/api/v2/tickets.json\", false);\n\n//basic authorisation with username and password\n\nreq.setRequestHeader(\"Authorization\", \"Basic \" + new Buffer('[email protected]:test123').toString('base64'));\nreq.send();\t\n\n/* debugging code when connecting to API\nconsole.log(req.status);\nconsole.log(req.statusText);\n*/\nstatus=req.status\n\n\n// stored requested data\nif(status!=0 && status!=404 && status!=401){\n\ttickData = JSON.parse(req.responseText);\n}\n/*debug code, testing whether API was getting all tickets.\nfor(var i=0;i<tickData.tickets.length){\n\tconsole.log(tickData.tickets.id[i]);\n}\n\n*/\n}", "function fetchDataFromAPI(connection)\n{\n\tvar url = 'https://data.gov.in/api/datastore/resource.json?resource_id=0a076478-3fd3-4e2c-b2d2-581876f56d77&api-key=8b5e72d61484945034cb91e8fc8361bb';\n\thttps.get(url, function(res) {\n var body = '';\n\n res.on('data', function(chunk) {\n body += chunk;\n });\n\n res.on('end', function()\n {\n var fbResponse = JSON.parse(body)\n console.log(\"KARTIK Got response: OK \");\n \n fbResponse.records.forEach(function(f)\n {\n \n // console.log(\"KARTIK LOG what is in array : \" + f.id);\n\t\t\n \tvar id = f.id ;\n \tvar officename = f.officename \n \tvar pincode = f.pincode ;\n \tvar officeType = f.officeType ;\n \tvar Deliverystatus = f.Deliverystatus ;\n \tvar divisionname = f.divisionname ;\n \tvar regionname = f.regionname ;\n \tvar circlename = f.circlename ;\n var Taluk = f.Taluk ;\n var Districtname = f.Districtname ;\n var statename = f.statename ;\n var Telephone = f.Telephone ;\n \n var values = [[id, officename, pincode, officeType, Deliverystatus, divisionname, regionname, circlename, Taluk, Districtname, statename, Telephone ]]; \n configureExpress(connection, values);\n \n });\n connection.end();\n });\n}).on('error', function(e) {\n console.log(\"Got error: \", e);\n});\n}", "function get_ships(req){\n var q = datastore.createQuery(SHIP).order('name').limit(3);\n var results = {}; //returned to user\n if(Object.keys(req.query).includes(\"cursor\")){ //If there is a cursor\n q.startVal = (req.query.cursor).replace(/ /g, \"+\"); //Set start of retrieval at cursor in URI format\n }\n console.log(\"QUERY\");\n console.log(q);\n return datastore.runQuery(q).then( entities => {\n results.items = entities[0];\n console.log(\"CURSOR\");\n console.log(entities[1]);\n if(entities[1].moreResults !== Datastore.NO_MORE_RESULTS){\n results.next = \"https://\" + req.get(\"host\") + \"/ships?cursor=\" + entities[1].endCursor;\n } else {\n results.next = \"END OF RESULTS\";\n }\n return results;\n }).catch( errr => {\n console.log(errr);\n return false;\n });\n}", "async GetAllData(ctx) {\n const allResults = [];\n // This is for a test, to see all the data in the world state.\n const iterator = await ctx.stub.getStateByRange('', '');\n let result = await iterator.next();\n while (!result.done) {\n const strValue = Buffer.from(result.value.value.toString()).toString('utf8');\n let record;\n try {\n record = JSON.parse(strValue);\n } catch (err) {\n console.log(err);\n record = strValue;\n }\n allResults.push({ Key: result.value.key, Record: record });\n result = await iterator.next();\n }\n return JSON.stringify(allResults);\n }", "static async getData() {\n const url = 'http://cparkchallenge.herokuapp.com/report/:lat/:long';\n\n return await fetch(url)\n .then(dataFromServer => dataFromServer.json());\n }", "function retrieveAllAccountData() {\n\tvar cellName = sessionStorage.selectedcell;\n\tvar totalRecordCount = retrieveAccountRecordCount();\n\tvar baseUrl = getClientStore().baseURL;\n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountMgr = createAccountManager();\n\tvar uri = objAccountMgr.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\"\n\t\t\t+ totalRecordCount;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "function getFlipkartData() {\n console.log(\"Fetching Flipkart Products: \");\n return axios.get(flipkartUrl);\n}", "function getData() {\n var url = baseUrl + '.dods?';\n var selected = $('#variables :checkbox').filter(':checked');\n selected.each(function(i) {\n if (this.id == 'location.time_series.time') timeIndex = i;\n url += this.id + ',';\n });\n if (selected.length <= 1) return;\n\n // Get buoy id.\n for (var i=0; i<buoys.markers.length; i++) {\n var marker = buoys.markers[i];\n if (marker.icon.imageDiv.firstChild.getAttribute('src') == 'js/OpenLayers/img/marker.png') {\n var id = marker.metadata.id;\n break;\n }\n }\n\n url = url.replace(/,$/, '');\n //url += '&location.time>1.1e12'; // get only a couple of points for this demo.\n url += '&location._id=' + id;\n\n jsdap.loadData(url, plotData, '/proxy/');\n}", "function getStockData(stocksToGet, callback) {\n // support passing a single symbol as a string instead of an array\n if (typeof stocksToGet === 'string') stocksToGet = [stocksToGet];\n // build the query string\n var s = 'q=select * from yahoo.finance.quotes where symbol in (\"' + stocksToGet.join(\"\\\",\\\"\") + '\")';\n // build the url\n var url = 'http://query.yahooapis.com/v1/public/yql?' + encodeURI(s) + '&format=json&diagnostics=true&env=http://datatables.org/alltables.env';\n // make the request\n console.log(url);\n request.get(url, function(err, res, body) {\n if (err) return console.log(err);\n try {\n var data = JSON.parse(body);\n } catch (e) {\n console.log(body);\n process.nextTick(function() {\n callback(e);\n });\n return;\n }\n var results = data.query.results.quote;\n var stocks = {};\n\n if (stocksToGet.length === 1) {\n var symbolName = results.symbol;\n delete results.symbol;\n stocks[symbolName] = results;\n } else {\n for (var index in results) {\n var symbolName = results[index].symbol;\n delete results[index].symbol;\n stocks[symbolName] = results[index];\n }\n }\n\n process.nextTick(function() {\n callback(null, stocks);\n });\n });\n\n}", "function getData(api) {\n\n const LIMIT = 30\n\n let entryList = []\n return http.get(api)\n .then(function(response) {\n var json = response.data.data.list\n\n if (json == undefined) {\n return here.miniWindow.set({ title: \"Invalid data.\" })\n }\n \n let entryList = json\n\n if (entryList.length <= 1) {\n return here.miniWindow.set({ title: \"Entrylist is empty.\" })\n }\n \n if (entryList.length > LIMIT) {\n entryList = entryList.slice(0, LIMIT)\n }\n return entryList\n })\n}", "function getData(query, callback) {\n query.api_key = apiKey;\n query.limit = 100;\n\n $.getJSON(endpointURL, query, callback);\n }", "function getResponseData() {\n\tconnection.query('SELECT * FROM departments', function(err, res) {\n\t\tif (err) throw err;\n\t\texecutiveInputs(res);\n\t})\n}", "async function getdata(){\n\tconst carsdata = await fetch(\"https://gist.githubusercontent.com/manashmandal/36a81de7f615855450a9c0265dd40c8c/raw/721d036d0fe0fc9b4adfad4413eef7520ef5e075/carsData.json\");\n\tconst cdata = await carsdata.json();\n\tconst mydata = cdata.map(car =>({\n\t\tmpg:car.Miles_per_Gallon,\n\t\thp:car.Horsepower,\n\t}))\n\t.filter(car=>(car.mpg!=null && car.hp!=null));\n\treturn mydata;\n}", "function get_all_cargo(req){\n var q = datastore.createQuery(CARGO).limit(3);\n var results = {}; //returned to user\n if(Object.keys(req.query).includes(\"cursor\")){ //If there is a cursor\n q.startVal = (req.query.cursor).replace(/ /g, \"+\"); //Set start of retrieval at cursor in URI format\n }\n console.log(\"QUERY\");\n console.log(q);\n return datastore.runQuery(q).then( entities => {\n results.items = entities[0];\n console.log(\"CURSOR\");\n console.log(entities[1]);\n if(entities[1].moreResults !== Datastore.NO_MORE_RESULTS){\n results.next = \"https://\" + req.get(\"host\") + \"/cargo?cursor=\" + entities[1].endCursor;\n } else {\n results.next = \"END OF RESULTS\";\n }\n\n return results;\n }).catch( err => {\n return false;\n });\n}", "async function fetchData() {\n const request = await authAxios.get(`${apiUrl}`);\n setData(request.data.results);\n console.warn(request);\n return request;\n }", "function retreiveAllData() {\n\n // -------------------------------------------------------------JavaScript - Arrays Ex. 1s||\n let data = [];\n // -------------------------------------------------------------JavaScript - Loop Ex. 1||\n // -------------------------------------------------------------JavaScript - Arrays (Associate) Ex. 3||\n for (entry in sessionUser.journal) {\n\n // -------------------------------------------------------------JSON - Parse Ex. 1||\n let obj = JSON.parse(sessionUser.journal[entry])\n\n data.push(obj);\n\n }\n return data;\n}", "function getData() {\n // data downloaded from the USGS at http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/ on 4/4/16\n // month.geojson represents recorded earthquakes between 03/04/2016 and 04/04/2016\n // week.geojson represents recorded earthquakes betwen 03/28/2016 and 04/04/2016\n var url = \"data/week.geojson\";\n return esriRequest(url, {\n responseType: \"json\"\n });\n }", "async queryAllRequests(ctx) {\n const startKey = '';\n const endKey = '';\n const allResults = [];\n for await (const {key, value} of ctx.stub.getStateByRange(startKey, endKey)) {\n const strValue = Buffer.from(value).toString('utf8');\n let record;\n try {\n record = JSON.parse(strValue);\n } catch (err) {\n console.log(err);\n record = strValue;\n }\n allResults.push({ Key: key, Record: record });\n }\n console.info(allResults);\n return JSON.stringify(allResults);\n }", "function getDashboardData(){\n var _serviceURI = '';\n $.each(DATA_METRICS_ARR, function(_index, _dataset){\n if((DATA_METRICS_ARR[_index] !== 'NA')){\n objloadedArr.push(DATA_METRICS_ARR[_index]);\n _serviceURI = DATA_SERVICE_URI + \"?dataset=\" + _dataset + \"&session_id=\" + session_id + \"&from=\" + from_date + \"&to=\" + to_date + \"&aggreg_type=\" + aggreg_typ;\n $engine.makeAJAXRequest(\n _serviceURI,\n 'get',\n {},\n '',\n 'json',\n {itemIndex: _index, dataSet: _dataset},\n true,\n graphDataSuccessHandler,\n dataErrorHandler\n );\n }\n });\n }", "function getData() {\n let name = qs(\"select\").value;\n let url = URL_BASE + name + \"/\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(genData)\n .catch(handleError);\n }", "function get24HETHData() {\r\n\tvar result;\r\n\tvar request = new XMLHttpRequest();\r\n\trequest.open('GET',\r\n\t\t'https://min-api.cryptocompare.com/data/v2/histohour?fsym=ETH&tsym=USD&limit=24&api_key=45419ed9fb65b31861ccb009765d97bb619e9eccedc722044457d066cbfb0a8b', false);\r\n\trequest.send(null);\r\n\tresult = JSON.parse(request.responseText);\r\n\treturn result;\r\n}", "async function getData() {\n const response = await fetch(data_url);\n const data = await response.json();\n console.log(data);\n const xs = data.map(function (e) {\n return parseInt(e[\"0\"]);\n });\n console.log(xs);\n for (u = 0; u < 10; u++) {\n xxs.push(xs[u]);\n }\n const ys = data.map(function (e) {\n return parseInt(e[\"1\"]);\n });\n console.log(ys);\n for (u = 0; u < 10; u++) {\n yys.push(ys[u]);\n }\n}", "async function gettingData() {\n let response = await fetch(url);\n let data = await response.json();\n console.log(data);\n }", "async function grabAllData(){\n let dataArr=[];\n let data = await fetchAndDecodeFloatData(\"https://geoweb.princeton.edu/people/sk8609/DEVearthscopeoceans/data/FloatInfo/distances.txt\", 'text');\n tempArr = data.split('\\n');\n for(let i=0; i<tempArr.length;i++){\n let splitArr = tempArr[i].split(' ');\n dataArr.push([splitArr[0], parseInt(splitArr[1]), parseInt(splitArr[2]), parseFloat(splitArr[3]), parseInt(splitArr[4])]);\n }\n return dataArr\n }", "function getStockData(symbol){\n\n //1. Create an XMLHttpRequest object (request object)\n const xhr = new XMLHttpRequest();\n //2.Define event listener\n xhr.onreadystatechange = function response(){\n if (xhr.readyState==4){\n if (xhr.status==200){\n //store response text to local storage to generate all tables\n insertRefreshTime();\n var responseText = xhr.responseText;\n localStorage.setItem(\"searchResult\",responseText);\n console.log(symbol + \"set in search result\");\n \n //print response text to console for troubleshooting\n console.log(\"Showing response text:\");\n console.log(xhr.responseText); \n\n //display results for user\n displayResults();\n \n if(xhr.status==404){\n console.log(\"File or resource not found\");\n }\n }\n }\n };\n //3.trim whitespace and carriage returns from user input\n //var symbol = document.getElementById(\"userInput\").value.trim().replace(/[\\n\\r]/g, '');\n //4.add trimmed output variable 'symbol' in url and send request\n url = \"https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=\"\n +symbol+\"&apikey=QTC0C7W8VC9B36VW\";\n //5.prepare request\n xhr.open('get',url,true);\n //6.send request\n xhr.send();\n //alternate api key: QTC0C7W8VC9B36VW\n //original api key:TXLZQ0VXP5QUYSXN\n}", "function fetchData() {\n queryType=document.querySelector('#queryType').value;\n itemID=document.querySelector('#itemID').value;\n getFromSWAPI(queryType, itemID)\n}", "async function getData() {\n request.open('GET',\n 'https://services1.arcgis.com/0n2NelSAfR7gTkr1/arcgis/rest/services/Business_Licenses/FeatureServer/0/query?where=FID' + ' > ' + lastFID + ' AND FID <= ' + (lastFID + 500) + '&outFields=*&outSR=4326&f=json',\n true);\n\n //comment out the following line to quickly edit ui without making requests\n request.send();\n}", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }", "static async pullData(input) {\n\n const params = new URLSearchParams();\n params.append('method', 'GET');\n params.append('api_key', configPackage.apiKey);\n params.append('format', 'json');\n\n if (input != '') params.append('q', input);\n const response = await fetch((input == '' ? configPackage.trendingUrl : configPackage.url) + params);\n const result = await response.json();\n return result.data;\n }", "function fetchData () {\n return fetch(`${config.API_URL}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ComicClanVettIO2019'}}) \n}", "function requestData(){\n\tloadJSON(\"https://dweet.io/get/dweets/for/money-tracker\", gotData);\n}", "function retrieveData(){\n\t$.ajax({\n\t\turl: searchUrl + searchTerm + limit + key,\n\t\tmethod: \"GET\"\n\t}).done(function(response){\n\t\t//console.log(response);\n\t\treturnedData = response;\n\t\t//console.log(returnedData);\n\t\tcreateGrid();\n\t})\n}", "function getRequest(){\n\tvar xhttp = new XMLHttpRequest();\n \txhttp.onreadystatechange = function() {\n \tif (xhttp.readyState == 4 && xhttp.status == 200) {\n\t\tvar myArr = JSON.parse(xhttp.responseText); \n\t\treturn myArr;\n \t}\n \t};\n \txhttp.open(\"GET\", \"http://gis.dc.turkuamk.fi/guillaume.kleinpoort/baguette/marker.php\", true);\n\txhttp.send();\n}", "function getDataset(){\n return $.ajax({\n url: \"https://opendata.cbs.nl/ODataApi/odata/71930ned/TypedDataSet\",\n method: \"GET\",\n dataType: \"json\",\n success: function(data){\n dataset = data.value;\n },\n error: function(){\n alert(\"Failed to get data from https://opendata.cbs.nl/ODataApi/odata/71930ned/TypedDataSet. \\nRefresh the page to try again.\");\n },\n timeout: 3000,\n });\n}", "getAll() {\n return _data;\n }", "function getApiData(req,res){\r\n res.send(projectData);// send the response that was stored on our dataArray\r\n}", "function getPlayerData() {\n\n var request = new XMLHttpRequest();\n\n request.open(\"GET\", \"https://api.spotify.com/v1/me/player/devices/\", true);\n request.setRequestHeader(\"Authorization\", \"Bearer \" + fullAccessToken);\n request.onload = function () {\n var data = JSON.parse(this.response);\n if (request.status >= 200 && request.status < 400) {\n console.log(data);\n writePlayerData(data);\n } else {\n alert('An error occurred while getting player data.');\n }\n }\n request.send();\n}", "function get30DayBTCData() {\r\n\tvar result;\r\n\tvar request = new XMLHttpRequest();\r\n\trequest.open('GET',\r\n\t\t'https://min-api.cryptocompare.com/data/v2/histoday?fsym=BTC&tsym=USD&limit=30&api_key=45419ed9fb65b31861ccb009765d97bb619e9eccedc722044457d066cbfb0a8b', false)\r\n\trequest.send(null);\r\n\tresult = JSON.parse(request.responseText);\r\n\treturn result;\r\n}", "async getMarkets() {\n const apiURL = `${this.dxApiURL}/v1/markets`\n const res = await fetcher(apiURL)\n\n return res.data || res\n }", "async function getData(url) {\n const response = await fetch(url);\n const data = await response.json();\n for (let i = 0; i < data.length; i++) {\n stateNameArray.push(data[i].StateName)\n }\n //console.log(stateNameArray)\n }", "function getSpaceData() {\n\n\t/*\n\tAn alt way to write the above line would be the following:\n\t\tvar getSpaceData = function(){\n\tFor this class, we will use the 'function nameOfFunction() {' syntax \n\t*/\n\n\t//Include the 'use strict;' statement in your functions in quotes with a trailing semicolon\n\t//It will require/encourage more uniform js style and help with \"this\"\n\t\"use strict\";\n\n\t/*\n\tUse jQuery's ajax method to get the data\n\n\tThe jQuery ajax method can accept an object as its argument\n\t\t$.ajax(objectGoesHere)\n\n\tIn the example below, we define/pass-in an object that has 5 properties\n\t\t- url\n\t\t- type\n\t\t- dataType\n\t\t- error\n\t\t- success\n\tSee the jQuery documentation for a full list of acceptable properties\n\thttp://api.jquery.com/jquery.ajax/\n\n\tFor even more abstraction, see the jQuery $.getJSON() method\n\thttp://api.jquery.com/jQuery.getJSON/\n\t*/\n\n\t$.ajax({\n\t\t//Define the url to make the request\n\t\turl: url,\n\t\t//Define the type of request - if you leave this out, it will default to be a GET\n\t\ttype: 'GET',\n\t\t//Define the type of data to be returned\n\t\t//We're using JSONP to get around the Cross Origin Access Issues\n\t\tdataType: 'jsonp',\n\t\t//Do this if the repsonse is an error\n\t\terror: function(data){\n\t\t\tconsole.log(\"We got problems\");\n\t\t\tconsole.log(data.status);\n\t\t},\n\t\t//Do this if the response is a success\n\t\tsuccess: function(data){\n\t\t\tconsole.log(\"WooHoo!\");\n\t\t\tconsole.log(data);\n\t\t\t$(\"#totalPeople\").html(data.number);\n\t\t}\n\t});\n}", "function getNumbers() {\n var temp = [];\n $.ajax({\n url: \"https://api.mlab.com/api/1/databases/tiplineapplication/collections/hotline_numbers?s={'country': 1}&apiKey=g68v4wvcTSO-6AudfojTLBdRTUBft52J\",\n success: function(data) {\n for (var i = 0; i < data.length; i++) {\n dbNumbers.push(data[i]);\n };\n },\n failure: function(err) {\n console.log(err);\n }\n }).done(function(data) {\n populateNumList(); \n });\n}", "async function getTerm(storeId) {\n //https://svc.bkstr.com/courseMaterial/info?storeId=166904\n const str = await fetch(`https://svc.bkstr.com/courseMaterial/info?storeId=${storeId}`, {\n method: 'GET',\n mode: 'cors',\n headers: getHeaderString(),\n });\n const ret = await str.json(); \n var termData = [];\n console.log('term id and program id');\n let camp = ret.finalData?.campus;\n if(!camp || typeof camp == \"undefined\"){\n console.log(\"no campus or you are blocked\");\n process.exit(0);\n }else{\n camp.forEach(function(val,index){\n let campusId = val.campusId; \n val.program.forEach(function(val2,index2){\n val.program[index2].term.forEach(function(val3,index3){\n let termId = val3.termId;\n let programId = val.program[index2].programId;\n termData.push({campusId,termId,programId});\n })\n })\n })\n // console.log(termData);\n return termData; \n }\n}", "async function getPermits(start,end,offset,limit){\n return new Promise((resolve,reject ) => {\n console.log('sending request to get permits ', start, end,offset,limit)\n const options = {\n host: 'data.cityofnewyork.us',\n path: '/resource/83x8-shf7.json?$limit=' + limit + '&$offset=' + offset +\n \"&$where=\" + encodeURIComponent(\"filing_date between '\" + start +\"' and '\" + end +\"'\")\n + \"&$$app_token=CPY5bSHYeai7igs8WfzssXyP4\" \n\n };\n var data = \"\";\n const req = https.get(options, (res) => {\n //console.log(res);\n res.on('data',(d)=>{\n data += d;\n })\n \n res.on('end',()=>{\n //console.log(data);\n resolve(JSON.parse(data));\n })\n });\n\n req.on('error', (e) => {\n reject(e.message);\n });\n })\n}", "function getData(request) {\n console.log(\"getData::STARTING\");\n console.log(\"getData():: @request\", { request });\n\n request.configParams = validateConfig(request);\n if (request.configParams.error) {\n cc.newUserError()\n .setText(message)\n .setDebugText(message)\n .throwException();\n }\n\n var includeGlobal = request.configParams.includeGlobal || false;\n\n console.log(\"getData::@request-postvalidateConfig\", request);\n\n var cacheKey = getSHA256(request.configParams.query + request.configParams.apiSite);\n // console.log('getData():: @cacheKey',cacheKey);\n\n var apiResponse = getCachedData(cacheKey, request);\n\n if (apiResponse.error) {\n debug_obj = {\n ...request.configParams,\n api_error_msg: apiResponse.error_msg || \"api_error_unknown\",\n apiKey: '',\n query: ''\n };\n sendUserError('The connector has encountered an unrecoverable error. Error fetching data from API. Please forward us those details: ##CONFIG## ' + JSON.stringify(debug_obj) + \" ##QUERY## \" + request.configParams.query);\n } else { console.log(\"no error detected in the API response\"); }\n\n try {\n var fields = getFields(request, apiResponse);\n var requestedFields = fields.forIds(request.fields.map((field) => field.name));\n\n var normalizedResponse = normalizeResponse(apiResponse, includeGlobal);\n var data = getFormattedData(normalizedResponse, requestedFields.asArray());\n } catch (e) {\n console.log(e);\n sendUserError('The connector has encountered an unrecoverable error. Error while retreating response from API. Exception details: ' + e);\n }\n try {\n return {\n schema: requestedFields.build(),\n rows: data\n };\n } catch (e) {\n sendUserError('problem' + e);\n }\n}", "function getData() {\n var data;\n try {\n data = require(dataPath);\n } catch (e) {\n console.log(e);\n data = {};\n }\n ['feeds', 'homepages', 'emails', 'openid', 'foaf', 'keys'].forEach(function (key) {\n if (!Array.isArray(data[key])) {\n data[key] = [];\n }\n });\n return data;\n }", "function getData(options) {\n if (options.capabilities && options.capabilities.url && options.capabilities.layer && options.capabilities.storedQueryId) {\n var errors = [];\n var now = (new Date()).getTime();\n\n // Capabilities object whose structure is reduced version of the one given by\n // {OpenLayers.Format.WMSCapabilities.read} function for the WMS capability object\n // structure.\n var capabilities = {\n capability : {\n layers : [],\n request : {\n getcapabilities : {\n href : jQuery.trim(options.capabilities.url)\n }\n }\n }\n };\n\n var params = {\n request : \"GetPropertyValue\",\n valuereference : \"wfs:FeatureCollection/wfs:member/omso:GridSeriesObservation/om:phenomenonTime/gml:TimeInstant/gml:timePosition\",\n storedquery_id : options.capabilities.storedQueryId,\n // Set starttime and endtime parameters because WFS query requires these unless default should be used\n // which would not give all the times available. Therefore, use deltas that defined large period which should\n // contain all the times available from the server.\n // Notice, server does not understand milliseconds. Therefore, they are removed from time strings.\n starttime : (new Date(now - DELTA_TIME_PAST)).toISOString().replace(/\\.\\d\\d\\dZ$/, \"Z\"),\n endtime : (new Date(now + DELTA_TIME_FUTURE)).toISOString().replace(/\\.\\d\\d\\dZ$/, \"Z\")\n };\n // Merge params into the default object.\n // Notice, options.params will replace default values if they overlap.\n _.merge(params, options.params);\n\n // Get XML data from the server.\n // Make sure that this function is asynchronous in all cases,\n // also in possible error cases that could otherwise use callback synchronously.\n setTimeout(function() {\n // URL may be logged here for debugging purposes.\n // Then, you may also use the URL directly with a web browser to check the XML.\n // if (\"undefined\" !== typeof console && console) { console.debug(\"URL: \" + options.capabilities.url); }\n jQuery.ajax({\n type : HTTP_METHOD,\n url : jQuery.trim(options.capabilities.url),\n dataType : REQUEST_DATA_TYPE,\n data : params,\n success : function(data) {\n // Request was success.\n // Notice, if server gives an exception information\n // in XML format for some error case, the flow should\n // come here. But, if testing is done for this javascript\n // in different domain or sub-domain than URL used for ajax,\n // the callback may call error-function instead. Then,\n // the XML body may not be available for parsing.\n var layer = {\n name : options.capabilities.layer,\n dimensions : {\n time : {\n values : []\n }\n }\n };\n capabilities.capability.layers.push(layer);\n jQuery(data).find(XML_GML_TIME_POSITION).each(function() {\n // XML gives times in ascending order.\n // Also, capabilities layer object should give times in ascending order.\n layer.dimensions.time.values.push((new Date(jQuery.trim(jQuery(this).text()))).getTime());\n });\n handleCallback(options.callback, capabilities, errors);\n },\n error : function(jqXHR, textStatus, errorThrown) {\n // An error occurred.\n var error = {};\n error[KEY_ERROR_CODE] = jqXHR.status;\n // Use errorThrown if it is available and not empty string.\n // Otherwise, use textStatus for error value. Notice, empty\n // string is also interpreted as false with logical or operator.\n error[KEY_ERROR_TEXT] = errorThrown || textStatus;\n errors.push(error);\n if (\"undefined\" !== typeof console && console) {\n var errorStr = \"ERROR: WFS XML response error: \";\n errorStr += \"Status: \" + error[KEY_ERROR_CODE];\n errorStr += \", Text: \" + error[KEY_ERROR_TEXT];\n console.error(errorStr);\n }\n handleCallback(options.callback, undefined, errors);\n }\n });\n }, 0);\n\n } else {\n // Throw an exception because of the synchronous error.\n // Then, this exception will be catched and handled properly by\n // the get data flow structure.\n throw \"ERROR: WFS capabilities configuration is missing URL, layer or storedQueryId information!\";\n }\n }", "async fetchData(searchTerm) {\n const response = await axios.get(\"http://www.omdbapi.com/\", {\n params: {\n apikey: \"3373d3bd\",\n s: searchTerm,\n },\n });\n\n //check for errors before we get back our response\n if (response.data.Error) {\n //empty array meaning we didnt get anything back to show to the user\n return [];\n }\n\n //return the data we want\n return response.data.Search;\n }", "getAll() {\n return this.getDataFromServer(this.path);\n }", "function getData() {\n\t\t\tvar deferred = $.Deferred();\n\t\t\t// get RPC results\n\t\t\tRactiveRPC.tab2dataAsync({\n\t\t\t\tonsuccess: function(results) {\n\t\t\t\t\tdeferred.resolve(results);\n\t\t\t\t},\n\t\t\t\tonerror: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\tontimeout: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\ttimeout: 2000,\n\t\t\t\tparams: [1,2]\n\t\t\t});\t\n\t\t\t\n\t\t\treturn deferred.promise();\n\t\t}", "function getRec(start, end) {\r\n\r\n //var baseURL = \"https://wistg.toronto.ca/inter/edc/festevents.nsf/api/data/collections/name/export?start=<start>&count=100\";\r\n var baseURL = \"http://dom01d.toronto.ca/inter/edc/festevents.nsf/api/data/collections/name/export?start=<start>&count=100\"\r\n var url = baseURL.replace('<start>',start);\r\n var request = $.ajax({\r\n type: 'GET',\r\n url: url,\r\n cache: false,\r\n crossDomain: true,\r\n dataType: 'json',\r\n success: function (data) {\r\n console.log(\"Start: \" + start + \" - found \" + data.length + \" rows\");\r\n $.each(data, function( index, row ) {\r\n eventHeaderJson.push(row);\r\n });\r\n\r\n },\r\n error: function (xhr, ajaxOptions, thrownError) {\r\n console.log(xhr.status);\r\n console.log(thrownError);\r\n }\r\n });\r\n return request;\r\n}", "function getData() {\n\t\t\tvar deferred = $.Deferred();\n\t\t\t// get RPC results\n\t\t\tRactiveRPC.testDataAsync({\n\t\t\t\tonsuccess: function(results) {\n\t\t\t\t\tdeferred.resolve(results);\n\t\t\t\t},\n\t\t\t\tonerror: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\tontimeout: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\ttimeout: 2000,\n\t\t\t\tparams: [1,2]\n\t\t\t});\t\n\t\t\t\n\t\t\treturn deferred.promise();\n\t\t}", "async function getDataFromAPI (zipCode) {\n let response = await fetch(`${baseURL}${zipCode}${units}`, {\n\t\"method\": \"GET\",\n\t\"headers\": {\n\t\t\"x-rapidapi-key\": apiKey,\n\t\t\"x-rapidapi-host\": apiHost\n\t}\n });\n\n try {\n let newData = await response.json();\n return newData;\n } catch(error) {\n alert(\"Something went wrong!\");\n console.log(`Error: ${error}`);\n }\n}", "async fetchAll() {\n try {\n // Make the request\n const response = await axios.get(\n `${this.DB_READ_URL}/${this.DB_DEFAULTS_CONFIG.plugin_id}/${this.DB_DEFAULTS_CONFIG.collection_name}/${this.DB_DEFAULTS_CONFIG.organization_id}`,\n );\n\n if (response.data.data == null) {\n return { data: [] };\n }\n\n // Return the response\n return response.data;\n } catch (error) {\n if (\n error.response.data.status === 404\n && error.response.data.message === 'collection not found'\n ) {\n return { data: [] };\n }\n\n throw new CustomError(`Unable to Connect to Zuri Core DB [READ ALL]: ${error}`, '500');\n }\n }", "async function xkcd_curr(){\n await common.getFromAPI(\"https://xkcd.com/info.0.json\", downloader);\n}", "function C24_GetBalances() { \r\n \r\n var C24request = {\r\n 'id' : 'C24',\r\n 'name' : 'Crex24',\r\n 'apikey' : EXKEY,\r\n 'secret' : EXSECRET,\r\n 'command' : \"/v2/account/balance\", \r\n 'uri' : 'https://api.crex24.com',\r\n 'method' : 'GET',\r\n 'payload' : '' // <- wallet address\r\n }; \r\n \r\n \r\n if (ADATTRIB === 'demo') \r\n DataAll = [ {\"currency\": \"ETH\",\"available\": 0.0979, \"reserved\": 0.0 },\r\n {\"currency\": \"BCD\", \"available\": 12.43897,\"reserved\": 0.0 },\r\n {\"currency\": \"BCH\", \"available\": 1.3394, \"reserved\": 1.4013 },]; \r\n else\r\n {\r\n Logger.log(\"Fetch\"); \r\n var response = C24_PrivateRequest(C24request),\r\n DataAll = JSON.parse(UrlFetchApp.fetch(response.uri, response.params));\r\n }\r\n try { Logger.log(\"Validate if we receive a valid response...\"+DataAll[0].currency); } catch(e) {Logger.log(DataAll); Logger.log(\"no or empty response\"); return null;}\r\n Logger.log( DataAll[0].currency);\r\n if (DataAll == null || DataAll == '') { Logger.log(\"no or empty response\"); return null;}\r\n \r\n\r\n var array = [];\r\n for (r in DataAll) { \r\n if (((DataAll[r].available + DataAll[r].reserved) * 10000 ) > 0) {\r\n array.push({\r\n curcodeEX: DataAll[r].currency, \r\n balance: DataAll[r].available + DataAll[r].reserved\r\n }); \r\n }\r\n }\r\n \r\n Logger.log(array); \r\n return (array);\r\n}", "function getReleaseData() {\n\t\tconst newReleaseURL = `${newReleaseOptions.api}${newReleaseOptions.endpoint}?api_key=${newReleaseOptions.key}&format=${newReleaseOptions.format}&limit=${newReleaseOptions.limit}&sort=${newReleaseOptions.sort}&filter=expected_release_year:${newReleaseOptions.filterYear},expected_release_month:${newReleaseOptions.filterMonth}`;\n\n\t\tfetch('https://cors-anywhere.herokuapp.com/' + newReleaseURL)\n\t\t\t.then((response) => response.json())\n\t\t\t.then((response) => {\n\t\t\t\tsetReleaseData(response.results);\n\t\t\t})\n\t\t\t.catch(alert.error);\n\t}", "function getBookings() {\n const request = new XMLHttpRequest();\n let bookings = [];\n\n // Request Bookings\n request.open(\"GET\", \"./booking.php\");\n request.setRequestHeader(\"Content-Type\", \"application/json\");\n request.onreadystatechange = () => {\n if (request.readyState == 4 && request.status == 200) {\n bookings = JSON.parse(request.responseText);\n displayData(bookings);\n }\n };\n request.send();\n}", "function getGeoBulk(qry){\n var apiAdd = `http://www.mapquestapi.com/geocoding/v1/batch?key=${key['mapQuest']}`;\n \n // Basic get request pulled from Node.js documentation \n http.get(apiAdd += qry, function(res) {\n var statusCode = res.statusCode;\n var contentType = res.headers['content-type'];\n\n let error;\n if (statusCode !== 200) {\n error = new Error(`Request Failed.\\n` + `Status Code: ${statusCode}`);\n } else if (!/^application\\/json/.test(contentType)) {\n error = new Error(`Invalid content-type.\\n` + `Expected application/json but received ${contentType}`);\n }\n if (error) {\n console.log(error.message);\n // consume response data to free up memory\n res.resume();\n return;\n }\n\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', function(chunk) {rawData += chunk});\n res.on('end', function(){\n try {\n // Parse JSON to object\n var locData = JSON.parse(rawData);\n // Generate array of City/Location objects\n var cityArr = geoCity(locData);\n // Get object containing cities with the shortest distance\n var shortObj = shortestDist(cityArr);\n // Return result of shortestDist function\n return console.log(\n \"\\n\" + shortObj[\"cityA\"] + \n \"\\n\" + shortObj[\"cityB\"] \n );\n\n } catch (e) {\n console.log(e.message);\n }\n });\n }).on('error', function(e) {\n console.log(`Got error: ${e.message}`);\n });\n }", "function getData() {\n openWebEocSession();\n var data = new XMLHttpRequest();\n data.open('GET', baseURL + boardURL, true);\n data.onload = function () {\n if (this.status == 200) {\n let allData = JSON.parse(this.responseText);\n populateAllVariables(allData);\n }\n }\n data.send();\n\n\n}", "function getData(){\n $http.get(rootUrl+\"?filter[period]=\"+$filter('date')($rootScope.selectedPeriod, \"yyyy-MM\")).then(function(response){\n self.list = response.data.data;\n });\n }", "function getData(){\r\n url = URL_COMMON + \"/current_config/\";\r\n fetch(url).then( response => response.json())\r\n .then( data => {\r\n console.log(data);\r\n appendData(data);\r\n })\r\n .catch( err => {\r\n console.log('error: ' + err);\r\n });\r\n\r\n}", "function fetchingData() {\n fetch(\"https://ipwhois.app/xml/?objects=ip,country,region,city,latitude,longitude,timezone,timezone_name\")\n .then((response) => response.text())\n .then((data) => {\n // console.log(`XML_data: ${data}`);\n const parser = new DOMParser();\n const xml = parser.parseFromString(data, \"application/xml\");\n // console.log(\"XML:\", xml);\n showPositionInfo(xml);\n let positionArray = [parseFloat(xml.all[5].textContent).toFixed(2), parseFloat(xml.all[6].textContent).toFixed(2)];\n setUpMap2(positionArray);\n showPassesISS(positionArray);\n showWeather(positionArray);\n })\n .catch(console.error);\n}", "function getData(){\n fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(myJSON) {\n var spaceObj = JSON.stringify(myJson.near_earth_objects);\n id = myJSON.near_earth_objects.id;\n name = myJSON.near_earth_objects.name;\n console.log(name);\n\n });\n \n }", "function getData(data) {\n var d = new Date();\n var currentDate = (d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate())\n var emitter = new events.EventEmitter();\n unirest.get('http://api.amp.active.com/v2/search/?query=hiking&query=marathon&query=cycling&query=climbing&query=marathon&near=' + data + '&radius=80&country=United+States&current_page=1&per_page=15&kids=false&start_date=' + currentDate + '..&sort=date&api_key=c7uavra377u4dbmbkhs7h52h')\n .header(\"Accept\", \"application/json\")\n .end(function (result) {\n if (result.ok) {\n emitter.emit('end', result.body);\n }\n //failure scenario\n else {\n emitter.emit('error', result.code);\n }\n });\n return emitter;\n}", "_cursorToArray(request) {\n return new Promise((resolve, reject) => {\n let results = [];\n request.onsuccess = () => {\n const cursor = request.result;\n if (cursor) {\n if ('value' in cursor) {\n results.push(cursor.value);\n }\n else {\n results.push(cursor.key);\n }\n cursor.continue();\n }\n else {\n resolve(results);\n }\n };\n request.onerror = reject;\n });\n }", "async function asyncGetChargingStations(latitudeA, longitudeA, latitudeB, longitudeB) {\n var url = new URL(baseUrl); //create the API contact url and define it's parameters\n const boundingBox = \"(\" + latitudeA + \",\" + longitudeA + \")(\" + latitudeB + \",\" + longitudeB + \")\";\n const params = [[\"boundingbox\", boundingBox],\n [\"maxresults\", maxResults]]\n\n /* var searchParams = new URLSearchParams(params);\n const searchParamString = searchParams.toString();\n url.search = searchParamString; */\n //merge the parameters with the URL (old code up top)\n url.search = new URLSearchParams(params).toString();\n if(enableDebug) console.log(url.toString());\n\n //contact the API and extract the returned json\n const response = await fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-API-key\": apiKey\n }\n });\n const data = await response.json();\n if(enableDebug) console.log(data);\n\n var stationArray = [];\n data.forEach(function (item, index) {\n var station = {};\n station.latitude = data[index].AddressInfo.Latitude;\n station.longitude = data[index].AddressInfo.Longitude;\n station.name = data[index].AddressInfo.Title;\n\n stationArray.push(station);\n });\n if(enableDebug) console.log(stationArray);\n return stationArray;\n\n}", "function getWeatherData(lat, long) {\r\n var key = \"1234f59e5798e86cc9241a1ff070cd36\";\r\n var req1 = new XMLHttpRequest();\r\n req1.open(\r\n \"GET\",\r\n `http://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${long}&appid=${key}`,\r\n true\r\n );\r\n req1.send();\r\n req1.onload = function () {\r\n var result = JSON.parse(this.response);\r\n console.log(result);\r\n };\r\n}", "async readServices() {\n let response = await fetch(url + 'get/services')\n let data = await response.json();\n return data\n }", "function getData (){\n var carData = JSON.parse(this.responseText).cars;\n carInfo(carData);\n }", "function getStockData(stocks) {\n var LIMIT = 100;\n var stockData = [];\n for (var i = 0; i < stocks.length; i += LIMIT) {\n batch = stocks.slice(i, i + LIMIT);\n stockData.push(queryAPI(batch));\n }\n return Promise.all(stockData);\n}", "async function callAPI(){\n\t let rawEtatStations = await fetch('https://data.mulhouse-alsace.fr/api/records/1.0/search/?dataset=68224_stationsvelocite_jcdecaux_tempsreel&rows=40&sort=-number&facet=status&facet=contract_name&facet=name&timezone=Europe%2FBerlin');\n\t return await rawEtatStations.json();\n\t}", "function getData(Lat, Lon) {\r\n const readyToSent = (url + \"lat=\" + Lat \r\n + \"&lon=\" + Lon + \"&appid=\" + key);\r\n fetch(readyToSent)\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(data);\r\n fetchData(data)\r\n })\r\n}", "function gettingRecordsData() {\n\treturn gettingRecordsDataForCheckin();\n}", "async function fetchAllCenturies() \n {\n if (localStorage.getItem('centuries')) \n {\n return JSON.parse(localStorage.getItem('centuries'));\n }\n\n try \n {\n const response = await fetch(`${ API.BASE_URL }/${ API.RESOURCES.CENTURY }?${ API.KEY }&size=100&sort=temporalorder`);\n\n // Now, you need to store them. Where can we do that? Right before we return them after successful fetch. \n // Add a line to set the centuries item in localstorage after you get the records, but before returning them.\n let { info, records } = await response.json();\n localStorage.setItem('centuries', JSON.stringify(records));\n \n return records;\n } \n catch (error) \n {\n console.error(error);\n }\n }", "function getTicketData(domain){\n client.data.get('ticket').then(\n function (data)\n {\n var ticket_user_id = data.ticket.requester_id;\n request(domain, ticket_user_id);\n },\n function (error) {\n alert(error.status + \": \" + error.response + \", Please reach out to IT team\");\n }\n );\n }", "function getResults() {\n results = JSON.parse(httpRequest.responseText);\n\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n populateWeatherCard();\n } else {\n alert('There was a problem with the request.');\n console.log('Error: ', httpRequest.status);\n }\n }\n return results;\n }", "getPricesDaily(ticker){\n\n let prices = [];\n\n return fetch(baseURLext + dailyQuery + ticker + dailyParams + key1)\n .then(doc => doc.json())\n .then((doc) => {\n if(doc[\"Meta Data\"]){\n const latestDate = new Date(doc[\"Meta Data\"][\"3. Last Refreshed\"]);\n const numberOfDays = latestDate.getDay();\n const sharesData = Object.values(doc[\"Time Series (Daily)\"])\n\n for(let i = 0; i < numberOfDays; i++){\n prices.push(parseFloat(sharesData[i][\"4. close\"]));\n }\n return prices;\n }\n return null;\n })\n }", "function getData(){ //Function that gathers the data from the API.\n return fetch(\"https://opentdb.com/api.php?amount=10&type=boolean\") //\"Fetches\" the data from the API. <<NTS: Need to read up more on this one>> \n .then (response => response.json())\n .then (response => {return response})\n}", "function getAllData() {\n\tvar jsonStr = cookieObj.get(\"datas\");\n\tvar listObj = JSON.parse(jsonStr);\n\treturn listObj;\n}" ]
[ "0.664377", "0.6622786", "0.6604872", "0.6239379", "0.62161946", "0.6199637", "0.6176015", "0.6162047", "0.5946423", "0.59363014", "0.59297293", "0.5926661", "0.5916459", "0.59053874", "0.58781564", "0.58560747", "0.5813922", "0.580794", "0.58037984", "0.5790968", "0.5737599", "0.5723809", "0.57046133", "0.5696247", "0.56869787", "0.566332", "0.5654335", "0.5649177", "0.5646598", "0.5633467", "0.5620461", "0.56121594", "0.5611804", "0.5578375", "0.5574596", "0.5573953", "0.5570607", "0.555454", "0.55506647", "0.5544784", "0.55316657", "0.55303866", "0.5527728", "0.5525772", "0.5524534", "0.55156314", "0.5513556", "0.55132", "0.55007976", "0.5494681", "0.54893744", "0.54794174", "0.5471279", "0.5469348", "0.54672366", "0.5454048", "0.545219", "0.54406774", "0.54401284", "0.5432917", "0.54206014", "0.54172945", "0.54143786", "0.54137564", "0.5411445", "0.540985", "0.5409163", "0.54056025", "0.54039156", "0.5399501", "0.5399215", "0.539722", "0.5396557", "0.5395157", "0.53947246", "0.53892565", "0.5383914", "0.538141", "0.53812766", "0.5380947", "0.5377922", "0.5374684", "0.5369709", "0.53667307", "0.5365022", "0.53599125", "0.53593934", "0.5355696", "0.53449905", "0.5343528", "0.5342896", "0.5339009", "0.5331438", "0.53301984", "0.53255975", "0.5325404", "0.5320951", "0.53189296", "0.5318717", "0.5315846", "0.5308106" ]
0.0
-1
Return a unique ID that can be assigned to an observable for dependency tracking. Theoretically, you could eventually overflow the number storage size, resulting in duplicate IDs. But in JavaScript, the largest exact integral value is 2^53 or 9,007,199,254,740,992. If you created 1,000,000 IDs per second, it would take over 285 years to reach that number. Reference
function getId() { return ++lastId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uniqueID() {\n return Math.round(new Date().getTime() * (Math.random() * 100));\n }", "function createId() {\n\tvar id = Math.floor( Math.random() * 100000 ) + 1;\n\treturn id;\n}", "function createID() {\n return Math.floor(Math.random() * 100000000000);\n}", "function generateId() {\n return (new Date()).getTime() - 1283136075795 + (_generateCounter++);\n }", "function uniqId()\n{\n\treturn Math.round(new Date().getTime() + (Math.random() * 100));\n}", "_createId() {\n // pretty much unique...\n const time = new Date().getTime()\n // unique so long as you aren't running on a massive supercomputer...\n const specificTime = parseInt(performance.now())\n // for that one person that one time where their computers\n // decided to use two of the same times anyway... (it's \"one in a million\")\n const randNumJustInCase = Math.floor(Math.random() * 1000000)\n let fullId = `NODE${time}-${specificTime}-${randNumJustInCase}`\n\n // okay... let's guarantee this id is unique\n while (this._nodesById[fullId]) {\n fullId += Math.floor(Math.random() * 10)\n }\n\n return fullId\n }", "function generateId(){\n return String(Math.round(new Date().getTime()/1000));\n}", "function getUniqueID() {\n var id = new Date().valueOf();\n return id + \".\" + incrementID.increment();\n }", "function uniqueId() {\n return new Date().getTime();\n }", "function createId(){\n return Math.round(Math.random()*1000000);\n }", "function uniqueId() {\n\t\tuniqueId.i = uniqueId.i || 0;\n\t\treturn '__' + uniqueId.i++;\n\t}", "function Id() {\n\treturn Math.floor(Math.random() * 99999999999) + 1;\n}", "function uniqueId() {\n return (new Date).getTime()\n }", "function getUniqueId() {\n _id++;\n return _id;\n}", "function createId(){\n return Math.floor(Math.random() * 10000)\n}", "function generateId() {\n\t\treturn Math.floor(Math.random() * 1000000) + ((new Date).getTime()).toString();\n\t}", "function uniqueID() {\n let x = 1;\n let uID = x++;\n}", "function uniqueID() \n{\n return (Math.floor((Math.random()*1000000))).toString(32)+''+(new Date().getTime()).toString(32)\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function uniqueId() {\n return (new Date).getTime()\n}", "function nextUniqueId() {\n\tidCounter++;\n\treturn idCounter.toString();\n}", "function generateId() {\n return new Date().getTime();\n}", "function generateID() {\n return Math.floor(Math.random() * 100000000);\n}", "function makeId() {\n return \"_\" + (\"\" + Math.random()).slice(2, 10); \n }", "function generateID() {\r\n return Math.floor(Math.random() * 100000000);\r\n}", "function generateID() {\n\t\tsID += 1;\n\t\treturn sID;\n\t}", "function generateUniqueID() {\r\n\treturn Date.now();\r\n}", "function createId() {\r\n return (\r\n Math.floor(Math.random() * 10000000) +\r\n \"-\" +\r\n Math.floor(Math.random() * 10000000)\r\n );\r\n }", "function uniqueId() {\n return Date.now() + 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }", "function createUniqueId() {\n return String((new Date()).valueOf()).slice(-4) + Math.floor(Math.random() * 1000);\n}", "_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function generateId() {\n return Math.floor(Math.random() * 10000000) + \"-\" + Math.floor(Math.random() * 10000000)\n}", "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function generateId() {\n // Generates random whole number between 0 and 100 million.\n return Math.floor(Math.random() * 100000000);\n}", "function useUniqueID() {\n var UUID = Math.floor(Math.random() * 1000000000);\n var UUIDBindings = new Map();\n\n function getID(model) {\n if (UUIDBindings.has(model)) {\n return UUIDBindings.get(model);\n } else {\n UUID++;\n UUIDBindings.set(model, UUID);\n return UUID;\n }\n }\n\n return {\n UUID: UUID,\n UUIDBindings: UUIDBindings,\n getID: getID\n };\n}", "function generateUniqueID () {\n var d = new Date().getTime();\n if (typeof window.performance !== 'undefined' && typeof window.performance.now === 'function') {\n d += window.performance.now(); // use high-precision timer if available\n }\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)\n })\n}", "function genID() {\n return Math.floor(Math.random() * 0x100000000).toString(16) + Math.floor(Math.random() * 0x100000000).toString(16);\n }", "function createId() {\n ++id;\n const t = process.hrtime();\n const v = id ^ t[0] ^ t[1];\n const a = ('0' + v % 13).slice(-2);\n const b = v;\n const c = id;\n const d = (c + b) % 7;\n return `ID-${a}-${b}-${c}-${d}`;\n}", "function generate_id(){\n var id=(Math.floor(Math.random() * 100000000));\n if(id<10000000){\n id=\"0\"+id.toString();\n return id;}\n else{\n id=id.toString();\n return id;}\n}", "function _id() {\n\t\tvar S4 = function() {\n\t\t return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n\t\t};\n\t\treturn (S4()+S4());\n\t}", "generateId() {\n if (!this.constructor.generatedIdIndex) this.constructor.generatedIdIndex = 0;\n return '_generated' + this.$name + ++this.constructor.generatedIdIndex;\n }", "function generateID () {\n return Date.now().toString(16)\n}", "function generateId() {\n\treturn Math.random() * 999999;\n}", "function makeId() {\n return \"_\" + Math.random().toString(36).substr(2, 9);\n }", "function newID() {\n return (Date.now() + ( (Math.random()*100000).toFixed()));\n}", "function generateId() {\n //http://forumsblogswikis.com/2008/05/26/how-to-generate-a-unique-id-in-javascript/\n var newDate = new Date;\n return newDate.getTime();\n}", "function idGenerator() {\n return MyApp.nextId++\n }", "function makeId() {\n idNumber = idNumber + 1;\n const newId = ($tw.browser?'b':'s') + idNumber;\n return newId;\n }", "function generateId() {\n\treturn now() + parseInt(Math.random() * 999999);\n}", "generateId() {\n let min = 1;\n let max = 999;\n let part1 = new Date().getTime();\n let part2 = Math.floor(Math.random() * (max - min + 1)) + min;\n return resolve(`${part1.toString(36)}_${part2.toString(36)}`);\n }", "getIdGenerator() {\n let lastId = 0;\n return function() {\n lastId += 1;\n return lastId;\n };\n }", "generateId() {\n return'id' + Date.now().toString() + Math.floor(Math.random(1000)).toString();\n }", "function generateID() {\n\tvar chunkSize = 1 << 16; // 2^16\n\tvar now = new Date();\n\tvar part1 = new Number(now.getTime() % chunkSize);\n\tvar part2 = new Number(Math.floor(chunkSize*Math.random()));\n\treturn part1.toString(16) + part2.toString(16);\n}", "function uniqid() \n{\n return (Math.floor((Math.random()*1000000))).toString(32)+''+(new Date().getTime()).toString(32)\n}", "function getNewId() {\n\t\treturn (_idGen++).toString();\n\t}", "function _generateId() {\n\treturn Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36);\n}", "function createID() {\n return (\"\" + 1e10).replace(/[018]/g, function(a) {\n return (a ^ Math.random() * 16 >> a / 4).toString(16)\n });\n}", "function getUniqueIdentifierStr() {\n return getIncrementalInteger() + Math.random().toString(16).substr(2);\n}", "static createID() {\n return /*'_' + */Math.random().toString(36).substr(2, 9);\n }", "function uniqueId() {\n return `a${Math.random().toString(36).substr(2, 9)}`;\n}", "function createUniqueID() {\n var dt = new Date().getTime();\n var uniqueId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (dt + Math.random() * 16) % 16 | 0;\n dt = Math.floor(dt / 16);\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return uniqueId;\n}", "nextId() {\n this.uniqueId = this.uniqueId || 0\n return this.uniqueId++\n}", "static randomID() {\n return Math.round(Math.random() * 1000000) + '';\n }", "function id() {\n return '_' + Math.random().toString(36).substr(2, 9);\n }", "function generateId() {\n return shortId.generate();\n}", "function guid() {\r\n return parseInt(Date.now() + Math.random());\r\n}", "function id () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function generateID() {\n return v4();\n}", "function uniqueID() {\n var chars = '0123456789abcdef';\n return 'xxxxxxxxxx'.replace(/./g, function () {\n return chars.charAt(Math.floor(Math.random() * chars.length));\n });\n}", "function getUniqueId() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n s4() + '-' + s4() + s4() + s4();\n}", "function generateId() {\n return Math.floor(Math.random() * Date.now()).toString(16);\n}", "function guid() {\n return parseInt(Date.now() + Math.random())\n }", "function guid() {\r\n\treturn parseInt(Date.now() + Math.random());\r\n}", "function getUniqueId(){\n\treturn Math.random().toString(36);\n}", "function getUniqueID() {\n return Math.random().toString(36).substr(2, 9)\n}", "function newid () {\n return Math.floor(Math.random() * 9007199254740992);\n}", "_id () {\n return (Math.random().toString(16) + '000000000').substr(2, 8)\n }", "static generateID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000000).toString(16);\n }\n return s4();\n }", "function makeId() {\n return Math.random().toString(36).substr(2, 5);\n}", "function makeId() {\r\n var rtn;\r\n\r\n rtn = String(Math.random());\r\n rtn = rtn.substring(2);\r\n rtn = parseInt(rtn).toString(36);\r\n\r\n return rtn;\r\n}", "function uniqueId () {\n return ('xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx').replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0,\n v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "function generateId() {\n let date = new Date();\n let random = Math.round((Math.random() * 10000));\n let id = date.getTime().toString() + random.toString();\n return id;\n}", "function ID() {\n return Math.random().toString(36).substr(2, 10) + Math.random().toString(36).substr(2, 5);\n}", "function genID() {\n return (+new Date() + Math.floor(Math.random() * 999999)).toString(36);\n}", "getId() {\n uniqueId++\n return uniqueId;\n }", "generateId () {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n }", "function random_id() {\n\treturn ('' + Math.floor((Math.random() * 100000) + 1));\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}" ]
[ "0.76844907", "0.7581741", "0.75364333", "0.7536082", "0.752612", "0.7521134", "0.75026023", "0.7491074", "0.7479059", "0.7447655", "0.7445163", "0.7413323", "0.74085927", "0.73978394", "0.73782", "0.73623604", "0.736198", "0.7361333", "0.7357073", "0.7357073", "0.7357073", "0.7357073", "0.7357073", "0.7357073", "0.7357073", "0.7357073", "0.73530674", "0.73510414", "0.7329284", "0.7326845", "0.7319366", "0.7314261", "0.7294483", "0.7278534", "0.7274785", "0.727399", "0.7273322", "0.72714823", "0.72714823", "0.722124", "0.7213035", "0.7204597", "0.7204597", "0.719888", "0.7186614", "0.7180782", "0.71803826", "0.7174873", "0.71649075", "0.71529084", "0.7145984", "0.7141525", "0.71384937", "0.71376866", "0.71130806", "0.7099161", "0.70945317", "0.7080486", "0.70706695", "0.70699257", "0.70688796", "0.7061383", "0.70415205", "0.7034262", "0.702934", "0.7028525", "0.70247656", "0.7016195", "0.70105726", "0.7005208", "0.69936377", "0.6992164", "0.69908047", "0.6989198", "0.69855034", "0.69840634", "0.69492656", "0.6948013", "0.69451", "0.69436157", "0.69363016", "0.69298816", "0.6924614", "0.6916129", "0.6905879", "0.6901337", "0.6900068", "0.6894878", "0.68908167", "0.6870473", "0.6862047", "0.68594545", "0.6845759", "0.6835641", "0.68333036", "0.683204", "0.68283635", "0.68181336", "0.6816157", "0.6816157", "0.6816157" ]
0.0
-1
The binding context object includes static properties for the current, parent, and root view models. If a view model is actually stored in an observable, the corresponding binding context object, and any child contexts, must be updated when the view model is changed.
function updateContext() { // Most of the time, the context will directly get a view model object, but if a function is given, // we call the function to retrieve the view model. If the function accesses any obsevables or returns // an observable, the dependency is tracked, and those observables can later cause the binding // context to be updated. var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor, dataItem = ko.utils.unwrapObservable(dataItemOrObservable); if (parentContext) { // When a "parent" context is given, register a dependency on the parent context. Thus whenever the // parent context is updated, this context will also be updated. if (parentContext._subscribable) parentContext._subscribable(); // Copy $root and any custom properties from the parent context ko.utils.extend(self, parentContext); // Because the above copy overwrites our own properties, we need to reset them. // During the first execution, "subscribable" isn't set, so don't bother doing the update then. if (subscribable) { self._subscribable = subscribable; } } else { self['$parents'] = []; self['$root'] = dataItem; // Export 'ko' in the binding context so it will be available in bindings and templates // even if 'ko' isn't exported as a global, such as when using an AMD loader. // See https://github.com/SteveSanderson/knockout/issues/490 self['ko'] = ko; } self['$rawData'] = dataItemOrObservable; self['$data'] = dataItem; if (dataItemAlias) self[dataItemAlias] = dataItem; // The extendCallback function is provided when creating a child context or extending a context. // It handles the specific actions needed to finish setting up the binding context. Actions in this // function could also add dependencies to this binding context. if (extendCallback) extendCallback(self, parentContext, dataItem); return self['$data']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = unwrap(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self.$parents = [];\n self.$root = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self.ko = options.knockoutInstance;\n }\n self.$rawData = dataItemOrObservable;\n self.$data = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self.$data;\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any obsevables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any obsevables (or is\n // itself an observable), the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItem = isFunc ? dataItemOrAccessor() : dataItemOrAccessor;\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrAccessor;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any obsevables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n\t // Most of the time, the context will directly get a view model object, but if a function is given,\n\t // we call the function to retrieve the view model. If the function accesses any observables or returns\n\t // an observable, the dependency is tracked, and those observables can later cause the binding\n\t // context to be updated.\n\t var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n\t dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n\t if (parentContext) {\n\t // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n\t // parent context is updated, this context will also be updated.\n\t if (parentContext._subscribable)\n\t parentContext._subscribable();\n\n\t // Copy $root and any custom properties from the parent context\n\t ko.utils.extend(self, parentContext);\n\n\t // Because the above copy overwrites our own properties, we need to reset them.\n\t self._subscribable = subscribable;\n\t } else {\n\t self['$parents'] = [];\n\t self['$root'] = dataItem;\n\n\t // Export 'ko' in the binding context so it will be available in bindings and templates\n\t // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n\t // See https://github.com/SteveSanderson/knockout/issues/490\n\t self['ko'] = ko;\n\t }\n\t self['$rawData'] = dataItemOrObservable;\n\t self['$data'] = dataItem;\n\t if (dataItemAlias)\n\t self[dataItemAlias] = dataItem;\n\n\t // The extendCallback function is provided when creating a child context or extending a context.\n\t // It handles the specific actions needed to finish setting up the binding context. Actions in this\n\t // function could also add dependencies to this binding context.\n\t if (extendCallback)\n\t extendCallback(self, parentContext, dataItem);\n\n\t return self['$data'];\n\t }", "function updateContext () {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n const dataItemOrObservable = isFunc ? realDataItemOrAccessor() : realDataItemOrAccessor;\n let dataItem = unwrap(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext[contextSubscribeSymbol]) {\n parentContext[contextSubscribeSymbol]();\n }\n\n // Copy $root and any custom properties from the parent context\n extend(self, parentContext);\n\n // Copy Symbol properties\n if (contextAncestorBindingInfo in parentContext) {\n self[contextAncestorBindingInfo] = parentContext[contextAncestorBindingInfo];\n }\n } else {\n self.$parents = [];\n self.$root = dataItem;\n }\n\n self[contextSubscribeSymbol] = subscribable$$1;\n\n if (shouldInheritData) {\n dataItem = self.$data;\n } else {\n self.$rawData = dataItemOrObservable;\n self.$data = dataItem;\n }\n\n if (dataItemAlias) { self[dataItemAlias] = dataItem; }\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback) { extendCallback(self, parentContext, dataItem); }\n\n return self.$data\n }", "function bindingContext(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, settings) {\n\n var self = this,\n isFunc = typeof(dataItemOrAccessor) == \"function\" && !isObservable(dataItemOrAccessor),\n nodes,\n subscribable;\n\n // The binding context object includes static properties for the current, parent, and root view models.\n // If a view model is actually stored in an observable, the corresponding binding context object, and\n // any child contexts, must be updated when the view model is changed.\n function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = unwrap(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self.$parents = [];\n self.$root = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self.ko = options.knockoutInstance;\n }\n self.$rawData = dataItemOrObservable;\n self.$data = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self.$data;\n }\n\n function disposeWhen() {\n return nodes && !anyDomNodeIsAttachedToDocument(nodes);\n }\n\n if (settings && settings.exportDependencies) {\n // The \"exportDependencies\" option means that the calling code will track any dependencies and re-create\n // the binding context when they change.\n updateContext();\n return;\n }\n\n subscribable = computed(updateContext, null, { disposeWhen: disposeWhen, disposeWhenNodeIsRemoved: true });\n\n // At this point, the binding context has been initialized, and the \"subscribable\" computed observable is\n // subscribed to any observables that were accessed in the process. If there is nothing to track, the\n // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in\n // the context object.\n if (subscribable.isActive()) {\n self._subscribable = subscribable;\n\n // Always notify because even if the model ($data) hasn't changed, other context properties might have changed\n subscribable.equalityComparer = null;\n\n // We need to be able to dispose of this computed observable when it's no longer needed. This would be\n // easy if we had a single node to watch, but binding contexts can be used by many different nodes, and\n // we cannot assume that those nodes have any relation to each other. So instead we track any node that\n // the context is attached to, and dispose the computed when all of those nodes have been cleaned.\n\n // Add properties to *subscribable* instead of *self* because any properties added to *self* may be overwritten on updates\n nodes = [];\n subscribable._addNode = function(node) {\n nodes.push(node);\n addDisposeCallback(node, function(node) {\n arrayRemoveItem(nodes, node);\n if (!nodes.length) {\n subscribable.dispose();\n self._subscribable = subscribable = undefined;\n }\n });\n };\n }\n }", "function bindingContext (dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, settings) {\n const self = this;\n const shouldInheritData = dataItemOrAccessor === inheritParentIndicator;\n const realDataItemOrAccessor = shouldInheritData ? undefined : dataItemOrAccessor;\n const isFunc = typeof realDataItemOrAccessor === 'function' && !isObservable(realDataItemOrAccessor);\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self.ko = options.knockoutInstance;\n let subscribable$$1;\n\n // The binding context object includes static properties for the current, parent, and root view models.\n // If a view model is actually stored in an observable, the corresponding binding context object, and\n // any child contexts, must be updated when the view model is changed.\n function updateContext () {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n const dataItemOrObservable = isFunc ? realDataItemOrAccessor() : realDataItemOrAccessor;\n let dataItem = unwrap(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext[contextSubscribeSymbol]) {\n parentContext[contextSubscribeSymbol]();\n }\n\n // Copy $root and any custom properties from the parent context\n extend(self, parentContext);\n\n // Copy Symbol properties\n if (contextAncestorBindingInfo in parentContext) {\n self[contextAncestorBindingInfo] = parentContext[contextAncestorBindingInfo];\n }\n } else {\n self.$parents = [];\n self.$root = dataItem;\n }\n\n self[contextSubscribeSymbol] = subscribable$$1;\n\n if (shouldInheritData) {\n dataItem = self.$data;\n } else {\n self.$rawData = dataItemOrObservable;\n self.$data = dataItem;\n }\n\n if (dataItemAlias) { self[dataItemAlias] = dataItem; }\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback) { extendCallback(self, parentContext, dataItem); }\n\n return self.$data\n }\n\n if (settings && settings.exportDependencies) {\n // The \"exportDependencies\" option means that the calling code will track any dependencies and re-create\n // the binding context when they change.\n updateContext();\n } else {\n subscribable$$1 = pureComputed(updateContext);\n subscribable$$1.peek();\n\n // At this point, the binding context has been initialized, and the \"subscribable\" computed observable is\n // subscribed to any observables that were accessed in the process. If there is nothing to track, the\n // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in\n // the context object.\n if (subscribable$$1.isActive()) {\n self[contextSubscribeSymbol] = subscribable$$1;\n\n // Always notify because even if the model ($data) hasn't changed, other context properties might have changed\n subscribable$$1['equalityComparer'] = null;\n } else {\n self[contextSubscribeSymbol] = undefined;\n }\n }\n }", "bind(source, context) {\n this.source = source;\n this.originalContext = context;\n this.childContext = Object.create(context);\n this.childContext.parent = source;\n this.childContext.parentContext = this.originalContext;\n this.items = this.itemsBindingObserver.observe(source, this.originalContext);\n this.template = this.templateBindingObserver.observe(source, this.originalContext);\n this.observeItems(true);\n this.refreshAllViews();\n }", "contextDidChange() {\n this.currentModel = this.context;\n }", "bind(bindingContext, overrideContext) {\n this.bindingContext = bindingContext;\n this.overrideContext = overrideContext;\n this.changes.view = this.view;\n this.changes.viewModel = this.viewModel;\n this.changes.model = this.model;\n processChanges(this);\n }", "extend (properties) {\n // If the parent context references an observable view model, \"_subscribable\" will always be the\n // latest view model object. If not, \"_subscribable\" isn't set, and we can use the static \"$data\" value.\n return new bindingContext(inheritParentIndicator, this, null, function (self, parentContext) {\n extend(self, typeof properties === 'function' ? properties.call(self) : properties);\n })\n }", "function BindContext () {\n if (!(this instanceof BindContext)) {\n return new BindContext();\n }\n\n this._modules = [];\n this._entrance = {};\n this._parent = module.parent;\n}", "function updateBindingContext() {\n\n\t\t\t\tvar oBindingContext = oComponent.getBindingContext();\n\t\t\t\tvar oTemplatePrivateModel = oComponentUtils.getTemplatePrivateModel();\n\t\t\t\tvar oContextInfo = oComponentUtils.registerContext(oBindingContext);\n\t\t\t\t// set draft status to blank according to UI decision\n\t\t\t\toTemplatePrivateModel.setProperty(\"/generic/draftIndicatorState\", DraftIndicatorState.Clear);\n\n\t\t\t\t//call the rebindTable explicitly since the smart table enableAutoBinding=true \n\t\t\t\t//didn't trigger GET of 1:n all cases\n\t\t\t\t(oViewProxy.refreshFacets || jQuery.noop)(null, true);\n\t\t\t\t\n\t\t\t\t(oViewProxy.getHeaderInfoTitleForNavigationMenue || jQuery.noop)();\n\t\t\t\t\n\t\t\t\tvar oActiveEntity = oBindingContext.getObject();\n\t\t\t\tvar oUIModel = oComponent.getModel(\"ui\");\n\t\t\t\tvar bIsEditable;\n\t\t\t\tif (oContextInfo.bIsDraft) {\n\t\t\t\t\tbIsEditable = true;\n\t\t\t\t\toUIModel.setProperty(\"/enabled\", true);\n\t\t\t\t\toTemplatePrivateModel.setProperty(\"/objectPage/displayMode\", oContextInfo.bIsCreate ? 4 : 2);\n\t\t\t\t} else {\n\t\t\t\t\tbIsEditable = oComponentUtils.getEditableNDC();\n\t\t\t\t\toTemplatePrivateModel.setProperty(\"/objectPage/displayMode\", bIsEditable ? 2 : 1);\n\t\t\t\t\tif (oActiveEntity.hasOwnProperty(\"HasDraftEntity\") && oActiveEntity.HasDraftEntity) {\n\t\t\t\t\t\toUIModel.setProperty(\"/enabled\", false);\n\t\t\t\t\t\tvar oModel = oComponent.getModel();\n\t\t\t\t\t\tvar oReadDraftInfoPromise = new Promise(function(fnResolve, fnReject) {\n\t\t\t\t\t\t\toModel.read(\n\t\t\t\t\t\t\t\toBindingContext.getPath(), {\n\t\t\t\t\t\t\t\t\turlParameters: {\n\t\t\t\t\t\t\t\t\t\t\"$expand\": \"SiblingEntity,DraftAdministrativeData\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tsuccess: fnResolve,\n\t\t\t\t\t\t\t\t\terror: fnReject\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvar oBusyHelper = oComponentUtils.getBusyHelper();\n\t\t\t\t\t\toBusyHelper.setBusy(oReadDraftInfoPromise);\n\t\t\t\t\t\toReadDraftInfoPromise.then(\n\t\t\t\t\t\t\tfunction(oResponseData) {\n\t\t\t\t\t\t\t\tvar oSiblingContext = oModel.getContext(\n\t\t\t\t\t\t\t\t\t\"/\" + oModel.getKey(oResponseData.SiblingEntity));\n\t\t\t\t\t\t\t\tif (oSiblingContext) {\n\t\t\t\t\t\t\t\t\t(oViewProxy.draftResume || jQuery.noop)(oSiblingContext, oActiveEntity,\n\t\t\t\t\t\t\t\t\t\toResponseData.DraftAdministrativeData);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// enable the buttons\n\t\t\t\t\t\t\t\toUIModel.setProperty(\"/enabled\", true);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(oError) {\n\t\t\t\t\t\t\t\t// open: error handling\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\t// enable the buttons\n\t\t\t\t\t\toUIModel.setProperty(\"/enabled\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toUIModel.setProperty(\"/createMode\", oContextInfo.bIsCreate);\n\t\t\t\toUIModel.setProperty(\"/editable\", bIsEditable);\n\t\t\t}", "function mainContentViewModel(context) {\n var self = this;\n var element = context.element;\n self.name = ko.observable('web');\n\n context.props.then(function(properties) {\n if (properties.name) {\n self.name(properties.name);\n }\n\n });\n\n self.changeColor = function(colour) {\n document.getElementById(\"message\").style[\"background-color\"] = colour ? colour : '#' + Math.floor(Math.random() * 16777215).toString(16);\n }\n self.sendMessage = function() {\n var params = {\n 'bubbles': true,\n 'detail': {\n 'value': new Date()\n }\n };\n element.dispatchEvent(new CustomEvent('messageClicked', params));\n }\n\n /**\n * This optional method may be implemented on the ViewModel to perform initialization tasks.\n * This method will be invoked only if the ViewModel specified during registration is\n * an object instance as opposed to a constructor function. If the registered ViewModel is\n * a constructor function, the same context object will be passed to the constructor function\n * instead. If this method returns a Promise, activation will be delayed until the Promise is resolved.\n **/\n self.initialize = function(context) {\n\n }\n\n /**\n * This optional method may be implemented on the ViewModel and will be invoked after the ViewModel is initialized.\n **/\n self.activated = function(context) {\n\n }\n\n /**\n * This optional method may be implemented on the ViewModel and will be invoked after the\n * View is inserted into the document DOM.\n **/\n self.attached = function(context) {\n\n }\n\n /**\n * This optional method may be implemented on the ViewModel and will be invoked after the\n * bindings are applied on this View.\n **/\n self.bindingsApplied = function(context) {\n\n }\n\n /**\n * This optional method may be implemented on the ViewModel and will be invoked when this\n * composite component is being disposed.\n **/\n self.dispose = function(element) {\n\n }\n\n\n\n }", "bind(context) {\n this.$parent = context;\n }", "get context() {\n return this.object\n }", "static get() { return currentContext; }", "function inferBindContext(bind, scope) {\n\t var staticContext = getStaticContext(bind, scope);\n\t if (staticContext) return staticContext;\n\n\t var tempId = getTempId(scope);\n\t if (bind.object) {\n\t bind.callee = t.sequenceExpression([t.assignmentExpression(\"=\", tempId, bind.object), bind.callee]);\n\t } else {\n\t bind.callee.object = t.assignmentExpression(\"=\", tempId, bind.callee.object);\n\t }\n\t return tempId;\n\t}", "function inferBindContext(bind, scope) {\n\t var staticContext = getStaticContext(bind, scope);\n\t if (staticContext) return staticContext;\n\n\t var tempId = getTempId(scope);\n\t if (bind.object) {\n\t bind.callee = t.sequenceExpression([t.assignmentExpression(\"=\", tempId, bind.object), bind.callee]);\n\t } else {\n\t bind.callee.object = t.assignmentExpression(\"=\", tempId, bind.callee.object);\n\t }\n\t return tempId;\n\t}", "constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) {\n this.location = location;\n this.itemsBinding = itemsBinding;\n this.templateBinding = templateBinding;\n this.options = options;\n this.source = null;\n this.views = [];\n this.items = null;\n this.itemsObserver = null;\n this.originalContext = void 0;\n this.childContext = void 0;\n this.bindView = bindWithoutPositioning;\n this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile);\n this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile);\n\n if (options.positioning) {\n this.bindView = bindWithPositioning;\n }\n }", "function Context(view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function getStaticContext(bind, scope) {\n\t var object = bind.object || bind.callee.object;\n\t return scope.isStatic(object) && object;\n\t}", "function getStaticContext(bind, scope) {\n\t var object = bind.object || bind.callee.object;\n\t return scope.isStatic(object) && object;\n\t}", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\r\n this.view = view;\r\n this.cache = { '.': this.view };\r\n this.parent = parentContext;\r\n }", "get context () {\n\t\treturn this._context;\n\t}", "get context () {\n\t\treturn this._context;\n\t}", "get context () {\n\t\treturn this._context;\n\t}", "function Context(view, parentContext) {\r\n this.view = view == null ? {} : view;\r\n this.cache = { '.': this.view };\r\n this.parent = parentContext;\r\n }", "function Context(view, parentContext) {\n this.view = view == null ? {} : view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view == null ? {} : view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view == null ? {} : view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view == null ? {} : view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view == null ? {} : view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view == null ? {} : view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }", "function Context(view, parentContext) {\n this.view = view;\n this.cache = {\n '.': this.view,\n '@each': function each() {\n var returns = [];\n for (var k in this) {\n returns.push({ '@key': k, '@value': this[k] });\n }\n return returns;\n }\n };\n this.parent = parentContext;\n }", "function Context (view, parentContext) {\n\t this.view = view;\n\t this.cache = { '.': this.view };\n\t this.parent = parentContext;\n\t }", "function Context (view, parentContext) {\n\t this.view = view;\n\t this.cache = { '.': this.view };\n\t this.parent = parentContext;\n\t }", "get Context(){\n return this.context;\n }", "function inferBindContext(bind, scope) {\n var staticContext = getStaticContext(bind, scope);\n if (staticContext) return staticContext;\n\n var tempId = getTempId(scope);\n if (bind.object) {\n bind.callee = t.sequenceExpression([t.assignmentExpression(\"=\", tempId, bind.object), bind.callee]);\n } else {\n bind.callee.object = t.assignmentExpression(\"=\", tempId, bind.callee.object);\n }\n return tempId;\n}", "bindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDockingEnabledChanged = this.onDockingEnabledChanged.bind(this);\n\t\tthis.onAlwaysOnTopChanged = this.onAlwaysOnTopChanged.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t\tthis.isTopRight = this.isTopRight.bind(this);\n\t\tthis.allowDragOnCenterRegion = this.allowDragOnCenterRegion.bind(this);\n\t\tthis.disallowDragOnCenterRegion = this.disallowDragOnCenterRegion.bind(this);\n\n\t\tthis.onShareEmitterChanged = this.onShareEmitterChanged.bind(this);\n\t\tthis.onTabsChanged = this.onTabsChanged.bind(this);\n\t\tthis.onShowTabsChanged = this.onShowTabsChanged.bind(this);\n\t\tthis.onHackScrollbarChanged = this.onHackScrollbarChanged.bind(this);\n\t\tthis.onTilingStop = this.onTilingStop.bind(this);\n\t\tthis.onTilingStart = this.onTilingStart.bind(this);\n\t\tthis.resizeDragHandle = this.resizeDragHandle.bind(this);\n\t\tthis.onDoubleClick = this.onDoubleClick.bind(this);\n\n\t}", "getChildContext() {\n\t\treturn {\n\t\t\troute: this.state.route,\n\t\t\tlinkHandler: this.handleLinkClick\n\t\t}\n\t}", "bindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDocking = this.onDocking.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t}", "get context() {\n\t\treturn this.__context;\n\t}", "get context() {\n\t\treturn this.__context;\n\t}", "get context() {\n\t\treturn this.__context;\n\t}", "function pageLoaded(args) {\n // Get the event sender\n var page = args.object;\n page.bindingContext = appViewModel;\n}", "function getStaticContext(bind, scope) {\n var object = bind.object || bind.callee.object;\n return scope.isStatic(object) && object;\n}", "function bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n currentContext = this,\n normalized, observer, i;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer ? valueNormalizer(result) : result;\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(Ember._HandlebarsBoundView, {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data\n });\n\n if (options.hash.controller) {\n bindView.set('_contextController', this.container.lookupFactory('controller:'+options.hash.controller).create({\n container: currentContext.container,\n parentController: currentContext,\n target: currentContext\n }));\n }\n\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGetEscaped(currentContext, property, options));\n }\n}", "function getContextualPath() {\n var currentObj = $scope.domainObject,\n currentParent,\n parents = [];\n\n currentParent = currentObj &&\n currentObj.hasCapability('context') &&\n currentObj.getCapability('context').getParent();\n\n while (currentParent && currentParent.getModel().type !== 'root' &&\n currentParent.hasCapability('context')) {\n // Record this object\n parents.unshift(currentParent);\n\n // Get the next one up the tree\n currentObj = currentParent;\n currentParent = currentObj.getCapability('context').getParent();\n }\n\n $scope.contextutalParents = parents;\n }", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var rawValue = valueAccessor(),\n dataValue = ko.utils.unwrapObservable(rawValue),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var rawValue = valueAccessor(),\n dataValue = ko.utils.unwrapObservable(rawValue),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "get context() {\n return getComponent$1(this.nativeNode) || getContext(this.nativeNode);\n }", "createChildContext (dataItemOrAccessor, dataItemAlias, extendCallback, settings) {\n return new bindingContext(dataItemOrAccessor, this, dataItemAlias, function (self, parentContext) {\n // Extend the context hierarchy by setting the appropriate pointers\n self.$parentContext = parentContext;\n self.$parent = parentContext.$data;\n self.$parents = (parentContext.$parents || []).slice(0);\n self.$parents.unshift(self.$parent);\n if (extendCallback) { extendCallback(self); }\n }, settings)\n }", "notifyImplicitReceiverUse() {\n if (this.bindingLevel !== 0) {\n // Since the implicit receiver is accessed in an embedded view, we need to\n // ensure that we declare a shared context variable for the current template\n // in the update variables.\n this.map.get(SHARED_CONTEXT_KEY + 0).declare = true;\n }\n }", "notifyImplicitReceiverUse() {\n if (this.bindingLevel !== 0) {\n // Since the implicit receiver is accessed in an embedded view, we need to\n // ensure that we declare a shared context variable for the current template\n // in the update variables.\n this.map.get(SHARED_CONTEXT_KEY + 0).declare = true;\n }\n }", "notifyImplicitReceiverUse() {\n if (this.bindingLevel !== 0) {\n // Since the implicit receiver is accessed in an embedded view, we need to\n // ensure that we declare a shared context variable for the current template\n // in the update variables.\n this.map.get(SHARED_CONTEXT_KEY + 0).declare = true;\n }\n }", "notifyImplicitReceiverUse() {\n if (this.bindingLevel !== 0) {\n // Since the implicit receiver is accessed in an embedded view, we need to\n // ensure that we declare a shared context variable for the current template\n // in the update variables.\n this.map.get(SHARED_CONTEXT_KEY + 0).declare = true;\n }\n }", "function initApp(){\n ko.applyBindings(new ViewModel());\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "get contextInvariant () {\n\t\treturn this._contextInvariant;\n\t}", "viewModelChanged(newValue, oldValue) {\n this.changes.viewModel = newValue;\n requestUpdate(this);\n }", "function ItemViewModel() {\n var self = this;\n self.OriginId = ko.observable(null);\n self.ItemTypeOriginId = ko.observable(null);\n self.CreationDate = ko.observable(null);\n self.LastEditDate = ko.observable(null);\n self.Properties = ko.observableArray([]);\n self.IsSelected = ko.observable(false);\n self.IsSelectedCssClass = ko.pureComputed(function () {\n return self.IsSelected() ? \"ion-ios-checkmark-outline\" : \"ion-ios-circle-outline\" ;\n }, self);\n\n self.setProperties = function (itemData, localizations) {\n self.OriginId(itemData.OriginId);\n self.ItemTypeOriginId(itemData.ItemTypeOriginId);\n self.CreationDate(itemData.CreationDate);\n self.LastEditDate(itemData.LastEditDate);\n\n var properties = new Array();\n ko.utils.arrayForEach(itemData.Properties, function (property) {\n var propertyToAdd = new PropertyViewModel();\n propertyToAdd.setProperties(property);\n propertyToAdd.setLocalization(localizations);\n properties.push(propertyToAdd);\n });\n self.Properties(properties);\n };\n}", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function () {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n }", "function bind(property, hash, options, env, preserveContext, shouldDisplay, valueNormalizer, childProperties, _viewClass) {\n var valueStream = property.isStream ? property : this.getStream(property);\n var lazyValue;\n\n if (childProperties) {\n lazyValue = new SimpleStream(valueStream);\n\n var subscriber = function(childStream) {\n childStream.value();\n lazyValue.notify();\n };\n\n for (var i = 0; i < childProperties.length; i++) {\n var childStream = valueStream.get(childProperties[i]);\n childStream.value();\n childStream.subscribe(subscriber);\n }\n } else {\n lazyValue = valueStream;\n }\n\n // Set up observers for observable objects\n var viewClass = _viewClass || BoundView;\n var viewOptions = {\n _morph: options.morph,\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: options.template,\n inverseTemplate: options.inverse,\n lazyValue: lazyValue,\n previousContext: get(this, 'context'),\n isEscaped: !hash.unescaped,\n templateHash: hash,\n helperName: options.helperName\n };\n\n if (options.keywords) {\n viewOptions._keywords = options.keywords;\n }\n\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._BoundView for more.\n var bindView = this.createChildView(viewClass, viewOptions);\n\n this.appendChild(bindView);\n\n lazyValue.subscribe(this._wrapAsScheduled(function() {\n run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n }));\n}", "getContext() {\n return this._context;\n }", "function applyKoBindings(page) {\n ko.applyBindings(appViewModel, page.container);\n}", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }" ]
[ "0.7729418", "0.7680203", "0.7680203", "0.7640491", "0.76353496", "0.76353496", "0.76353496", "0.76353496", "0.76145273", "0.75955725", "0.7506894", "0.7365157", "0.66395456", "0.642034", "0.6334558", "0.61824316", "0.6145124", "0.60111", "0.5719577", "0.5696956", "0.55442894", "0.55181044", "0.54516923", "0.5407382", "0.5284806", "0.5284806", "0.52795297", "0.5258583", "0.5258583", "0.5257605", "0.5257605", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5249", "0.5245697", "0.5212841", "0.5212841", "0.5212841", "0.5212721", "0.5191179", "0.5191179", "0.5191179", "0.5191179", "0.5191179", "0.5191179", "0.5181799", "0.5181134", "0.5181134", "0.5172092", "0.5133893", "0.51303434", "0.5123157", "0.510938", "0.5081671", "0.5081671", "0.5081671", "0.5080624", "0.5075716", "0.5009249", "0.49783212", "0.4922857", "0.4922857", "0.49219245", "0.4915708", "0.49142313", "0.49142313", "0.49142313", "0.49142313", "0.4914191", "0.49140617", "0.49140617", "0.49140617", "0.49140617", "0.49140617", "0.49067125", "0.49009073", "0.4882304", "0.4849009", "0.4830729", "0.48255137", "0.48086357", "0.47928783", "0.47928083", "0.47928083", "0.47928083" ]
0.74857
12
Returns the valueAccesor function for a binding value
function makeValueAccessor(value) { return function() { return value; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeValueAccessor(value) {\n return function () {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function FixedValueGetter(value){\n return function(){return value};\n}", "makeValueAccessor (value) {\n return () => value\n }", "function createAccessor(value) {\n return function () { return value; };\n }", "function bind(value) {\n return bindingUpdated(viewData[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "setOnValueChangeEvent(func){\r\n this._onValueChange = func;\r\n }", "function WjValueAccessorFactory(e){return new WjValueAccessor(e)}", "function functionValue(value) {\n if (_.isFunction(value)) {\n var args = Array.prototype.slice.call(arguments, 1);\n return value.apply(this, args);\n }\n return value;\n }", "function fnDirect(value) { return value; }", "function getBinding(binding) {\n if (!data.bindings[binding]) return undefined;\n return data.bindings[binding].value;\n }", "function value() { }", "function getBinding(binding) {\n if (!data.bindings[binding]) return undefined;\n return data.bindings[binding].value;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function makeAccessor2(valueOrAccessor) {\n if (_lodash2.default.isFunction(valueOrAccessor)) return valueOrAccessor;\n return function () {\n return valueOrAccessor;\n };\n}", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n\t return valueAccessor();\n\t }", "function evaluateValueAccessor(valueAccessor) {\n\t return valueAccessor();\n\t }", "function evaluateValueAccessor(valueAccessor) {\n\t return valueAccessor();\n\t }", "getBindingHandler (/* key */) {}", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function toValueIn(obj) {\n return function (name) {\n return obj[name];\n };\n }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function evaluateValueAccessor (valueAccessor) {\n return valueAccessor()\n }", "function editable(value) {\n return function (target, propName, descriptor) {\n descriptor.writable = value;\n };\n}", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function editable(value) {\n return function (target, // constructorFN in static class or prototype in instantiated one\n propName, descriptor) {\n descriptor.writable = value;\n };\n}", "function bind(value){var lView=getLView();return bindingUpdated(lView,lView[BINDING_INDEX]++,value)?value:NO_CHANGE;}", "function Component_BindingHandler() {}", "value(el, value) {\n return setGet(el, this.facade(el).valueAttribute(), value);\n }", "registerOnChange(fn) {\n this.controlValueAccessorChangeFn = fn;\n }", "function editable(value) {\n return function (target, propName, descriptor) {\n //targert:any = static or private... Method\n descriptor.writable = value; //make writable or not\n };\n}", "function valMethod( a ){\n\t\t\treturn a.hasClass(Classes[0]) ? value : $val;\n\t\t}", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function bindings() {\n var model = $parse(attr.clickAnywhereButHere);\n var value = model(scope);\n\n //The value can be a function to afford the user more control over \n //visibility.\n if (isWatchingFunction)\n value = value();\n\n if (!angular.isUndefined(value) && lastActiveValue !== value) {\n if (value)\n $document.bind('mousedown', handler);\n else\n $document.unbind('mousedown', handler);\n\n lastActiveValue = value;\n }\n }", "function selectValueAccessor(dir, valueAccessors) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"b\" /* isBlank */])(valueAccessors))\n return null;\n var defaultAccessor;\n var builtinAccessor;\n var customAccessor;\n valueAccessors.forEach(function (v) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"j\" /* hasConstructor */])(v, __WEBPACK_IMPORTED_MODULE_4__default_value_accessor__[\"a\" /* DefaultValueAccessor */])) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(builtinAccessor))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(customAccessor))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(customAccessor))\n return customAccessor;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(builtinAccessor))\n return builtinAccessor;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(defaultAccessor))\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}", "registerOnChange(fn) {\n this._controlValueAccessorChangeFn = fn;\n }", "registerOnChange(fn) {\n this._controlValueAccessorChangeFn = fn;\n }", "function bindingValue() {\n return '{{ ' + pathString + ' }}';\n }", "makeBindingAccessors (bindings, context, node) {\n if (typeof bindings === 'function') {\n return this.makeAccessorsFromFunction(bindings.bind(null, context, node))\n } else {\n return objectMap(bindings, this.makeValueAccessor)\n }\n }", "function editable(value) {\n return function (target, propName, descriptor) {\n // see Object.defineProperty\n descriptor.writable = value;\n };\n}", "get valueInput() {\n return this._value;\n }", "function valueGet ( ) {\r\n\r\n\t\tvar i, retour = [];\r\n\r\n\t\t// Get the value from all handles.\r\n\t\tfor ( i = 0; i < options.handles; i += 1 ){\r\n\t\t\tretour[i] = options.format.to( scope_Values[i] );\r\n\t\t}\r\n\r\n\t\treturn inSliderOrder( retour );\r\n\t}", "function valueGet ( ) {\r\n\r\n\t\t\tvar i, retour = [];\r\n\r\n\t\t\t// Get the value from all handles.\r\n\t\t\tfor ( i = 0; i < options.handles; i += 1 ){\r\n\t\t\t\tretour[i] = options.format.to( scope_Values[i] );\r\n\t\t\t}\r\n\r\n\t\t\treturn inSliderOrder( retour );\r\n\t\t}", "function getVal(val) {\n if (typeof val === 'function') {\n return val.apply(undefined, slice.call(arguments, 1));\n } else {\n return val;\n }\n }", "triggerOnValue() {\n\t\tif (this.hasValue()) {\n\t\t\tthis.onValueFunctions_.forEach(each => each(this.value_, this));\n\t\t}\n\t\treturn this;\n\t}", "get value() { return this._inputValueAccessor.value; }", "function valueGet ( ) {\n\n\t\tvar i, retour = [];\n\n\t\t// Get the value from all handles.\n\t\tfor ( i = 0; i < options.handles; i += 1 ){\n\t\t\tretour[i] = options.format.to( scope_Values[i] );\n\t\t}\n\n\t\treturn inSliderOrder( retour );\n\t}", "function valueGet ( ) {\n\n\t\tvar i, retour = [];\n\n\t\t// Get the value from all handles.\n\t\tfor ( i = 0; i < options.handles; i += 1 ){\n\t\t\tretour[i] = options.format.to( scope_Values[i] );\n\t\t}\n\n\t\treturn inSliderOrder( retour );\n\t}", "function functor (val) {\n return function () {\n return val\n }\n}", "applyBindingSet() {\n // set the attribute mappings\n this.binder.attributeMappings = {\n placeholder: 'placeholder', // map placeholder to placeholder\n 'value-state': '_valueState',\n name: 'name',\n maxlength: 'maxlength', // for the input element itself\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n 'show-value-help-icon': 'showValueHelpIcon',\n 'show-suggestions': 'showSuggestions',\n readonly: '__readonly',\n required: 'required',\n disabled: 'disabled',\n modified: 'modified',\n highlight: 'highlight',\n };\n\n // set attributes to constrains mapping for furo.fat types\n this.binder.fatAttributesToConstraintsMappings = {\n maxlength: 'value._constraints.max.is', // for the fieldnode constraint\n required: 'value._constraints.required.is', // for the fieldnode constraint\n };\n\n // set constrains to attributes mapping for furo.fat types\n this.binder.constraintsTofatAttributesMappings = {\n max: 'maxlength',\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // update the value on input changes\n this.addEventListener('input', val => {\n // update the value\n this.binder.fieldValue = val.target.value;\n\n /**\n * Fired when value changed\n * @type {Event}\n */\n const customEvent = new Event('value-changed', { composed: true, bubbles: true });\n customEvent.detail = val.target.value;\n this.dispatchEvent(customEvent);\n\n // set flag empty on empty strings (for fat types)\n if (val.target.value) {\n this.binder.deleteLabel('empty');\n } else {\n this.binder.addLabel('empty');\n }\n // if something was entered the field is not empty\n this.binder.addLabel('modified');\n });\n }", "function valueGet ( ) {\n\t\n\t\t\tvar i, retour = [];\n\t\n\t\t\t// Get the value from all handles.\n\t\t\tfor ( i = 0; i < options.handles; i += 1 ){\n\t\t\t\tretour[i] = options.format.to( scope_Values[i] );\n\t\t\t}\n\t\n\t\t\treturn inSliderOrder( retour );\n\t\t}", "resolve(binding) {\n const bindingNode = this.list.get(binding);\n if (!bindingNode) {\n throw IocLookupException_1.IocLookupException.lookupFailed(binding);\n }\n let resolvedValue;\n if (bindingNode.singleton) {\n bindingNode.cachedValue = bindingNode.cachedValue ?? bindingNode.callback(this.container);\n resolvedValue = bindingNode.cachedValue;\n }\n else {\n resolvedValue = bindingNode.callback(this.container);\n }\n return resolvedValue;\n }", "function valueDistortion(value) {\n return value;\n }", "function getValue(accessor) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return _lodash2.default.isFunction(accessor) ? accessor.apply(undefined, args) : accessor;\n}", "static _propertyValueFromAttribute(value,options){const type=options.type,converter=options.converter||defaultConverter,fromAttribute=\"function\"===typeof converter?converter:converter.fromAttribute;return fromAttribute?fromAttribute(value,type):value}", "get value() { return this.#val; }", "value() {\n return this.#value;\n }", "function editable(value) {\n //this is the actual constrcutor\n return function (target, propName, descriptor) {\n descriptor.writable = value;\n // to prevent TS on error, set the tsc to noUnusedParameters: false\n };\n}", "_onChange() {\n let value = this.get('value');\n return this.attrs.onChange(value, this);\n }", "getValue() { return this.input.value; }", "function value ( ) {\n\t\treturn this[0][ !arguments.length ? 'vGet' : 'vSet' ].apply(this[0], arguments);\n\t}", "get valueField() {\n return this.i.jo;\n }", "function valueGet() {\n var i, retour = [];\n // Get the value from all handles.\n for (i = 0; i < options.handles; i += 1) {\n retour[i] = options.format.to(scope_Values[i]);\n }\n return inSliderOrder(retour);\n }", "function caloryValue(event){\n calory = event.target.value;\n }", "getValue() {\n return this.value;\n }", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}" ]
[ "0.644786", "0.6169277", "0.6169277", "0.6169277", "0.6169277", "0.6169277", "0.6169277", "0.6169277", "0.6169277", "0.5979802", "0.59227747", "0.59073776", "0.58821946", "0.57806706", "0.5733423", "0.56551385", "0.5635954", "0.56089807", "0.56039524", "0.5599379", "0.54747087", "0.54747087", "0.54658157", "0.5451988", "0.54353577", "0.54353577", "0.54353577", "0.542597", "0.5374691", "0.53415984", "0.5338966", "0.5338966", "0.5338966", "0.5320438", "0.53143245", "0.5307954", "0.52837634", "0.52837634", "0.52837634", "0.52837634", "0.52837634", "0.52837634", "0.52837634", "0.52837634", "0.52657133", "0.5265062", "0.52604747", "0.52584046", "0.5253479", "0.5245984", "0.52452666", "0.5238595", "0.5238595", "0.5238595", "0.5238595", "0.5238595", "0.5238595", "0.5238595", "0.5238595", "0.52296937", "0.5208079", "0.5198905", "0.5198905", "0.5196123", "0.5189599", "0.51785284", "0.5162879", "0.51532036", "0.51268744", "0.5125256", "0.5125", "0.5105652", "0.51045275", "0.51045275", "0.51003623", "0.5080755", "0.50779605", "0.506797", "0.5067328", "0.50649816", "0.505608", "0.50190836", "0.5012954", "0.50097346", "0.5009699", "0.50040656", "0.49985304", "0.49859893", "0.49847013", "0.4983847", "0.49751183", "0.49601814", "0.49601814", "0.49601814", "0.49601814", "0.49601814", "0.49601814", "0.49601814" ]
0.6320255
3
Returns the value of a valueAccessor function
function evaluateValueAccessor(valueAccessor) { return valueAccessor(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluateValueAccessor (valueAccessor) {\n return valueAccessor()\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }", "makeValueAccessor (value) {\n return () => value\n }", "function makeValueAccessor(value) {\n return function () {\n return value;\n };\n }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function getValue(accessor) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return _lodash2.default.isFunction(accessor) ? accessor.apply(undefined, args) : accessor;\n}", "function createAccessor(value) {\n return function () { return value; };\n }", "get value() {}", "get value() {}", "function __getter(value) {\n // console.log('GET', arguments)\n\n return value;\n }", "function FixedValueGetter(value){\n return function(){return value};\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"b\" /* isBlank */])(valueAccessors))\n return null;\n var defaultAccessor;\n var builtinAccessor;\n var customAccessor;\n valueAccessors.forEach(function (v) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"j\" /* hasConstructor */])(v, __WEBPACK_IMPORTED_MODULE_4__default_value_accessor__[\"a\" /* DefaultValueAccessor */])) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(builtinAccessor))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(customAccessor))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(customAccessor))\n return customAccessor;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(builtinAccessor))\n return builtinAccessor;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"a\" /* isPresent */])(defaultAccessor))\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (lang_1.isBlank(valueAccessors)) return null;\n var defaultAccessor;\n var builtinAccessor;\n var customAccessor;\n valueAccessors.forEach(function (v) {\n if (lang_1.hasConstructor(v, default_value_accessor_1.DefaultValueAccessor)) {\n defaultAccessor = v;\n } else if (lang_1.hasConstructor(v, checkbox_value_accessor_1.CheckboxControlValueAccessor) || lang_1.hasConstructor(v, number_value_accessor_1.NumberValueAccessor) || lang_1.hasConstructor(v, select_control_value_accessor_1.SelectControlValueAccessor) || lang_1.hasConstructor(v, radio_control_value_accessor_1.RadioControlValueAccessor)) {\n if (lang_1.isPresent(builtinAccessor)) _throwError(dir, \"More than one built-in value accessor matches\");\n builtinAccessor = v;\n } else {\n if (lang_1.isPresent(customAccessor)) _throwError(dir, \"More than one custom value accessor matches\");\n customAccessor = v;\n }\n });\n if (lang_1.isPresent(customAccessor)) return customAccessor;\n if (lang_1.isPresent(builtinAccessor)) return builtinAccessor;\n if (lang_1.isPresent(defaultAccessor)) return defaultAccessor;\n _throwError(dir, \"No valid value accessor for\");\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n var defaultAccessor = undefined;\n var builtinAccessor = undefined;\n var customAccessor = undefined;\n valueAccessors.forEach(function (v) {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor)\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor)\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n var defaultAccessor = undefined;\n var builtinAccessor = undefined;\n var customAccessor = undefined;\n valueAccessors.forEach(function (v) {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor)\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor)\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n var defaultAccessor = undefined;\n var builtinAccessor = undefined;\n var customAccessor = undefined;\n valueAccessors.forEach(function (v) {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor)\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor)\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n var defaultAccessor = undefined;\n var builtinAccessor = undefined;\n var customAccessor = undefined;\n valueAccessors.forEach(function (v) {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor)\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor)\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n _throwError(dir, 'No valid value accessor for form control with');\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n\t if (lang_1.isBlank(valueAccessors))\n\t return null;\n\t var defaultAccessor;\n\t var builtinAccessor;\n\t var customAccessor;\n\t valueAccessors.forEach(function (v) {\n\t if (lang_1.hasConstructor(v, default_value_accessor_1.DefaultValueAccessor)) {\n\t defaultAccessor = v;\n\t }\n\t else if (lang_1.hasConstructor(v, checkbox_value_accessor_1.CheckboxControlValueAccessor) || lang_1.hasConstructor(v, number_value_accessor_1.NumberValueAccessor) ||\n\t lang_1.hasConstructor(v, select_control_value_accessor_1.SelectControlValueAccessor) ||\n\t lang_1.hasConstructor(v, select_multiple_control_value_accessor_1.SelectMultipleControlValueAccessor) ||\n\t lang_1.hasConstructor(v, radio_control_value_accessor_1.RadioControlValueAccessor)) {\n\t if (lang_1.isPresent(builtinAccessor))\n\t _throwError(dir, 'More than one built-in value accessor matches form control with');\n\t builtinAccessor = v;\n\t }\n\t else {\n\t if (lang_1.isPresent(customAccessor))\n\t _throwError(dir, 'More than one custom value accessor matches form control with');\n\t customAccessor = v;\n\t }\n\t });\n\t if (lang_1.isPresent(customAccessor))\n\t return customAccessor;\n\t if (lang_1.isPresent(builtinAccessor))\n\t return builtinAccessor;\n\t if (lang_1.isPresent(defaultAccessor))\n\t return defaultAccessor;\n\t _throwError(dir, 'No valid value accessor for form control with');\n\t return null;\n\t}", "function WjValueAccessorFactory(e){return new WjValueAccessor(e)}", "function makeAccessor2(valueOrAccessor) {\n if (_lodash2.default.isFunction(valueOrAccessor)) return valueOrAccessor;\n return function () {\n return valueOrAccessor;\n };\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n if (!valueAccessors)\n return null;\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Value accessor was not provided as an array for form control with');\n let defaultAccessor = undefined;\n let builtinAccessor = undefined;\n let customAccessor = undefined;\n valueAccessors.forEach((v) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n }\n else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n }\n else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n if (customAccessor)\n return customAccessor;\n if (builtinAccessor)\n return builtinAccessor;\n if (defaultAccessor)\n return defaultAccessor;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}", "function selectValueAccessor(dir, valueAccessors) {\n\t if (isBlank(valueAccessors))\n\t return null;\n\t var defaultAccessor;\n\t var builtinAccessor;\n\t var customAccessor;\n\t valueAccessors.forEach(function (v) {\n\t if (hasConstructor(v, DefaultValueAccessor)) {\n\t defaultAccessor = v;\n\t }\n\t else if (isBuiltInAccessor(v)) {\n\t if (isPresent(builtinAccessor))\n\t _throwError(dir, 'More than one built-in value accessor matches form control with');\n\t builtinAccessor = v;\n\t }\n\t else {\n\t if (isPresent(customAccessor))\n\t _throwError(dir, 'More than one custom value accessor matches form control with');\n\t customAccessor = v;\n\t }\n\t });\n\t if (isPresent(customAccessor))\n\t return customAccessor;\n\t if (isPresent(builtinAccessor))\n\t return builtinAccessor;\n\t if (isPresent(defaultAccessor))\n\t return defaultAccessor;\n\t _throwError(dir, 'No valid value accessor for form control with');\n\t return null;\n\t }", "function selectValueAccessor(dir, valueAccessors) {\n\t if (isBlank(valueAccessors))\n\t return null;\n\t var defaultAccessor;\n\t var builtinAccessor;\n\t var customAccessor;\n\t valueAccessors.forEach(function (v) {\n\t if (hasConstructor(v, DefaultValueAccessor)) {\n\t defaultAccessor = v;\n\t }\n\t else if (isBuiltInAccessor(v)) {\n\t if (isPresent(builtinAccessor))\n\t _throwError(dir, 'More than one built-in value accessor matches form control with');\n\t builtinAccessor = v;\n\t }\n\t else {\n\t if (isPresent(customAccessor))\n\t _throwError(dir, 'More than one custom value accessor matches form control with');\n\t customAccessor = v;\n\t }\n\t });\n\t if (isPresent(customAccessor))\n\t return customAccessor;\n\t if (isPresent(builtinAccessor))\n\t return builtinAccessor;\n\t if (isPresent(defaultAccessor))\n\t return defaultAccessor;\n\t _throwError(dir, 'No valid value accessor for form control with');\n\t return null;\n\t }", "function value() { }", "function accessor$1(data, field) {\n var value = null;\n if (typeof field === 'function') value = field(data);else if (typeof field === 'string' && typeof data === 'object' && data != null && field in data) value = data[field];\n return value;\n }", "_getValue() {\n return this._value;\n }", "getValue() {\n return this.value;\n }", "function getValueGetter(attr, query) {\n // if query looks like [foo-bar], get attribute\n if (attr) {\n return function getAttribute(elem) {\n return elem.getAttribute(attr);\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText(elem) {\n var child = elem.querySelector(query);\n return child && child.textContent;\n };\n }", "function propertyAccessor(fld) {\r\n return function (obj) { return obj[fld]; }\r\n}", "function getValueGetter(attr, query) {\n // if query looks like [foo-bar], get attribute\n if (attr) {\n return function getAttribute(elem) {\n return elem.getAttribute(attr);\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText(elem) {\n var child = elem.querySelector(query);\n return child && child.textContent;\n };\n }", "function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }", "function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }", "function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }", "function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }", "function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }", "function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }", "get doubleValue() {}", "function getValue(val) {\n if (typeOf(val) === 'string') {\n var propVal = get(this, val);\n\n return 'undefined' === typeof propVal ? val : propVal;\n } else if ((0, _emberMomentUtilsIsDescriptor['default'])(val)) {\n var funcName = val.func ? 'func' : // Ember < 1.11\n '_getter'; // Ember >= 1.11\n return val.altKey ? get(this, val.altKey) : val[funcName].apply(this);\n } else {\n return val;\n }\n }", "GetValue()\n\t{\n\t\treturn this.value;\n\t}", "function getValueGetter(attr, query) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if (attr) {\n getValue = function(elem) {\n return elem.getAttribute(attr);\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function(elem) {\n var child = elem.querySelector(query);\n return child && getText(child);\n };\n }\n return getValue;\n }", "function getValueGetter(attr, query) {\r\n var getValue;\r\n // if query looks like [foo-bar], get attribute\r\n if (attr) {\r\n getValue = function(elem) {\r\n return elem.getAttribute(attr);\r\n };\r\n } else {\r\n // otherwise, assume its a querySelector, and get its text\r\n getValue = function(elem) {\r\n var child = elem.querySelector(query);\r\n return child && getText(child);\r\n };\r\n }\r\n return getValue;\r\n }", "getValue()\n {\n return this.value;\n }", "function get(k, key$$1, value, fields) {\n return accessor(\n function(d) { return key$$1(d) === k ? value(d) : NaN; },\n fields,\n k + ''\n );\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getValueGetter( attr, query ) {\n var getValue;\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n getValue = function( elem ) {\n return elem.getAttribute( attr );\n };\n } else {\n // otherwise, assume its a querySelector, and get its text\n getValue = function( elem ) {\n var child = elem.querySelector( query );\n return child && getText( child );\n };\n }\n return getValue;\n }", "function getVal() {\n return 5;\n}", "getValue() {\n return this.value;\n }", "getValue() {\n return this.value;\n }", "getValue() {\n return this.value;\n }", "get() {\n const value = this.properties[name].get_value();\n return value;\n }", "function get() {\n return _value;\n }", "get value() { return this._inputValueAccessor.value; }", "get value() {\n return this._inputValueAccessor.value;\n }", "value() {\n return this.#value;\n }", "function value ( ) {\n\t\treturn this[0][ !arguments.length ? 'vGet' : 'vSet' ].apply(this[0], arguments);\n\t}", "getCachedValue() {\n if (!this.hasOwnProperty('value')) {\n return (this.value = this.getValue());\n }\n return this.value;\n }", "_get_value() {\n return this._has_value() ? this._value : undefined;\n }", "getValue(owner){\n return this.valueGetter(owner, this);\n }", "function _value(field, attribute)\n\t{\n\t\treturn field.values[attribute];\n\t}", "value(el, value) {\n return setGet(el, this.facade(el).valueAttribute(), value);\n }", "get value() {\n return this.getValue();\n }", "getValue() {\n return this.value;\n }", "function fnDirect(value) { return value; }", "get(name) {\n return getters[name]();\n }", "get value() {\n return this.getNumberAttribute('value');\n }", "function get(k, key, value, fields) {\n return (0,vega_util__WEBPACK_IMPORTED_MODULE_2__.accessor)(\n function(d) { return key(d) === k ? value(d) : NaN; },\n fields,\n k + ''\n );\n}", "function getVal(val) {\n if (typeof val === 'function') {\n return val.apply(undefined, slice.call(arguments, 1));\n } else {\n return val;\n }\n }" ]
[ "0.82307124", "0.8219515", "0.8170258", "0.8148536", "0.8148536", "0.8148536", "0.8148536", "0.8148536", "0.8148536", "0.8148536", "0.8148536", "0.7644628", "0.76069796", "0.7545255", "0.7545255", "0.7545255", "0.74490565", "0.74490565", "0.74490565", "0.74490565", "0.74490565", "0.74490565", "0.74490565", "0.74490565", "0.73482573", "0.7344338", "0.6991237", "0.6991237", "0.6946729", "0.6833542", "0.67965156", "0.66985846", "0.66605014", "0.66605014", "0.66605014", "0.66605014", "0.6658309", "0.6651038", "0.6645442", "0.6620086", "0.6620086", "0.6620086", "0.6620086", "0.6620086", "0.6620086", "0.6620086", "0.658245", "0.658245", "0.6549495", "0.63956726", "0.6372322", "0.6368146", "0.631277", "0.62800586", "0.6252457", "0.62435085", "0.62435085", "0.62435085", "0.62435085", "0.62435085", "0.62435085", "0.62164986", "0.62146986", "0.62093407", "0.617894", "0.61779976", "0.61739236", "0.6159903", "0.6144397", "0.6144397", "0.6144397", "0.6144397", "0.6144397", "0.6144397", "0.6144397", "0.6144397", "0.61347085", "0.61330897", "0.61330897", "0.61330897", "0.61305636", "0.60981333", "0.6095905", "0.608417", "0.6075829", "0.60611796", "0.60497475", "0.6044741", "0.6022711", "0.600649", "0.6006231", "0.5976681", "0.59709895", "0.5955233", "0.59380513", "0.591787", "0.58942086", "0.5892002" ]
0.82074046
4
Given a function that returns bindings, create and return a new object that contains binding valueaccessors functions. Each accessor function calls the original function so that it always gets the latest value and all dependencies are captured. This is used by ko.applyBindingsToNode and getBindingsAndMakeAccessors.
function makeAccessorsFromFunction(callback) { return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) { return function() { return callback()[key]; }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeBindingAccessors (bindings, context, node) {\n if (typeof bindings === 'function') {\n return this.makeAccessorsFromFunction(bindings.bind(null, context, node))\n } else {\n return objectMap(bindings, this.makeValueAccessor)\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this.getBindings.bind(this, node, context));\n }", "getBindingsAndMakeAccessors (node, context) {\n const bindingsFn = this.providerObject.getBindings.bind(this.providerObject, node, context);\n return this.makeAccessorsFromFunction(bindingsFn)\n }", "function execNewBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {\n var bindingKey = bindingKeyAndHandler.key,\n handlerParams = {\n element: node,\n $data: bindingContext.$data,\n $context: bindingContext,\n allBindings: allBindings\n },\n handlerConstructor = bindingKeyAndHandler.handler,\n handlerInstance,\n subscriptions = [];\n\n Object.defineProperty(handlerParams, 'value', {\n get: function () { return getValueAccessor(bindingKey)(); }\n });\n\n function handlerConstructorWrapper() {\n handlerInstance = this;\n\n // The handler instance will have properties `computed` and\n // `subscribe`, which are almost the same as the `ko.-` equivalent\n // except their lifecycle is limited to that of the node (i.e.\n // they are automatically disposed).\n this.computed = function handlerInstanceComputed(functionOrObject) {\n var settings = typeof functionOrObject === 'function' ?\n { read: functionOrObject, write: functionOrObject } :\n functionOrObject;\n extend(settings, {\n owner: handlerInstance,\n disposeWhenNodeIsRemoved: node\n });\n return computed(settings);\n };\n\n this.subscribe = function handlerInstanceSubscription(subscribable, callback, eventType) {\n subscriptions.push(\n subscribable.subscribe(callback, handlerInstance, eventType)\n );\n };\n\n this.value = this.computed(function () {\n return getValueAccessor(bindingKey)();\n });\n\n handlerConstructor.call(this, handlerParams);\n }\n\n // We have to wrap the handler instance in this \"subclass\" because\n // it's the only way to define this.computed/subscribe before the\n // handlerConstructor is called, and one would expect those\n // utilities to be available in the constructor.\n extend(handlerConstructorWrapper, handlerConstructor);\n handlerConstructorWrapper.prototype = handlerConstructor.prototype;\n\n try {\n new handlerConstructorWrapper();\n } catch(ex) {\n reportBindingError('construction', ex);\n }\n\n addDisposeCallback(node, function () {\n if (typeof handlerInstance.dispose === \"function\") {\n handlerInstance.dispose.call(handlerInstance);\n }\n arrayForEach(subscriptions, function (subs) {\n subs.dispose();\n });\n });\n\n return handlerConstructor.controlsDescendantBindings || handlerInstance.controlsDescendantBindings;\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function (value, key) {\n return function () {\n return callback()[key];\n };\n });\n }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function prepBindings(bindings) {\n\t\t\tvar scope = {}; // Objects of functions\n\t\t\tvar attr = {}; // Object\n\n\t\t\t// Run through each binding and create the needed attr and scope\n\t\t\tangular.forEach(bindings, function(val, key) {\n\t\t\t\tattr[kebabCase(key)] = typeof val === 'function' ? key + '({ res: res });' : key\n\t\t\t\tscope[key] = val;\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tscope: scope,\n\t\t\t\tattr: attr\n\t\t\t}\n\t\t}", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "makeAccessorsFromFunction (callback) {\n return objectMap(ignore(callback),\n (value, key) => () => callback()[key]\n )\n }", "function allBindings () {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor)\n }", "function makeAccessor2(valueOrAccessor) {\n if (_lodash2.default.isFunction(valueOrAccessor)) return valueOrAccessor;\n return function () {\n return valueOrAccessor;\n };\n}", "function makeAccessorsFromFunction(callback) {\n return objectMap(ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function _KoCustomBindingProvider() {\n var _evaluatorCacheMap = new WeakMap();\n\n var _postprocessors = {};\n var _preprocessors = {};\n var _KoBindingCache = {};\n var _OJ_EXTENDED = '_ojExtended';\n var _OJ_CACHE_SCOPE = '_ojCacheScope';\n\n var _changeQueue = new GlobalChangeQueue();\n\n this.install = function () {\n var provider = ko.bindingProvider;\n var instanceName = 'instance';\n var wrapped = provider[instanceName];\n var getAccessors = 'getBindingAccessors';\n\n if (!wrapped[getAccessors]) {\n Logger.error(\"JET's Knockout bindings are not compatible with the current binding \" + 'provider since it does not implement getBindingAccessors()');\n return this;\n }\n\n var custom = {\n getWrapped: function getWrapped() {\n return wrapped;\n }\n };\n provider[instanceName] = custom;\n var methodsToWrap = [];\n methodsToWrap.push(getAccessors, 'nodeHasBindings', 'getBindings');\n methodsToWrap.forEach(function (name) {\n custom[name] = _wrap(wrapped, name, function (n, original) {\n // _wrap() will be producing a function that always calls the 'wrapped'/original method first\n // to handle the binding postprocessor case.\n // Hovewer, for cases when the binding context has been created with .extendBindingContext(),\n // we are replacing the binding evaluaror completely, and we do not need to call the original\n // getAccessors() method. _preWrapGetAccessors() will 'pre-wrap'/replace getAccessors() for that case,\n // so _wrap() will be wrapping the replaced method, and we will not be creating an evaluator in the original\n // getAccessors() method just to throw it away\n if (n !== getAccessors) {\n return original;\n }\n\n return _preWrapGetAccessors(original, wrapped);\n });\n });\n custom.preprocessNode = _wrapPreprocessNode(wrapped);\n\n _patchKoRenderTemplateSource(ko);\n\n _patchKoComponentsLoaders(ko);\n\n _patchKoEvaluatorForCSP(_KoBindingCache);\n\n return this;\n };\n\n this.addPostprocessor = function (postprocessor) {\n var keys = Object.keys(postprocessor);\n keys.forEach(function (key) {\n _postprocessors[key] = _postprocessors[key] || [];\n\n _postprocessors[key].push(postprocessor[key]);\n });\n };\n\n this.registerPreprocessor = function (tagName, preprocessor) {\n _preprocessors[tagName] = preprocessor;\n };\n\n this.getBindingsString = function (node, wrapped, bindingContext) {\n return _getBindingsString(node, wrapped, bindingContext);\n };\n\n this.extendBindingContext = function (context, current, alias, templateAlias, cacheKey) {\n var extension = {\n $current: current,\n $root: undefined,\n $parent: undefined,\n $parents: undefined\n };\n\n if (alias) {\n extension[alias] = current;\n }\n\n if (templateAlias) {\n extension[templateAlias] = current;\n }\n\n if (context) {\n extension = context.extend(extension);\n } else {\n extension.$data = {}; // ensure that KO evaluator does not blow up when $context has no $data property\n }\n\n Object.defineProperty(extension, _OJ_CACHE_SCOPE, {\n value: cacheKey\n });\n Object.defineProperty(extension, _OJ_EXTENDED, {\n value: true\n });\n return extension;\n };\n\n this.createBindingExpressionEvaluator = function (expressionText, bindingContext) {\n if (bindingContext[_OJ_EXTENDED]) {\n return _createReplacementEvaluatorForExtend(expressionText);\n }\n\n var factory = Config.getExpressionEvaluator();\n\n if (factory) {\n var evaluate = factory.createEvaluator(expressionText).evaluate;\n return function ($context) {\n return evaluate([$context.$data || {}, $context]);\n };\n }\n\n var evaluator;\n\n try {\n /* jslint evil:true */\n // eslint-disable-next-line no-new-func\n evaluator = new Function('$context', 'with($context){with($data||{}){return ' // @HTMLUpdateOK\n + expressionText + ';}}'); // binding expression evaluation\n } catch (e) {\n throw new Error(e.message + ' in expression \"' + expressionText + '\"');\n }\n\n return evaluator;\n };\n\n this.createEvaluator = function (expression, bindingContext) {\n return _createEvaluatorViaCache(this.createBindingExpressionEvaluator, expression, bindingContext);\n };\n\n this.getGlobalChangeQueue = function () {\n return _changeQueue;\n };\n\n this.getThrottlePromise = function () {\n return this.getGlobalChangeQueue().getThrottlePromise();\n };\n\n function _wrap(wrapped, name, prewrap) {\n var isHasBindings = name === 'nodeHasBindings';\n\n var impl = function impl(arg0) {\n if (isHasBindings) {\n var type = arg0.nodeType;\n\n if (type !== 1 && type !== 8) {\n return false;\n }\n }\n\n var delegate = prewrap(name, wrapped[name]);\n var ret = delegate ? delegate.apply(wrapped, arguments) : null;\n var postprocessHandlers = _postprocessors[name];\n\n if (postprocessHandlers != null) {\n var originalArgs = arguments;\n postprocessHandlers.forEach(function (handler) {\n var args = Array.prototype.slice.call(originalArgs);\n args.push(ret, wrapped); // Ignore dependencies here so that bindings don't get triggered due to contained evaluations\n\n ret = ko.ignoreDependencies(handler, null, args);\n });\n }\n\n return ret;\n };\n\n return impl;\n }\n\n function _wrapPreprocessNode(wrapped) {\n var originalPreprocessor = wrapped.preprocessNode;\n\n var impl = function impl(node) {\n var preprocessor;\n var ret;\n var obj = null;\n\n if (node.nodeType === 1) {\n preprocessor = _preprocessors[node.nodeName.toLowerCase()];\n }\n\n if (!preprocessor) {\n preprocessor = originalPreprocessor;\n obj = wrapped;\n }\n\n if (preprocessor) {\n ret = ko.ignoreDependencies(preprocessor, obj, [node]);\n }\n\n if (Array.isArray(ret)) {\n ret = _preprocessNewNodes(node, ret);\n }\n\n return ret;\n };\n\n return impl;\n }\n\n function _preprocessNewNodes(originalNode, newNodes) {\n var provider = ko.bindingProvider.instance;\n var ret = newNodes.slice(0);\n var current = newNodes[0];\n var currentIndex = 0;\n var i = 0;\n\n while (currentIndex >= 0) {\n // get the next current element before preprocessing replaces current\n var next = ko.virtualElements.nextSibling(current);\n\n if (current !== originalNode) {\n var insertedNodes = provider.preprocessNode(current);\n\n if (Array.isArray(insertedNodes)) {\n // insert the nodes instead of the item at the index i\n ret.splice.apply(ret, [i, 1].concat(insertedNodes)); // jump over the inserted nodes (-1 represents one node being replaced)\n\n i += insertedNodes.length - 1;\n }\n }\n\n current = next;\n i += 1;\n var nextIndex = currentIndex + 1;\n currentIndex = current ? newNodes.indexOf(current, nextIndex) : -1; // figure out how many virtual children we need to skip (they will be preprocessed after their container is entered)\n\n i += currentIndex - nextIndex; // this value is irrelevent if currentIndex is negative\n }\n\n return ret;\n } // Patches renderTemplateSource() to ensure that the template is parsed with the current document.\n // Otherwise, the custom elements are not being upgraded synchronously\n\n\n function _patchKoRenderTemplateSource(ko) {\n var proto = ko.nativeTemplateEngine.prototype;\n var method = 'renderTemplateSource';\n var delegate = proto[method];\n\n proto[method] = function (templateSource, bindingContext, options, templateDocument) {\n return delegate.call(this, templateSource, bindingContext, options, templateDocument || document\n /* use current document if none is provided*/\n );\n };\n } // This method adds custom KO component loader that overrides defaultLoader.loadTemplate().\n // This is done to ensure that the template is parsed with the current document in order\n // to upgrade custom elements synchronously\n // The custom loader takes precedence over the default loader.\n\n\n function _patchKoComponentsLoaders(ko) {\n ko.components.loaders.unshift({\n loadTemplate: function loadTemplate(name, templateConfig, callback) {\n if (typeof templateConfig === 'string') {\n var nodes = ko.utils.parseHtmlFragment(templateConfig, document);\n ko.components.defaultLoader.loadTemplate(name, nodes, callback);\n } else {\n // Config type is not a string. Let default loader handle it.\n callback(null);\n }\n }\n });\n }\n\n function _preWrapGetAccessors(original, wrappedProvider) {\n var impl = function impl(node, bindingContext) {\n if (bindingContext[_OJ_EXTENDED]) {\n var bindingsString = _getBindingsString(node, wrappedProvider, bindingContext); // _createExtendAccessorsViaCache() returns a function that will produce a map of binding accessors.\n // Note that this function is immediately invoked with the bindingcontext and node as parameters.\n // That will pre-bind binding accessors to the values of $context and $element\n\n\n var accessors = bindingsString ? _createExtendAccessorsViaCache(bindingsString, bindingContext)(bindingContext, node) : null; // Check whether a node is a KO component. We will be using the default evaluator\n // to initialize component binding, while our own evaluator will be handling the\n // rest of the bindings specified with data-bind.\n // This means that in the inlikely case when a KO component is used in an inline\n // template or the oj-bind-foreach, the properties of component will be subject to a\n // possible collision between an aliased data object and a ViewModel property (avery unlikely scenario)\n\n if (node.nodeType === 1 && ko.components.isRegistered(node.tagName.toLowerCase())) {\n var originalAccessors = original.call(wrappedProvider, node, bindingContext);\n var componentEval = originalAccessors.component;\n\n if (componentEval) {\n // copy the component binding accessor from the original accessor map\n accessors = accessors || {};\n accessors.component = componentEval;\n }\n }\n\n return accessors;\n }\n\n return original.call(wrappedProvider, node, bindingContext);\n };\n\n return impl;\n }\n\n function _createExtendAccessorsViaCache(bindingsString, bindingContext) {\n var factory = function factory(expr) {\n // .preProcessBindings() will produce a string that defines a Function retrurning a map\n // with each key being the bidning name, and each value being an evalutor function for\n // binding value\n var rewrittenBindings = ko.expressionRewriting.preProcessBindings(expr, {\n valueAccessors: true\n });\n return _createReplacementEvaluatorForExtend('{' + rewrittenBindings + '}');\n };\n\n return _createEvaluatorViaCache(factory, bindingsString, bindingContext);\n }\n\n function _createReplacementEvaluatorForExtend(expressionText) {\n // Note that the priority order of the binding context and the ViewModel are reversed\n // in this evaluator. This is needed for allowing properties supplied in bindsingProvider.extend()\n // to obscure properties in the ViewModel, which is the behavior one would expect when .extend()\n // is used\n var factory = Config.getExpressionEvaluator();\n\n if (factory) {\n var evaluate = factory.createEvaluator(expressionText).evaluate;\n return function ($context, $element) {\n return evaluate([$context, $context.$data || {}, {\n $element: $element\n }]);\n };\n }\n\n var evaluator;\n\n try {\n /* jslint evil:true */\n // eslint-disable-next-line no-new-func\n evaluator = new Function('$context', '$element', 'with($context.$data||{}){with($context){return ' + // @HTMLUpdateOK\n expressionText + '}}'); // binding expression evaluation\n } catch (e) {\n throw new Error(e.message + ' in expression \"' + expressionText + '\"');\n }\n\n return evaluator;\n }\n\n function _createEvaluatorViaCache(factory, expr, bindingContext) {\n // The absence of binding context indicates that no caching should occur\n if (!bindingContext) {\n return factory(expr, bindingContext);\n }\n\n var cacheScope;\n var scopeMap = _evaluatorCacheMap;\n var key = bindingContext[_OJ_CACHE_SCOPE] || bindingContext;\n cacheScope = scopeMap.get(key);\n\n if (!cacheScope) {\n cacheScope = {};\n scopeMap.set(key, cacheScope);\n }\n\n var func = cacheScope[expr];\n\n if (!func) {\n func = factory(expr, bindingContext);\n cacheScope[expr] = func;\n }\n\n return func;\n }\n\n function _getBindingsString(node, wrapped, bindingContext) {\n var func = wrapped.getBindingsString;\n\n if (func) {\n return func.call(wrapped, node, bindingContext);\n }\n\n switch (node.nodeType) {\n case 1:\n // Element\n return node.getAttribute('data-bind');\n\n case 8:\n // Comment node\n var match = node.nodeValue.match(/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/);\n return match ? match[1] : null;\n\n default:\n return null;\n }\n }\n}", "function execObjectBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {\n var handlerInitFn = bindingKeyAndHandler.handler[\"init\"],\n handlerUpdateFn = bindingKeyAndHandler.handler[\"update\"],\n bindingKey = bindingKeyAndHandler.key,\n controlsDescendantBindings = false;\n\n // Run init, ignoring any dependencies\n if (typeof handlerInitFn === \"function\") {\n try {\n ignore(function() {\n var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, bindingContext.$data, bindingContext);\n\n // If this binding handler claims to control descendant bindings, make a note of this\n if (initResult && initResult.controlsDescendantBindings) {\n controlsDescendantBindings = true;\n }\n });\n } catch(ex) {\n reportBindingError('init', ex);\n }\n }\n\n // Run update in its own computed wrapper\n if (typeof handlerUpdateFn === \"function\") {\n computed(\n function() {\n try {\n handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, bindingContext.$data, bindingContext);\n } catch (ex) {\n reportBindingError('update', ex);\n }\n },\n null,\n { disposeWhenNodeIsRemoved: node }\n );\n }\n return controlsDescendantBindings;\n }", "function createAccessor(value) {\n return function () { return value; };\n }", "function wrapApplyOnBindings(bindings)\n\t{\n\t\tbindings.apply = function(key)\n\t\t{\n\t\t\tfor (var index in bindings)\n\t\t\t{\n\t\t\t\tif (index !== 'apply' && typeof bindings[index].apply === 'function')\n\t\t\t\t{\n\t\t\t\t\tif (key) bindings[index].key === key && bindings[index].apply();\n\t\t\t\t\telse bindings[index].apply();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bindings;\n\t}", "function makeValueAccessor(value) {\n return function () {\n return value;\n };\n }", "function resolveBindings(bindings) {\r\n var normalized = _createListOfBindings(_normalizeBindings(bindings, new Map()));\r\n return normalized.map(function (b) {\r\n if (b instanceof _NormalizedBinding) {\r\n return new ResolvedBinding_(b.key, [b.resolvedFactory], false);\r\n }\r\n else {\r\n var arr = b;\r\n return new ResolvedBinding_(arr[0].key, arr.map(function (_) { return _.resolvedFactory; }), true);\r\n }\r\n });\r\n}", "function setKeyBindingProvider(getBindingsFunction) {\n\t\t\tgetBindings = getBindingsFunction;\n\t\t}", "function BindingCallManager(scope, path, setterFn, getterFn, defaultValue) {\n _super.call(this, (function () {\n // Create an object with getter and setter.\n var target = {};\n Object.defineProperty(target, 'result', {\n set: function (result) {\n setterFn(result);\n },\n get: function () {\n if (getterFn) {\n return getterFn();\n }\n return void 0;\n }\n });\n return target;\n })(), 'result', scope, path, defaultValue);\n }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function makeValueAccessor(value) {\n return function() {\n return value;\n };\n }", "function forward(obj, target, onlyAccessors) {\n onlyAccessors = onlyAccessors || false;\n for (var k in target) {\n (function(k) {\n if (typeof(target[k]) == 'function') {\n if (!onlyAccessors) {\n obj[k] = target[k].bind(target);\n }\n } else {\n Object.defineProperty(obj, k, {\n get: function() { return target[k]; },\n set: function(x) { target[k] = x; }\n });\n }\n })(k);\n }\n}", "update() {\n this.bindings.forEach((binding) => {\n if (\n binding.element &&\n binding.attribute &&\n binding.element.hasOwnProperty(binding.attribute)\n ) {\n binding.element[binding.attribute] = this.value\n }\n })\n return this\n }", "_createAccessors(accessors) {\n this._accessors = {};\n // add it to the prototype\n const proto = Object.getPrototypeOf(this);\n // create a getter / setter for each accessors\n // setter : `this.x = callback`\n // getter : `this.x(datum)`\n Object.keys(accessors).forEach((name) => {\n if (proto.hasOwnProperty(name)) { return; }\n\n Object.defineProperty(proto, name, {\n get: function() { return this._accessors[name]; },\n set: function(func) {\n this._accessors[name] = func;\n }\n });\n });\n }", "function setBinding(binding, value) {\n if (!data.bindings[binding]) {\n data.bindings[binding] = {\n elements: [],\n lastValue: undefined,\n value: undefined,\n listeners: []\n };\n }\n\n data.bindings[binding].lastValue = data.bindings[binding].value;\n data.bindings[binding].value = value;\n data.bindings[binding].elements.map(element => {\n element.element[element.value] = data.bindings[binding].value;\n });\n}", "function WjValueAccessorFactory(e){return new WjValueAccessor(e)}", "function setBinding(binding, value) {\n if (!data.bindings[binding]) {\n data.bindings[binding] = {\n elements: [],\n lastValue: undefined,\n value: undefined,\n listeners: []\n };\n }\n\n data.bindings[binding].lastValue = data.bindings[binding].value;\n data.bindings[binding].value = value;\n data.bindings[binding].elements.map(element => {\n element.element[element.value] = data.bindings[binding].value;\n });\n }", "function FixedValueGetter(value){\n return function(){return value};\n}", "function returnNewFunctionOf(functionToBeCopied, thisValue) {\n return functionToBeCopied.bind(thisValue);\n}", "function returnNewFunctionOf(functionToBeCopied,thisValue){\n return functionToBeCopied.bind(thisValue)\n}", "forEach (fcn, getterSetter = this.sharedGetterSetter) {\n for (var i = 0, len = this.length; i < len; i++) {\n getterSetter.ix = i\n fcn(getterSetter, i)\n }\n }", "function returnNewFunctionOf(functionToBeCopied, thisValue){\n\treturn functionToBeCopied.bind(thisValue);\n}", "_createAccessorMap() {\n return {\n a: val => this._reg8(RegMap.a, val),\n b: val => this._reg8(RegMap.b, val),\n c: val => this._reg8(RegMap.c, val),\n d: val => this._reg8(RegMap.d, val),\n e: val => this._reg8(RegMap.e, val),\n f: val => this._specialRegF(RegMap.f, val),\n h: val => this._reg8(RegMap.h, val),\n l: val => this._reg8(RegMap.l, val),\n af: val => this._specialRegAF(RegMap.af, val),\n bc: val => this._reg16(RegMap.bc, val),\n de: val => this._reg16(RegMap.de, val),\n hl: val => this._reg16(RegMap.hl, val),\n sp: val => this.sp(val),\n pc: val => this.pc(val),\n };\n }", "function autobind(target, key, descriptor) {\n var fn = descriptor.value;\n var defining = false;\n return {\n configurable: true,\n get: function () {\n if (defining || this === fn.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n // Bind method only once, and update the property to return the bound value from now on\n var fnBound = fn.bind(this);\n defining = true;\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: fnBound\n });\n defining = false;\n return fnBound;\n },\n set: function (newValue) {\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: newValue\n });\n }\n };\n}", "function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) { // 8850\n var removeWatchCollection = []; // 8851\n forEach(bindings, function(definition, scopeName) { // 8852\n var attrName = definition.attrName, // 8853\n optional = definition.optional, // 8854\n mode = definition.mode, // @, =, or & // 8855\n lastValue, // 8856\n parentGet, parentSet, compare; // 8857\n // 8858\n switch (mode) { // 8859\n // 8860\n case '@': // 8861\n if (!optional && !hasOwnProperty.call(attrs, attrName)) { // 8862\n destination[scopeName] = attrs[attrName] = void 0; // 8863\n } // 8864\n attrs.$observe(attrName, function(value) { // 8865\n if (isString(value)) { // 8866\n destination[scopeName] = value; // 8867\n } // 8868\n }); // 8869\n attrs.$$observers[attrName].$$scope = scope; // 8870\n if (isString(attrs[attrName])) { // 8871\n // If the attribute has been provided then we trigger an interpolation to ensure // 8872\n // the value is there for use in the link fn // 8873\n destination[scopeName] = $interpolate(attrs[attrName])(scope); // 8874\n } // 8875\n break; // 8876\n // 8877\n case '=': // 8878\n if (!hasOwnProperty.call(attrs, attrName)) { // 8879\n if (optional) break; // 8880\n attrs[attrName] = void 0; // 8881\n } // 8882\n if (optional && !attrs[attrName]) break; // 8883\n // 8884\n parentGet = $parse(attrs[attrName]); // 8885\n if (parentGet.literal) { // 8886\n compare = equals; // 8887\n } else { // 8888\n compare = function(a, b) { return a === b || (a !== a && b !== b); }; // 8889\n } // 8890\n parentSet = parentGet.assign || function() { // 8891\n // reset the change, or we will throw this exception on every $digest // 8892\n lastValue = destination[scopeName] = parentGet(scope); // 8893\n throw $compileMinErr('nonassign', // 8894\n \"Expression '{0}' used with directive '{1}' is non-assignable!\", // 8895\n attrs[attrName], directive.name); // 8896\n }; // 8897\n lastValue = destination[scopeName] = parentGet(scope); // 8898\n var parentValueWatch = function parentValueWatch(parentValue) { // 8899\n if (!compare(parentValue, destination[scopeName])) { // 8900\n // we are out of sync and need to copy // 8901\n if (!compare(parentValue, lastValue)) { // 8902\n // parent changed and it has precedence // 8903\n destination[scopeName] = parentValue; // 8904\n } else { // 8905\n // if the parent can be assigned then do so // 8906\n parentSet(scope, parentValue = destination[scopeName]); // 8907\n } // 8908\n } // 8909\n return lastValue = parentValue; // 8910\n }; // 8911\n parentValueWatch.$stateful = true; // 8912\n var removeWatch; // 8913\n if (definition.collection) { // 8914\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch); // 8915\n } else { // 8916\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); // 8917\n } // 8918\n removeWatchCollection.push(removeWatch); // 8919\n break; // 8920\n // 8921\n case '&': // 8922\n // Don't assign Object.prototype method to scope // 8923\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; // 8924\n // 8925\n // Don't assign noop to destination if expression is not valid // 8926\n if (parentGet === noop && optional) break; // 8927\n // 8928\n destination[scopeName] = function(locals) { // 8929\n return parentGet(scope, locals); // 8930\n }; // 8931\n break; // 8932\n } // 8933\n }); // 8934\n // 8935\n return removeWatchCollection.length && function removeWatches() { // 8936\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) { // 8937\n removeWatchCollection[i](); // 8938\n } // 8939\n }; // 8940\n }", "projectComponentBindings(component, bindings) {\n if (bindings) {\n if (bindings.inputs !== undefined) {\n const bindingKeys = Object.getOwnPropertyNames(bindings.inputs);\n for (const bindingName of bindingKeys) {\n component.instance[bindingName] = bindings.inputs[bindingName];\n }\n }\n if (bindings.outputs !== undefined) {\n const eventKeys = Object.getOwnPropertyNames(bindings.outputs);\n for (const eventName of eventKeys) {\n component.instance[eventName] = bindings.outputs[eventName];\n }\n }\n }\n return component;\n }", "projectComponentBindings(component, bindings) {\n if (bindings) {\n if (bindings.inputs !== undefined) {\n const bindingKeys = Object.getOwnPropertyNames(bindings.inputs);\n for (const bindingName of bindingKeys) {\n component.instance[bindingName] = bindings.inputs[bindingName];\n }\n }\n if (bindings.outputs !== undefined) {\n const eventKeys = Object.getOwnPropertyNames(bindings.outputs);\n for (const eventName of eventKeys) {\n component.instance[eventName] = bindings.outputs[eventName];\n }\n }\n }\n return component;\n }", "applyBindingSet() {\n // set the attribute mappings\n this.binder.attributeMappings = {\n placeholder: 'placeholder', // map placeholder to placeholder\n 'value-state': '_valueState',\n name: 'name',\n maxlength: 'maxlength', // for the input element itself\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n 'show-value-help-icon': 'showValueHelpIcon',\n 'show-suggestions': 'showSuggestions',\n readonly: '__readonly',\n required: 'required',\n disabled: 'disabled',\n modified: 'modified',\n highlight: 'highlight',\n };\n\n // set attributes to constrains mapping for furo.fat types\n this.binder.fatAttributesToConstraintsMappings = {\n maxlength: 'value._constraints.max.is', // for the fieldnode constraint\n required: 'value._constraints.required.is', // for the fieldnode constraint\n };\n\n // set constrains to attributes mapping for furo.fat types\n this.binder.constraintsTofatAttributesMappings = {\n max: 'maxlength',\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // update the value on input changes\n this.addEventListener('input', val => {\n // update the value\n this.binder.fieldValue = val.target.value;\n\n /**\n * Fired when value changed\n * @type {Event}\n */\n const customEvent = new Event('value-changed', { composed: true, bubbles: true });\n customEvent.detail = val.target.value;\n this.dispatchEvent(customEvent);\n\n // set flag empty on empty strings (for fat types)\n if (val.target.value) {\n this.binder.deleteLabel('empty');\n } else {\n this.binder.addLabel('empty');\n }\n // if something was entered the field is not empty\n this.binder.addLabel('modified');\n });\n }", "* processBinding (key, value) {\n // Get the \"on\" binding from \"on.click\"\n const [handlerName, property] = key.split('.')\n const handler = this.bindingHandlers.get(handlerName)\n\n if (handler && handler.preprocess) {\n const bindingsAddedByHandler = []\n const chainFn = (...args) => bindingsAddedByHandler.push(args)\n value = handler.preprocess(value, key, chainFn)\n for (const [key, value] of bindingsAddedByHandler) {\n yield * this.processBinding(key, value)\n }\n } else if (property) {\n value = `{${property}:${value}}`\n }\n\n yield `${handlerName}:${value}`\n }", "function updateBinding(bindingIndex, value) {\n return viewData[bindingIndex] = value;\n}", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n if (!hasOwnProperty.call(attrs, attrName)) {\n // In the case of user defined a binding with the same name as a method in Object.prototype but didn't set\n // the corresponding attribute. We need to make sure subsequent code won't access to the prototype function\n attrs[attrName] = undefined;\n }\n\n switch (mode) {\n\n case '@':\n if (!attrs[attrName] && !optional) {\n destination[scopeName] = undefined;\n }\n\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n if (!hasOwnProperty.call(attrs, attrName)) {\n // In the case of user defined a binding with the same name as a method in Object.prototype but didn't set\n // the corresponding attribute. We need to make sure subsequent code won't access to the prototype function\n attrs[attrName] = undefined;\n }\n\n switch (mode) {\n\n case '@':\n if (!attrs[attrName] && !optional) {\n destination[scopeName] = undefined;\n }\n\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }", "function createAutoBindPairs() {\n var __reactAutoBindPairs = [];\n\n for (var i = 0; i < current.__reactAutoBindPairs.length; i += 2) {\n var name = current.__reactAutoBindPairs[i];\n var method = proxy[name];\n\n if (typeof method === 'function') {\n __reactAutoBindPairs.push(name, method);\n }\n }\n\n return __reactAutoBindPairs;\n }", "function createAutoBindPairs() {\n var __reactAutoBindPairs = [];\n\n for (var i = 0; i < current.__reactAutoBindPairs.length; i += 2) {\n var name = current.__reactAutoBindPairs[i];\n var method = proxy[name];\n\n if (typeof method === 'function') {\n __reactAutoBindPairs.push(name, method);\n }\n }\n\n return __reactAutoBindPairs;\n }", "function createAutoBindPairs() {\n var __reactAutoBindPairs = [];\n\n for (var i = 0; i < current.__reactAutoBindPairs.length; i += 2) {\n var name = current.__reactAutoBindPairs[i];\n var method = proxy[name];\n\n if (typeof method === 'function') {\n __reactAutoBindPairs.push(name, method);\n }\n }\n\n return __reactAutoBindPairs;\n }" ]
[ "0.7839172", "0.7835442", "0.7835442", "0.7835442", "0.7835442", "0.7835442", "0.7835442", "0.7835442", "0.7835442", "0.7832581", "0.7832581", "0.7832581", "0.7808206", "0.7019667", "0.69962955", "0.69962955", "0.69962955", "0.6892035", "0.6892035", "0.6892035", "0.6892035", "0.6892035", "0.6892035", "0.6892035", "0.6892035", "0.68456376", "0.6665184", "0.6102361", "0.6092655", "0.6092655", "0.6092655", "0.6092655", "0.6092655", "0.6092655", "0.6092655", "0.6092655", "0.6039348", "0.5959391", "0.5959391", "0.5959391", "0.5956613", "0.5923047", "0.58834046", "0.5871449", "0.5871449", "0.5871449", "0.5871449", "0.5871449", "0.5871449", "0.5871449", "0.5871449", "0.5841074", "0.5836273", "0.5775691", "0.56050193", "0.55433846", "0.550489", "0.544174", "0.5336831", "0.52886105", "0.52506757", "0.5246762", "0.52160484", "0.5169806", "0.5169806", "0.5169806", "0.51606184", "0.51606184", "0.51606184", "0.51606184", "0.51606184", "0.51606184", "0.51606184", "0.51606184", "0.51524395", "0.5131868", "0.51158315", "0.5106593", "0.5103659", "0.50869614", "0.5067237", "0.50389665", "0.5036736", "0.50142485", "0.5014087", "0.49721995", "0.49672675", "0.49643755", "0.4964116", "0.4964116", "0.49589145", "0.49137598", "0.49055755", "0.49040064", "0.49040064", "0.4901594", "0.4901594", "0.4901594" ]
0.6012142
39
Given a bindings function or object, create and return a new object that contains binding valueaccessors functions. This is used by ko.applyBindingsToNode.
function makeBindingAccessors(bindings, context, node) { if (typeof bindings === 'function') { return makeAccessorsFromFunction(bindings.bind(null, context, node)); } else { return ko.utils.objectMap(bindings, makeValueAccessor); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "makeBindingAccessors (bindings, context, node) {\n if (typeof bindings === 'function') {\n return this.makeAccessorsFromFunction(bindings.bind(null, context, node))\n } else {\n return objectMap(bindings, this.makeValueAccessor)\n }\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this.getBindings.bind(this, node, context));\n }", "getBindingsAndMakeAccessors (node, context) {\n const bindingsFn = this.providerObject.getBindings.bind(this.providerObject, node, context);\n return this.makeAccessorsFromFunction(bindingsFn)\n }", "function prepBindings(bindings) {\n\t\t\tvar scope = {}; // Objects of functions\n\t\t\tvar attr = {}; // Object\n\n\t\t\t// Run through each binding and create the needed attr and scope\n\t\t\tangular.forEach(bindings, function(val, key) {\n\t\t\t\tattr[kebabCase(key)] = typeof val === 'function' ? key + '({ res: res });' : key\n\t\t\t\tscope[key] = val;\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tscope: scope,\n\t\t\t\tattr: attr\n\t\t\t}\n\t\t}", "function execNewBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {\n var bindingKey = bindingKeyAndHandler.key,\n handlerParams = {\n element: node,\n $data: bindingContext.$data,\n $context: bindingContext,\n allBindings: allBindings\n },\n handlerConstructor = bindingKeyAndHandler.handler,\n handlerInstance,\n subscriptions = [];\n\n Object.defineProperty(handlerParams, 'value', {\n get: function () { return getValueAccessor(bindingKey)(); }\n });\n\n function handlerConstructorWrapper() {\n handlerInstance = this;\n\n // The handler instance will have properties `computed` and\n // `subscribe`, which are almost the same as the `ko.-` equivalent\n // except their lifecycle is limited to that of the node (i.e.\n // they are automatically disposed).\n this.computed = function handlerInstanceComputed(functionOrObject) {\n var settings = typeof functionOrObject === 'function' ?\n { read: functionOrObject, write: functionOrObject } :\n functionOrObject;\n extend(settings, {\n owner: handlerInstance,\n disposeWhenNodeIsRemoved: node\n });\n return computed(settings);\n };\n\n this.subscribe = function handlerInstanceSubscription(subscribable, callback, eventType) {\n subscriptions.push(\n subscribable.subscribe(callback, handlerInstance, eventType)\n );\n };\n\n this.value = this.computed(function () {\n return getValueAccessor(bindingKey)();\n });\n\n handlerConstructor.call(this, handlerParams);\n }\n\n // We have to wrap the handler instance in this \"subclass\" because\n // it's the only way to define this.computed/subscribe before the\n // handlerConstructor is called, and one would expect those\n // utilities to be available in the constructor.\n extend(handlerConstructorWrapper, handlerConstructor);\n handlerConstructorWrapper.prototype = handlerConstructor.prototype;\n\n try {\n new handlerConstructorWrapper();\n } catch(ex) {\n reportBindingError('construction', ex);\n }\n\n addDisposeCallback(node, function () {\n if (typeof handlerInstance.dispose === \"function\") {\n handlerInstance.dispose.call(handlerInstance);\n }\n arrayForEach(subscriptions, function (subs) {\n subs.dispose();\n });\n });\n\n return handlerConstructor.controlsDescendantBindings || handlerInstance.controlsDescendantBindings;\n }", "function _KoCustomBindingProvider() {\n var _evaluatorCacheMap = new WeakMap();\n\n var _postprocessors = {};\n var _preprocessors = {};\n var _KoBindingCache = {};\n var _OJ_EXTENDED = '_ojExtended';\n var _OJ_CACHE_SCOPE = '_ojCacheScope';\n\n var _changeQueue = new GlobalChangeQueue();\n\n this.install = function () {\n var provider = ko.bindingProvider;\n var instanceName = 'instance';\n var wrapped = provider[instanceName];\n var getAccessors = 'getBindingAccessors';\n\n if (!wrapped[getAccessors]) {\n Logger.error(\"JET's Knockout bindings are not compatible with the current binding \" + 'provider since it does not implement getBindingAccessors()');\n return this;\n }\n\n var custom = {\n getWrapped: function getWrapped() {\n return wrapped;\n }\n };\n provider[instanceName] = custom;\n var methodsToWrap = [];\n methodsToWrap.push(getAccessors, 'nodeHasBindings', 'getBindings');\n methodsToWrap.forEach(function (name) {\n custom[name] = _wrap(wrapped, name, function (n, original) {\n // _wrap() will be producing a function that always calls the 'wrapped'/original method first\n // to handle the binding postprocessor case.\n // Hovewer, for cases when the binding context has been created with .extendBindingContext(),\n // we are replacing the binding evaluaror completely, and we do not need to call the original\n // getAccessors() method. _preWrapGetAccessors() will 'pre-wrap'/replace getAccessors() for that case,\n // so _wrap() will be wrapping the replaced method, and we will not be creating an evaluator in the original\n // getAccessors() method just to throw it away\n if (n !== getAccessors) {\n return original;\n }\n\n return _preWrapGetAccessors(original, wrapped);\n });\n });\n custom.preprocessNode = _wrapPreprocessNode(wrapped);\n\n _patchKoRenderTemplateSource(ko);\n\n _patchKoComponentsLoaders(ko);\n\n _patchKoEvaluatorForCSP(_KoBindingCache);\n\n return this;\n };\n\n this.addPostprocessor = function (postprocessor) {\n var keys = Object.keys(postprocessor);\n keys.forEach(function (key) {\n _postprocessors[key] = _postprocessors[key] || [];\n\n _postprocessors[key].push(postprocessor[key]);\n });\n };\n\n this.registerPreprocessor = function (tagName, preprocessor) {\n _preprocessors[tagName] = preprocessor;\n };\n\n this.getBindingsString = function (node, wrapped, bindingContext) {\n return _getBindingsString(node, wrapped, bindingContext);\n };\n\n this.extendBindingContext = function (context, current, alias, templateAlias, cacheKey) {\n var extension = {\n $current: current,\n $root: undefined,\n $parent: undefined,\n $parents: undefined\n };\n\n if (alias) {\n extension[alias] = current;\n }\n\n if (templateAlias) {\n extension[templateAlias] = current;\n }\n\n if (context) {\n extension = context.extend(extension);\n } else {\n extension.$data = {}; // ensure that KO evaluator does not blow up when $context has no $data property\n }\n\n Object.defineProperty(extension, _OJ_CACHE_SCOPE, {\n value: cacheKey\n });\n Object.defineProperty(extension, _OJ_EXTENDED, {\n value: true\n });\n return extension;\n };\n\n this.createBindingExpressionEvaluator = function (expressionText, bindingContext) {\n if (bindingContext[_OJ_EXTENDED]) {\n return _createReplacementEvaluatorForExtend(expressionText);\n }\n\n var factory = Config.getExpressionEvaluator();\n\n if (factory) {\n var evaluate = factory.createEvaluator(expressionText).evaluate;\n return function ($context) {\n return evaluate([$context.$data || {}, $context]);\n };\n }\n\n var evaluator;\n\n try {\n /* jslint evil:true */\n // eslint-disable-next-line no-new-func\n evaluator = new Function('$context', 'with($context){with($data||{}){return ' // @HTMLUpdateOK\n + expressionText + ';}}'); // binding expression evaluation\n } catch (e) {\n throw new Error(e.message + ' in expression \"' + expressionText + '\"');\n }\n\n return evaluator;\n };\n\n this.createEvaluator = function (expression, bindingContext) {\n return _createEvaluatorViaCache(this.createBindingExpressionEvaluator, expression, bindingContext);\n };\n\n this.getGlobalChangeQueue = function () {\n return _changeQueue;\n };\n\n this.getThrottlePromise = function () {\n return this.getGlobalChangeQueue().getThrottlePromise();\n };\n\n function _wrap(wrapped, name, prewrap) {\n var isHasBindings = name === 'nodeHasBindings';\n\n var impl = function impl(arg0) {\n if (isHasBindings) {\n var type = arg0.nodeType;\n\n if (type !== 1 && type !== 8) {\n return false;\n }\n }\n\n var delegate = prewrap(name, wrapped[name]);\n var ret = delegate ? delegate.apply(wrapped, arguments) : null;\n var postprocessHandlers = _postprocessors[name];\n\n if (postprocessHandlers != null) {\n var originalArgs = arguments;\n postprocessHandlers.forEach(function (handler) {\n var args = Array.prototype.slice.call(originalArgs);\n args.push(ret, wrapped); // Ignore dependencies here so that bindings don't get triggered due to contained evaluations\n\n ret = ko.ignoreDependencies(handler, null, args);\n });\n }\n\n return ret;\n };\n\n return impl;\n }\n\n function _wrapPreprocessNode(wrapped) {\n var originalPreprocessor = wrapped.preprocessNode;\n\n var impl = function impl(node) {\n var preprocessor;\n var ret;\n var obj = null;\n\n if (node.nodeType === 1) {\n preprocessor = _preprocessors[node.nodeName.toLowerCase()];\n }\n\n if (!preprocessor) {\n preprocessor = originalPreprocessor;\n obj = wrapped;\n }\n\n if (preprocessor) {\n ret = ko.ignoreDependencies(preprocessor, obj, [node]);\n }\n\n if (Array.isArray(ret)) {\n ret = _preprocessNewNodes(node, ret);\n }\n\n return ret;\n };\n\n return impl;\n }\n\n function _preprocessNewNodes(originalNode, newNodes) {\n var provider = ko.bindingProvider.instance;\n var ret = newNodes.slice(0);\n var current = newNodes[0];\n var currentIndex = 0;\n var i = 0;\n\n while (currentIndex >= 0) {\n // get the next current element before preprocessing replaces current\n var next = ko.virtualElements.nextSibling(current);\n\n if (current !== originalNode) {\n var insertedNodes = provider.preprocessNode(current);\n\n if (Array.isArray(insertedNodes)) {\n // insert the nodes instead of the item at the index i\n ret.splice.apply(ret, [i, 1].concat(insertedNodes)); // jump over the inserted nodes (-1 represents one node being replaced)\n\n i += insertedNodes.length - 1;\n }\n }\n\n current = next;\n i += 1;\n var nextIndex = currentIndex + 1;\n currentIndex = current ? newNodes.indexOf(current, nextIndex) : -1; // figure out how many virtual children we need to skip (they will be preprocessed after their container is entered)\n\n i += currentIndex - nextIndex; // this value is irrelevent if currentIndex is negative\n }\n\n return ret;\n } // Patches renderTemplateSource() to ensure that the template is parsed with the current document.\n // Otherwise, the custom elements are not being upgraded synchronously\n\n\n function _patchKoRenderTemplateSource(ko) {\n var proto = ko.nativeTemplateEngine.prototype;\n var method = 'renderTemplateSource';\n var delegate = proto[method];\n\n proto[method] = function (templateSource, bindingContext, options, templateDocument) {\n return delegate.call(this, templateSource, bindingContext, options, templateDocument || document\n /* use current document if none is provided*/\n );\n };\n } // This method adds custom KO component loader that overrides defaultLoader.loadTemplate().\n // This is done to ensure that the template is parsed with the current document in order\n // to upgrade custom elements synchronously\n // The custom loader takes precedence over the default loader.\n\n\n function _patchKoComponentsLoaders(ko) {\n ko.components.loaders.unshift({\n loadTemplate: function loadTemplate(name, templateConfig, callback) {\n if (typeof templateConfig === 'string') {\n var nodes = ko.utils.parseHtmlFragment(templateConfig, document);\n ko.components.defaultLoader.loadTemplate(name, nodes, callback);\n } else {\n // Config type is not a string. Let default loader handle it.\n callback(null);\n }\n }\n });\n }\n\n function _preWrapGetAccessors(original, wrappedProvider) {\n var impl = function impl(node, bindingContext) {\n if (bindingContext[_OJ_EXTENDED]) {\n var bindingsString = _getBindingsString(node, wrappedProvider, bindingContext); // _createExtendAccessorsViaCache() returns a function that will produce a map of binding accessors.\n // Note that this function is immediately invoked with the bindingcontext and node as parameters.\n // That will pre-bind binding accessors to the values of $context and $element\n\n\n var accessors = bindingsString ? _createExtendAccessorsViaCache(bindingsString, bindingContext)(bindingContext, node) : null; // Check whether a node is a KO component. We will be using the default evaluator\n // to initialize component binding, while our own evaluator will be handling the\n // rest of the bindings specified with data-bind.\n // This means that in the inlikely case when a KO component is used in an inline\n // template or the oj-bind-foreach, the properties of component will be subject to a\n // possible collision between an aliased data object and a ViewModel property (avery unlikely scenario)\n\n if (node.nodeType === 1 && ko.components.isRegistered(node.tagName.toLowerCase())) {\n var originalAccessors = original.call(wrappedProvider, node, bindingContext);\n var componentEval = originalAccessors.component;\n\n if (componentEval) {\n // copy the component binding accessor from the original accessor map\n accessors = accessors || {};\n accessors.component = componentEval;\n }\n }\n\n return accessors;\n }\n\n return original.call(wrappedProvider, node, bindingContext);\n };\n\n return impl;\n }\n\n function _createExtendAccessorsViaCache(bindingsString, bindingContext) {\n var factory = function factory(expr) {\n // .preProcessBindings() will produce a string that defines a Function retrurning a map\n // with each key being the bidning name, and each value being an evalutor function for\n // binding value\n var rewrittenBindings = ko.expressionRewriting.preProcessBindings(expr, {\n valueAccessors: true\n });\n return _createReplacementEvaluatorForExtend('{' + rewrittenBindings + '}');\n };\n\n return _createEvaluatorViaCache(factory, bindingsString, bindingContext);\n }\n\n function _createReplacementEvaluatorForExtend(expressionText) {\n // Note that the priority order of the binding context and the ViewModel are reversed\n // in this evaluator. This is needed for allowing properties supplied in bindsingProvider.extend()\n // to obscure properties in the ViewModel, which is the behavior one would expect when .extend()\n // is used\n var factory = Config.getExpressionEvaluator();\n\n if (factory) {\n var evaluate = factory.createEvaluator(expressionText).evaluate;\n return function ($context, $element) {\n return evaluate([$context, $context.$data || {}, {\n $element: $element\n }]);\n };\n }\n\n var evaluator;\n\n try {\n /* jslint evil:true */\n // eslint-disable-next-line no-new-func\n evaluator = new Function('$context', '$element', 'with($context.$data||{}){with($context){return ' + // @HTMLUpdateOK\n expressionText + '}}'); // binding expression evaluation\n } catch (e) {\n throw new Error(e.message + ' in expression \"' + expressionText + '\"');\n }\n\n return evaluator;\n }\n\n function _createEvaluatorViaCache(factory, expr, bindingContext) {\n // The absence of binding context indicates that no caching should occur\n if (!bindingContext) {\n return factory(expr, bindingContext);\n }\n\n var cacheScope;\n var scopeMap = _evaluatorCacheMap;\n var key = bindingContext[_OJ_CACHE_SCOPE] || bindingContext;\n cacheScope = scopeMap.get(key);\n\n if (!cacheScope) {\n cacheScope = {};\n scopeMap.set(key, cacheScope);\n }\n\n var func = cacheScope[expr];\n\n if (!func) {\n func = factory(expr, bindingContext);\n cacheScope[expr] = func;\n }\n\n return func;\n }\n\n function _getBindingsString(node, wrapped, bindingContext) {\n var func = wrapped.getBindingsString;\n\n if (func) {\n return func.call(wrapped, node, bindingContext);\n }\n\n switch (node.nodeType) {\n case 1:\n // Element\n return node.getAttribute('data-bind');\n\n case 8:\n // Comment node\n var match = node.nodeValue.match(/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/);\n return match ? match[1] : null;\n\n default:\n return null;\n }\n }\n}", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function (value, key) {\n return function () {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n\t return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n\t return function() {\n\t return callback()[key];\n\t };\n\t });\n\t }", "function makeAccessorsFromFunction(callback) {\n\t return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n\t return function() {\n\t return callback()[key];\n\t };\n\t });\n\t }", "function makeAccessorsFromFunction(callback) {\n\t return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n\t return function() {\n\t return callback()[key];\n\t };\n\t });\n\t }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function makeAccessorsFromFunction(callback) {\n return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "function setBinding(binding, value) {\n if (!data.bindings[binding]) {\n data.bindings[binding] = {\n elements: [],\n lastValue: undefined,\n value: undefined,\n listeners: []\n };\n }\n\n data.bindings[binding].lastValue = data.bindings[binding].value;\n data.bindings[binding].value = value;\n data.bindings[binding].elements.map(element => {\n element.element[element.value] = data.bindings[binding].value;\n });\n}", "function execObjectBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {\n var handlerInitFn = bindingKeyAndHandler.handler[\"init\"],\n handlerUpdateFn = bindingKeyAndHandler.handler[\"update\"],\n bindingKey = bindingKeyAndHandler.key,\n controlsDescendantBindings = false;\n\n // Run init, ignoring any dependencies\n if (typeof handlerInitFn === \"function\") {\n try {\n ignore(function() {\n var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, bindingContext.$data, bindingContext);\n\n // If this binding handler claims to control descendant bindings, make a note of this\n if (initResult && initResult.controlsDescendantBindings) {\n controlsDescendantBindings = true;\n }\n });\n } catch(ex) {\n reportBindingError('init', ex);\n }\n }\n\n // Run update in its own computed wrapper\n if (typeof handlerUpdateFn === \"function\") {\n computed(\n function() {\n try {\n handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, bindingContext.$data, bindingContext);\n } catch (ex) {\n reportBindingError('update', ex);\n }\n },\n null,\n { disposeWhenNodeIsRemoved: node }\n );\n }\n return controlsDescendantBindings;\n }", "function setBinding(binding, value) {\n if (!data.bindings[binding]) {\n data.bindings[binding] = {\n elements: [],\n lastValue: undefined,\n value: undefined,\n listeners: []\n };\n }\n\n data.bindings[binding].lastValue = data.bindings[binding].value;\n data.bindings[binding].value = value;\n data.bindings[binding].elements.map(element => {\n element.element[element.value] = data.bindings[binding].value;\n });\n }", "function binding (obj) {\n return function (name) {\n var _name = '_' + name;\n obj[_name] = obj[_name] || bind(obj, name);\n return obj[_name];\n }\n}", "function makeAccessor2(valueOrAccessor) {\n if (_lodash2.default.isFunction(valueOrAccessor)) return valueOrAccessor;\n return function () {\n return valueOrAccessor;\n };\n}", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function WjValueAccessorFactory(e){return new WjValueAccessor(e)}", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function resolveBindings(bindings) {\r\n var normalized = _createListOfBindings(_normalizeBindings(bindings, new Map()));\r\n return normalized.map(function (b) {\r\n if (b instanceof _NormalizedBinding) {\r\n return new ResolvedBinding_(b.key, [b.resolvedFactory], false);\r\n }\r\n else {\r\n var arr = b;\r\n return new ResolvedBinding_(arr[0].key, arr.map(function (_) { return _.resolvedFactory; }), true);\r\n }\r\n });\r\n}", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "projectComponentBindings(component, bindings) {\n if (bindings) {\n if (bindings.inputs !== undefined) {\n const bindingKeys = Object.getOwnPropertyNames(bindings.inputs);\n for (const bindingName of bindingKeys) {\n component.instance[bindingName] = bindings.inputs[bindingName];\n }\n }\n if (bindings.outputs !== undefined) {\n const eventKeys = Object.getOwnPropertyNames(bindings.outputs);\n for (const eventName of eventKeys) {\n component.instance[eventName] = bindings.outputs[eventName];\n }\n }\n }\n return component;\n }", "projectComponentBindings(component, bindings) {\n if (bindings) {\n if (bindings.inputs !== undefined) {\n const bindingKeys = Object.getOwnPropertyNames(bindings.inputs);\n for (const bindingName of bindingKeys) {\n component.instance[bindingName] = bindings.inputs[bindingName];\n }\n }\n if (bindings.outputs !== undefined) {\n const eventKeys = Object.getOwnPropertyNames(bindings.outputs);\n for (const eventName of eventKeys) {\n component.instance[eventName] = bindings.outputs[eventName];\n }\n }\n }\n return component;\n }", "makeAccessorsFromFunction (callback) {\n return objectMap(ignore(callback),\n (value, key) => () => callback()[key]\n )\n }", "function keyhandlerBindingFactory(keyCode) {\n return {\n init: function (element, valueAccessor, allBindingsAccessor, data, bindingContext) {\n var wrappedHandler, newValueAccessor;\n\n // wrap the handler with a check for the enter key\n wrappedHandler = function (data, event) {\n if (event.keyCode === keyCode) {\n valueAccessor().call(this, data, event);\n }\n };\n\n // create a valueAccessor with the options that we would want to pass to the event binding\n newValueAccessor = function () {\n return {\n keyup: wrappedHandler\n };\n };\n\n // call the real event binding's init function\n ko.bindingHandlers.event.init(element, newValueAccessor, allBindingsAccessor, data, bindingContext);\n }\n };\n }", "function updateBinding(bindingIndex, value) {\n return viewData[bindingIndex] = value;\n}", "function allBindings() {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function toValueIn(obj) {\n return function (name) {\n return obj[name];\n };\n }", "function allBindings () {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor)\n }", "function EZglobal_domBindings()\n\t{\n\t\tObject.keys(EZ).forEach(function(key)\n\t\t{\n\t\t\tif (EZ.functions.dom[key] \t\t\t\t\t//binding already created\n\t\t\t|| EZ.dom.functions.indexOf(key) == -1) \t//not dom related function\n\t\t\t\treturn;\n\n\t\t\tvar fn = 'EZ.functions.dom.' + key + ' = function ' + key + '()\\n'\n\t\t\t\t + '{\\n'\n\t\t\t\t + ' var args = window.EZ.dom.context(this);\\n'\n\t\t\t\t + ' window.EZ.' + key + '.apply(window.EZ, args);\\n'\n\t\t\t\t + '}';\n\t\t\teval(fn);\n\t\t});\n\t}", "function convertPropertyBinding(localResolver,implicitReceiver,expressionWithoutBuiltins,bindingId,form,interpolationFunction){if(!localResolver){localResolver=new DefaultLocalResolver();}var currValExpr=createCurrValueExpr(bindingId);var stmts=[];var visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,interpolationFunction);var outputExpr=expressionWithoutBuiltins.visit(visitor,_Mode.Expression);if(visitor.temporaryCount){for(var i=0;i<visitor.temporaryCount;i++){stmts.push(temporaryDeclaration(bindingId,i));}}else if(form==BindingForm.TrySimple){return new ConvertPropertyBindingResult([],outputExpr);}stmts.push(currValExpr.set(outputExpr).toDeclStmt(DYNAMIC_TYPE,[StmtModifier.Final]));return new ConvertPropertyBindingResult(stmts,currValExpr);}", "function createAccessor(value) {\n return function () { return value; };\n }", "function enableBindings(){bindingsEnabled=true;}", "function addBindings(){\n $(\".edit-field\").bind('input',function(e){\n empty_if_empty();\n disable_button_if_empty();\n enable_button_if_filled();\n });\n\n $(\".edit-field\").bind('focus',function(e){\n empty_if_empty();\n disable_button_if_empty();\n enable_button_if_filled();\n });\n\n addNewGroupAttributes($(\".group\"));\n}", "function Component_BindingHandler() {}", "function rtdbBindAsObject(_a, extraOptions) {\r\n var vm = _a.vm, key = _a.key, document = _a.document, resolve = _a.resolve, reject = _a.reject, ops = _a.ops;\r\n if (extraOptions === void 0) { extraOptions = DEFAULT_OPTIONS; }\r\n var options = Object.assign({}, DEFAULT_OPTIONS, extraOptions);\r\n var listener = document.on('value', function (snapshot) {\r\n ops.set(vm, key, options.serialize(snapshot));\r\n }, reject);\r\n document.once('value', resolve);\r\n return function (reset) {\r\n document.off('value', listener);\r\n if (reset !== false) {\r\n var value = typeof reset === 'function' ? reset() : null;\r\n ops.set(vm, key, value);\r\n }\r\n };\r\n}", "function setKeyBindingProvider(getBindingsFunction) {\n\t\t\tgetBindings = getBindingsFunction;\n\t\t}", "applyBindingSet() {\n // set the attribute mappings\n this.binder.attributeMappings = {\n placeholder: 'placeholder', // map placeholder to placeholder\n 'value-state': '_valueState',\n name: 'name',\n maxlength: 'maxlength', // for the input element itself\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n 'show-value-help-icon': 'showValueHelpIcon',\n 'show-suggestions': 'showSuggestions',\n readonly: '__readonly',\n required: 'required',\n disabled: 'disabled',\n modified: 'modified',\n highlight: 'highlight',\n };\n\n // set attributes to constrains mapping for furo.fat types\n this.binder.fatAttributesToConstraintsMappings = {\n maxlength: 'value._constraints.max.is', // for the fieldnode constraint\n required: 'value._constraints.required.is', // for the fieldnode constraint\n };\n\n // set constrains to attributes mapping for furo.fat types\n this.binder.constraintsTofatAttributesMappings = {\n max: 'maxlength',\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // update the value on input changes\n this.addEventListener('input', val => {\n // update the value\n this.binder.fieldValue = val.target.value;\n\n /**\n * Fired when value changed\n * @type {Event}\n */\n const customEvent = new Event('value-changed', { composed: true, bubbles: true });\n customEvent.detail = val.target.value;\n this.dispatchEvent(customEvent);\n\n // set flag empty on empty strings (for fat types)\n if (val.target.value) {\n this.binder.deleteLabel('empty');\n } else {\n this.binder.addLabel('empty');\n }\n // if something was entered the field is not empty\n this.binder.addLabel('modified');\n });\n }", "function makeValueAccessor(value) {\n return function () {\n return value;\n };\n }", "function wrapApplyOnBindings(bindings)\n\t{\n\t\tbindings.apply = function(key)\n\t\t{\n\t\t\tfor (var index in bindings)\n\t\t\t{\n\t\t\t\tif (index !== 'apply' && typeof bindings[index].apply === 'function')\n\t\t\t\t{\n\t\t\t\t\tif (key) bindings[index].key === key && bindings[index].apply();\n\t\t\t\t\telse bindings[index].apply();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bindings;\n\t}", "function parseBindingsString(bindingValue) {\n \n var result = { };\n \n // if the value doesn't start with '{' then it is\n // a primitive value that we shouldn't parse \n if (bindingValue.charAt(0) !== '{'){\n return bindingValue;\n }\n \n // convert string with bindings to the array by KO\n var array = ko.expressionRewriting.parseObjectLiteral(bindingValue);\n \n for (var i = 0; i < array.length; i++) {\n result[array[i].key] = parseBindingsString(array[i].value);\n } \n \n return result;\n }", "update() {\n this.bindings.forEach((binding) => {\n if (\n binding.element &&\n binding.attribute &&\n binding.element.hasOwnProperty(binding.attribute)\n ) {\n binding.element[binding.attribute] = this.value\n }\n })\n return this\n }", "function editable(value) {\n return function (target, // constructorFN in static class or prototype in instantiated one\n propName, descriptor) {\n descriptor.writable = value;\n };\n}", "function createSpecificAccessors(propName, isWritable, objToCreateIn) {\r\n if (isWritable) {\r\n objToCreateIn[methodNames.setPrefix + propName] = function (propertyValue) {\r\n setValueInternal(propName, propertyValue);\r\n }\r\n\r\n objToCreateIn[methodNames.appendPrefix + propName] = function (propertyValue) {\r\n appendValueInternal(propName, propertyValue);\r\n }\r\n }\r\n\r\n objToCreateIn[methodNames.getPrefix + propName] = function () {\r\n return getValueInternal(propName);\r\n }\r\n }", "function mapValues(obj, fn) {\n obj = _.extend({}, obj);\n for (var k in obj) {\n if (obj.hasOwnProperty(k)) obj[k] = fn(k, obj[k]);\n }\n return obj;\n }", "applyBindingSet() {\n // set the attribute mappings\n this.binder.attributeMappings = {\n label: 'label',\n 'format-pattern': 'formatPattern', // Determines the format, displayed in the input field.\n name: 'name', // Determines the name with which the ui5-date-picker will be submitted in an HTML form.\n 'max-date': 'maxDate', // Determines the maximum date available for selection.\n 'min-date': 'minDate', // Determines the minimum date available for selection.\n 'value-state': 'valueState', // Defines the value state of the ui5-date-picker. Available options are: None, Error, Warning, Success, Information\n 'primary-calendar-type': 'primary-calendar-type', // Determines the calendar type. The input value is formated according to the calendar type and the picker shows the months and years from the specified calendar. Available options are: Gregorian, Islamic, Japanese, Buddhist, Persian\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n error: '_error',\n readonly: '_readonly', // Determines whether the ui5-date-picker is displayed as read-only.\n required: 'required', // Defines whether the ui5-date-picker is required.\n disabled: 'disabled', // Determines whether the ui5-date-picker is displayed as disabled.\n modified: 'modified',\n 'hide-week-numbers': 'hideWeekNumbers', // Defines the visibility of the week numbers column. Note: For calendars other than Gregorian, the week numbers are not displayed regardless of what is set.\n };\n\n // set attributes to constrains mapping for furo.fat types\n this.binder.fatAttributesToConstraintsMappings = {\n 'max-date': 'value._constraints.max.is',\n 'min-date': 'value._constraints.min.is',\n pattern: 'value._constraints.pattern.is',\n required: 'value._constraints.required.is',\n 'min-msg': 'value._constraints.min.message',\n 'max-msg': 'value._constraints.max.message',\n };\n\n // set constrains to attributes mapping for furo.fat types\n this.binder.constraintsTofatAttributesMappings = {\n max: 'max-date',\n min: 'min-date',\n pattern: 'format-pattern',\n required: 'required',\n };\n\n // update the value on input changes\n this.addEventListener('change', val => {\n const { dateValue } = val.target;\n let isoValue = '';\n\n if (val.detail.value === '') {\n this.binder.fieldNode.reset();\n } else if (this.binder.fieldNode) {\n isoValue = dateValue.toISOString();\n if (JSON.stringify(this.binder.fieldValue) !== JSON.stringify(isoValue)) {\n // update the value\n this.binder.fieldNode._value = isoValue;\n }\n }\n /**\n * Fired when datepicker value changed\n * the event detail is the date in IOS 8601 format\n * @type {Event}\n */\n const customEvent = new Event('value-changed', { composed: true, bubbles: true });\n customEvent.detail = isoValue;\n this.dispatchEvent(customEvent);\n\n // set flag empty on empty strings (for fat types)\n if (val.target.value.length) {\n this.binder.deleteLabel('empty');\n } else {\n this.binder.addLabel('empty');\n }\n // if something was entered the field is not empty\n this.binder.addLabel('modified');\n });\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n if (!hasOwnProperty.call(attrs, attrName)) {\n // In the case of user defined a binding with the same name as a method in Object.prototype but didn't set\n // the corresponding attribute. We need to make sure subsequent code won't access to the prototype function\n attrs[attrName] = undefined;\n }\n\n switch (mode) {\n\n case '@':\n if (!attrs[attrName] && !optional) {\n destination[scopeName] = undefined;\n }\n\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n if (!hasOwnProperty.call(attrs, attrName)) {\n // In the case of user defined a binding with the same name as a method in Object.prototype but didn't set\n // the corresponding attribute. We need to make sure subsequent code won't access to the prototype function\n attrs[attrName] = undefined;\n }\n\n switch (mode) {\n\n case '@':\n if (!attrs[attrName] && !optional) {\n destination[scopeName] = undefined;\n }\n\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }", "function createCamundaInOutAttrs(binding, value) {\n var properties = {};\n // camunda:in source(Expression) target\n if (binding.target) {\n properties.target = binding.target;\n if (binding.expression) {\n properties.sourceExpression = value;\n }\n else {\n properties.source = value;\n }\n }\n else \n // camunda:(in|out) variables local\n if (binding.variables) {\n properties.variables = 'all';\n if (binding.variables === 'local') {\n properties.local = true;\n }\n }\n // camunda:out source(Expression) target\n else {\n properties.target = value;\n ['source', 'sourceExpression'].forEach(function (k) {\n if (binding[k]) {\n properties[k] = binding[k];\n }\n });\n }\n return properties;\n}", "function Binding(config, defaults)\n{\n // replace array with multi binding.\n var m;\n\n if (!config) {\n config = {};\n }\n\n if (defaults) {\n for (m in defaults) {\n if (!config[m]) {\n\tconfig[m] = defaults[m];\n }\n }\n }\n\n if (config instanceof Binding) {\n return config;\n }\n\n for (m in config) {\n if (config.hasOwnProperty(m)) {\n this[m] = config[m];\n }\n }\n\n //\n // turn non-functions into map functions, using Binding.AS_MAP\n //\n\n this.viewAdapter = Binding.AS_MAP(this.viewAdapter);\n this.modelAdapter = Binding.AS_MAP(this.modelAdapter);\n\n // optimise the bindings if adaption is not required.\n\n this.read = Binding.OPTIMIZE_READ(this.read, this.viewAdapter);\n this.update = Binding.OPTIMIZE_UPDATE(this.update, this.modelAdapter);\n\n return this;\n}", "function RegisterHandlers(binding) {\n //Map Binding Selection Changed event to the HandleRecordChange function\n binding.addHandlerAsync(Office.EventType.BindingSelectionChanged, RecalculateDistance);\n //Map Binding Data Changed event to the HandleRecordChange function\n binding.addHandlerAsync(Office.EventType.BindingDataChanged, RecalculateDistance);\n\n //Get the name of the field to set data into. This is the third field in the binding\n Office.select(\"bindings#\" + BindingName).getDataAsync({\n coercionType: Office.CoercionType.Table,\n //Get the data for the current row\n rows: \"thisRow\"\n }, function (callback) {\n //Check if the call succeeded\n if (callback.status == Office.AsyncResultStatus.Succeeded) {\n //Store the name(header) of the field\n PostField = callback.value.headers[0][2];\n }\n });\n}", "function makeAccessorsFromFunction(callback) {\n return objectMap(ignore(callback), function(value, key) {\n return function() {\n return callback()[key];\n };\n });\n }", "constructor(binding) {\n super();\n this.binding = binding;\n this.bind = normalBind;\n this.unbind = normalUnbind;\n this.updateTarget = updateAttributeTarget;\n this.isBindingVolatile = Observable.isVolatileBinding(this.binding);\n }", "function functionBinding(name, moduleSource, minArity, isVarArity, permissions, isCps, loc){\n this.name = name;\n this.moduleSource = moduleSource;\n this.minArity = minArity;\n this.isVarArity = isVarArity;\n this.permissions = permissions;\n this.isCps = isCps;\n this.loc = loc;\n this.toString = function(){return this.name;};\n return this;\n}", "function bindings() {\n var model = $parse(attr.clickAnywhereButHere);\n var value = model(scope);\n\n //The value can be a function to afford the user more control over \n //visibility.\n if (isWatchingFunction)\n value = value();\n\n if (!angular.isUndefined(value) && lastActiveValue !== value) {\n if (value)\n $document.bind('mousedown', handler);\n else\n $document.unbind('mousedown', handler);\n\n lastActiveValue = value;\n }\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) { // 8850\n var removeWatchCollection = []; // 8851\n forEach(bindings, function(definition, scopeName) { // 8852\n var attrName = definition.attrName, // 8853\n optional = definition.optional, // 8854\n mode = definition.mode, // @, =, or & // 8855\n lastValue, // 8856\n parentGet, parentSet, compare; // 8857\n // 8858\n switch (mode) { // 8859\n // 8860\n case '@': // 8861\n if (!optional && !hasOwnProperty.call(attrs, attrName)) { // 8862\n destination[scopeName] = attrs[attrName] = void 0; // 8863\n } // 8864\n attrs.$observe(attrName, function(value) { // 8865\n if (isString(value)) { // 8866\n destination[scopeName] = value; // 8867\n } // 8868\n }); // 8869\n attrs.$$observers[attrName].$$scope = scope; // 8870\n if (isString(attrs[attrName])) { // 8871\n // If the attribute has been provided then we trigger an interpolation to ensure // 8872\n // the value is there for use in the link fn // 8873\n destination[scopeName] = $interpolate(attrs[attrName])(scope); // 8874\n } // 8875\n break; // 8876\n // 8877\n case '=': // 8878\n if (!hasOwnProperty.call(attrs, attrName)) { // 8879\n if (optional) break; // 8880\n attrs[attrName] = void 0; // 8881\n } // 8882\n if (optional && !attrs[attrName]) break; // 8883\n // 8884\n parentGet = $parse(attrs[attrName]); // 8885\n if (parentGet.literal) { // 8886\n compare = equals; // 8887\n } else { // 8888\n compare = function(a, b) { return a === b || (a !== a && b !== b); }; // 8889\n } // 8890\n parentSet = parentGet.assign || function() { // 8891\n // reset the change, or we will throw this exception on every $digest // 8892\n lastValue = destination[scopeName] = parentGet(scope); // 8893\n throw $compileMinErr('nonassign', // 8894\n \"Expression '{0}' used with directive '{1}' is non-assignable!\", // 8895\n attrs[attrName], directive.name); // 8896\n }; // 8897\n lastValue = destination[scopeName] = parentGet(scope); // 8898\n var parentValueWatch = function parentValueWatch(parentValue) { // 8899\n if (!compare(parentValue, destination[scopeName])) { // 8900\n // we are out of sync and need to copy // 8901\n if (!compare(parentValue, lastValue)) { // 8902\n // parent changed and it has precedence // 8903\n destination[scopeName] = parentValue; // 8904\n } else { // 8905\n // if the parent can be assigned then do so // 8906\n parentSet(scope, parentValue = destination[scopeName]); // 8907\n } // 8908\n } // 8909\n return lastValue = parentValue; // 8910\n }; // 8911\n parentValueWatch.$stateful = true; // 8912\n var removeWatch; // 8913\n if (definition.collection) { // 8914\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch); // 8915\n } else { // 8916\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); // 8917\n } // 8918\n removeWatchCollection.push(removeWatch); // 8919\n break; // 8920\n // 8921\n case '&': // 8922\n // Don't assign Object.prototype method to scope // 8923\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; // 8924\n // 8925\n // Don't assign noop to destination if expression is not valid // 8926\n if (parentGet === noop && optional) break; // 8927\n // 8928\n destination[scopeName] = function(locals) { // 8929\n return parentGet(scope, locals); // 8930\n }; // 8931\n break; // 8932\n } // 8933\n }); // 8934\n // 8935\n return removeWatchCollection.length && function removeWatches() { // 8936\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) { // 8937\n removeWatchCollection[i](); // 8938\n } // 8939\n }; // 8940\n }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "function makeValueAccessor(value) {\n\t return function() {\n\t return value;\n\t };\n\t }", "getBindingHandler (/* key */) {}", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n switch (mode) {\n\n case '@':\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n // Don't assign Object.prototype method to scope\n if (!attrs.hasOwnProperty(attrName) && optional) break;\n\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }" ]
[ "0.78046787", "0.7790671", "0.7790671", "0.7790671", "0.7790671", "0.7790671", "0.7790671", "0.7790671", "0.7790671", "0.7686497", "0.660013", "0.65840673", "0.65840673", "0.65840673", "0.6436627", "0.6436627", "0.6436627", "0.6436627", "0.6436627", "0.6436627", "0.6436627", "0.6436627", "0.6356069", "0.63387024", "0.6278122", "0.616002", "0.5731604", "0.56952167", "0.56913644", "0.56913644", "0.56913644", "0.56849086", "0.56849086", "0.56849086", "0.56849086", "0.56849086", "0.56849086", "0.56849086", "0.56849086", "0.5630903", "0.56272155", "0.5596219", "0.5594234", "0.5451907", "0.54376453", "0.54376453", "0.54376453", "0.54173154", "0.5415665", "0.5356309", "0.5341966", "0.5341966", "0.5341966", "0.5341966", "0.5341966", "0.5341966", "0.5341966", "0.5341966", "0.52925736", "0.52925736", "0.5248871", "0.51966673", "0.51933074", "0.5189755", "0.5172777", "0.51617515", "0.51551926", "0.51537347", "0.5138365", "0.51323223", "0.5128334", "0.5124396", "0.512101", "0.51140445", "0.50933975", "0.5056363", "0.50529945", "0.50471026", "0.50439256", "0.50417143", "0.50413686", "0.50353146", "0.503438", "0.5031583", "0.5031583", "0.5024013", "0.5011226", "0.49922574", "0.4983349", "0.4981959", "0.4976681", "0.49735677", "0.4970431", "0.49623096", "0.49623096", "0.49623096", "0.49239635", "0.49074894" ]
0.7832013
2
This function is used if the binding provider doesn't include a getBindingAccessors function. It must be called with 'this' set to the provider instance.
function getBindingsAndMakeAccessors(node, context) { return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBindingsAndMakeAccessors (node, context) {\n const bindingsFn = this.providerObject.getBindings.bind(this.providerObject, node, context);\n return this.makeAccessorsFromFunction(bindingsFn)\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function _KoCustomBindingProvider() {\n var _evaluatorCacheMap = new WeakMap();\n\n var _postprocessors = {};\n var _preprocessors = {};\n var _KoBindingCache = {};\n var _OJ_EXTENDED = '_ojExtended';\n var _OJ_CACHE_SCOPE = '_ojCacheScope';\n\n var _changeQueue = new GlobalChangeQueue();\n\n this.install = function () {\n var provider = ko.bindingProvider;\n var instanceName = 'instance';\n var wrapped = provider[instanceName];\n var getAccessors = 'getBindingAccessors';\n\n if (!wrapped[getAccessors]) {\n Logger.error(\"JET's Knockout bindings are not compatible with the current binding \" + 'provider since it does not implement getBindingAccessors()');\n return this;\n }\n\n var custom = {\n getWrapped: function getWrapped() {\n return wrapped;\n }\n };\n provider[instanceName] = custom;\n var methodsToWrap = [];\n methodsToWrap.push(getAccessors, 'nodeHasBindings', 'getBindings');\n methodsToWrap.forEach(function (name) {\n custom[name] = _wrap(wrapped, name, function (n, original) {\n // _wrap() will be producing a function that always calls the 'wrapped'/original method first\n // to handle the binding postprocessor case.\n // Hovewer, for cases when the binding context has been created with .extendBindingContext(),\n // we are replacing the binding evaluaror completely, and we do not need to call the original\n // getAccessors() method. _preWrapGetAccessors() will 'pre-wrap'/replace getAccessors() for that case,\n // so _wrap() will be wrapping the replaced method, and we will not be creating an evaluator in the original\n // getAccessors() method just to throw it away\n if (n !== getAccessors) {\n return original;\n }\n\n return _preWrapGetAccessors(original, wrapped);\n });\n });\n custom.preprocessNode = _wrapPreprocessNode(wrapped);\n\n _patchKoRenderTemplateSource(ko);\n\n _patchKoComponentsLoaders(ko);\n\n _patchKoEvaluatorForCSP(_KoBindingCache);\n\n return this;\n };\n\n this.addPostprocessor = function (postprocessor) {\n var keys = Object.keys(postprocessor);\n keys.forEach(function (key) {\n _postprocessors[key] = _postprocessors[key] || [];\n\n _postprocessors[key].push(postprocessor[key]);\n });\n };\n\n this.registerPreprocessor = function (tagName, preprocessor) {\n _preprocessors[tagName] = preprocessor;\n };\n\n this.getBindingsString = function (node, wrapped, bindingContext) {\n return _getBindingsString(node, wrapped, bindingContext);\n };\n\n this.extendBindingContext = function (context, current, alias, templateAlias, cacheKey) {\n var extension = {\n $current: current,\n $root: undefined,\n $parent: undefined,\n $parents: undefined\n };\n\n if (alias) {\n extension[alias] = current;\n }\n\n if (templateAlias) {\n extension[templateAlias] = current;\n }\n\n if (context) {\n extension = context.extend(extension);\n } else {\n extension.$data = {}; // ensure that KO evaluator does not blow up when $context has no $data property\n }\n\n Object.defineProperty(extension, _OJ_CACHE_SCOPE, {\n value: cacheKey\n });\n Object.defineProperty(extension, _OJ_EXTENDED, {\n value: true\n });\n return extension;\n };\n\n this.createBindingExpressionEvaluator = function (expressionText, bindingContext) {\n if (bindingContext[_OJ_EXTENDED]) {\n return _createReplacementEvaluatorForExtend(expressionText);\n }\n\n var factory = Config.getExpressionEvaluator();\n\n if (factory) {\n var evaluate = factory.createEvaluator(expressionText).evaluate;\n return function ($context) {\n return evaluate([$context.$data || {}, $context]);\n };\n }\n\n var evaluator;\n\n try {\n /* jslint evil:true */\n // eslint-disable-next-line no-new-func\n evaluator = new Function('$context', 'with($context){with($data||{}){return ' // @HTMLUpdateOK\n + expressionText + ';}}'); // binding expression evaluation\n } catch (e) {\n throw new Error(e.message + ' in expression \"' + expressionText + '\"');\n }\n\n return evaluator;\n };\n\n this.createEvaluator = function (expression, bindingContext) {\n return _createEvaluatorViaCache(this.createBindingExpressionEvaluator, expression, bindingContext);\n };\n\n this.getGlobalChangeQueue = function () {\n return _changeQueue;\n };\n\n this.getThrottlePromise = function () {\n return this.getGlobalChangeQueue().getThrottlePromise();\n };\n\n function _wrap(wrapped, name, prewrap) {\n var isHasBindings = name === 'nodeHasBindings';\n\n var impl = function impl(arg0) {\n if (isHasBindings) {\n var type = arg0.nodeType;\n\n if (type !== 1 && type !== 8) {\n return false;\n }\n }\n\n var delegate = prewrap(name, wrapped[name]);\n var ret = delegate ? delegate.apply(wrapped, arguments) : null;\n var postprocessHandlers = _postprocessors[name];\n\n if (postprocessHandlers != null) {\n var originalArgs = arguments;\n postprocessHandlers.forEach(function (handler) {\n var args = Array.prototype.slice.call(originalArgs);\n args.push(ret, wrapped); // Ignore dependencies here so that bindings don't get triggered due to contained evaluations\n\n ret = ko.ignoreDependencies(handler, null, args);\n });\n }\n\n return ret;\n };\n\n return impl;\n }\n\n function _wrapPreprocessNode(wrapped) {\n var originalPreprocessor = wrapped.preprocessNode;\n\n var impl = function impl(node) {\n var preprocessor;\n var ret;\n var obj = null;\n\n if (node.nodeType === 1) {\n preprocessor = _preprocessors[node.nodeName.toLowerCase()];\n }\n\n if (!preprocessor) {\n preprocessor = originalPreprocessor;\n obj = wrapped;\n }\n\n if (preprocessor) {\n ret = ko.ignoreDependencies(preprocessor, obj, [node]);\n }\n\n if (Array.isArray(ret)) {\n ret = _preprocessNewNodes(node, ret);\n }\n\n return ret;\n };\n\n return impl;\n }\n\n function _preprocessNewNodes(originalNode, newNodes) {\n var provider = ko.bindingProvider.instance;\n var ret = newNodes.slice(0);\n var current = newNodes[0];\n var currentIndex = 0;\n var i = 0;\n\n while (currentIndex >= 0) {\n // get the next current element before preprocessing replaces current\n var next = ko.virtualElements.nextSibling(current);\n\n if (current !== originalNode) {\n var insertedNodes = provider.preprocessNode(current);\n\n if (Array.isArray(insertedNodes)) {\n // insert the nodes instead of the item at the index i\n ret.splice.apply(ret, [i, 1].concat(insertedNodes)); // jump over the inserted nodes (-1 represents one node being replaced)\n\n i += insertedNodes.length - 1;\n }\n }\n\n current = next;\n i += 1;\n var nextIndex = currentIndex + 1;\n currentIndex = current ? newNodes.indexOf(current, nextIndex) : -1; // figure out how many virtual children we need to skip (they will be preprocessed after their container is entered)\n\n i += currentIndex - nextIndex; // this value is irrelevent if currentIndex is negative\n }\n\n return ret;\n } // Patches renderTemplateSource() to ensure that the template is parsed with the current document.\n // Otherwise, the custom elements are not being upgraded synchronously\n\n\n function _patchKoRenderTemplateSource(ko) {\n var proto = ko.nativeTemplateEngine.prototype;\n var method = 'renderTemplateSource';\n var delegate = proto[method];\n\n proto[method] = function (templateSource, bindingContext, options, templateDocument) {\n return delegate.call(this, templateSource, bindingContext, options, templateDocument || document\n /* use current document if none is provided*/\n );\n };\n } // This method adds custom KO component loader that overrides defaultLoader.loadTemplate().\n // This is done to ensure that the template is parsed with the current document in order\n // to upgrade custom elements synchronously\n // The custom loader takes precedence over the default loader.\n\n\n function _patchKoComponentsLoaders(ko) {\n ko.components.loaders.unshift({\n loadTemplate: function loadTemplate(name, templateConfig, callback) {\n if (typeof templateConfig === 'string') {\n var nodes = ko.utils.parseHtmlFragment(templateConfig, document);\n ko.components.defaultLoader.loadTemplate(name, nodes, callback);\n } else {\n // Config type is not a string. Let default loader handle it.\n callback(null);\n }\n }\n });\n }\n\n function _preWrapGetAccessors(original, wrappedProvider) {\n var impl = function impl(node, bindingContext) {\n if (bindingContext[_OJ_EXTENDED]) {\n var bindingsString = _getBindingsString(node, wrappedProvider, bindingContext); // _createExtendAccessorsViaCache() returns a function that will produce a map of binding accessors.\n // Note that this function is immediately invoked with the bindingcontext and node as parameters.\n // That will pre-bind binding accessors to the values of $context and $element\n\n\n var accessors = bindingsString ? _createExtendAccessorsViaCache(bindingsString, bindingContext)(bindingContext, node) : null; // Check whether a node is a KO component. We will be using the default evaluator\n // to initialize component binding, while our own evaluator will be handling the\n // rest of the bindings specified with data-bind.\n // This means that in the inlikely case when a KO component is used in an inline\n // template or the oj-bind-foreach, the properties of component will be subject to a\n // possible collision between an aliased data object and a ViewModel property (avery unlikely scenario)\n\n if (node.nodeType === 1 && ko.components.isRegistered(node.tagName.toLowerCase())) {\n var originalAccessors = original.call(wrappedProvider, node, bindingContext);\n var componentEval = originalAccessors.component;\n\n if (componentEval) {\n // copy the component binding accessor from the original accessor map\n accessors = accessors || {};\n accessors.component = componentEval;\n }\n }\n\n return accessors;\n }\n\n return original.call(wrappedProvider, node, bindingContext);\n };\n\n return impl;\n }\n\n function _createExtendAccessorsViaCache(bindingsString, bindingContext) {\n var factory = function factory(expr) {\n // .preProcessBindings() will produce a string that defines a Function retrurning a map\n // with each key being the bidning name, and each value being an evalutor function for\n // binding value\n var rewrittenBindings = ko.expressionRewriting.preProcessBindings(expr, {\n valueAccessors: true\n });\n return _createReplacementEvaluatorForExtend('{' + rewrittenBindings + '}');\n };\n\n return _createEvaluatorViaCache(factory, bindingsString, bindingContext);\n }\n\n function _createReplacementEvaluatorForExtend(expressionText) {\n // Note that the priority order of the binding context and the ViewModel are reversed\n // in this evaluator. This is needed for allowing properties supplied in bindsingProvider.extend()\n // to obscure properties in the ViewModel, which is the behavior one would expect when .extend()\n // is used\n var factory = Config.getExpressionEvaluator();\n\n if (factory) {\n var evaluate = factory.createEvaluator(expressionText).evaluate;\n return function ($context, $element) {\n return evaluate([$context, $context.$data || {}, {\n $element: $element\n }]);\n };\n }\n\n var evaluator;\n\n try {\n /* jslint evil:true */\n // eslint-disable-next-line no-new-func\n evaluator = new Function('$context', '$element', 'with($context.$data||{}){with($context){return ' + // @HTMLUpdateOK\n expressionText + '}}'); // binding expression evaluation\n } catch (e) {\n throw new Error(e.message + ' in expression \"' + expressionText + '\"');\n }\n\n return evaluator;\n }\n\n function _createEvaluatorViaCache(factory, expr, bindingContext) {\n // The absence of binding context indicates that no caching should occur\n if (!bindingContext) {\n return factory(expr, bindingContext);\n }\n\n var cacheScope;\n var scopeMap = _evaluatorCacheMap;\n var key = bindingContext[_OJ_CACHE_SCOPE] || bindingContext;\n cacheScope = scopeMap.get(key);\n\n if (!cacheScope) {\n cacheScope = {};\n scopeMap.set(key, cacheScope);\n }\n\n var func = cacheScope[expr];\n\n if (!func) {\n func = factory(expr, bindingContext);\n cacheScope[expr] = func;\n }\n\n return func;\n }\n\n function _getBindingsString(node, wrapped, bindingContext) {\n var func = wrapped.getBindingsString;\n\n if (func) {\n return func.call(wrapped, node, bindingContext);\n }\n\n switch (node.nodeType) {\n case 1:\n // Element\n return node.getAttribute('data-bind');\n\n case 8:\n // Comment node\n var match = node.nodeValue.match(/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/);\n return match ? match[1] : null;\n\n default:\n return null;\n }\n }\n}", "makeBindingAccessors (bindings, context, node) {\n if (typeof bindings === 'function') {\n return this.makeAccessorsFromFunction(bindings.bind(null, context, node))\n } else {\n return objectMap(bindings, this.makeValueAccessor)\n }\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this.getBindings.bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n\t if (typeof bindings === 'function') {\n\t return makeAccessorsFromFunction(bindings.bind(null, context, node));\n\t } else {\n\t return ko.utils.objectMap(bindings, makeValueAccessor);\n\t }\n\t }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function enableBindings(){bindingsEnabled=true;}", "function setKeyBindingProvider(getBindingsFunction) {\n\t\t\tgetBindings = getBindingsFunction;\n\t\t}", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function makeBindingAccessors(bindings, context, node) {\n if (typeof bindings === 'function') {\n return makeAccessorsFromFunction(bindings.bind(null, context, node));\n } else {\n return ko.utils.objectMap(bindings, makeValueAccessor);\n }\n }", "function Component_BindingHandler() {}", "function enableBindings() {\n bindingsEnabled = true;\n}", "function enableBindings() {\n bindingsEnabled = true;\n}", "function enableBindings() {\n bindingsEnabled = true;\n}", "function disableBindings(){bindingsEnabled=false;}", "function disableBindings() {\n bindingsEnabled = false;\n}", "function disableBindings() {\n bindingsEnabled = false;\n}", "function disableBindings() {\n bindingsEnabled = false;\n}", "static get BINDINGS() { return _PROVIDERS; }", "autoBind() {\n this.bind(\n Object.getOwnPropertyNames(this.constructor.prototype)\n .filter(prop => typeof this[prop] === 'function')\n );\n }", "autoBind(proto) {\n let methods = Object.getOwnPropertyNames(proto || this.constructor.prototype)\n .filter(prop => typeof this[prop] === \"function\");\n\n methods.filter(nonCoreMethods).forEach(method => {\n this[method] = this[method].bind(this);\n });\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "function allBindings() {\n\t return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n\t }", "constructor(binding) {\n super();\n this.binding = binding;\n this.bind = normalBind;\n this.unbind = normalUnbind;\n this.updateTarget = updateAttributeTarget;\n this.isBindingVolatile = Observable.isVolatileBinding(this.binding);\n }", "get _getter() {\n return descriptorForDecorator(this)._getter;\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function bindings() {\n var model = $parse(attr.clickAnywhereButHere);\n var value = model(scope);\n\n //The value can be a function to afford the user more control over \n //visibility.\n if (isWatchingFunction)\n value = value();\n\n if (!angular.isUndefined(value) && lastActiveValue !== value) {\n if (value)\n $document.bind('mousedown', handler);\n else\n $document.unbind('mousedown', handler);\n\n lastActiveValue = value;\n }\n }", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', {\n get: debugGetter,\n enumerable: false\n });\n } else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n }", "function allBindings() {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function methodBindingInterceptor(methodArgs) {\r\n // capture the caller\r\n var caller = this;\r\n // call original method\r\n originalSourceMethod.call(caller, methodArgs);\r\n // forward the call to the binding logic\r\n ComponentBindingConnector.updateBindingValue(caller, bindingDescriptor, methodArgs);\r\n }", "function bindable(){\n\t\t\n\t}", "validateBinding(binding) {\n if (!binding.isBound) {\n return;\n }\n let propertyInfo = getPropertyInfo(binding.sourceExpression, binding.source);\n let rules = undefined;\n const registeredBinding = this.bindings.get(binding);\n if (registeredBinding) {\n rules = registeredBinding.rules;\n registeredBinding.propertyInfo = propertyInfo;\n }\n if (!propertyInfo) {\n return;\n }\n const { object, propertyName } = propertyInfo;\n this.validate({ object, propertyName, rules });\n }", "function Class_checkPrebind(object) {\n if ('prebind' in object && isArray(object.prebind)) {\n object.prebind.each(function(method) {\n object[method] = object[method].bind(object);\n });\n }\n}", "function allBindings () {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor)\n }", "function HostBindingDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function Autobind(_, _2, descriptor) {\n return {\n enumerable: false,\n configurable: true,\n get() {\n return descriptor.value.bind(this);\n }\n };\n}", "function InstallGetter(object, name, getter, attributes) {\n %CheckIsBootstrapping();\n if (typeof attributes == \"undefined\") {\n attributes = DONT_ENUM;\n }\n SetFunctionName(getter, name, \"get\");\n %FunctionRemovePrototype(getter);\n %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes);\n %SetNativeFlag(getter);\n}", "get _bound() {\n return this._events._bound;\n }", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "applyBindingSet() {\n // set the attribute mappings\n this.binder.attributeMappings = {\n placeholder: 'placeholder', // map placeholder to placeholder\n 'value-state': '_valueState',\n name: 'name',\n maxlength: 'maxlength', // for the input element itself\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n 'show-value-help-icon': 'showValueHelpIcon',\n 'show-suggestions': 'showSuggestions',\n readonly: '__readonly',\n required: 'required',\n disabled: 'disabled',\n modified: 'modified',\n highlight: 'highlight',\n };\n\n // set attributes to constrains mapping for furo.fat types\n this.binder.fatAttributesToConstraintsMappings = {\n maxlength: 'value._constraints.max.is', // for the fieldnode constraint\n required: 'value._constraints.required.is', // for the fieldnode constraint\n };\n\n // set constrains to attributes mapping for furo.fat types\n this.binder.constraintsTofatAttributesMappings = {\n max: 'maxlength',\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // update the value on input changes\n this.addEventListener('input', val => {\n // update the value\n this.binder.fieldValue = val.target.value;\n\n /**\n * Fired when value changed\n * @type {Event}\n */\n const customEvent = new Event('value-changed', { composed: true, bubbles: true });\n customEvent.detail = val.target.value;\n this.dispatchEvent(customEvent);\n\n // set flag empty on empty strings (for fat types)\n if (val.target.value) {\n this.binder.deleteLabel('empty');\n } else {\n this.binder.addLabel('empty');\n }\n // if something was entered the field is not empty\n this.binder.addLabel('modified');\n });\n }", "function boundMethod(target, key, descriptor) {\n\t var fn = descriptor.value;\n\n\t if (typeof fn !== 'function') {\n\t throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n\t }\n\n\t // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n\t // getter for the property which is being replaced. This causes infinite\n\t // recursion and an \"Out of stack space\" error.\n\t var definingProperty = false;\n\n\t return {\n\t configurable: true,\n\t get: function get() {\n\t if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n\t return fn;\n\t }\n\n\t var boundFn = fn.bind(this);\n\t definingProperty = true;\n\t Object.defineProperty(this, key, {\n\t value: boundFn,\n\t configurable: true,\n\t writable: true\n\t });\n\t definingProperty = false;\n\t return boundFn;\n\t }\n\t };\n\t}", "function attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', {\n get: debugGetter,\n enumerable: false\n });\n } else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}", "constructor() {\n super();\n this._initBinder();\n }", "function getBindingHandler(bindingKey) {\n return options.bindingProviderInstance.bindingHandlers.get(bindingKey);\n }", "static isGetAccessor(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.GetAccessor;\r\n }", "function overrideAccessors(name, fn) {\n helperAccessors[name] = fn;\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n}", "constructor() { \n autoBind(this); \n }", "_get () {\n throw new Error('_get not implemented')\n }", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + (typeof fn === 'undefined' ? 'undefined' : _typeof(fn)));\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + (typeof fn === 'undefined' ? 'undefined' : _typeof(fn)));\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "appendBinding(binding) { this.bindings.add(binding); }", "appendBinding(binding) { this.bindings.add(binding); }", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function setUpInputBindings() {\n //Called when setting the input field\n //_data.attachChangeEventHandler();\n return;\n}", "_proxyMethods() {\n const methods = this._opts.methods || {}\n for(const method in methods) {\n Object.defineProperty(this, method, {\n get() {\n return methods[method]\n }\n })\n }\n }", "bindMethods() {\n this.onButtonClick = this.onButtonClick.bind(this);\n }", "get dataProvider() {\n throw new Error('[ERROR] Tried to get dataProvider from ' + this);\n }", "getBindingHandler (/* key */) {}", "function createAutoBindPairs(){var __reactAutoBindPairs=[];for(var i=0;i<current.__reactAutoBindPairs.length;i+=2){var name=current.__reactAutoBindPairs[i];var method=proxy[name];if(typeof method==='function'){__reactAutoBindPairs.push(name,method);}}return __reactAutoBindPairs;}", "function createAutoBindPairs(){var __reactAutoBindPairs=[];for(var i=0;i<current.__reactAutoBindPairs.length;i+=2){var name=current.__reactAutoBindPairs[i];var method=proxy[name];if(typeof method==='function'){__reactAutoBindPairs.push(name,method);}}return __reactAutoBindPairs;}", "get bindingCompleted () { return true }", "get bindingCompleted () { return true }", "function linksBinding(){\n return this.resolveLinks ? this.resolveLinks()\n : this.schema.resolveLinks(this.instance);\n}", "get delegations() {\n return {\n ...super.delegations,\n properties: super.delegations.properties.filter(p => p !== 'disabled'),\n attributes: super.delegations.attributes.filter(p => p !== 'disabled'),\n };\n }" ]
[ "0.68577576", "0.6389461", "0.63457733", "0.6320145", "0.62521076", "0.61818063", "0.61818063", "0.61818063", "0.61818063", "0.61818063", "0.61818063", "0.61818063", "0.61818063", "0.6171506", "0.6171506", "0.6171506", "0.6163265", "0.6122634", "0.6079923", "0.60291374", "0.60291374", "0.60291374", "0.60291374", "0.60291374", "0.60291374", "0.60291374", "0.60291374", "0.59633166", "0.59568995", "0.59568995", "0.59568995", "0.5905532", "0.58023226", "0.58023226", "0.58023226", "0.5462858", "0.54561156", "0.5418234", "0.53976625", "0.5327765", "0.5327765", "0.5327765", "0.53276956", "0.5320396", "0.52762455", "0.52762455", "0.52762455", "0.52762455", "0.52762455", "0.52762455", "0.52762455", "0.52762455", "0.52483326", "0.52384484", "0.51573336", "0.5148948", "0.5145524", "0.51454467", "0.5142355", "0.511068", "0.50916415", "0.50810456", "0.5075771", "0.5068218", "0.5057763", "0.5057763", "0.5057763", "0.5057763", "0.5057763", "0.5057763", "0.5054993", "0.5050126", "0.5047805", "0.5014077", "0.50098085", "0.4996725", "0.49894902", "0.49830654", "0.49683523", "0.49587712", "0.4956445", "0.4956445", "0.49435174", "0.49435174", "0.49363807", "0.49363807", "0.49363807", "0.49309823", "0.49278912", "0.49127024", "0.48994026", "0.4896371", "0.48868784", "0.48868784", "0.4885567", "0.4885567", "0.48714972", "0.48708785" ]
0.63668627
4
Use of allBindings as a function is maintained for backwards compatibility, but its use is deprecated
function allBindings() { return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allBindings() {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings () {\n return objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor)\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function allBindings() {\n return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n }", "function enableBindings(){bindingsEnabled=true;}", "function bindAll(obj, rest_methodNames){\n\t var keys = arguments.length > 1?\n\t slice(arguments, 1) : functions(obj);\n\t forEach(keys, function(key){\n\t obj[key] = bind(obj[key], obj);\n\t });\n\t }", "function disableBindings(){bindingsEnabled=false;}", "function Component_BindingHandler() {}", "function enableBindings() {\n bindingsEnabled = true;\n}", "function enableBindings() {\n bindingsEnabled = true;\n}", "function enableBindings() {\n bindingsEnabled = true;\n}", "autoBind() {\n this.bind(\n Object.getOwnPropertyNames(this.constructor.prototype)\n .filter(prop => typeof this[prop] === 'function')\n );\n }", "function disableBindings() {\n bindingsEnabled = false;\n}", "function disableBindings() {\n bindingsEnabled = false;\n}", "function disableBindings() {\n bindingsEnabled = false;\n}", "function wrapApplyOnBindings(bindings)\n\t{\n\t\tbindings.apply = function(key)\n\t\t{\n\t\t\tfor (var index in bindings)\n\t\t\t{\n\t\t\t\tif (index !== 'apply' && typeof bindings[index].apply === 'function')\n\t\t\t\t{\n\t\t\t\t\tif (key) bindings[index].key === key && bindings[index].apply();\n\t\t\t\t\telse bindings[index].apply();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bindings;\n\t}", "function bindable(){\n\t\t\n\t}", "function bindMethods(obj) {\n for (var p in obj) {\n if (isFunction(obj[p])) {\n obj[p] = obj[p].bind(obj);\n }\n }\n}", "mounted() {\n this._requestAllBindings();\n }", "function bindings() {\n var model = $parse(attr.clickAnywhereButHere);\n var value = model(scope);\n\n //The value can be a function to afford the user more control over \n //visibility.\n if (isWatchingFunction)\n value = value();\n\n if (!angular.isUndefined(value) && lastActiveValue !== value) {\n if (value)\n $document.bind('mousedown', handler);\n else\n $document.unbind('mousedown', handler);\n\n lastActiveValue = value;\n }\n }", "bindingAll() {\n this.getAllDataJQ = this.getAllDataJQ.bind(this);\n this.creaTabella = this.creaTabella.bind(this);\n this.deleteRow = this.deleteRow .bind(this);\n this.addRow = this.addRow.bind(this);\n this.editRow = this.editRow.bind(this); \n this.ricreaJson = this.ricreaJson.bind(this); \n this.ricreaArrJson = this.ricreaArrJson.bind(this); \n this.creaJsonRes = this.creaJsonRes.bind(this); \n this.riempiFlussi = this.riempiFlussi.bind(this); \n }", "function bindAll(list){\n\t//alert(\"oldlist=\"+JSON.stringify(list));\n\tvar newlist=[];\n\tfor(var i=0;i<list.length;i++)\n\t\tnewlist.push(bind(list[i]));\n\t//alert(\"newlist=\"+JSON.stringify(newlist));\n\treturn newlist;\n}", "autoBind(proto) {\n let methods = Object.getOwnPropertyNames(proto || this.constructor.prototype)\n .filter(prop => typeof this[prop] === \"function\");\n\n methods.filter(nonCoreMethods).forEach(method => {\n this[method] = this[method].bind(this);\n });\n }", "function iterateEvents(target, obj, bindings, method) {\n if (!obj || !bindings) {\n return;\n }\n\n // Iterate the bindings and bind/unbind them\n _.each(bindings, function (methods, name) {\n var methodNames = methods.split(methodSplitter);\n handler(target, obj, name, methodNames, method);\n });\n }", "function bindAll(scope, data) {\n\n\t\t// wrapper to bind anonymous functions\n\t\tscope.fn = function(fn) {\n\t\t\tvar parentArgs = Array.prototype.slice.call(arguments, 1);\n\t\t\treturn function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\treturn (fn && typeof fn === \"function\") ? fn.apply(scope, parentArgs.concat(args)) : undefined;\n\t\t\t};\n\t\t};\n\n\t\tif (data && data.constructor === Array) {\n\t\t\tdata.forEach(function(l) {\n\t\t\t\tscope[l] = scope[l].bind(scope);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tfor (var l in scope) {\n\t\t\tif (typeof scope[l] === \"function\") {\n\t\t\t\tscope[l] = scope[l].bind(scope);\n\t\t\t}\n\t\t}\n\t}", "function createAutoBindPairs(){var __reactAutoBindPairs=[];for(var i=0;i<current.__reactAutoBindPairs.length;i+=2){var name=current.__reactAutoBindPairs[i];var method=proxy[name];if(typeof method==='function'){__reactAutoBindPairs.push(name,method);}}return __reactAutoBindPairs;}", "function createAutoBindPairs(){var __reactAutoBindPairs=[];for(var i=0;i<current.__reactAutoBindPairs.length;i+=2){var name=current.__reactAutoBindPairs[i];var method=proxy[name];if(typeof method==='function'){__reactAutoBindPairs.push(name,method);}}return __reactAutoBindPairs;}", "function main(){ // Because sigurt loves Java so much\n addBindings();\n empty_if_empty();\n}", "_bindDependencies() {\n this._oc.setBindingState(ObjectContainer.IMA_BINDING_STATE);\n this._config.initBindIma(\n ns,\n this._oc,\n this._config.bind,\n ObjectContainer.IMA_BINDING_STATE\n );\n\n this._config.plugins\n .filter(plugin => typeof plugin.module.initBind === 'function')\n .forEach(plugin => {\n this._oc.setBindingState(\n ObjectContainer.PLUGIN_BINDING_STATE,\n plugin.name\n );\n plugin.module.initBind(ns, this._oc, this._config.bind, plugin.name);\n });\n\n this._oc.setBindingState(ObjectContainer.APP_BINDING_STATE);\n this._config.initBindApp(\n ns,\n this._oc,\n this._config.bind,\n ObjectContainer.APP_BINDING_STATE\n );\n }", "function gatherBindings(node) {\n const bindings =[];\n return Array.from(node.attributes).map(attr => {\n const match = /[(\\[](\\w+)[\\])]/.exec(attr.name);\n if(match) {\n return {\n type: match[0][0] === \"[\" ? 'input' : 'output',\n name: match[1],\n value: attr.value,\n attachTo: node \n };\n }\n }).filter(n => n)\n}", "function getAllDataBind() {\n\n $log.debug('getAllDataBind');\n\n var dataBind = vm.session.source.match(/\\{{2}(.*?)\\}{2}|ng-bind=[\"|'](.*?)[\"|']/igm);\n\n angular.forEach(dataBind, function(data) {\n\n data = data.replace(/\\\"|\\'|ng-bind=|{{|}}/g, '').trim();\n\n if (!$filter('filter')(vm.dataBind, data).length) {\n\n vm.dataBind.push({\n type: 'bind',\n value: data\n });\n\n }\n\n });\n\n $log.debug(dataBind);\n $log.debug(vm.dataBind);\n\n }", "function getListOfBindings(idPropValue, $element) {\n var listOfBindings = [],\n $elementDataBind;\n\n $(\"[data-bind]\", $element).each(function () {\n var input = {};\n $elementDataBind = $(this);\n input[\"el\"] = $elementDataBind;\n input[\"prop\"] = $elementDataBind.attr(\"data-bind\");\n input[\"type\"] = $elementDataBind.attr(\"type\");\n listOfBindings.push(input);\n });\n return listOfBindings;\n }", "appendBinding(binding) { this.bindings.add(binding); }", "appendBinding(binding) { this.bindings.add(binding); }", "function __get_bindings(root, process_event, search){\n\n var evaluate = search || \".//*[contains(text(),'{binding ') or @*[contains(.,'{binding ')]]\";\n \n //probleme! dois recuperer les bindings sur le root aussi!\n var binders = document.evaluate(evaluate,\n root,\n null,\n XPathResult.ORDERED_NODE_ITERATOR_TYPE,\n null);\n \n \n var elem = binders.iterateNext();\n var pg_bindings = [] , bindings = null;\n\n //recupere les elements de la page demandant un binding de données\n while (elem != null){\n //parse tous les attributs pour trouver ceux bindés\n bindings = __get_binding_from_attributes(elem, root, process_event);\n \n \n if (bindings==null || bindings.length == 0){\n elem = binders.iterateNext();\n continue;\n }\n \n __prepare_binding(bindings, process_event, pg_bindings);\n elem = binders.iterateNext();\n\n }\n \n //test aussi pour le root\n bindings = __get_binding_from_attributes(root, root, process_event);\n if (bindings!=null && bindings.length > 0)__prepare_binding(bindings, process_event, pg_bindings);\n \n\n //un tableau avec tous les bindings du model\n return pg_bindings;\n}", "function fillAndTrimBindingsInformation(binding) {\n var _a, _b, _c, _d, _e;\n if (!binding) {\n return;\n }\n (_a = binding.bindings) === null || _a === void 0 ? void 0 : _a.forEach(function (b) {\n // Propagate id down if not defined\n if (!b.app_id) {\n b.app_id = binding.app_id;\n }\n // Compose location\n b.location = binding.location + '/' + b.location;\n // Propagate call down if not defined\n if (!b.call) {\n b.call = binding.call;\n }\n fillAndTrimBindingsInformation(b);\n });\n // Trim branches without app_id\n if (!binding.app_id) {\n binding.bindings = (_b = binding.bindings) === null || _b === void 0 ? void 0 : _b.filter(function (v) { return v.app_id; });\n }\n // Trim branches without calls\n if (!binding.call) {\n binding.bindings = (_c = binding.bindings) === null || _c === void 0 ? void 0 : _c.filter(function (v) { return v.call; });\n }\n // Pull up app_id if needed\n if (((_d = binding.bindings) === null || _d === void 0 ? void 0 : _d.length) && !binding.app_id) {\n binding.app_id = binding.bindings[0].app_id;\n }\n // Pull up call if needed\n if (((_e = binding.bindings) === null || _e === void 0 ? void 0 : _e.length) && !binding.call) {\n binding.call = binding.bindings[0].call;\n }\n}", "getBindingHandler (/* key */) {}", "function resolveBindings(bindings) {\r\n var normalized = _createListOfBindings(_normalizeBindings(bindings, new Map()));\r\n return normalized.map(function (b) {\r\n if (b instanceof _NormalizedBinding) {\r\n return new ResolvedBinding_(b.key, [b.resolvedFactory], false);\r\n }\r\n else {\r\n var arr = b;\r\n return new ResolvedBinding_(arr[0].key, arr.map(function (_) { return _.resolvedFactory; }), true);\r\n }\r\n });\r\n}", "getMenuBindings() {\n let bind = [];\n // sort by weight\n for (let cmd in this.bindings) {\n if (typeof this.bindings[cmd].menu !== 'undefined') {\n bind[this.bindings[cmd].menu.weight - 1] = this.bindings[cmd];\n }\n }\n return bind;\n }", "_bind(...methods) {\n methods.forEach((method) => this[method] = this[method].bind(this));\n }", "function EZglobal_domBindings()\n\t{\n\t\tObject.keys(EZ).forEach(function(key)\n\t\t{\n\t\t\tif (EZ.functions.dom[key] \t\t\t\t\t//binding already created\n\t\t\t|| EZ.dom.functions.indexOf(key) == -1) \t//not dom related function\n\t\t\t\treturn;\n\n\t\t\tvar fn = 'EZ.functions.dom.' + key + ' = function ' + key + '()\\n'\n\t\t\t\t + '{\\n'\n\t\t\t\t + ' var args = window.EZ.dom.context(this);\\n'\n\t\t\t\t + ' window.EZ.' + key + '.apply(window.EZ, args);\\n'\n\t\t\t\t + '}';\n\t\t\teval(fn);\n\t\t});\n\t}", "function createAutoBindPairs() {\n\t var __reactAutoBindPairs = [];\n\n\t for (var i = 0; i < current.__reactAutoBindPairs.length; i += 2) {\n\t var name = current.__reactAutoBindPairs[i];\n\t var method = proxy[name];\n\n\t if (typeof method === 'function') {\n\t __reactAutoBindPairs.push(name, method);\n\t }\n\t }\n\n\t return __reactAutoBindPairs;\n\t }", "function createAutoBindPairs() {\n\t var __reactAutoBindPairs = [];\n\n\t for (var i = 0; i < current.__reactAutoBindPairs.length; i += 2) {\n\t var name = current.__reactAutoBindPairs[i];\n\t var method = proxy[name];\n\n\t if (typeof method === 'function') {\n\t __reactAutoBindPairs.push(name, method);\n\t }\n\t }\n\n\t return __reactAutoBindPairs;\n\t }", "function HostBindingDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }" ]
[ "0.8146741", "0.8140547", "0.79797053", "0.79378724", "0.79378724", "0.79378724", "0.79378724", "0.79378724", "0.79378724", "0.79378724", "0.79378724", "0.68821084", "0.6657657", "0.66334903", "0.65729946", "0.6489872", "0.6489872", "0.6489872", "0.6468127", "0.6436297", "0.6436297", "0.6436297", "0.6287226", "0.6258543", "0.6221016", "0.6215897", "0.6153668", "0.6145949", "0.6142315", "0.6061945", "0.59783953", "0.5952165", "0.59412736", "0.59412736", "0.5937145", "0.59217167", "0.5921267", "0.588438", "0.5883705", "0.5866827", "0.5866827", "0.58578837", "0.5857034", "0.58255893", "0.5823301", "0.5813767", "0.57965887", "0.5795598", "0.5793332", "0.5793332", "0.57860196", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066", "0.5769066" ]
0.79595983
5
Makes a binding like with or if
function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) { ko.bindingHandlers[bindingKey] = { 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { var didDisplayOnLastUpdate, savedNodes; ko.computed(function() { var dataValue = ko.utils.unwrapObservable(valueAccessor()), shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue isFirstRender = !savedNodes, needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate); if (needsRefresh) { // Save a copy of the inner nodes on the initial update, but only if we have dependencies. if (isFirstRender && ko.computedContext.getDependenciesCount()) { savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */); } if (shouldDisplay) { if (!isFirstRender) { ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes)); } ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element); } else { ko.virtualElements.emptyNode(element); } didDisplayOnLastUpdate = shouldDisplay; } }, null, { disposeWhenNodeIsRemoved: element }); return { 'controlsDescendantBindings': true }; } }; ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings ko.virtualElements.allowedBindings[bindingKey] = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleBind(context,fn){return function(value){fn.call(context,value);};}", "function bind(value){var lView=getLView();return bindingUpdated(lView,lView[BINDING_INDEX]++,value)?value:NO_CHANGE;}", "function bindable(){\n\t\t\n\t}", "function simpleBind(context, fn) { // 14775\n return function(value) { // 14776\n fn.call(context, value); // 14777\n }; // 14778\n } // 14779", "function bind(value) {\n return bindingUpdated(viewData[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function () {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n }", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n\t ko.bindingHandlers[bindingKey] = {\n\t 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n\t var didDisplayOnLastUpdate,\n\t savedNodes;\n\t ko.computed(function() {\n\t var rawValue = valueAccessor(),\n\t dataValue = ko.utils.unwrapObservable(rawValue),\n\t shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n\t isFirstRender = !savedNodes,\n\t needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n\t if (needsRefresh) {\n\t // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n\t if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n\t savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n\t }\n\n\t if (shouldDisplay) {\n\t if (!isFirstRender) {\n\t ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n\t }\n\t ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n\t } else {\n\t ko.virtualElements.emptyNode(element);\n\t }\n\n\t didDisplayOnLastUpdate = shouldDisplay;\n\t }\n\t }, null, { disposeWhenNodeIsRemoved: element });\n\t return { 'controlsDescendantBindings': true };\n\t }\n\t };\n\t ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n\t ko.virtualElements.allowedBindings[bindingKey] = true;\n\t}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var rawValue = valueAccessor(),\n dataValue = ko.utils.unwrapObservable(rawValue),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var rawValue = valueAccessor(),\n dataValue = ko.utils.unwrapObservable(rawValue),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function simpleBind(context, fn) {\n return function (value) {\n fn.call(context, value);\n };\n }", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function binding (obj) {\n return function (name) {\n var _name = '_' + name;\n obj[_name] = obj[_name] || bind(obj, name);\n return obj[_name];\n }\n}", "function simpleBind(context, fn) {\n\t return function(value) {\n\t fn.call(context, value);\n\t };\n\t }", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n\t\t\treturn function(value) {\n\t\t\t\tfn.call(context, value);\n\t\t\t};\n\t\t}", "function Bind_A_Oother() {\r\n}", "evalIfBind(expression) {\n if (_.startsWith(expression, 'bind:')) {\n expression = expression.replace(/\\[\\$\\i\\]/g, '[0]');\n return $parseExpr(expression.replace('bind:', ''))(this.app);\n }\n return expression;\n }", "function bindout(tree, binding) {\n if (tree[0] === \"stat\") // We want to process the content of the statement\n tree = tree[1]; // (but still handle the case, we get the content directly)\n var type = tree[0];\n var walker = walkers[type];\n if (walker) {\n return walker.apply(type, tree.slice(1));\n } else {\n return new QMLBinding(binding, tree);\n }\n }", "function Bind_A_A_R() {\r\n}", "function If_bound_bound_literal() {\r\n}", "function newBind(fn,ctx) {\n return function () {\n return fn.call(ctx)\n }\n}", "function Bind_A_Obound() {\r\n}", "Bind(IDispatch, string, string) {\n\n }", "function bind(e,t){return function(){return t.apply(e,arguments)}}", "function If_bound_other_literal() {\r\n}", "function NewBinding(message, name) {\nthis.name = name;\nthis.message = message;\nthis.say = function(){\n return `${this.name} has a message for you: ${this.message}.`\n}\n}", "function Bind_A_Oliteral() {\r\n}", "function i(e){return o.bind(this,e)}", "function bind(lView, value) {\n var bindingIndex = lView[BINDING_INDEX]++;\n storeBindingMetadata(lView);\n return bindingUpdated(lView, bindingIndex, value) ? value : NO_CHANGE;\n}", "function makeWithIfBinding(isWith, isNot, isElse, makeContextCallback) {\n return {\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n\n var didDisplayOnLastUpdate,\n hasElse = detectElse(element),\n completesElseChain = observable(),\n ifElseNodes,\n precedingConditional;\n\n set(element, \"conditional\", {\n elseChainSatisfied: completesElseChain,\n });\n\n if (isElse) {\n precedingConditional = getPrecedingConditional(element);\n }\n\n computed(function() {\n var rawValue = valueAccessor(),\n dataValue = unwrap(rawValue),\n shouldDisplayIf = !isNot !== !dataValue || (isElse && rawValue === undefined), // equivalent to (isNot ? !dataValue : !!dataValue) || isElse && rawValue === undefined\n isFirstRender = !ifElseNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplayIf !== didDisplayOnLastUpdate);\n\n if (precedingConditional && precedingConditional.elseChainSatisfied()) {\n needsRefresh = shouldDisplayIf !== false;\n shouldDisplayIf = false;\n completesElseChain(true);\n } else {\n completesElseChain(shouldDisplayIf);\n }\n\n if (!needsRefresh) { return; }\n\n if (isFirstRender && (getDependenciesCount() || hasElse)) {\n ifElseNodes = cloneIfElseNodes(element, hasElse);\n }\n\n if (shouldDisplayIf) {\n if (!isFirstRender || hasElse) {\n setDomNodeChildren(element, cloneNodes(ifElseNodes.ifNodes));\n }\n } else if (ifElseNodes) {\n setDomNodeChildren(element, cloneNodes(ifElseNodes.elseNodes));\n } else {\n emptyNode(element);\n }\n\n applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n\n didDisplayOnLastUpdate = shouldDisplayIf;\n }, null, { disposeWhenNodeIsRemoved: element });\n\n return { 'controlsDescendantBindings': true };\n },\n allowVirtualElements: true,\n bindingRewriteValidator: false\n };\n }", "bind(key) {\n const binding = new binding_1.Binding(key.toString());\n this.add(binding);\n return binding;\n }", "function If_bound_other_other() {\r\n}", "function BindAndRun() {\r\n}", "function If_bound_bound_other() {\r\n}", "function enableBindings(){bindingsEnabled=true;}", "function Bind_A_A_A() {\r\n}", "function $bind(func, thisValue) {\n return function() {return func.apply(thisValue, arguments)}\n}", "function bind(fn, obj) {\n\t return function binded() {\n\t return fn.apply(obj, arguments);\n\t }\n\t}", "bind(source, context) {\n const behaviors = this.behaviors;\n\n if (this.source === source) {\n return;\n } else if (this.source !== null) {\n const oldSource = this.source;\n this.source = source;\n this.context = context;\n\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n const current = behaviors[i];\n current.unbind(oldSource);\n current.bind(source, context);\n }\n } else {\n this.source = source;\n this.context = context;\n\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n behaviors[i].bind(source, context);\n }\n }\n }", "function bindings() {\n var model = $parse(attr.clickAnywhereButHere);\n var value = model(scope);\n\n //The value can be a function to afford the user more control over \n //visibility.\n if (isWatchingFunction)\n value = value();\n\n if (!angular.isUndefined(value) && lastActiveValue !== value) {\n if (value)\n $document.bind('mousedown', handler);\n else\n $document.unbind('mousedown', handler);\n\n lastActiveValue = value;\n }\n }", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function Component_BindingHandler() {}", "function useBindingEngine(context, target) {\n // Setting vlModule for element\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = target.querySelectorAll(\"[\\\\[\".concat(bind_attribute, \"\\\\]]\"))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var element = _step.value;\n var propName = getBindedAttributeName(element);\n twoWayBinding(context, propName, element);\n } // Setting vlIf\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n vlIfBind(target, context); // Setting vlSubmit for <form> only\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n var _loop = function _loop() {\n var element = _step2.value;\n\n if (element.tagName != 'FORM') {\n throw \"Cannot apply \".concat(submit_attribute, \" to not <form></form>\");\n }\n\n var prop = element.getAttribute(\"[\".concat(submit_attribute, \"]\"));\n element.addEventListener(\"submit\", function (event) {\n event.preventDefault();\n getVariable(context, prop, context, true);\n return false;\n });\n };\n\n for (var _iterator2 = target.querySelectorAll(\"[\\\\[\".concat(submit_attribute, \"\\\\]]\"))[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n _loop();\n } // Setting vlFor\n\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2[\"return\"] != null) {\n _iterator2[\"return\"]();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n var _loop2 = function _loop2() {\n var element = _step3.value;\n var prop = element.getAttribute(\"*\".concat(for_attribute));\n var keys = prop.trim().split(' ');\n var container = element.parentNode;\n var elements = []; // let item of array\n // keys[0] must be let, keys[1] must be var, keys[2] must be of, kyes[3] must be arr\n\n var array = getVariable(context, keys[3], context);\n\n if (keys.length != 4) {\n throw \"invalid vlFor\";\n }\n\n Object.defineProperty(context, keys[3], {\n get: function get() {\n return array;\n },\n set: function set(newArray) {\n // Where variable updated\n // Removing all old elements\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = elements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var innerElement = _step4.value;\n innerElement.parentNode.removeChild(innerElement);\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4[\"return\"] != null) {\n _iterator4[\"return\"]();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n\n elements = [];\n array = newArray;\n\n var populate = function populate(item) {\n var itemElement = element.cloneNode(true);\n\n var itemContext = _defineProperty({}, keys[1], item);\n\n itemElement.innerHTML = useTemplateEngine(itemContext, itemElement.innerHTML); // Setting vlIf and vlClick for inner elements according context is outer context\n\n vlIfBind(itemElement, context);\n vlClickBind(itemElement, context);\n container.appendChild(itemElement);\n elements.push(itemElement);\n }; // Filling new elements\n\n\n if (array instanceof Object) {\n for (var key in array) {\n populate(array[key]);\n }\n } else if (array instanceof Array) {\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = array[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var item = _step5.value;\n populate(item);\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5[\"return\"] != null) {\n _iterator5[\"return\"]();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n }\n },\n configurable: true\n }); // setting array for immediate filling dom element\n\n context[keys[3]] = array; // remove element with [vlFor]=\"let item of items\"\n\n element.parentNode.removeChild(element);\n };\n\n for (var _iterator3 = target.querySelectorAll(\"[\\\\*\".concat(for_attribute, \"]\"))[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n _loop2();\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3[\"return\"] != null) {\n _iterator3[\"return\"]();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n vlClickBind(target, context);\n}", "function Bind_R() {\r\n}", "function bindFn(r, fn, obj) {\n var slice = [].slice,\n args = slice.call(arguments, 3),\n fNOP = function () {\n },\n bound = function () {\n var inArgs = slice.call(arguments);\n return fn.apply(\n this instanceof fNOP ? this : obj,\n (r ? inArgs.concat(args) : args.concat(inArgs))\n );\n };\n fNOP.prototype = fn.prototype;\n bound.prototype = new fNOP();\n return bound;\n }", "function bind(fn, ctx) {\n\t\t return function (a) {\n\t\t var l = arguments.length;\n\t\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t\t };\n\t\t}", "function If_bound_literal_literal() {\r\n}", "function BindFactory(){}", "function wrapApplyOnBindings(bindings)\n\t{\n\t\tbindings.apply = function(key)\n\t\t{\n\t\t\tfor (var index in bindings)\n\t\t\t{\n\t\t\t\tif (index !== 'apply' && typeof bindings[index].apply === 'function')\n\t\t\t\t{\n\t\t\t\t\tif (key) bindings[index].key === key && bindings[index].apply();\n\t\t\t\t\telse bindings[index].apply();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bindings;\n\t}", "constructor(binding) {\n super();\n this.binding = binding;\n this.bind = normalBind;\n this.unbind = normalUnbind;\n this.updateTarget = updateAttributeTarget;\n this.isBindingVolatile = Observable.isVolatileBinding(this.binding);\n }", "function bind(method, context) { // 102\n\t\treturn function() { return method.apply(context, arguments); }; // 103\n\t} // 104", "function If_other_bound_other() {\r\n}", "function bind(key, action) {\r\n bindings[key] = action; \r\n\r\n}", "bindVariable() {\n if (Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_1__[\"authority\"])() && this.bind && this.sys && this.mod) {\n const module = Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_1__[\"getModule\"])(this.sys, this.mod, this.index);\n const binding = module.binding(this.bind);\n this.unbind = binding.bind();\n this.listener = binding.listen().subscribe(value => setTimeout(() => {\n this.model = value;\n this.modelChange.emit(this.model);\n }, 10));\n }\n }", "function Bind_Oliteral() {\r\n}", "function bind(b) {\n var vb = verifyBinding(b);\n if (vb.dir != Direction.v2m) {\n if (vb.toView) {\n vb.toView.addObserver(vb.view);\n if (typeof vb.model.addObserverInit === 'function') {\n vb.model.addObserverInit(vb.toView);\n }\n else {\n vb.model.addObserver(vb.toView);\n }\n }\n else {\n if (typeof vb.model.addObserverInit === 'function') {\n vb.model.addObserverInit(vb.view);\n }\n else {\n vb.model.addObserver(vb.view);\n }\n }\n }\n if (vb.dir != Direction.m2v) {\n if (vb.toModel) {\n vb.view.addObserver(vb.toModel);\n vb.toModel.addObserver(vb.model);\n }\n else {\n vb.view.addObserver(vb.model);\n }\n }\n }", "function repeatBindCallApply() {\n let john = {\n name: 'John',\n age: 26,\n job: 'teacher',\n presentation: function (style, timeOfDay) {\n if (style === 'formal') {\n console.log('Good ' + timeOfDay +\n ', Ladies and gentlemen! I\\'m ' +\n this.name + ', I\\'m a ' +\n this.job + ' and I\\'m ' +\n this.age + ' years old.');\n } else if (style === 'friendly') {\n console.log('Hey! What\\'s up? I\\'m ' +\n this.name + ', I\\'m a ' +\n this.job + ' and I\\'m ' +\n this.age + ' years old. Have a nice ' +\n timeOfDay + '.');\n }\n }\n };\n\n let emily = {\n name: 'Emily',\n age: 35,\n job: 'designer'\n }\n\n john.presentation('formal', 'morning');\n // Copy johns function for emily and use arguments separately.\n john.presentation.call(emily, 'friendly', 'afternoon');\n\n // Same, but arguments as an array.\n // john.presentation.apply(emily, ['friendly', 'afternoon']);\n\n // Store function separatetely for chosen parameters.\n // Currying - Don't repeat same parameters while calling function.\n let johnFriendly = john.presentation.bind(john, 'friendly');\n johnFriendly('morning');\n\n let emilyFormal = john.presentation.bind(emily, 'formal');\n emilyFormal('afternoon');\n\n\n // Another bind example\n let years = [1990, 1965, 1937, 2005, 1998];\n\n function arrCalc(arr, fn) {\n let arrResult = [];\n for (let i = 0; i < arr.length; i++)\n arrResult.push(fn(arr[i]));\n return arrResult;\n }\n\n function calculateAge(el) {\n return 2019 - el;\n }\n\n function isFullAge(limit, el) {\n return el >= limit;\n }\n\n let ages = arrCalc(years, calculateAge);\n var fullJapan = arrCalc(ages, isFullAge.bind(this, 20));\n console.log(ages);\n console.log(fullJapan);\n}", "function bind(context, name) {\n return function() {\n return context[name].apply(context,arguments);\n }\n}", "function bind(fn, thisArg, ...outerArgs){\n// rest operator \n return function(...innerArgs) {\n// spread operator\n return fn.apply(thisArg, [...outerArgs, ...innerArgs]);\n }\n}", "function Fay$$bind(m){\n return function(f){\n return new $(function(){\n var monad = _(m,true);\n return _(f)(monad.value);\n });\n };\n}", "function bind(fn,o) {\n return function() {\n fn.call(o);\n }\n}", "function bind( func, ob ) {\n\treturn function() {\n\t\treturn func.apply( ob, arguments );\n\t};\n}", "function Bindings(p, isFunction, isWith) {\n this.parent = p;\n this.isFunction = isFunction;\n this.isWith = isWith;\n this.currents = {};\n this.params = {};\n this.possibleHoists = {};\n this.dead = false;\n this.inRHS = 0;\n if (isWith) {\n this.withIntervenes = new Map;\n }\n if (isFunction) {\n // frees is a superset of upvars\n this.frees = {};\n this.upvars = new Upvars;\n this.backpatchUpvars = new Map;\n // The set of variables that have escaped permanently. Monotonic\n // per function.\n this.escaped = new Upvars;\n // Backup values for upvars that were assigned to.\n this.upvarOlds = {};\n // Nodes for recursive function calls.\n this.backpatchMus = [];\n }\n\n // Cache nearest function.\n var r = this;\n while (!r.isFunction) {\n r = r.parent;\n }\n this.nearestFunction = r;\n }", "function enableWrappedCallback(bindingKeyOrHandler) {\n setBindingPreprocessor(bindingKeyOrHandler, wrappedCallbackPreprocessor);\n }", "function when(binding, templateOrTemplateBinding) {\n const getTemplate = typeof templateOrTemplateBinding === \"function\" ? templateOrTemplateBinding : () => templateOrTemplateBinding;\n return (source, context) => binding(source, context) ? getTemplate(source, context) : null;\n}", "parseBinding() {\n\t\tthis.nextIf('keyword', 'let');\n\n\t\tlet bindingObject = {\n\t\t\ttype: 'binding',\n\t\t\tname: this.parseIdentifier(),\n\t\t};\n\n\t\tif (this.is('punctuation', ':')) {\n\t\t\tbindingObject.valueType = this.parseBindingValueType();\n\t\t}\n\n\t\t// TODO: optimize\n\t\tif (this.currentFunction !== null) {\n\t\t\tthis.currentFunction.addVariable(\n\t\t\t\tbindingObject.name.value, \n\t\t\t\tbindingObject.valueType.size,\n\t\t\t\tbindingObject.valueType\n\t\t\t);\n\t\t} else {\t\t\t\n\t\t\tthis.main.addVariable(\n\t\t\t\tbindingObject.name.value, \n\t\t\t\tbindingObject.valueType.size,\n\t\t\t\tbindingObject.valueType\t\t\t\t\n\t\t\t);\n\t\t}\n\n\t\treturn bindingObject;\n\t}", "function bindFn(r, fn, obj) {\r\n function FNOP() {\r\n }\r\n\r\n var slice = [].slice,\r\n args = slice.call(arguments, 3),\r\n bound = function () {\r\n var inArgs = slice.call(arguments);\r\n return fn.apply(\r\n this instanceof FNOP ? this :\r\n // fix: y.x=util.bind(fn);\r\n obj || this,\r\n (r ? inArgs.concat(args) : args.concat(inArgs))\r\n );\r\n };\r\n FNOP.prototype = fn.prototype;\r\n bound.prototype = new FNOP();\r\n return bound;\r\n}", "function myBind(func, context, ...args) {\n //call\n //input: context, arg1 ...argN\n //output: func result\n\n //input: the same as func\n //out: func result\n return function (...funcArgs) {\n func.call(context, ...args, ...funcArgs);\n };\n}" ]
[ "0.6507822", "0.6353678", "0.6320383", "0.62198526", "0.61838305", "0.6112397", "0.6111167", "0.6034252", "0.6034252", "0.60112244", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5995306", "0.5975392", "0.59434617", "0.59120345", "0.59057206", "0.59057206", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.5863397", "0.58155966", "0.58002", "0.5651535", "0.56420267", "0.56380075", "0.5606568", "0.56050944", "0.5600931", "0.5556287", "0.55412906", "0.5531946", "0.5530856", "0.5526131", "0.54916674", "0.54896915", "0.5483592", "0.54832286", "0.5474103", "0.545844", "0.5454615", "0.54383767", "0.5435089", "0.5422643", "0.5414893", "0.5412497", "0.5404699", "0.53769404", "0.53769404", "0.53560543", "0.5346615", "0.5345358", "0.5336491", "0.5331384", "0.5300217", "0.5291725", "0.52859443", "0.52847916", "0.5282756", "0.52800566", "0.5275622", "0.52427137", "0.52418035", "0.52367944", "0.5227629", "0.5214681", "0.52009654", "0.519965", "0.51884305", "0.5180182", "0.517793", "0.5166171", "0.5165773", "0.5162107", "0.5158058", "0.5153887" ]
0.6098783
8
Simple calculation based on Levenshtein distance.
function compareArrays(oldArray, newArray, options) { // For backward compatibility, if the third arg is actually a bool, interpret // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }. options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {}); oldArray = oldArray || []; newArray = newArray || []; if (oldArray.length <= newArray.length) return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options); else return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringCompByLevenshteinDistance(s1,s2){\n\tlet longer = s1;\n\tlet shorter = s2;\n\tif (s1.length < s2.length) {\n\t\tlonger = s2;\n\t\tshorter = s1;\n\t}\n\tvar longerLength = longer.length;\n\tif (longerLength == 0) {\n\t\treturn 1.0;\n\t}\n\treturn (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);\n}", "levenshtein_distance(str1, str2) {\n\t str1=str1.toUpperCase()\n\t str2=str2.toUpperCase()\n\t //If strings are empty, return opposite strings length\n\t if(str1.length == 0) return str2.length \n\t if(str2.length == 0) return str1.length\n\t \n\t\t//Create the matrix\n\t var matrix = [];\n\t for(let i = 0; i <= str2.length; i++){\n\t matrix[i] = [i]\n\t }\n\t for(let j = 0; j <= str1.length; j++){\n\t matrix[0][j] = j\n\t }\n\n\t \t//Iterate through i axis, or first word\n\t for(let i = 1; i <= str2.length; i++){\n\t\t\t//Iterate through j axis, or second word\n\t \tfor(let j = 1; j <= str1.length; j++){\n\t \t\t//If characters are equal\n\t\t if(str2.charAt(i-1) === str1.charAt(j-1)){\n\t\t matrix[i][j] = matrix[i-1][j-1]\n\t\t } \n\t else {\n\t matrix[i][j] = Math.min(\n\t matrix[i-1][j-1] + 1, //Represents a substitution\n\t matrix[i][j-1] + 1, //Represents an insertion\n\t matrix[i-1][j] + 1 //Represents a deletion\n\t \t\t\t\t)\n\t }\n\t }\n\t }\n\t //Retruns total amount of subsitutions, insertions and deletions necesseary to transform one word to another\n\t return matrix[str2.length][str1.length]\n\t}", "function levenshteinDistance(str1, str2) {\n const edits = [];\n for (let i = 0; i < str2.length + 1; i++) {\n const row = [];\n for (let j = 0; j < str1.length + 1; j++) {\n row.push(j);\n }\n row[0] = i;\n edits.push(row);\n }\n for (let i = 1; i < str2.length + 1; i++) {\n for (let j = 1; j < str1.length + 1; j++) {\n if (str2[i - 1] === str1[j - 1]) {\n edits[i][j] = edits[i - 1][j - 1];\n } else {\n edits[i][j] = 1 + Math.min(edits[i - 1][j - 1], edits[i - 1][j], edits[i][j - 1]);\n }\n }\n }\n return edits[str2.length][str1.length];\n}", "function levenshteinDistance(str1, str2) {\n const small = str1.length < str2.length ? str1 : str2;\n const big = str1.length >= str2.length ? str1 : str2;\n const evenEdits = [];\n const oddEdits = new Array(small.length + 1);\n for (let j = 0; j < small.length + 1; j++) {\n evenEdits.push(j);\n }\n for (let i = 1; i < big.length + 1; i++) {\n let currentEdits, previousEdits;\n if (i % 2 === 1) {\n currentEdits = oddEdits;\n previousEdits = evenEdits;\n } else {\n currentEdits = evenEdits;\n previousEdits = oddEdits;\n }\n currentEdits[0] = 1;\n for (let j = 1; j < small.length + 1; j++) {\n if (big[i - 1] === small[j - 1]) {\n currentEdits[j] = previousEdits[j - 1];\n } else {\n currentEdits[j] = 1 + Math.min(previousEdits[j - 1], previousEdits[j], currentEdits[j - 1]);\n }\n }\n }\n return big.length % 2 === 0 ? evenEdits[small.length] : oddEdits[small.length];\n}", "function levenshteinDistance(str1, str2) {\n const grid = new Array(str1.length + 1);\n for (let i = 0; i < str1.length + 1; i += 1) {\n grid[i] = new Array(str2.length + 1);\n grid[i][0] = i;\n }\n for (let i = 0; i < str2.length + 1; i += 1) {\n grid[0][i] = i;\n }\n for (let i = 1; i < grid.length; i += 1) {\n const row = grid[i];\n for (let j = 1; j < row.length; j += 1) {\n if (str1[i - 1] === str2[j - 1]) {\n grid[i][j] = grid[i - 1][j - 1];\n } else {\n grid[i][j] =\n 1 +\n Math.min(\n grid[i][j - 1],\n grid[i - 1][j],\n grid[i - 1][j - 1]\n );\n }\n }\n }\n return grid[str1.length][str2.length];\n}", "function levenshteinDistance(str1, str2) {\n let small, big;\n if (str1.length < str2.length) {\n small = str1;\n big = str2;\n } else {\n small = str2;\n big = str1;\n }\n\n const oddEdits = new Array(small.length + 1)\n const evenEdits = [];\n for (let j = 0; j < small.length + 1; j++) {\n evenEdits.push(j);\n }\n\n for (let i = 1; i < big.length + 1; i++) {\n let currEdits, prevEdits;\n if (i % 2 === 0) {\n currEdits = evenEdits;\n prevEdits = oddEdits;\n } else {\n currEdits = oddEdits;\n prevEdits = evenEdits;\n }\n currEdits[0] = i;\n\n for (let j = 1; j < small.length + 1; j++) {\n if (big[i - 1] === small[j - 1]) currEdits[j] = prevEdits[j - 1];\n // similar logic to sol 1\n else\n currEdits[j] =\n 1 + Math.min(prevEdits[j - 1], prevEdits[j], currEdits[j - 1]);\n }\n }\n if (big.length % 2 === 0) return evenEdits[small.length];\n else return oddEdits[small.length];\n} // O(n*m) time, O(min(n, m)) space", "function LevenshteinDistance(string1, string2) {\n // using the Wagner-Fischer algorithm\n // set each element in distance to 0\n const distance = getDistanceMatrix(string1, string2);\n for (let j = 1; j <= string1.length; j++) {\n for (let k = 1; k <= string2.length; k++) {\n \n if (string1[k] == string2[j]) {\n distance[j][k] = distance[j-1][k-1]\n } else{\n distance[j][k] = Math.min(distance[j-1][k] + 1, // a deletion\n distance[j][k-1] + 1, // an insertion\n distance[j-1][k-1] + 1 // a substitution\n );\n }\n }\n }\n return distance[string1.length][string2.length];\n}", "function levenshteinDistance(word1, word2){\n if (word1 === word2) return 0;\n \n const n = word1.length; \n const m = word2.length;\n\n\tif (0 === n) return m;\n if (0 === m) return n;\n \n var d = new Array(m); \n for(var i = 0; i <= m; d[i] = i++); // d = 0..m\n\n let cost, x, e;\n \n\tfor(let i = 0; i < n; i++){\n\t\te = i + 1;\n\t\tfor(var j = 0; j < m; j++){\n\t\t\tcost = (word1[i] === word2[j]) ? 0 : 1;\n x = Math.min(\n\t\t\t\td[j+1] + 1, // insertion\n e + 1, // deletion\n d[j] + cost // substitution\n\t\t\t);\n d[j] = e;\n e = x;\n\t\t}\n\t\td[m] = x;\n\t}\n\n\treturn x;\n}", "function LevenshteinDistance(a, b){\n if(a.length === 0) return b.length; \n if(b.length === 0) return a.length; \n \n var matrix = [];\n \n // increment along the first column of each row\n var i;\n for(i = 0; i <= b.length; i++){\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n var j;\n for(j = 0; j <= a.length; j++){\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for(i = 1; i <= b.length; i++){\n for(j = 1; j <= a.length; j++){\n if(b.charAt(i-1) == a.charAt(j-1)){\n matrix[i][j] = matrix[i-1][j-1];\n } else {\n matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution\n Math.min(matrix[i][j-1] + 1, // insertion\n matrix[i-1][j] + 1)); // deletion\n }\n }\n }\n return matrix[b.length][a.length];\n}", "function levenshtein2(str1, str2) {\r\n\tvar l1 = str1.length, l2 = str2.length;\r\n\tif (Math.min(l1, l2) === 0) { return Math.max(l1, l2); };\r\n\tvar i = 0, j = 0, d = [];\r\n\tfor (i = 0 ; i <= l1 ; i++) { d[i] = []; d[i][0] = i; };\r\n\tfor (j = 0 ; j <= l2 ; j++) { d[0][j] = j; };\r\n\tfor (i = 1 ; i <= l1 ; i++) {\r\n\t\tfor (j = 1 ; j <= l2 ; j++) {\r\n\t\t\td[i][j] = Math.min(\r\n\t\t\td[i - 1][j] + 1,\r\n\t\t\td[i][j - 1] + 1,\r\n\t\t\td[i - 1][j - 1] + (str1.charAt(i - 1) === str2.charAt(j - 1) ? 0 : 1)\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\treturn (1 - (d[l1][l2] / Math.max(l1, l2)));\r\n}", "function getLevenshteinDistance(str1, str2) {\n var len1 = str1.length;\n var len2 = str2.length;\n var matrix = [];\n // fill the first row of the matrix\n for (var i = 0; i <= len1; i++) {\n matrix[i] = [i];\n }\n // fill the first column of the matrix\n for (var j = 0; j <= len2; j++) {\n matrix[0][j] = j;\n }\n // fill the rest of the matrix\n for (var i = 1; i <= len1; i++) {\n for (var j = 1; j <= len2; j++) {\n if (str1.charAt(i - 1) == str2.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n } else {\n matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution\n Math.min(matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j] + 1)); // deletion\n }\n }\n }\n return matrix[len1][len2];\n}", "function levenshteinDistanceDP (token1, token2){\n\n \n const rows = token1.length + 1;\n const columns = token2.length + 1;\n\n // lets create a matrix to hold our values\n const matrix = new Array(rows).fill(null).map(() => Array(columns).fill(0));\n // now we init the first row to equal 0 1 2 3 .... rows\n // these values are derived from the number of operations it would take \n // each substring from \"\", \"h\", \"he\", ..... \"hello\" to match \"\"\n for (let i = 0; i < columns; i++)\n matrix[0][i] = i;\n\n // and the first column to equal 0 1 2 3 .... columns\n // these values are derived from the number of operations it would take \n // each substring from \"\", \"w\", \"wo\", ..... \"world\" to match \"\"\n for (let i = 0; i < columns; i++)\n matrix[0][i] = i;\n \n\n // our operations can only be operations can only be insert, replace or delete\n // 0: subtrings \"\" and \"\" match, so no operation is taken \n // 1: substrings \"h\" and \"w\" require 1 deletion each (h => \"\" and w => \"\")\n // 2: substrings \"he\" and \"wo\" require 2 deletions each (\"he\" => \"\" and \"wo\" => \"\")\n // 3: substrings \"hel\" and \"wor\" require 3 deletions each (\"hel\" => \"\" and \"wor\" =>\"\")\n\n\n // iterate through each cell\n // start at 1,1\n for (let r = 1; r < rows; r++) {\n for (let c = 1; c < columns; c++){\n\n // CASE 1 : the index being checked contains the same letter\n // \"bread\" \"boy\"\n // \"b\" === \"b\"\n // get value in top left corner (no change in edit distance since previous letter)\n // i - 1 because we have extra space in front \"\" empty string\n if(token1.charAt(r-1) === token2.charAt(c -1)) matrix[r][c] = matrix[r-1][c-1];\n\n\n // CASE 2 : the index being checked does not contains the same letter\n // \"hello\" \"world\"\n // \"h\" !== \"w\"\n \n // get minimum value in 2 by 2 neighborhood and add 1\n else {\n let above = matrix[r-1][c];\n let next = matrix[r][c-1];\n let topLeft = matrix[r-1][c-1];\n\n if(above <= next && above <= topLeft) \n matrix[r][c] = above+1;\n \n else if (next <= above && next <= topLeft)\n matrix[r][c] = next+1;\n \n else \n matrix[r][c] = topLeft+1;\n }\n\n }\n }\n\n return matrix[rows-1][columns-1]; // this is total distance for both whole words \n}", "function Levenshtein (str1, str2) {\n var m = str1.length,\n n = str2.length,\n d = [],\n i, j;\n \n if (!m) return n;\n if (!n) return m;\n for (i = 0; i <= m; i++) d[i] = [i];\n for (j = 0; j <= n; j++) d[0][j] = j;\n for (j = 1; j <= n; j++) {\n for (i = 1; i <= m; i++) {\n if (str1[i-1] === str2[j-1]) d[i][j] = d[i - 1][j - 1];\n else d[i][j] = Math.min(d[i-1][j], d[i][j-1], d[i-1][j-1]) + 1;\n }\n }\n return d[m][n];\n }", "function levenshtein(a, b) {\n a = a.toUpperCase();\n b = b.toUpperCase();\n if (a.length === 0) return b.length; \n if (b.length === 0) return a.length; \n\n var matrix = [];\n\n // increment along the first column of each row\n var i;\n for (i = 0; i <= b.length; i++) {\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n var j;\n for (j = 0; j <= a.length; j++) {\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for (i = 1; i <= b.length; i++) {\n for (j = 1; j <= a.length; j++) {\n if (b.charAt(i-1) == a.charAt(j-1)) {\n matrix[i][j] = matrix[i-1][j-1];\n } else {\n matrix[i][j] = Math.min(matrix[i-1][j-1] + 1.5, // substitution\n Math.min(matrix[i][j-1] + 1, // insertion\n matrix[i-1][j] + 1)); // deletion\n }\n }\n }\n\n return matrix[b.length][a.length];\n}", "function levenshtein (s1, s2) {\n // http://kevin.vanzonneveld.net\n // + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)\n // + bugfixed by: Onno Marsman\n // + revised by: Andrea Giammarchi (http://webreflection.blogspot.com)\n // + reimplemented by: Brett Zamir (http://brett-zamir.me)\n // + reimplemented by: Alexander M Beedie\n // * example 1: levenshtein('Kevin van Zonneveld', 'Kevin van Sommeveld');\n // * returns 1: 3\n if (s1 == s2) {\n return 0;\n }\n\n var s1_len = s1.length;\n var s2_len = s2.length;\n if (s1_len === 0) {\n return s2_len;\n }\n if (s2_len === 0) {\n return s1_len;\n }\n\n // BEGIN STATIC\n var split = false;\n try {\n split = !('0')[0];\n } catch (e) {\n split = true; // Earlier IE may not support access by string index\n }\n // END STATIC\n if (split) {\n s1 = s1.split('');\n s2 = s2.split('');\n }\n\n var v0 = new Array(s1_len + 1);\n var v1 = new Array(s1_len + 1);\n\n var s1_idx = 0,\n s2_idx = 0,\n cost = 0;\n for (s1_idx = 0; s1_idx < s1_len + 1; s1_idx++) {\n v0[s1_idx] = s1_idx;\n }\n var char_s1 = '',\n char_s2 = '';\n for (s2_idx = 1; s2_idx <= s2_len; s2_idx++) {\n v1[0] = s2_idx;\n char_s2 = s2[s2_idx - 1];\n\n for (s1_idx = 0; s1_idx < s1_len; s1_idx++) {\n char_s1 = s1[s1_idx];\n cost = (char_s1 == char_s2) ? 0 : 1;\n var m_min = v0[s1_idx + 1] + 1;\n var b = v1[s1_idx] + 1;\n var c = v0[s1_idx] + cost;\n if (b < m_min) {\n m_min = b;\n }\n if (c < m_min) {\n m_min = c;\n }\n v1[s1_idx + 1] = m_min;\n }\n var v_tmp = v0;\n v0 = v1;\n v1 = v_tmp;\n }\n return v0[s1_len];\n}", "totalDistance(arr, str){\n\t\treturn arr.reduce((total,singleElem)=>{\n\t return total+this.levenshtein_distance(singleElem,str)\n\t },0)\n\t}", "function similarity(s1, s2) {\r\n var longer = s1;\r\n var shorter = s2;\r\n if (s1.length < s2.length) {\r\n longer = s2;\r\n shorter = s1;\r\n }\r\n var longerLength = longer.length;\r\n if (longerLength == 0) {\r\n return 1.0;\r\n }\r\n return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);\r\n}", "function getLevenshteinDistance (string, to_match) {\n var distance, row1, row2, i, j;\n for (row2 = [i = 0]; string[i]; ++i) {\n for (row1 = [j = 0]; to_match[++j];) {\n distance = row2[j] = !!i ? \n getMin(\n row2[--j], \n (\n getMin(\n row1[j] - (string[i - 1] === to_match[j]),\n row1[++j] = row2[j]\n )\n )\n ) + 1 : \n j;\n }\n }\n return distance;\n }", "function similarity(s1, s2) {\n var longer = s1;\n var shorter = s2;\n if (s1.length < s2.length) {\n longer = s2;\n shorter = s1;\n }\n var longerLength = longer.length;\n if (longerLength == 0) {\n return 1.0;\n }\n return (\n (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength)\n );\n}", "function similarity(string1, string2) {\n var longer = string1;\n var shorter = string2;\n if (string1.length < string2.length) {\n longer = string2;\n shorter = string1;\n }\n var longerLength = longer.length;\n if (longerLength == 0) {\n return 1.0;\n }\n return (\n (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength)\n );\n}", "function similarity (s1, s2) {\n var longer = s1;\n var shorter = s2;\n if (s1.length < s2.length) {\n longer = s2;\n shorter = s1;\n }\n var longerLength = longer.length;\n if (longerLength == 0) {\n return 1.0;\n }\n return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);\n}", "similarity(str1, str2) {\n\t\t//Check for undefined\n\t\tif(!str1||!str2) return 0\n\t\t//Set longest string\n\t\tvar longer = str1;\n\t\tvar shorter = str2;\n\t\tif (str1.length < str2.length){\n\t\t\tlonger = str2;\n\t\t\tshorter = str1;\n\t\t}\n\t\tvar longerLength = longer.length;\n\t\tif (longerLength == 0) {\n\t\t\treturn 1.0;\n\t\t}\n\t\treturn (longerLength - this.levenshtein_distance(longer, shorter)) / parseFloat(longerLength);\n\t}", "function levenshtein(s, t) {\r\n\tif (s == t) return 0;\r\n\tif (s.length === 0) return t.length;\r\n\tif (t.length === 0) return s.length;\r\n\tvar v0 = new Array(t.length + 1);\r\n\tvar v1 = new Array(t.length + 1);\r\n\tvar i, j;\r\n\tfor (i = 0; i < v0.length; i++) {\r\n\t\tv0[i] = i;\r\n\t}\r\n\tfor (i = 0; i < s.length; i++) {\r\n\t\tv1[0] = i + 1;\r\n\t\tfor (j = 0; j < t.length; j++) {\r\n\t\t\tvar cost = (s[i] == t[j]) ? 0 : 1;\r\n\t\t\tv1[j + 1] = Math.min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost);\r\n\t\t}\r\n\t\tfor (j = 0; j < v0.length; j++) {\r\n\t\t\tv0[j] = v1[j];\r\n\t\t}\r\n\t}\r\n\treturn v1[t.length];\r\n}", "function editDistance(s1, s2) {\n\ts1 = s1.toLowerCase();\n\ts2 = s2.toLowerCase();\n\tvar costs = new Array();\n\tfor (var i = 0; i <= s1.length; i++) {\n var lastValue = i;\n for (var j = 0; j <= s2.length; j++) {\n if (i == 0)\n costs[j] = j;\n else {\n if (j > 0) {\n var newValue = costs[j - 1];\n if (s1.charAt(i - 1) != s2.charAt(j - 1))\n newValue = Math.min(Math.min(newValue, lastValue),\n costs[j]) + 1;\n costs[j - 1] = lastValue;\n lastValue = newValue;\n }\n }\n }\n if (i > 0)\n costs[s2.length] = lastValue;\n }\n return costs[s2.length];\n}", "function levenshtein(a, b) {\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n\n var matrix = [];\n\n // increment along the first column of each row\n var i;\n for (i = 0; i <= b.length; i++) {\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n var j;\n for (j = 0; j <= a.length; j++) {\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for (i = 1; i <= b.length; i++) {\n for (j = 1; j <= a.length; j++) {\n if (b.charAt(i - 1) == a.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n } else {\n matrix[i][j] = Math.min(\n matrix[i - 1][j - 1] + 1, // substitution\n Math.min(\n matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j] + 1\n )\n ); // deletion\n }\n }\n }\n\n return matrix[b.length][a.length];\n}", "function levenshtein(a, b) {\n // How many edit operations separate string a from b?\n // MIT licensed, https://gist.github.com/andrei-\n // Copyright (c) 2011 Andrei Mackenzie and https://github.com/kigiri\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n var tmp, i, j, prev, val, row;\n // swap to save some memory O(min(a,b)) instead of O(a)\n if (a.length > b.length) {\n tmp = a;a = b;b = tmp;\n }\n\n row = Array(a.length + 1);\n // init the row\n for (i = 0; i <= a.length; i++) {\n row[i] = i;\n } // fill in the rest\n for (i = 1; i <= b.length; i++) {\n prev = i;\n for (j = 1; j <= a.length; j++) {\n if (b[i - 1] === a[j - 1]) {\n val = row[j - 1]; // match\n } else {\n val = Math.min(row[j - 1] + 1, // substitution\n Math.min(prev + 1, // insertion\n row[j] + 1)); // deletion\n }\n row[j - 1] = prev;\n prev = val;\n }\n row[a.length] = prev;\n }\n return row[a.length];\n}", "function damerauLevenshteinSellers(term, candidate) {\n\tif (term.length === 0) {\n\t\treturn 1;\n\t}\n\n\tvar rowA = void 0;\n\tvar rowB = new Array(candidate.length + 1).fill(0);\n\n\tfor (var i = 0; i < term.length; i++) {\n\t\tvar rowC = [];\n\t\trowC[0] = i + 1;\n\n\t\tfor (var j = 0; j < candidate.length; j++) {\n\t\t\tvar cost = term[i] === candidate[j] ? 0 : 1;\n\t\t\tvar m = void 0;\n\t\t\tvar min = rowC[j] + 1; //insertion\n\t\t\tif ((m = rowB[j + 1] + 1) < min) min = m; //deletion\n\t\t\tif ((m = rowB[j] + cost) < min) min = m; //substitution\n\t\t\tif (i > 0 && j > 0 && term[i] === candidate[j - 1] && term[i - 1] === candidate[j] && (m = rowA[j - 1] + cost) < min) min = m;\n\t\t\trowC[j + 1] = min;\n\t\t}\n\n\t\trowA = rowB;\n\t\trowB = rowC;\n\t}\n\n\treturn 1 - Math.min.apply(Math, _toConsumableArray(rowB)) / term.length;\n}", "function edit_distance(longstring, shortstring) {\n\tif (longstring == shortstring)\n return 0;\n if (shortstring.length == 0)\n return longstring.length;\n if (longstring.length == 0)\n return shortstring.length;\n var longform = new Array(shortstring.length + 1);\n var shortform = new Array(shortstring.length + 1);\n for (var i = 0; i < longform.length; i++)\n longform[i] = i;\n for (var i = 0; i < longstring.length; i++) {\n shortform[0] = i + 1;\n \n for (var j = 0; j < shortstring.length; j++) {\n var cost = 1;\n if(longstring[i] == shortstring[j])\n cost = 0;\n shortform[j + 1] = Math.min(longform[j] + cost, shortform[j] + 1,\n longform[j + 1] + 1);\n }\n for (var j = 0; j < longform.length; j++) {\n longform[j] = shortform[j];\n }\n }\n return shortform[shortstring.length];\n}", "function levenshtein(s, t) {\n\n // var distance = fastLevenshtein(s, t)\n // return distance;\n if (s === t) {\n return 0;\n }\n var n = s.length, m = t.length;\n if (n === 0 || m === 0) {\n return n + m;\n }\n var x = 0, y, a, b, c, d, g, h, k;\n var p = new Array(n);\n for (y = 0; y < n;) {\n p[y] = ++y;\n }\n\n for (; (x + 3) < m; x += 4) {\n var e1 = t.charCodeAt(x);\n var e2 = t.charCodeAt(x + 1);\n var e3 = t.charCodeAt(x + 2);\n var e4 = t.charCodeAt(x + 3);\n c = x;\n b = x + 1;\n d = x + 2;\n g = x + 3;\n h = x + 4;\n for (y = 0; y < n; y++) {\n k = s.charCodeAt(y);\n a = p[y];\n if (a < c || b < c) {\n c = (a > b ? b + 1 : a + 1);\n }\n else {\n if (e1 !== k) {\n c++;\n }\n }\n\n if (c < b || d < b) {\n b = (c > d ? d + 1 : c + 1);\n }\n else {\n if (e2 !== k) {\n b++;\n }\n }\n\n if (b < d || g < d) {\n d = (b > g ? g + 1 : b + 1);\n }\n else {\n if (e3 !== k) {\n d++;\n }\n }\n\n if (d < g || h < g) {\n g = (d > h ? h + 1 : d + 1);\n }\n else {\n if (e4 !== k) {\n g++;\n }\n }\n p[y] = h = g;\n g = d;\n d = b;\n b = c;\n c = a;\n }\n }\n\n for (; x < m;) {\n var e = t.charCodeAt(x);\n c = x;\n d = ++x;\n for (y = 0; y < n; y++) {\n a = p[y];\n if (a < c || d < c) {\n d = (a > d ? d + 1 : a + 1);\n }\n else {\n if (e !== s.charCodeAt(y)) {\n d = c + 1;\n }\n else {\n d = c;\n }\n }\n p[y] = d;\n c = a;\n }\n h = d;\n }\n return h;\n\n\n }", "function levenshteinSellers(term, candidate) {\n\tif (term.length === 0) {\n\t\treturn 1;\n\t}\n\n\tvar rowA = new Array(candidate.length + 1).fill(0);\n\n\tfor (var i = 0; i < term.length; i++) {\n\t\tvar rowB = [];\n\t\trowB[0] = i + 1;\n\n\t\tfor (var j = 0; j < candidate.length; j++) {\n\t\t\tvar cost = term[i] === candidate[j] ? 0 : 1;\n\t\t\tvar m = void 0;\n\t\t\tvar min = rowB[j] + 1; //insertion\n\t\t\tif ((m = rowA[j + 1] + 1) < min) min = m; //deletion\n\t\t\tif ((m = rowA[j] + cost) < min) min = m; //substitution\n\t\t\trowB[j + 1] = min;\n\t\t}\n\n\t\trowA = rowB;\n\t}\n\n\treturn 1 - Math.min.apply(Math, _toConsumableArray(rowA)) / term.length;\n}", "function editDistance(str1, str2) {\r\n //base cases if either string is empty, return length of the other\r\n if(str1.length === 0) return str2.length; \r\n if(str2.length === 0) return str1.length; \r\n\r\n var matrix = [];\r\n\r\n // increment along the first column of each row\r\n var i;\r\n for(i = 0; i <= str2.length; i++){\r\n matrix[i] = [i];\r\n }\r\n\r\n // increment each column in the first row\r\n var j;\r\n for(j = 0; j <= str1.length; j++){\r\n matrix[0][j] = j;\r\n }\r\n\r\n // Fill in the rest of the matrix\r\n for(i = 1; i <= str2.length; i++){\r\n for(j = 1; j <= str1.length; j++){\r\n \r\n if(str2.charAt(i-1) == str1.charAt(j-1)){\r\n matrix[i][j] = matrix[i-1][j-1];\r\n } else {\r\n matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution\r\n matrix[i][j-1] + 1, // insertion\r\n matrix[i-1][j] + 1); // deletion\r\n }\r\n }\r\n }\r\n\r\n //return the number in the bottom right cell\r\n return matrix[str2.length][str1.length];\r\n}", "function levenshtein_match(tk) {\n var MAX_DIST, match = null, match_dist = 1000;\n if (tk.length > 3)\n MAX_DIST = 2.5;\n else\n MAX_DIST = 1.5;\n\n for (var i in FirstSTMT) {\n var candidate = FirstSTMT[i];\n if (candidate.startsWith('RW_') || candidate.startsWith('KW_'))\n candidate = candidate.substring(3);\n else\n continue;\n var d = levenshtein(tk, candidate);\n if (d <= MAX_DIST && d < match_dist) {\n match = candidate;\n match_dist = d;\n }\n }\n return match;\n}", "function hammingDistance(str1, str2) {\n if (str1.length !== str2.length)\n return \"Input strings must have the same length.\";\n let diff = 0;\n for (let i = 0; i < str1.length; i++) {\n if (str1[i].toLowerCase() !== str2[i].toLowerCase()) diff++;\n }\n return diff;\n}", "function distance(str1, str2) {\n\tvar maxOffset = 5\n\n\tif (str1 == \"\")\n\t\treturn (str2 ==\"\")?0:str2.length\n\tif (str2 == \"\")\n\t\treturn str1.length\n\n\tvar c = 0\n\tvar offset1 = 0\n\tvar offset2 = 0\n\tvar lcs = 0\n\n\twhile ((c + offset1 < str1.length)\n\t\t&& (c + offset2 < str2.length)) {\n\t\tif (str1[c + offset1] == str2[c + offset2])\n\t\t\tlcs++\n\t\telse {\n\t\t\toffset1 = 0\n\t\t\toffset2 = 0\n\n\t\t\tfor (var i = 0; i < maxOffset; ++i) {\n\t\t\t\tif ((c + i < str1.length) && str1[c + i] == str2[c]) {\n\t\t\t\t\toffset1 = i\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((c + i < str2.length) && str1[c] == str2[c+i]) {\n\t\t\t\t\toffset2 = i\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t++c\n\t}\n\n\treturn (str1.length + str2.length)/2 - lcs\n}", "function levenshtein(fst, snd, { logDPMatrix } = {}) {\n const dp = zeros([fst.length + 1, snd.length + 1])\n\n for (let i = 0; i <= fst.length; i++) {\n dp[i][0] = i\n }\n for (let j = 0; j <= snd.length; j++) {\n dp[0][j] = j\n }\n\n for (let i = 1; i <= fst.length; i++) {\n for (let j = 1; j <= snd.length; j++) {\n if (fst[i - 1] === snd[j - 1]) {\n dp[i][j] = dp[i - 1][j - 1]\n } else {\n dp[i][j] = Math.min(\n dp[i - 1][j - 1], // substitute\n dp[i][j - 1], // insert\n dp[i - 1][j] // delete\n ) + 1\n }\n }\n }\n\n if (logDPMatrix) {\n logDPMatrix(dp)\n }\n\n return dp[fst.length][snd.length]\n}", "function calculateLevDistance(src, tgt) {\n if (!(src && tgt)) {\n return false;\n }\n var realCost;\n var srcLength = src.length,\n tgtLength = tgt.length,\n tempString,\n tempLength; // for swapping\n\n var resultMatrix = new Array();\n resultMatrix[0] = new Array(); // Multi dimensional\n\n if (srcLength < tgtLength) {\n tempString = src;\n src = tgt;\n tgt = tempString;\n tempLength = srcLength;\n srcLength = tgtLength;\n tgtLength = tempLength;\n }\n\n for (var c = 0; c < tgtLength + 1; c++) {\n resultMatrix[0][c] = c;\n }\n\n for (var i = 1; i < srcLength + 1; i++) {\n resultMatrix[i] = new Array();\n resultMatrix[i][0] = i;\n for (var j = 1; j < tgtLength + 1; j++) {\n realCost = src.charAt(i - 1) === tgt.charAt(j - 1) ? 0 : 1;\n resultMatrix[i][j] = Math.min(\n resultMatrix[i - 1][j] + 1,\n resultMatrix[i][j - 1] + 1,\n resultMatrix[i - 1][j - 1] + realCost\n );\n }\n }\n\n return resultMatrix[srcLength][tgtLength];\n}", "function HDistance(strArr) {\n let res = 0;\n for (let i = 0; i < strArr[0].length; i++) {\n if (strArr[0][i] !== strArr[1][i]) {\n res++;\n }\n }\n return res;\n}", "function calcDistance(w1, w2) {\n\tlet len1 = w1.length,\n\t\tlen2 = w2.length;\n\n\tlet len = Math.min(len1, len2),\n\tresult = Math.abs(len1 - len2);\n\tfor (let i = 0; i < len; i++) {\n\t\tif (w1[i] !== w2[len]) {\n\t\t\tresult++;\n\t\t}\n\t}\n\treturn result;\n}", "function LevenshteinDistance (source, target, options) {\n options = options || {};\n options.insertion_cost = options.insertion_cost || 1;\n options.deletion_cost = options.deletion_cost || 1;\n options.substitution_cost = options.substitution_cost || 2;\n \n // If usekeyboardmodel is true, then \n // - insertion_cost = option.insertion_cost/2 if the key is in vicinity, or option.insertion_cost otherwise.\n // - substitution_cost = option.substitution_cost/2 if the key is in vicinity of other key, or option.substitution_cost otherwise. \n options.usekeyboardmodel = !!options.usekeyboardmodel;\n \n if (options.usekeyboardmodel) {\n this.keyboardModel = new KeyboardModel();\n }\n \n var sourceLength = source.length;\n var targetLength = target.length;\n var distanceMatrix = [[0]];\n\n for (var row = 1; row <= sourceLength; row++) {\n distanceMatrix[row] = [];\n distanceMatrix[row][0] = distanceMatrix[row-1][0] + options.deletion_cost;\n }\n\n for (var column = 1; column <= targetLength; column++) {\n distanceMatrix[0][column] = distanceMatrix[0][column-1] + options.insertion_cost;\n }\n\n for (var row = 1; row <= sourceLength; row++) {\n for (var column = 1; column <= targetLength; column++) {\n var costToInsert = distanceMatrix[row][column-1] + options.insertion_cost;\n var costToDelete = distanceMatrix[row-1][column] + options.deletion_cost;\n \n var sourceElement = source[row-1];\n var targetElement = target[column-1];\n var costToSubstitute = distanceMatrix[row-1][column-1];\n \n if (options.usekeyboardmodel) {\n if (this.keyboardModel.areNeighbors(source[row], target[column-1])) {\n costToInsert = distanceMatrix[row][column-1] + options.insertion_cost/3;\n }\n }\n \n if (sourceElement !== targetElement) {\n if (options.usekeyboardmodel && this.keyboardModel.areNeighbors(sourceElement, targetElement)) {\n costToSubstitute = costToSubstitute + options.substitution_cost/3;\n } else {\n costToSubstitute = costToSubstitute + options.substitution_cost; \n }\n }\n distanceMatrix[row][column] = Math.min(costToInsert, costToDelete, costToSubstitute);\n }\n }\n console.log(\"Lev(\", source,\", \", target,\", \", options.usekeyboardmodel, \") = \", distanceMatrix[sourceLength][targetLength]);\n return distanceMatrix[sourceLength][targetLength];\n}", "function distance(s1, s2) {\r\n if (typeof(s1) != \"string\" || typeof(s2) != \"string\") return 0;\r\n if (s1.length == 0 || s2.length == 0) \r\n return 0;\r\n s1 = s1.toLowerCase(), s2 = s2.toLowerCase();\r\n var matchWindow = (Math.floor(Math.max(s1.length, s2.length) / 2.0)) - 1;\r\n var matches1 = new Array(s1.length);\r\n var matches2 = new Array(s2.length);\r\n var m = 0; // number of matches\r\n var t = 0; // number of transpositions\r\n\r\n //debug helpers\r\n //console.log(\"s1: \" + s1 + \"; s2: \" + s2);\r\n //console.log(\" - matchWindow: \" + matchWindow);\r\n\r\n // find matches\r\n for (var i = 0; i < s1.length; i++) {\r\n\tvar matched = false;\r\n\r\n\t// check for an exact match\r\n\tif (s1[i] == s2[i]) {\r\n\t\tmatches1[i] = matches2[i] = matched = true;\r\n\t\tm++\r\n\t}\r\n\r\n\t// check the \"match window\"\r\n\telse {\r\n \t// this for loop is a little brutal\r\n \tfor (k = (i <= matchWindow) ? 0 : i - matchWindow;\r\n \t\t(k <= i + matchWindow) && k < s2.length && !matched;\r\n\t\t\tk++) {\r\n \t\tif (s1[i] == s2[k]) {\r\n \t\tif(!matches1[i] && !matches2[k]) {\r\n \t \t\tm++;\r\n \t\t}\r\n\r\n \t matches1[i] = matches2[k] = matched = true;\r\n \t }\r\n \t}\r\n\t}\r\n }\r\n\r\n if(m == 0)\r\n return 0.0;\r\n\r\n // count transpositions\r\n var k = 0;\r\n\r\n for(var i = 0; i < s1.length; i++) {\r\n \tif(matches1[k]) {\r\n \t while(!matches2[k] && k < matches2.length)\r\n k++;\r\n\t if(s1[i] != s2[k] && k < matches2.length) {\r\n t++;\r\n }\r\n\r\n \t k++;\r\n \t}\r\n }\r\n \r\n //debug helpers:\r\n //console.log(\" - matches: \" + m);\r\n //console.log(\" - transpositions: \" + t);\r\n t = t / 2.0;\r\n return (m / s1.length + m / s2.length + (m - t) / m) / 3;\r\n}", "jaroWinklerDistance(s1, s2, dj) {\n if (s1 == s2) {\n return 1 \n }\n else {\n var jaro;\n (typeof(dj) == 'undefined')? jaro = this.distance(s1,s2) : jaro = dj;\n var p = 0.1; //\n var l = 0 // length of the matching prefix\n while(s1[l] == s2[l] && l < 4)\n\tl++;\n \n return jaro + l * p * (1 - jaro);\n }\n }", "function LevenshteinDistance (source, target, options) {\n options = options || {};\n if(isNaN(options.insertion_cost)) options.insertion_cost = 1;\n if(isNaN(options.deletion_cost)) options.deletion_cost = 1;\n if(isNaN(options.substitution_cost)) options.substitution_cost = 1;\n\n var sourceLength = source.length;\n var targetLength = target.length;\n var distanceMatrix = [[0]];\n\n for (var row = 1; row <= sourceLength; row++) {\n distanceMatrix[row] = [];\n distanceMatrix[row][0] = distanceMatrix[row-1][0] + options.deletion_cost;\n }\n\n for (var column = 1; column <= targetLength; column++) {\n distanceMatrix[0][column] = distanceMatrix[0][column-1] + options.insertion_cost;\n }\n\n for (var row = 1; row <= sourceLength; row++) {\n for (var column = 1; column <= targetLength; column++) {\n var costToInsert = distanceMatrix[row][column-1] + options.insertion_cost;\n var costToDelete = distanceMatrix[row-1][column] + options.deletion_cost;\n\n var sourceElement = source[row-1];\n var targetElement = target[column-1];\n var costToSubstitute = distanceMatrix[row-1][column-1];\n if (sourceElement !== targetElement) {\n costToSubstitute = costToSubstitute + options.substitution_cost;\n }\n distanceMatrix[row][column] = Math.min(costToInsert, costToDelete, costToSubstitute);\n }\n }\n return distanceMatrix[sourceLength][targetLength];\n}", "calculer_distance() {}", "function fullStringDistance(a, b) {\n var aLength = a.length;\n var bLength = b.length;\n var table = [];\n\n if (!aLength) {\n return bLength;\n }\n if (!bLength) {\n return aLength;\n }\n\n // Initialize the table axes:\n //\n // 0 1 2 3 4 ... bLength\n // 1\n // 2\n //\n // ...\n //\n // aLength\n //\n for (var x = 0; x <= aLength; ++x) {\n table[x] = [x];\n }\n for (var y = 0; y <= bLength; ++y) {\n table[0][y] = y;\n }\n\n // Populate the rest of the table with a dynamic programming algorithm.\n for (var _x2 = 1; _x2 <= aLength; ++_x2) {\n for (var _y2 = 1; _y2 <= bLength; ++_y2) {\n table[_x2][_y2] = a[_x2 - 1] === b[_y2 - 1] ? table[_x2 - 1][_y2 - 1] : 1 + Math.min(table[_x2 - 1][_y2], // Substitution,\n table[_x2][_y2 - 1], // insertion,\n table[_x2 - 1][_y2 - 1]); // and deletion.\n }\n }\n\n return table[aLength][bLength];\n}", "function calcDistance(g1, s1, p1, g2, s2, p2) {\r\n\tif(p1 == p2 && s1 == s2 && g1 == g2) {\r\n\t\treturn 5\r\n\t}\r\n\telse if(s1 == s2 && g1 == g2) {\r\n\t\treturn 1000 + Math.abs(p1 - p2) * 5\r\n\t}\r\n\telse if(g1 == g2) {\r\n\t\treturn 2700 + Math.abs(s1 - s2) * 95\r\n\t}\r\n\telse {\r\n\t\treturn Math.abs(g1 - g2) * 20000\r\n\t}\r\n}", "function editDistance(a, b) {\n\t if (a.length === 0) return b.length; \n\t if (b.length === 0) return a.length; \n\n\t var matrix = [];\n\n\t // increment along the first column of each row\n\t var i;\n\t for (i = 0; i <= b.length; i++) {\n\t matrix[i] = [i];\n\t }\n\n\t // increment each column in the first row\n\t var j;\n\t for (j = 0; j <= a.length; j++) {\n\t matrix[0][j] = j;\n\t }\n\n\t // Fill in the rest of the matrix\n\t for (i = 1; i <= b.length; i++) {\n\t for (j = 1; j <= a.length; j++) {\n\t if (b.charAt(i-1) == a.charAt(j-1)) {\n\t matrix[i][j] = matrix[i-1][j-1];\n\t } else {\n\t matrix[i][j] = Math.min(\n\t\t\t\t\t\tmatrix[i-1][j-1] + 1, \t\t\t // substitution\n\t Math.min(matrix[i][j-1] + 1, // insertion\n\t matrix[i-1][j] + 1)); \t\t\t // deletion\n\t }\n\t }\n\t }\n\n\t return matrix[b.length][a.length];\n\t}", "function jaroWinklerDistance(s1, s2, dj) {\n var jaro;\n (typeof(dj) == 'undefined') ? jaro = jwdistance(s1, s2) : jaro = dj;\n var p = 0.1; //\n var l = 0 // length of the matching prefix\n while (s1[l] == s2[l] && l < 4)\n l++;\n return jaro + l * p * (1 - jaro);\n}", "checkCorrectness(answer) {\n var playerAnswer = answer.toLowerCase().replace(\", \", \" ja \").replace(\" & \", \" ja \")\n var latinName = this.props.game.currentImage.bone.nameLatin.toLowerCase().replace(\" & \", \" ja \")\n return 100 * StringSimilarity.compareTwoStrings(playerAnswer, latinName); // calculate similarity \n //return 100 * StringSimilarity.compareTwoStrings(this.props.game.currentImage.bone.nameLatin.toLowerCase(), this.state.value.toLowerCase()); // calculate similarity \n }", "function hammingDistance(string1, string2) {\n var total = 0;\n for (var i=0; i<string1.length; i++) {\n if (string1[i] != string2[i]) {\n total = total + 1;\n }\n }\n return total;\n}", "function editDistance1(word) {\n\n}", "function HDistance(strArr) {\n let count = 0;\n for (let i = 0; i < strArr[0].length; i++) {\n if (strArr[0][i] !== strArr[1][i]) count++;\n }\n\n // code goes here\n return count;\n}", "function getDistance(a, b) {\n 'use strict';\n return Math.sqrt((a[0] - b[0]) * (a[0] - b[0]) +\n (a[1] - b[1]) * (a[1] - b[1]));\n}", "function calcDistance(text, unit, reverse) {\n if (unit === 'character') {\n return getCharacterDistance(text, reverse);\n } else if (unit === 'word') {\n return getWordDistance(text, reverse);\n } else if (unit === 'line' || unit === 'block') {\n return text.length;\n }\n\n return 1;\n }", "function JaroWinklerDistance(s1, s2, dj) {\r\n var jaro;\r\n (typeof(dj) == 'undefined')? jaro = distance(s1,s2) : jaro = dj;\r\n var p = 0.1; //\r\n var l = 0 // length of the matching prefix\r\n while(s1[l] == s2[l] && l < 4)\r\n l++;\r\n \r\n return jaro + l * p * (1 - jaro);\r\n}", "function jwdistance(s1, s2) {\n if (typeof(s1) != \"string\" || typeof(s2) != \"string\") return 0;\n if (s1.length == 0 || s2.length == 0) return 0;\n s1 = s1.toLowerCase(), s2 = s2.toLowerCase();\n var matchWindow = (Math.floor(Math.max(s1.length, s2.length) / 2.0)) - 1;\n var matches1 = new Array(s1.length);\n var matches2 = new Array(s2.length);\n var m = 0; // number of matches\n var t = 0; // number of transpositions\n //debug helpers\n //console.log(\"s1: \" + s1 + \"; s2: \" + s2);\n //console.log(\" - matchWindow: \" + matchWindow);\n // find matches\n for (var i = 0; i < s1.length; i++) {\n var matched = false;\n // check for an exact match\n if (s1[i] == s2[i]) {\n matches1[i] = matches2[i] = matched = true;\n m++\n }\n // check the \"match window\"\n else {\n // this for loop is a little brutal\n for (k = (i <= matchWindow) ? 0 : i - matchWindow;\n (k <= i + matchWindow) && k < s2.length && !matched;\n k++) {\n if (s1[i] == s2[k]) {\n if (!matches1[i] && !matches2[k]) {\n m++;\n }\n matches1[i] = matches2[k] = matched = true;\n }\n }\n }\n }\n if (m == 0) return 0.0;\n // count transpositions\n var k = 0;\n for (var i = 0; i < s1.length; i++) {\n if (matches1[k]) {\n while (!matches2[k] && k < matches2.length)\n k++;\n if (s1[i] != s2[k] && k < matches2.length) {\n t++;\n }\n k++;\n }\n }\n //debug helpers:\n //console.log(\" - matches: \" + m);\n //console.log(\" - transpositions: \" + t);\n t = t / 2.0;\n return (m / s1.length + m / s2.length + (m - t) / m) / 3;\n}", "function sellers_levenshtein (pattern, txt, k) {\n if (pattern === txt) return 0;\n\n let smallest_distance = k + 1;\n let prev_diag_value;\n let col = [0];\n let j;\n let i = pattern.length;\n\n while (i--) col[i] = i;\n\n for (j = 1; j <= txt.length; j++) {\n prev_diag_value = 0;\n\n for (i = 1; i <= pattern.length; i++) {\n [prev_diag_value, col[i]] = [col[i], prev_diag_value];\n\n if (pattern[i-1] === txt[j-1]) continue;\n else col[i] = 1 + Math.min(col[i], col[i-1], prev_diag_value);\n }\n\n if (col[i-1] === 0) return col[i-1];\n if (col[i-1] < smallest_distance) smallest_distance = col[i-1];\n }\n\n if (smallest_distance <= k) return smallest_distance;\n else return -1;\n}", "function HamingDistance(strArr) {\n\t// strArr[0].length;\n\tlet count = 0;\n\tfor (let i = 0; i < strArr[0].length; i++) {\n\t\tif (strArr[0][i] != strArr[1][i]) {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\n\treturn count;\n}", "function charsimilarity(record1, record2) {\n\t\tvar fields1 = record1.controlfield.filter(isDescriptiveField);\n\t\tvar fields2 = record2.controlfield.filter(isDescriptiveField);\n\t\n\t\tvar dataFields1 = record1.datafield.filter(isDescriptiveField);\n\t\tvar dataFields2 = record2.datafield.filter(isDescriptiveField);\n\n\t\tvar normalizations = ['toSpace(\"-\")', 'delChars(\"\\':,.\")', 'trimEnd', 'upper', 'utf8norm', 'removediacs', 'removeEmpty'];\n\n\t\tvar normalized1 = fields1.concat(normalize(clone(dataFields1), normalizations) );\n\t\tvar normalized2 = fields2.concat(normalize(clone(dataFields2), normalizations) );\n\n\t\tfields1 = fields1.concat(dataFields1);\n\t\tfields2 = fields2.concat(dataFields2);\n\n\t\tvar str1 = normalizeFuncs.fieldsToString( fields1 );\n\t\tvar str2 = normalizeFuncs.fieldsToString( fields2 );\n\t\n\t\tvar set1 = str1;\n\t\tvar set2 = str2;\n\n\t\tfunction getData() {\n\t\t\treturn {\n\t\t\t\tfields: [fields1, fields2],\n\t\t\t\tnormalized: [normalized1, normalized2]\n\t\t\t};\n\t\t}\n\n\t\tfunction check() {\n\n\t\t\t//if other is missing, then we skip the step\n\t\t\tif (set1.length === 0 || set2.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar change = compareFuncs.levenshtein(set1, set2 );\n\t\t\n\t\t\tif (change > 0.60) {\n\t\t\t\treturn change;\n\t\t\t}\n\n\t\t\t// Otherwise suggest that these are different records.\n\t\t\treturn SURELY_NOT;\n\t\t}\n\n\t\treturn {\n\t\t\tcheck: check,\n\t\t\tgetData: getData\n\t\t};\n\t}", "function similarity(query, testString) {\n\t\t// console.log(query);\n\t\t// console.log(testString);\n\n\t\t// ignore case sensitivity\t\t\n\t\tquery = query.toLowerCase();\n\t\ttestString = testString.toLowerCase();\t\n\t\tvar i = 0, j = 0, total = 0;\n\t\twhile(i < query.length && j < testString.length) {\t\t\t\n\t\t\ttotal += Math.abs(query.charCodeAt(i) - testString.charCodeAt(j));\t\t\t\n\t\t\ti++;\n\t\t\tj++;\n\t\t}\t\t\n\n\t\t// case: the query string is longer\n\t\twhile(i < query.length) {\n\t\t\ttotal += DEFAULT_SCORE;\n\t\t\ti++;\n\t\t}\n\n\t\t// case: the testString is longer\n\t\twhile(j < testString.length) {\n\t\t\ttotal += DEFAULT_SCORE;\n\t\t\tj++;\n\t\t}\n\t\t\n\t\treturn total;\n\t}", "function weightDistance (pt1,pt2) {\n const xCost = 1\n const yCost = 1\n const zCost = 1\n\n return parseFloat(Math.sqrt(xCost*Math.pow((pt1.x - pt2.x),2)+\n yCost*Math.pow((pt1.y - pt2.y),2)+\n zCost*Math.pow((pt1.z - pt2.z),2)))\n}", "function distance(a, b) {\n return Math.sqrt(distanceSq(a, b));\n }", "function minDistance(word1, word2) {\n // equation is length of w1 + length of w2 - (2 * length of longest common subsequence)\n // in case of total mismatch, the answer will just be the combined lengths\n // * 2 makes sense since each mismatch requires 2 operations\n \n const matrix = [];\n for(let i = 0; i < word1.length + 1; i++) {\n matrix.push([])\n for(let j = 0; j < word2.length + 1; j++) {\n matrix[i].push(0)\n }\n }\n console.log(matrix)\n \n for(let i = 0; i <= word1.length; i++) {\n for(let j = 0; j <= word2.length; j++) {\n console.log()\n if(i === 0 || j === 0) continue\n if(word1[i - 1] === word2[j - 1]) {\n matrix[i][j] = matrix[i - 1][j - 1] + 1;\n } else {\n matrix[i][j] = Math.max(matrix[i - 1][j], matrix[i][j - 1])\n }\n }\n }\n \n \n return word1.length + word2.length - (2 * matrix[word1.length][word2.length])\n}", "function getHammingDistance(str1, str2){ \n\tvar cnt=0, i=0;\n\t\n\tif(str1.length != str2.length) console.log(\"Error! Strings are not equal!\"); //prints error msg if length of both string is NOT equal\n\tif(str1.length <= 0 || str2.length <= 0) console.log(\"Invalid string length!\"); //prints error msg if length is invalid (negative or zero)\n\telse{\n\t\twhile(i<str1.length){\n\t\t\tif(str1[i]!=str2[i]) //if characters in ith position is NOT equal\n\t\t\t\tcnt++;\t//updates counter\t\t\t\t\n\t\t\ti++; //updates i\n\t\t}\n\t\treturn(cnt);\n\t}\t\n}", "function hammingDistance(textA, textB) {\n if (textA.length !== textB.length) {\n throw new Error('String lengths are not equal');\n }\n\n let distance = 0;\n\n for (let i = 0; i < textA.length; i++) {\n if (textA[i].toLowerCase() !== textB[i].toLowerCase()) {\n distance++;\n }\n }\n\n return distance;\n}", "getCosineDistance(word1, word2) {\n\t\tvar vec1 = this._getVector(word1);\n\t\tvar vec2 = this._getVector(word2);\n\t\tvar dotProduct = vec1.dot(vec2).asScalar();\n\t\tvar abs1 = vec1.norm(2);\n\t\tvar abs2 = vec2.norm(2);\n\t\tvar cosineDistance = dotProduct.div(abs1).div(abs2);\n\t\treturn cosineDistance.dataSync()[0];\n\t}", "function mostSimilarName(name, otherNames) {\n if (name.length >= minLength) {\n var proposedName;\n var proposedNamesDistance = Number.MAX_VALUE;\n for (var i = 0; i < otherNames.length; i++) {\n var other = otherNames[i];\n if (other !== name && other.length >= minLength) {\n var distance = sandbox.levenshtein(name, other);\n if (distance <= maxDiff && distance < proposedNamesDistance) {\n proposedName = other;\n proposedNamesDistance = distance;\n }\n }\n }\n if (proposedName)\n return proposedName;\n }\n }", "function search(w1, w2)\n{\n let l1 = w1.length;\n let l2 = w2.length;\n console.log(w1, w2);\n let ch,c,maxc=0;\n let i,j;\n\n for(i=0;i<l1;i++)\n {\n ch = w1.charAt(i);\n\n for(j=0;j<l2;j++)\n {\n if(ch === w2.charAt(j))\n {\n c=1;\n tempi = i;\n tempj = j;\n\n\n while (w1.charAt(++tempi) === w2.charAt(++tempj))\n {\n c++;\n if(tempi+1>l1 || tempj+1>l2)\n {\n c--;\n break;\n }\n\n }\n\n\n }\n\n\n if(c>maxc)\n {\n maxc = c;\n }\n\n }\n }\n let perc_match = maxc/l1*100;\n console.log(perc_match)\n return perc_match;\n}", "function comparePhrases(str1, str2){\n\n str1 = \"\"+str1\n str2 = \"\"+str2\n\n score = 0\n\n // split the phrases into lists containing words\n strlists = [str1.split(\" \"), str2.split(\" \")]\n listLengs = [strlists[0].length, strlists[1].length]\n // work out smallest and biggest list\n minIndex = listLengs.indexOf(Math.min.apply(null, listLengs))\n maxIndex = 1-minIndex\n\n for(var i1=0 ; i1<strlists[minIndex].length ; i1+=1){\n for(var i2=0 ; i2<strlists[maxIndex].length ; i2+=1){\n // if a word is very similar/identical to another then add to similarity score\n if(compareStr(strlists[minIndex][i1], strlists[maxIndex][i2])){\n score += 1\n }\n }\n }\n\n return score\n\n}", "function squareDistance(s1, s2) {\n s1 = s1.split('');\n var s1x = COLUMNS.indexOf(s1[0]) + 1;\n var s1y = parseInt(s1[1], 10);\n\n s2 = s2.split('');\n var s2x = COLUMNS.indexOf(s2[0]) + 1;\n var s2y = parseInt(s2[1], 10);\n\n var xDelta = Math.abs(s1x - s2x);\n var yDelta = Math.abs(s1y - s2y);\n\n if (xDelta >= yDelta) return xDelta;\n return yDelta;\n}", "function getDistance(a, b) {\n return ((addresses[a][0] - addresses[b][0]) ** 2) + ((addresses[a][1] - addresses[b][1]) ** 2)\n}", "function compareWordLen(x, y){\n return (x.length - y.length);\n}", "function getDistance(a, b) {\n const distX = a.x - b.x;\n const distY = a.y - b.y;\n return Math.sqrt(distX ** 2 + distY ** 2); // ** exponentiation\n}", "function stringDifference(s1, s2) {\n s1 = s1.toLowerCase().trim();\n s2 = s2.toLowerCase().trim();\n\n var costs = [];\n for (var i = 0; i <= s1.length; i++) {\n var lastValue = i;\n for (var j = 0; j <= s2.length; j++) {\n if (i === 0)\n costs[j] = j;\n else {\n if (j > 0) {\n var newValue = costs[j - 1];\n if (s1.charAt(i - 1) !== s2.charAt(j - 1))\n newValue = Math.min(Math.min(newValue, lastValue),\n costs[j]) + 1;\n costs[j - 1] = lastValue;\n lastValue = newValue;\n }\n }\n }\n if (i > 0)\n costs[s2.length] = lastValue;\n }\n return costs[s2.length];\n}", "function getDistanceSQ(a, b) {\n const diffs = [];\n for (let i = 0; i < a.length; i++) {\n diffs.push(a[i] - b[i]);\n }\n return diffs.reduce((r, e) => (r + (e * e)), 0);\n}", "function getDistance(a, b) {\n return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n }", "function weighted_dissimilarity(word_list1, word_list2, word_weight){\n if (word_list1.length == 0 || word_list2.length == 0){\n\treturn 0;\n }\n var prod11 = product(word_list1, word_list1, word_weight);\n var prod22 = product(word_list2, word_list2, word_weight);\n var prod12 = product(word_list1, word_list2, word_weight);\n // is it right?\n var cos12 = prod12 / Math.sqrt(0.1 + prod11 * prod22);\n return Math.sqrt(prod11 * prod22 * (1-cos12*cos12)) / word_list1.length / word_list2.length;\n}", "function euclidean(person1, person2) {\n // Ratings of person 1 and 2\n var ratings1 = ratings[person1];\n var ratings2 = ratings[person2];\n\n // Need to add up all the differences\n var sum = 0;\n\n // All the movies rated by person 1\n var movies = Object.keys(ratings1);\n // For every movie\n for (var i = 0; i < movies.length; i++) {\n var movie = movies[i];\n // As long as both rated the movie\n if (ratings2[movie] !== undefined) {\n var rating1 = ratings1[movie];\n var rating2 = ratings2[movie];\n // Difference between the ratings\n var diff = rating1 - rating2;\n // Square it\n sum += diff * diff;\n }\n }\n\n // This maps the distance to 0 and 1\n // Higher score is more similar\n return 1 / (1 + sqrt(sum));\n}", "distance (a, b) {\n return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n }", "function similar_text(first, second, percent) {\n\t\t/**\n\t\t * discuss at: http://phpjs.org/functions/similar_text/\n\t\t * original by: Rafał Kukawski (http://blog.kukawski.pl)\n\t\t * bugfixed by: Chris McMacken\n\t\t * bugfixed by: Jarkko Rantavuori original by findings in stackoverflow\n\t\t * (http://stackoverflow.com/questions/14136349/how-does-similar-text-work)\n\t\t * improved by: Markus Padourek (taken from\n\t\t * http://www.kevinhq.com/2012/06/php-similartext-function-in-javascript_16.html)\n\t\t * example 1: similar_text('Hello World!', 'Hello phpjs!');\n\t\t * returns 1: 7\n\t\t * example 2: similar_text('Hello World!', null);\n\t\t * returns 2: 0\n\t\t */\n\n\t\tif (first === null || second === null || typeof first === 'undefined' || typeof second === 'undefined') {\n\t\t\treturn 0;\n\t\t}\n\n\t\tfirst += '';\n\t\tsecond += '';\n\n\t\tvar pos1 = 0,\n\t\t\tpos2 = 0,\n\t\t\tmax = 0,\n\t\t\tfirstLength = first.length,\n\t\t\tsecondLength = second.length,\n\t\t\tp, q, l, sum;\n\n\t\tmax = 0;\n\n\t\tfor (p = 0; p < firstLength; p++) {\n\t\t\tfor (q = 0; q < secondLength; q++) {\n\t\t\t\tfor (l = 0;\n\t\t\t\t\t (p + l < firstLength) &&\n\t\t\t\t\t (q + l < secondLength) && (first.charAt(p + l) === second.charAt(q + l)); l++);\n\t\t\t\tif (l > max) {\n\t\t\t\t\tmax = l;\n\t\t\t\t\tpos1 = p;\n\t\t\t\t\tpos2 = q;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsum = max;\n\n\t\tif (sum) {\n\t\t\tif (pos1 && pos2) {\n\t\t\t\tsum += this.similar_text(first.substr(0, pos1), second.substr(0, pos2), 0);\n\t\t\t}\n\n\t\t\tif ((pos1 + max < firstLength) && (pos2 + max < secondLength)) {\n\t\t\t\tsum += this.similar_text(first.substr(pos1 + max, firstLength - pos1 - max), second.substr(pos2 + max,\n\t\t\t\t\tsecondLength - pos2 - max));\n\t\t\t}\n\t\t}\n\n\t\tif (!percent) {\n\t\t\treturn sum;\n\t\t}\n\t\telse {\n\t\t\treturn (sum * 200) / (firstLength + secondLength);\n\t\t}\n\t}", "function getScore(str1,str2,v1,v2,v3){\n\t\t\t\t\t\t\tvar r = 0;\n\t\t\t\t\t\t\tstr1 = str1.toUpperCase();\n\t\t\t\t\t\t\tstr2 = str2.toUpperCase();\n\t\t\t\t\t\t\tif(str1.indexOf(str2)==0) r += (v1||3);\n\t\t\t\t\t\t\tif(str1.indexOf(str2)>0) r += (v2||1);\n\t\t\t\t\t\t\tif(str1==str2) r += (v3||4);\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}", "function comparisonByDistance(a, b) {\n return a.distance - b.distance;\n }", "function levDist(s, t) {\n var d = []; //2d matrix\n\n // Step 1\n var n = s.length;\n var m = t.length;\n\n if (n == 0) return m;\n if (m == 0) return n;\n\n //Create an array of arrays in javascript (a descending loop is quicker)\n for (var i = n; i >= 0; i--) d[i] = [];\n\n // Step 2\n for (var i = n; i >= 0; i--) d[i][0] = i;\n for (var j = m; j >= 0; j--) d[0][j] = j;\n\n // Step 3\n for (var i = 1; i <= n; i++) {\n var s_i = s.charAt(i - 1);\n\n // Step 4\n for (var j = 1; j <= m; j++) {\n\n //Check the jagged ld total so far\n if (i == j && d[i][j] > 4) return n;\n\n var t_j = t.charAt(j - 1);\n var cost = (s_i == t_j) ? 0 : 1; // Step 5\n\n //Calculate the minimum\n var mi = d[i - 1][j] + 1;\n var b = d[i][j - 1] + 1;\n var c = d[i - 1][j - 1] + cost;\n\n if (b < mi) mi = b;\n if (c < mi) mi = c;\n\n d[i][j] = mi; // Step 6\n\n //Damerau transposition\n if (i > 1 && j > 1 && s_i == t.charAt(j - 2) && s.charAt(i - 2) == t_j) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);\n }\n }\n }\n // Step 7\n return d[n][m];\n}", "function euclidean_similarity(data1, data2){\n //const dist = normalized_euclidean_distance(data1, data2)\n const dist = euclidean_distance(data1, data2);\n //return (1.0 - dist)/(1.0 + dist)\n return 1 / (dist + 1); // 1 added in denominator as distance with self = 0\n}", "function distance(p1, p2){\n\tvar result = 0;\n\tfor(var i = 0; i < 3; i++){\n\t\tresult += Math.pow( p1[i] - p2[i], 2);\n\t}\n\treturn result;\n}", "function getScore(str1,str2,v1,v2,v3){\n\t\tvar r = 0;\n\t\tstr1 = str1.toUpperCase();\n\t\tstr2 = str2.toUpperCase();\n\t\tif(str1.indexOf(str2)==0) r += (v1||3);\n\t\tif(str1.indexOf(str2)>0) r += (v2||1);\n\t\tif(str1==str2) r += (v3||4);\n\t\treturn r;\n\t}", "function miniMapDistance(x, y)\n{\n\treturn Math.sqrt(Math.pow(x - 0, 2) + Math.pow(y - 0, 2));\n}", "function distance(legs) {\n return _(legs).map(haversine).sum();\n}", "function byDistance(a, b) {\n return a.dist - b.dist;\n }", "function _tr_tally(dist, // distance of matched string\n\t\tlc // match length-MIN_MATCH or unmatched char (if dist==0)\n\t\t) {\n\t\t var out_length, in_length, dcode;\n\t\t that.pending_buf[d_buf + last_lit * 2] = dist >>> 8 & 0xff;\n\t\t that.pending_buf[d_buf + last_lit * 2 + 1] = dist & 0xff;\n\t\t that.pending_buf[l_buf + last_lit] = lc & 0xff;\n\t\t last_lit++;\n \n\t\t if (dist === 0) {\n\t\t\t// lc is the unmatched char\n\t\t\tdyn_ltree[lc * 2]++;\n\t\t } else {\n\t\t\tmatches++; // Here, lc is the match length - MIN_MATCH\n \n\t\t\tdist--; // dist = match distance - 1\n \n\t\t\tdyn_ltree[(Tree._length_code[lc] + LITERALS + 1) * 2]++;\n\t\t\tdyn_dtree[Tree.d_code(dist) * 2]++;\n\t\t }\n \n\t\t if ((last_lit & 0x1fff) === 0 && level > 2) {\n\t\t\t// Compute an upper bound for the compressed length\n\t\t\tout_length = last_lit * 8;\n\t\t\tin_length = strstart - block_start;\n \n\t\t\tfor (dcode = 0; dcode < D_CODES; dcode++) {\n\t\t\t out_length += dyn_dtree[dcode * 2] * (5 + Tree.extra_dbits[dcode]);\n\t\t\t}\n \n\t\t\tout_length >>>= 3;\n\t\t\tif (matches < Math.floor(last_lit / 2) && out_length < Math.floor(in_length / 2)) return true;\n\t\t }\n \n\t\t return last_lit == lit_bufsize - 1; // We avoid equality with lit_bufsize because of wraparound at 64K\n\t\t // on 16 bit machines and because stored blocks are restricted to\n\t\t // 64K-1 bytes.\n\t\t} // Send the block data compressed using the given Huffman trees", "function calculateDistance(testpoint,trainpoint){\n var dist_square = 0;\n for(var i=0; i<testpoint.digits.length;i++){\n dist_square += Math.pow(testpoint.digits[i] - trainpoint.digits[i],2);\n }\n return Math.sqrt(dist_square);\n }", "function compute_lcd_of_matches(matches) {\n for (var i = 0; i < matches[0].length; i++) {\n for (var j = 1; j < matches.length; j++) {\n if (matches[j].charCodeAt(i) != matches[0].charCodeAt(i)) {\n return matches[0].substring(0, i);\n }\n }\n }\n return matches[0];\n}", "function fuzzy(term, candidate, options) {\n\toptions = Object.assign({}, defaultOptions, options);\n\tvar scoreMethod = options.useDamerau ? damerauLevenshteinSellers : levenshteinSellers;\n\tterm = normalize(term, options);\n\tcandidate = normalize(candidate, options);\n\treturn scoreMethod(term, candidate);\n}", "function getDistance(A, B) {\n return Math.sqrt((A[0]-B[0])**2 + (A[1]-B[1])**2);\n}", "function countingDistance() {\n setTimeout(function () {\n let color1 = document.querySelector(\"#RGBvalue> span\").innerHTML.split(\" \");\n let color2 = document.querySelector(\"#RGBvalue2>span\").innerHTML.split(\" \");\n color1 = color1.map((elem) => (elem = parseInt(elem)));\n color2 = color2.map((elem) => (elem = parseInt(elem)));\n console.log(226, color1, color2);\n let distance = Math.sqrt(\n (color2[0] - color1[0]) ** 2 +\n (color2[1] - color1[1]) ** 2 +\n (color2[2] - color1[2]) ** 2\n ).toFixed(1);\n // console.log(232, \"distance:\", distance);\n let putDistance = document.querySelector(\"p.fetched>span\").innerHTML;\n // console.log(234, putDistance);\n putDistance = putDistance.concat(\" [\", distance, \"]\");\n console.log(236, putDistance);\n document.querySelector(\"p.fetched>span\").innerHTML = putDistance;\n }, 150);\n}", "calcDiff(otherGene) {\n var val = 0;\n for (var i = 0; i < this.code.length; i++) {\n val += (this.code.charCodeAt(i) - otherGene.charCodeAt(i)) * (this.code.charCodeAt(i) - otherGene.charCodeAt(i));\n }\n this.cost = val;\n }", "function occurrencesLevenshtein ( string, subStrings ) {\n var levenshtein = window.Levenshtein;\n var words = (!!string && string != '') ? string.replace(/([^\\w\\d\\s]+)/g, '').replace(/\\s(\\s+)/g, ' ').split(/\\s/) : [];\n var counter = 0;\n var occurrences = [];\n words.forEach ( function ( entry ) {\n if (entry.length > 2) {\n subStrings.forEach ( function ( subString ) {\n var value = levenshtein.get(entry, subString);\n if (value <= minSimilarity) {\n counter++;\n var index = -1;\n for ( var i = 0; i < occurrences.length; i++ ) {\n if (occurrences[i].name == entry) {\n index = i;\n break;\n }\n }\n if (index < 0) occurrences.push({name: entry, value: 1});\n else occurrences[index].value++;\n }\n });\n }\n });\n return {value: counter, occurrences: occurrences};\n }", "function get_distance(x1, y1, x2, y2)\n{\n return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));\n}", "function distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0])*(v1[0] - v2[0]) +\n (v1[1] - v2[1])*(v1[1] - v2[1]));\n}", "function compareWords(word1,word2) {\n\t\t\t\t//word 1 must always be smaller after this guy blaze\n\t\t\t\tif (word1.length > word2.length) {\n\t\t\t\t\tvar temp = word2;\n\t\t\t\t\tword2 = word1;\n\t\t\t\t\tword1 = temp;\n\t\t\t\t}\n\n\t\t\t\tvar previousIndex = -1;\n\t\t\t\tvar blazes = 0;\n\t\t\t\tvar currentIndex;\n\t\t\t\tfor (var i = 0; i < word1.length; i++) {\n\t\t\t\t\tcurrentIndex = word2.indexOf(word1.charAt(i), previousIndex+1);\n\n\t\t\t\t\tif (currentIndex == -1) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (currentIndex < previousIndex+3) {\n\t\t\t\t\t\tpreviousIndex = currentIndex;\n\t\t\t\t\t\tblazes++;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tpreviousIndex++;\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\treturn (blazes / word2.length); \n\t\t}", "function computeDistance(a, b) {\n var dx = a.x - b.x;\n var dy = a.y - b.y;\n return Math.sqrt(dx * dx + dy * dy);\n}", "function distance(a, b) {\r\n var d = [ a[0] - b[0], a[1] - b[1] ];\r\n return Math.sqrt( d[0]*d[0] + d[1]*d[1] )\r\n}" ]
[ "0.8275167", "0.7799088", "0.7767071", "0.75914854", "0.7547063", "0.74966866", "0.7487881", "0.74867857", "0.73635983", "0.73543656", "0.72983307", "0.72502756", "0.7233416", "0.7195262", "0.71762425", "0.71755457", "0.7136185", "0.7135121", "0.71308506", "0.7128799", "0.7077079", "0.7054622", "0.704247", "0.69491214", "0.6923615", "0.68569016", "0.68263406", "0.6809824", "0.6783095", "0.6653838", "0.6649732", "0.6633558", "0.6514644", "0.651049", "0.64886814", "0.64138675", "0.64099294", "0.6386117", "0.6357367", "0.62668127", "0.6261387", "0.62438476", "0.62155485", "0.6205632", "0.61969316", "0.61952037", "0.61732435", "0.61682844", "0.61496735", "0.613755", "0.6136786", "0.6115309", "0.60912883", "0.60783005", "0.6076796", "0.60601634", "0.6053934", "0.60360926", "0.59958404", "0.59794444", "0.59491646", "0.59389937", "0.59367245", "0.59215784", "0.591149", "0.5899162", "0.58964634", "0.5893326", "0.5877352", "0.586667", "0.58363235", "0.58337826", "0.58193076", "0.5813011", "0.5812342", "0.58043915", "0.58013314", "0.5798785", "0.5797609", "0.57894415", "0.5775355", "0.57604", "0.5754205", "0.57416844", "0.5725716", "0.5719692", "0.5712844", "0.57117194", "0.5693955", "0.56823593", "0.56812984", "0.56812614", "0.56711155", "0.5669207", "0.5668406", "0.56623226", "0.56620395", "0.5654586", "0.5646438", "0.56398046", "0.56316173" ]
0.0
-1
Objective: Given an input array, a container DOM node, and a function from array elements to arrays of DOM nodes, map the array elements to arrays of DOM nodes, concatenate together all these arrays, and use them to populate the container DOM node Next time we're given the same combination of things (with the array possibly having mutated), update the container DOM node so that its children is again the concatenation of the mappings of the array elements, but don't remap any array elements that we previously mapped retain those nodes, and just insert/delete other ones "callbackAfterAddingNodes" will be invoked after any "mapping"generated nodes are inserted into the container node You can use this, for example, to activate bindings on those nodes.
function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) { // Map this array value inside a dependentObservable so we re-map when any dependency changes var mappedNodes = []; var dependentObservable = ko.dependentObservable(function() { var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || []; // On subsequent evaluations, just replace the previously-inserted DOM nodes if (mappedNodes.length > 0) { ko.utils.replaceDomNodes(mappedNodes, newMappedNodes); if (callbackAfterAddingNodes) ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]); } // Replace the contents of the mappedNodes array, thereby updating the record // of which nodes would be deleted if valueToMap was itself later removed mappedNodes.length = 0; ko.utils.arrayPushAll(mappedNodes, newMappedNodes); }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } }); return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function () {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function () { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes: mappedNodes, dependentObservable: (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.splice(0, mappedNodes.length);\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged (containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = computed(function () {\n var newMappedNodes = mapping(valueToMap, index, fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes) { ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]); }\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function () { return !anyDomNodeIsAttachedToDocument(mappedNodes) } });\n return { mappedNodes: mappedNodes, dependentObservable: (dependentObservable.isActive() ? dependentObservable : undefined) }\n }", "function localSetDomNodeChildrenFromArrayMapping (newArray, changeList) {\n ignore(setDomNodeChildrenFromArrayMapping, null, [targetNode, newArray, executeTemplateForArrayItem, options$$1, activateBindingsCallback, changeList]);\n bindingEvent.notify(targetNode, bindingEvent.childrenComplete);\n }", "function fixUpNodesToBeMovedOrRemoved(contiguousNodeArray) {\n // Before moving, deleting, or replacing a set of nodes that were previously outputted by the \"map\" function, we have to reconcile\n // them against what is in the DOM right now. It may be that some of the nodes have already been removed from the document,\n // or that new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been\n // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding.\n // So, this function translates the old \"map\" output array into its best guess of what set of current DOM nodes should be removed.\n //\n // Rules:\n // [A] Any leading nodes that aren't in the document any more should be ignored\n // These most likely correspond to memoization nodes that were already removed during binding\n // See https://github.com/SteveSanderson/knockout/pull/440\n // [B] We want to output a contiguous series of nodes that are still in the document. So, ignore any nodes that\n // have already been removed, and include any nodes that have been inserted among the previous collection\n\n // Rule [A]\n while (contiguousNodeArray.length && !ko.utils.domNodeIsAttachedToDocument(contiguousNodeArray[0]))\n contiguousNodeArray.splice(0, 1);\n\n // Rule [B]\n if (contiguousNodeArray.length > 1) {\n // Build up the actual new contiguous node set\n var current = contiguousNodeArray[0], last = contiguousNodeArray[contiguousNodeArray.length - 1], newContiguousSet = [current];\n while (current !== last) {\n current = current.nextSibling;\n if (!current) // Won't happen, except if the developer has manually removed some DOM elements (then we're in an undefined scenario)\n return;\n newContiguousSet.push(current);\n }\n\n // ... then mutate the input array to match this.\n // (The following line replaces the contents of contiguousNodeArray with newContiguousSet)\n Array.prototype.splice.apply(contiguousNodeArray, [0, contiguousNodeArray.length].concat(newContiguousSet));\n }\n return contiguousNodeArray;\n }", "function mapElements(containerElement, func)\n {\n // TODO: This heuristic breaks for elements that contain a mixture of\n // inline and block elements.\n var nestedBlockElements = arrays.toArray(containerElement.children).filter(elementHelpers.isBlockElement);\n if (nestedBlockElements.length)\n {\n nestedBlockElements.forEach(function (nestedBlockElement)\n {\n // Map the nested block elements\n mapElements(nestedBlockElement, func);\n });\n } else\n {\n mapTextNodes(containerElement, func);\n }\n }", "function mapFn(array, mapCallback) {\n array.forEach( (element, i) => {\n array[i] = mapCallback(element);\n })\n return array;\n}", "function updateChildren (newNode, oldNode) {\n // if (DEBUG) {\n // console.log(\n // 'updateChildren\\nold\\n %s\\nnew\\n %s',\n // oldNode && oldNode.outerHTML,\n // newNode && newNode.outerHTML\n // )\n // }\n var oldChild, newChild, morphed, oldMatch\n\n // The offset is only ever increased, and used for [i - offset] in the loop\n var offset = 0\n\n for (var i = 0; ; i++) {\n oldChild = oldNode.childNodes[i]\n newChild = newNode.childNodes[i - offset]\n // if (DEBUG) {\n // console.log(\n // '===\\n- old\\n %s\\n- new\\n %s',\n // oldChild && oldChild.outerHTML,\n // newChild && newChild.outerHTML\n // )\n // }\n // Both nodes are empty, do nothing\n if (!oldChild && !newChild) {\n break\n\n // There is no new child, remove old\n } else if (!newChild) {\n oldNode.removeChild(oldChild)\n i--\n\n // There is no old child, add new\n } else if (!oldChild) {\n oldNode.appendChild(newChild)\n offset++\n\n // Both nodes are the same, morph\n } else if (same(newChild, oldChild)) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Both nodes do not share an ID or a placeholder, try reorder\n } else {\n oldMatch = null\n\n // Try and find a similar node somewhere in the tree\n for (var j = i; j < oldNode.childNodes.length; j++) {\n if (same(oldNode.childNodes[j], newChild)) {\n oldMatch = oldNode.childNodes[j]\n break\n }\n }\n\n // If there was a node with the same ID or placeholder in the old list\n if (oldMatch) {\n morphed = walk(newChild, oldMatch)\n if (morphed !== oldMatch) offset++\n oldNode.insertBefore(morphed, oldChild)\n\n // It's safe to morph two nodes in-place if neither has an ID\n } else if (!newChild.id && !oldChild.id) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Insert the node at the index if we couldn't morph or find a matching node\n } else {\n oldNode.insertBefore(newChild, oldChild)\n offset++\n }\n }\n }\n}", "function updateViaArray(node, childNodes, i) {\n var fragment = node.ownerDocument.createDocumentFragment();\n if (0 < i) {\n removeNodeList(node.childNodes, i);\n appendNodes(fragment, childNodes.slice(i));\n node.appendChild(fragment);\n } else {\n appendNodes(fragment, childNodes);\n resetAndPopulate(node, fragment);\n }\n }", "function myMap2(array, callback){\n var tmp = [];\n array.forEach(function(element){\n tmp.push(callback(element));\n });\n return tmp;\n}", "function _transform(node, callback) {\n return node.map(function (child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function map(arr, callback){\n let newArr = [] \n arr.forEach(element => {\n newArr.push(callback(element)) \n });\n return newArr\n}", "function map(array, callbackFunction) {\n var newArray = [];\n array.forEach(function(element) {\n newArray.push(callbackFunction(element));\n });\n return newArray;\n}", "function map(array, callbackFunction) {\n var newArray = [];\n array.forEach(function(element) {\n newArray.push(callbackFunction(element));\n });\n return newArray;\n}", "function myMap(array, callback) {\n let arrayCopy = [];\n array.forEach(element => {\n const newItem = callback(element);\n arrayCopy.push(newItem);\n });\n return arrayCopy;\n}", "function mapWith(array, callback) {\n result = [];\n array.forEach((el) => {\n result.push(callback(el));\n });\n result;\n}", "function myMap(callback, array){\n let arrayCopy = [];\n array.forEach(element => {\n const newItem = callback(element)\n arrayCopy.push(newItem)\n });\n return arrayCopy;\n}", "function bindArrayToHTML(holder, array, template, _parent) {\n if ((array.onCall && array.onCall.push)) return;\n let templates = []; // the list of template instance objects\n array.onSet = array.onSet || {};\n array.onSet['_length'] = array.onSet['_length'] || [];\n let cleanUpBinding;\n function cleanUp(){\n cleanUpBinding();\n clearInterval(interval);\n }\n let interval = setInterval(() => {\n if(!document.body.contains(holder)){\n cleanUp();\n }\n }, 1000);\n // array listeners\n cleanUpBinding = dataBinding.array(array, {\n push: function(x) {\n setTimeout(function() {\n var tpl = template(array.length - 1, array);\n templates.push(tpl);\n holder.appendChild(tpl.template);\n }, 1);\n },\n pop: function() {\n holder.removeChild(holder.lastChild);\n templates.pop();\n },\n unshift: function(x) {\n var tpl = template(0, array);\n templates.unshift(tpl);\n holder.insertBefore(tpl.template, holder.firstChild);\n },\n shift: function() {\n holder.removeChild(holder.firstChild);\n templates.shift();\n },\n splice: function(index, count) {\n var countCopy = count;\n while (countCopy) {\n holder.removeChild(holder.childNodes[index]);\n countCopy--;\n }\n var items = Array.prototype.slice.call(arguments, 2);\n if (items.length) {\n var createdTemplates = [],\n indexCopy = index;\n items.forEach(function(item) {\n var tpl = template(indexCopy, array);\n createdTemplates.push(tpl);\n holder.insertBefore(tpl.template, holder.children[indexCopy]);\n indexCopy++;\n });\n templates.splice.bind(templates, index, count).apply(createdTemplates);\n } else\n templates.splice(index, count);\n },\n setIndexFrom: function(index) {\n while (index < templates.length) {\n templates[index].arrayScopeSetIndex(index, array);\n index++;\n }\n },\n length: function(x) {\n dataBinding.callArray(array.onSet['_length'], [x]);\n }\n });\n // initalize\n holder.innerHTML = '';\n for (var i = 0; i < array.length; i++) {\n templates[i] = template(i, array);\n holder.appendChild(templates[i].template);\n }\n}", "function mapWith(array, callback) {\n\n}", "function map (inputArray, callbackFunction) {\n var outputArray = []\n for (var i = 0; i - inputArray.length; i++) {\n outputArray[i] = callbackFunction(inputArray[i])\n }\n return outputArray\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n if (action === 0 /* Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n if (action === 0 /* Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n if (action === 0 /* Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n if (action === 0 /* Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n if (action === 0 /* Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n if (action === 0 /* Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function map(array, callbackFn) { //callback e.g.: function(a){ return a * a }\n const newArr = [];\n for (const ele of array) {\n newArr.push(callbackFn(ele))\n }\n return newArr;\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n var lContainer;\n var isComponent = false; // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n } else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n\n var rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n\n if (action === 0\n /* Create */\n && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n } else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n } else if (action === 1\n /* Insert */\n && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n } else if (action === 2\n /* Detach */\n ) {\n nativeRemoveNode(renderer, rNode, isComponent);\n } else if (action === 3\n /* Destroy */\n ) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}", "function createHtmlArrayElements(arr, wrapperId) {\n const algoWrapper = document.getElementById(wrapperId)\n const algoContainer = algoWrapper.getElementsByClassName('algo-container')[0]\n\n const elements = arr.map(createArrayHtmlElement)\n\n appendChildrenToHtmlElement(algoContainer, elements)\n\n return elements\n}", "function map(array, callback) {\n var updatedArray = [];\n for (item of array) {\n updatedArray.push(callback(item))\n }\n return updatedArray;\n}", "function updateChildren(DOMElement, changes, dispatch, context) {\n // Create a clone of the children so we can reference them later\n // using their original position even if they move around\n if (!DOMElement) return;\n let childNodes = toArray(DOMElement.childNodes)\n\n // changes.forEach(change => {\n // Actions.case({\n // insertChild: (vnode, index, path) => {\n // var placeHolder = createPlaceHolderAtIndex(DOMElement, childNodes, index)\n // change.placeHolder = placeHolder\n // },\n // moveChild: (vnode, index, actions) => {\n // var placeHolder = createPlaceHolderAtIndex(DOMElement, childNodes, index)\n // change.placeHolder = placeHolder\n //\n //\n // },\n // removeChild: (index) => {\n //\n // },\n // updateChild: (index, actions) => {\n // let _update = updateElement(dispatch, context)\n // actions.forEach(action => _update(childNodes[index], action))\n // }\n // }, change)\n // })\n\n changes.forEach(change => {\n Actions.case({\n insertChild: (vnode, index, path) => {\n insertAtIndex(DOMElement, index, createElement(vnode, path, dispatch, context), change.placeHolder)\n mountElement(vnode)\n },\n moveChild: (index, newVnode, oldVnode, actions, path) => {\n var el = (oldVnode.nativeNode || createElement(newVnode, path, dispatch, context))\n insertAtIndex(DOMElement, index, el, change.placeHolder)\n let _update = updateElement(dispatch, context)\n actions.forEach(action => _update(el, action))\n },\n removeChild: (index, vnode) => {\n var child = childNodes[index];\n if (child && child.parentNode == DOMElement) {\n DOMElement.removeChild(child)\n removeThunks(vnode)\n }\n },\n updateChild: (index, actions) => {\n let _update = updateElement(dispatch, context)\n actions.forEach(action => _update(childNodes[index], action))\n }\n }, change)\n })\n}", "function homeMadeMap(array, callbackFnc) {\n let mapped = []; // new array \n for (let i = 0; i < array.length; i++) {\n mapped.push(callbackFnc(array[i])); //calling the callbackfunction, which takes in an element of the array we put in.\n }\n return mapped; //after looping over entire array homeMadeMap (the higher order function) returns the new array\n}", "function map(array, callback) {\n\n}", "function generateOrganizedArray() {\n for (var i = 0; i < oldArray.length; i++) {\n if (oldArray[i][1] == \"-1\") {\n var n = getFirstEmptyIndex();\n for (var j = 0; j < oldArray[i].length; j++) {\n OrganizedArray[n][j] = oldArray[i][j];\n }\n }\n }\n for (var i = 0; i < OrganizedArray.length; i++) {\n if (OrganizedArray[i][0] != null || OrganizedArray[i][0] != \"\") {\n putChild(OrganizedArray[i]);\n }\n }\n}", "function mapWith(array, callback) {\n const result = [];\n const cb = el => result.push(callback(el));\n forEach(array, cb);\n return result;\n}", "function offsetTree(t, offset, offsetFunction) {\n for (var i = 0; i < t.length; i++) {\n var offsetpaths = offsetFunction(t[i], offset);\n if (offsetpaths.length == 1) {\n // replace array items in place\n Array.prototype.splice.apply(t[i], [0, t[i].length].concat(offsetpaths[0]));\n }\n\n if (t[i].childNodes && t[i].childNodes.length > 0) {\n offsetTree(t[i].childNodes, -offset, offsetFunction);\n }\n }\n }", "function map(array, fn) {\n let mappedArray = [];\n array.forEach(element => {\n mappedArray.push(fn(element));\n });\n console.log(mappedArray);\n}", "function refreshAlbum(container, array) {\n for (var i = 0; i < array.length; i++) {\n container.appendChild(array[i]); }\n}", "function mapUpon(func) {\n return function (array) {\n return array.map(bind(func, this));\n };\n }", "function _containerInsertAfter(nodes) {\n\t return this._containerInsert(this.key + 1, nodes);\n\t}", "function _containerInsertAfter(nodes) {\n\t return this._containerInsert(this.key + 1, nodes);\n\t}", "function mapWith(array, callback) {\n var updatedArray = [];\n array.forEach(item => updatedArray.push(callback(item)))\n\n return updatedArray;\n}", "function _containerInsertAfter(nodes) {\n return this._containerInsert(this.key + 1, nodes);\n}", "function map(array, f){\n //create var for transformed array\n var transformed = [];\n //loop through the element\n each(array, function(element, index){\n //push the value from the parameter function (f) to transformed array\n transformed.push(f(element));\n });\n //return transformed array\n return transformed;\n}", "function myMap(array, callback){\n let newArray = []\n for(let i=0; i<array.length; i++){\n let transformedValue = callback(array[i])\n newArray.push(transformedValue)\n }\n return newArray\n}", "_onContainerChanged(change) {\n let doc = this.getDocument()\n // first update the container\n let renderContext = RenderingEngine.createContext(this)\n let $$ = renderContext.$$\n let container = this.getContainer()\n let path = container.getContentPath()\n for (let i = 0; i < change.ops.length; i++) {\n let op = change.ops[i]\n if (op.type === \"update\" && op.path[0] === path[0]) {\n let diff = op.diff\n if (diff.type === \"insert\") {\n let nodeId = diff.getValue()\n let node = doc.get(nodeId)\n let nodeEl\n if (node) {\n nodeEl = this._renderNode($$, node)\n } else {\n // node does not exist anymore\n // so we insert a stub element, so that the number of child\n // elements is consistent\n nodeEl = $$('div')\n }\n this.insertAt(diff.getOffset(), nodeEl)\n } else if (diff.type === \"delete\") {\n this.removeAt(diff.getOffset())\n }\n }\n }\n this._attachPlaceholder()\n }", "function newMap(arr,callback) {\n var newArr = [];\n for(var i=0; i < arr.length; i++) {\n newArr.push(callback(arr[i]));\n }\n return newArr;\n}", "function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n var lContainer;\n var isComponent = false; // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n } else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n\n var rNode = unwrapRNode(lNodeToHandle);\n ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);\n\n if (action === 0\n /* Create */\n && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n } else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n } else if (action === 1\n /* Insert */\n && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n } else if (action === 2\n /* Detach */\n ) {\n nativeRemoveNode(renderer, rNode, isComponent);\n } else if (action === 3\n /* Destroy */\n ) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n }", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function mapWith(array, callback) {\n var arr = [];\n array.forEach(x => { \n arr.push(callback(x));\n});\n return arr;\n}", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n var anchor = lContainer[NATIVE]; // LContainer has its own before node.\n\n var _native5 = unwrapRNode(lContainer); // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n\n\n if (anchor !== _native5) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n }", "function myMap(array, callback) {\n let newerArr = [];\n for (let i = 0; i < array.length; i++) {\n newerArr.push(callback(array[i]));\n }\n return newerArr;\n}", "bindNodeTemplate (nodes) {\n if (isObservable(nodes)) {\n throw new Error('The \"nodes\" option must be a plain, non-observable array.')\n }\n\n // If the nodes are already attached to a KO-generated container, we reuse that container without moving the\n // elements to a new one (we check only the first node, as the nodes are always moved together)\n let container = nodes[0] && nodes[0].parentNode;\n if (!container || !get(container, cleanContainerDomDataKey)) {\n container = moveCleanedNodesToContainerElement(nodes);\n set(container, cleanContainerDomDataKey, true);\n }\n\n new anonymousTemplate(this.$element).nodes(container);\n }", "function update_dom(toplevelNode, nodes, relations) {\n var i, parent, child;\n // TODO: rewrite this to move stuff all in one go... possible? necessary?\n\n // move all children to their proper parents\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'parent') {\n parent = relations[i].parent;\n child = relations[i].child;\n if (child.parentNode !== parent) {\n parent.appendChild(child);\n }\n }\n }\n\n // arrange siblings in proper order\n // truly terrible... BUBBLE SORT\n var unsorted = true;\n while (unsorted) {\n unsorted = false;\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'neighbor') {\n var left = relations[i].left, right = relations[i].right;\n\n if (! nodeEq(left.nextSibling, right)) {\n left.parentNode.insertBefore(left, right);\n unsorted = true;\n }\n }\n }\n }\n\n // Finally, remove nodes that shouldn't be attached anymore.\n var nodesPlus = nodes.concat([toplevelNode]);\n preorder(toplevelNode, function(aNode, continueTraversalDown) {\n if (aNode.jsworldOpaque) {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n }\n } else {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n } else {\n continueTraversalDown();\n }\n }\n });\n\n refresh_node_values(nodes);\n }", "function update_dom(toplevelNode, nodes, relations) {\n var i, parent, child;\n // TODO: rewrite this to move stuff all in one go... possible? necessary?\n\n // move all children to their proper parents\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'parent') {\n parent = relations[i].parent;\n child = relations[i].child;\n if (child.parentNode !== parent) {\n parent.appendChild(child);\n }\n }\n }\n\n // arrange siblings in proper order\n // truly terrible... BUBBLE SORT\n var unsorted = true;\n while (unsorted) {\n unsorted = false;\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'neighbor') {\n var left = relations[i].left, right = relations[i].right;\n\n if (! nodeEq(left.nextSibling, right)) {\n left.parentNode.insertBefore(left, right);\n unsorted = true;\n }\n }\n }\n }\n\n // Finally, remove nodes that shouldn't be attached anymore.\n var nodesPlus = nodes.concat([toplevelNode]);\n preorder(toplevelNode, function(aNode, continueTraversalDown) {\n if (aNode.jsworldOpaque) {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n }\n } else {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n } else {\n continueTraversalDown();\n }\n }\n });\n\n refresh_node_values(nodes);\n }", "function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n var anchor = lContainer[NATIVE]; // LContainer has its own before node.\n\n var native = unwrapRNode(lContainer); // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}", "function _appendNodes(elem, nodes) {\n $.each(nodes, function (i, node) {\n elem.appendChild(node);\n });\n }", "wrapAll(elements, wrapper) {\n elements[0].parentNode.insertBefore(wrapper, elements[0]);\n elements.forEach(x => wrapper.appendChild(x));\n }", "function addElementsToFinal (arrayOfArrays) {\n //base case: no remaining elements in input array\n if (!arrayOfArrays.length) {\n return finalArray;\n }\n //for each subarray in the source arrays first element...\n for (var i = 0; i < arrayOfArrays[0].length; i++) {\n //...add to the results array\n finalArray.push(arrayOfArrays[0][i]);\n }\n //recursive function call of the rest of the source array\n return addElementsToFinal (arrayOfArrays.slice(1));\n }", "function rebuildArrays(){\nconsole.log(backlogList.children);\nconsole.log(progressList.children);\nbacklogListArray=[];\nfor (let i =0;i<backlogList.children.length;i++){\n backlogListArray.push(backlogList.children[i].textContent);\n}\nprogressListArray=[];\nfor (let i =0;i<progressList.children.length;i++){\n progressListArray.push(progressList.children[i].textContent);\n}\ncompleteListArray=[];\nfor (let i =0;i<completeList.children.length;i++){\n completeListArray.push(completeList.children[i].textContent);\n}\nonHoldListArray=[];\nfor (let i =0;i<onHoldList.children.length;i++){\n onHoldListArray.push(onHoldList.children[i].textContent);\n}\nupdateDOM();\n}", "function mergeDOM(parentDOM, items, onCreateUpdate) {\n // grab our DOM child elements\n let children = parentDOM.children;\n\n // check for array length matching up front\n // pruning up front will make adding/updating faster and the check is cheap.\n // note that when replacing items, this check will fail and pruning will happen AFTER adding/updating\n if (children.length > items.length)\n pruneChildren(children, items);\n\n // add or update each item\n items.forEach((item, arrayIndex) => {\n const domIndex = findChildIndexById(children, item.id);\n let itemDOM = (domIndex == -1 ? null : children[domIndex]);\n \n // if itemDOM's srcObject matches this item, it doesn't need an update\n // inversely, we need to update if itemDOM is null or the srcObject is different than item\n if (!itemDOM || itemDOM.srcObject != item) {\n itemDOM = onCreateUpdate(item, itemDOM);\n\n // if itemDOM is null after calling onCreateUpdate, there's an error. bail out.\n if (!itemDOM)\n return;\n\n // otherwise, update srcObject\n itemDOM.srcObject = item;\n\n // ensure zIndex is set (reverse order - first on top!)\n /*\n const zIndex = 10000 - arrayIndex;\n if (itemDOM.style.zIndex != zIndex)\n itemDOM.style.zIndex = zIndex;\n */\n }\n\n if (domIndex == -1) {\n // if we're adding, ensure itemDOM has an ID specified\n itemDOM.id = item.id;\n // insert the new DOM element\n if (arrayIndex < children.length)\n parentDOM.insertBefore(itemDOM, children[arrayIndex]);\n else\n parentDOM.appendChild(itemDOM);\n } else if (domIndex != arrayIndex) {\n // we need to move the itemDOM to a new location\n // this one call will simultaneously remove and re-insert\n parentDOM.insertBefore(itemDOM, children[arrayIndex]);\n } else {\n // do nothing - itemDOM has been updated and doesn't need to be moved\n }\n });\n\n // check for array length again - if they don't match because we REPLACED an element, then we'll prune\n if (children.length > items.length)\n pruneChildren(children, items);\n}", "function fnMapsArr(myArray, myFunction){\n var newArray =[];\n for(var i = 0; i<myArray.length; i++){\n var newInput = myFunction(myArray[i]);\n newArray.push(newInput);\n }\n return newArray;\n \n}", "function _appendNodes(elem, nodes) {\n $.each(nodes, function (i, node) {\n elem.appendChild(node);\n });\n }", "function updateArrays() {\r\n // Update arrays from DOM element's textContent\r\n listArrays.forEach((arrItem, index) => {\r\n listArrays[index] = [...columns[index].children].map(\r\n (i) => i.textContent\r\n );\r\n });\r\n}", "function map(fn, array) {\n arr = array.slice();\n result = [];\n for (let i = 0; i < arr.length; i++) {\n const element = arr[i];\n result.push(fn(element));\n }\n return result;\n }", "function addElements(tElements, oElements, addHandler) {\n tIndexes = {};\n _.forEach(tElements, function(element) {\n addHandler(element);\n });\n _.forEach(oElements, function(element) {\n var i = tIndexes[element.id];\n // not found, then just push it in\n if (typeof i === \"undefined\")\n addHandler(element);\n // otherwise, 50/50 of using oNode\n else if (Utils.randomBool())\n addHandler(element, i);\n });\n }", "function apply(element, sequence) {\n const oreo = document.createElement(\"div\")\n oreo.classList.add('oreo')\n\n // Empty the element\n while (element.firstChild) {\n element.removeChild(element.firstChild)\n }\n\n // Apply the oreo\n let index = 0\n let offset = 0\n let lastType = null\n\n for (layer of sequence) {\n offset = adjustOffset(offset, layer, lastType)\n const element = segment(layer, index++, offset)\n oreo.appendChild(element)\n lastType = layer\n }\n\n // Resize\n oreo.style.height = (offset + 43) + \"px\"\n element.appendChild(oreo)\n}", "renderLoop(arr, target) {\n const wrapper = document.createElement('div');\n for (let val of arr) {\n wrapper.appendChild(val.domElem);\n }\n\n this.addToDom(wrapper, target);\n }", "function rebuildArrays() {\n // Map func is better when you want to rebuild an array or add to an array\n // whereas forEach is better when you want to iterate over an array without changing it.\n // Anytime you see an empty array then a for loop it will be better to use map\n backlogListArray = Array.from(backlogList.children).map((item) => item.textContent);\n progressListArray = Array.from(progressList.children).map((item) => item.textContent);\n completeListArray = Array.from(completeList.children).map((item) => item.textContent);\n onHoldListArray = Array.from(onHoldList.children).map((item) => item.textContent);\n updateDOM();\n // backlogListArray = [];\n // for (let i = 0; i < backlogList.children.length; i++) {\n // backlogListArray.push(backlogList.children[i].textContent);\n // }\n // progressListArray = [];\n // for (let i = 0; i < progressList.children.length; i++) {\n // progressListArray.push(progressList.children[i].textContent);\n // }\n // completeListArray = [];\n // for (let i = 0; i < completeList.children.length; i++) {\n // completeListArray.push(completeList.children[i].textContent);\n // }\n // onHoldListArray = [];\n // for (let i = 0; i < onHoldList.children.length; i++) {\n // onHoldListArray.push(onHoldList.children[i].textContent);\n // }\n}", "function myMap(array, callback) {\n let mapped = [];\n array.forEach(function (element, index, array) {\n mapped.push(callback(element, index, array));\n })\n\n return mapped;\n}", "function map(arr, func) {\n let nwarr = []\n for (let ele of arr) {\n nwarr.push(func(ele))\n }\n return nwarr\n}", "function groupDuplicates(arr, callback = (el) => el) {\n\t//create a temporary container to hold array values\n\tlet tempContainer = new Map();\n\n\t//wrap duplicate elements in an array\n\t//store these wrapper arrays in a temporary Map\n\tfor (let i = 0; i < arr.length; i++) {\n\t\t//create a Map address out of the array value\n\t\tlet address = callback(arr[i])?.toString();\n\t\t//if the address doesn't yet exist in the container\n\t\t//create an array at that address\n\t\tif (!tempContainer.has(address)) tempContainer.set(address, []);\n\t\t//add the array value to the selected array\n\t\tlet wrapperArray = tempContainer.get(address);\n\t\twrapperArray.push(arr[i]);\n\t}\n\n\t//convert map into array\n\treturn Array.from(tempContainer.values());\n}", "map(callback) {\n const arr = [];\n for (const ele of this.arr) {\n arr.push(callback(ele));\n }\n\n return arr;\n }", "appendElements() {\n this.appendChild(this.container)\n }", "function singleItems(element, anArray, parentElem){\nfor (let i = 0; i < anArray.length; i++){\n createElement(element, anArray[i], parentElem);\n }\n}", "function map (array, fn) {\n const newArray = []\n for (let item of array) {\n newArray.push(fn(item))\n }\n return newArray\n}", "function setup(container, items) {\n let intialLength = items.length; \n for (let i = 0; i < intialLength; i++) {\n container.appendChild(items[i].cloneNode(true));\n }\n}", "function modifyArray(array,callback){\n const newArr = [];\n for(let i=0;i<array.length;i++){\n newArr.push(callback(array[i]));\n }\n return newArr;\n}", "function map(array, callback) {\n let arr = []\n for(let i=0; i<array.length; i++) {\n arr.push(callback(array[i]))\n }\n\treturn arr\n}", "function mapPrimitiveNodes(arr) {\n for (var i = 0; i < arr.length; ++i) {\n var node = arr[i];\n if (typeof node === 'string' || typeof node === 'number') arr[i] = (0, _vnode.vnode)(undefined, undefined, undefined, node);\n }\n}", "appendToElement(ele) {\n for (let el of this.elArray) {\n ele.appendChild(el);\n }\n }", "function mapLookAlike(arr, callbackFunc) {\n let newArr = [];\n\n // go through each item\n // call the function\n // update the new arr\n for (let i = 0; i < arr.length; i++) {\n const item = arr[i];\n\n newArr.push(callbackFunc(item, i));\n }\n\n return newArr;\n}", "function renderArrayInComponent(array, renderConponent, $container) {\n if (array) {\n array.forEach((item) => {\n const component = renderConponent(item);\n $container\n .appendChild(component)\n .animate([{ opacity: 0 }, { opacity: 1 }], 500);\n });\n }\n}", "function addEl() {\r\n var nodes = arguments\r\n for (var i = 1; i < nodes.length; i++) {\r\n nodes[i - 1].appendChild(nodes[i])\r\n }\r\n}" ]
[ "0.6603838", "0.65494925", "0.65494925", "0.65494925", "0.65494925", "0.65494925", "0.65494925", "0.65494925", "0.6540742", "0.64597815", "0.64268744", "0.6322469", "0.6247582", "0.5875311", "0.5607404", "0.5551369", "0.55266005", "0.5524079", "0.5513698", "0.5513698", "0.5487044", "0.5450397", "0.5450397", "0.5447942", "0.5426216", "0.5411458", "0.5386654", "0.5386609", "0.5380976", "0.5318486", "0.5318486", "0.5318486", "0.5318486", "0.5318486", "0.5318486", "0.53141165", "0.53085524", "0.530707", "0.5300994", "0.52996725", "0.5273225", "0.52690405", "0.5268347", "0.5262826", "0.5252346", "0.5252205", "0.52466935", "0.52442217", "0.522831", "0.522831", "0.5221442", "0.5204545", "0.5204462", "0.52002126", "0.5194717", "0.518203", "0.5178078", "0.51763594", "0.51763594", "0.51763594", "0.51763594", "0.51763594", "0.51763594", "0.51632977", "0.51377296", "0.51358694", "0.5124895", "0.5124718", "0.5124718", "0.5116867", "0.51020783", "0.50989217", "0.50953954", "0.5092058", "0.5087755", "0.5086899", "0.5085816", "0.5084567", "0.50835276", "0.5069734", "0.5058114", "0.5048218", "0.5039799", "0.50396895", "0.5037846", "0.5032225", "0.5018867", "0.5015172", "0.5004944", "0.5000025", "0.49907723", "0.49842584", "0.49837145", "0.4977004", "0.49719974", "0.4963048", "0.49616724", "0.4960914" ]
0.652609
11
Convert Stringformatted options into Objectformatted ones and store in cache
function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.split( core_rspace ), function( _, flag ) { object[ flag ] = true; }); return object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.split( core_rspace ), function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n }", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.split( core_rspace ), function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n}", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.split( core_rspace ), function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions(options) {\n var object = optionsCache[options] = {};\n jQuery.each(options.split(core_rspace), function(_, flag) {\n object[flag] = true;\n });\n return object;\n }", "function createOptions(options) {\n var object = optionsCache[options] = {};\n jQuery.each(options.split(core_rspace), function (_, flag) {\n object[flag] = true;\n });\n return object;\n }", "function createOptions( options ) {\r\n\tvar object = optionsCache[ options ] = {};\r\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\r\n\t\tobject[ flag ] = true;\r\n\t});\r\n\treturn object;\r\n}", "function createOptions( options ) {\r\r\n\tvar object = optionsCache[ options ] = {};\r\r\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\r\r\n\t\tobject[ flag ] = true;\r\r\n\t});\r\r\n\treturn object;\r\r\n}", "function createOptions(options) {\n var object = optionsCache[ options ] = {};\n jQuery.each(options.match(rnotwhite) || [], function (_, flag) {\n object[ flag ] = true;\n });\n return object;\n }", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tDM.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function setOptions(obj, options) {\n if (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\n obj.options = obj.options ? create(obj.options) : {};\n }\n\n for (var i in options) {\n obj.options[i] = options[i];\n }\n\n return obj.options;\n } // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String", "function prepareOptions(options){\n\n\n //if options isnt instance of GeneralOptions\n if (!(options instanceof GeneralOptions)) {\n \n\n //var generalOptions = new GeneralOptions\n var generalOptions = new GeneralOptions();\n //for each own property key,value in options\n var value=undefined;\n for ( var key in options)if (options.hasOwnProperty(key)){value=options[key];\n {\n //generalOptions.setProperty key, value\n generalOptions.setProperty(key, value);\n }\n \n }// end for each property\n //end for\n //options = generalOptions\n \n //options = generalOptions\n options = generalOptions;\n };\n\n\n //options.version = version\n options.version = module.exports.version;\n\n //return options\n return options;\n }", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n}", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions(options) {\n var object = optionsCache[options] = {};\n jQuery.each(options.match(rnotwhite) || [], function (_, flag) {\n object[flag] = true;\n });\n return object;\n }", "function createOptions(options){var object=optionsCache[options] = {};jQuery.each(options.match(rnotwhite) || [],function(_,flag){object[flag] = true;});return object;}", "function createOptions(options) {\n var object = optionsCache[options] = {};\n jQuery.each(options.match(rnotwhite) || [], function(_, flag) {\n object[flag] = true;\n });\n return object;\n }", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n }", "function createOptions(options) {\n var object = optionsCache[options] = {};\n jQuery.each(options.match(core_rnotwhite) || [], function(_, flag) {\n object[flag] = true;\n });\n return object;\n }", "function createOptions( options ) {\r\n\tvar object = optionsCache[ options ] = {};\r\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\r\n\t\tobject[ flag ] = true;\r\n\t});\r\n\treturn object;\r\n}", "function optionsFromStrings(options) {\n\tvar intOptions = [\"width\", \"height\", \"textMargin\", \"fontSize\", \"margin\", \"marginTop\", \"marginBottom\", \"marginLeft\", \"marginRight\"];\n\n\tfor (var intOption in intOptions) {\n\t\tif (intOptions.hasOwnProperty(intOption)) {\n\t\t\tintOption = intOptions[intOption];\n\t\t\tif (typeof options[intOption] === \"string\") {\n\t\t\t\toptions[intOption] = parseInt(options[intOption], 10);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof options[\"displayValue\"] === \"string\") {\n\t\toptions[\"displayValue\"] = options[\"displayValue\"] != \"false\";\n\t}\n\n\treturn options;\n}", "function optionsFromStrings(options) {\n\tvar intOptions = [\"width\", \"height\", \"textMargin\", \"fontSize\", \"margin\", \"marginTop\", \"marginBottom\", \"marginLeft\", \"marginRight\"];\n\n\tfor (var intOption in intOptions) {\n\t\tif (intOptions.hasOwnProperty(intOption)) {\n\t\t\tintOption = intOptions[intOption];\n\t\t\tif (typeof options[intOption] === \"string\") {\n\t\t\t\toptions[intOption] = parseInt(options[intOption], 10);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof options[\"displayValue\"] === \"string\") {\n\t\toptions[\"displayValue\"] = options[\"displayValue\"] != \"false\";\n\t}\n\n\treturn options;\n}", "function optionsFromStrings(options) {\n\tvar intOptions = [\"width\", \"height\", \"textMargin\", \"fontSize\", \"margin\", \"marginTop\", \"marginBottom\", \"marginLeft\", \"marginRight\"];\n\n\tfor (var intOption in intOptions) {\n\t\tif (intOptions.hasOwnProperty(intOption)) {\n\t\t\tintOption = intOptions[intOption];\n\t\t\tif (typeof options[intOption] === \"string\") {\n\t\t\t\toptions[intOption] = parseInt(options[intOption], 10);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof options[\"displayValue\"] === \"string\") {\n\t\toptions[\"displayValue\"] = options[\"displayValue\"] != \"false\";\n\t}\n\n\treturn options;\n}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions( options ) {\n\t\tvar object = optionsCache[ options ] = {};\n\t\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\t\tobject[ flag ] = true;\n\t\t});\n\t\treturn object;\n\t}", "function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=true;});return object;}", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n object[ flag ] = true;\n });\n return object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}" ]
[ "0.65983355", "0.65088433", "0.64988786", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.6476238", "0.647308", "0.6450778", "0.64444906", "0.6403399", "0.6280776", "0.6278151", "0.62330157", "0.6211959", "0.62033", "0.61873025", "0.61873025", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.6185875", "0.615401", "0.6152873", "0.6150098", "0.61350304", "0.6115597", "0.6111653", "0.6108955", "0.6108955", "0.6108955", "0.6091507", "0.6091507", "0.6091507", "0.6091507", "0.6091507", "0.6091507", "0.6091507", "0.607726", "0.6044106", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255", "0.60436255" ]
0.6588602
1
checks a cache object for emptiness
function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emptyCache() {\n this.cache = {};\n }", "emptyCache() {\n this.cache = {};\n }", "function clearcache() {\n dbgmsg( 'retrieveData: Internal cache contain attribute values for: ' + Object.keys( cache ).sort().join( '; ' ) );\n cache = {};\n logmsg( 'retrieveData: cache cleared.' );\n }", "function clearCache() {\n cache = undefined;\n}", "function clearCache() {\n _cache = {};\n }", "function clear() {\n cache = {};\n}", "function clear() {\n cache = {};\n}", "function clear() {\n cache = {};\n}", "function clear() {\n cache = {};\n}", "function checkNoCache (res) {\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'x-cache-channel'));\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'surrogate-key'));\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'cache-control')); // is this correct ?\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'last-modified')); // is this correct ?\n}", "function clear () {\n\tcache = {};\n}", "clearCache() {\n if (!isNullOrUndefined(localStorage.getItem(this.uniqueKey))) {\n localStorage.removeItem(this.uniqueKey);\n }\n }", "checkCacheTimer() {\n var oldCacheTime = this.cacheTime;\n super.checkCacheTimer(); // First call service level cache clearning\n // Then do implementation specific cache clean-up\n if (this.now - oldCacheTime > this.CACHE_TIMEOUT) {\n // Clear the cache\n this.cache.bar = {};\n }\n }", "clear() {\n if (!this._cache) {\n return;\n }\n this._cache.clear();\n }", "function checkCache () {\n fetch('/cache/', {\n method: 'HEAD'\n }).then( function (response) {\n if (parseInt(response.headers.get('Last-modified'), 10) > CACHE_NAME) caches.delete(CACHE_NAME);\n });\n}", "function resetCache() {\n console.log('resetCache');\n cache = {};\n }", "function listCacheClear(){this.__data__=[];this.size=0}", "function listCacheClear(){this.__data__=[];this.size=0}", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function checkEmptyObject(obj) {\n return Object.keys(obj).length <= 0;\n }", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "function listCacheClear(){\nthis.__data__=[];\nthis.size=0;\n}", "function clearCache() {\n measurementIs = {};\n}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "isEmpty(obj){\n return !Object.keys(obj).length;\n }", "clearCache() {\n\t /*\n\t * Tracks specific objects such as accounts that can trigger additional\n\t * fetching that should only happen if we're actually interested in the account\n\t */\n\t this.subbed_accounts = new Set();\n\t this.subbed_witnesses = new Set();\n\t this.subbed_committee = new Set();\n\n\t this.objects_by_id = new Map();\n\t this.accounts_by_name = new Map();\n\t this.assets_by_symbol = new Map();\n\t this.account_ids_by_key = __WEBPACK_IMPORTED_MODULE_0_immutable___default.a.Map();\n\t this.account_ids_by_account = __WEBPACK_IMPORTED_MODULE_0_immutable___default.a.Map();\n\n\t this.balance_objects_by_address = new Map();\n\t this.get_account_refs_of_keys_calls = new Set();\n\t this.get_account_refs_of_accounts_calls = new Set();\n\t this.account_history_requests = new Map(); ///< tracks pending history requests\n\t this.witness_by_account_id = new Map();\n\t this.committee_by_account_id = new Map();\n\t this.objects_by_vote_id = new Map();\n\t this.fetching_get_full_accounts = new Map();\n\t this.get_full_accounts_subscriptions = new Map();\n\t clearTimeout(this.timeout);\n\t this.dispatched = false;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }" ]
[ "0.7050553", "0.7050553", "0.66289544", "0.6554919", "0.65317714", "0.64950603", "0.64907366", "0.64907366", "0.64907366", "0.6364922", "0.63472253", "0.6262434", "0.6233119", "0.6168802", "0.6158475", "0.6138711", "0.61330646", "0.61330646", "0.6131914", "0.6131914", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.6101407", "0.60972124", "0.60972124", "0.60972124", "0.60972124", "0.6088776", "0.6068192", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.6053886", "0.605309", "0.6047907", "0.60474974", "0.60474974", "0.6036195", "0.6026654", "0.602466", "0.60240847", "0.60240847", "0.60240847", "0.60240847", "0.60240847", "0.60240847" ]
0.0
-1
Returns a function to use in pseudos for input types
function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createInputPseudo(type) {\n return function(elem) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === type;\n };\n }", "function createInputPseudo( type ) {\r\r\n\treturn function( elem ) {\r\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\r\n\t\treturn name === \"input\" && elem.type === type;\r\r\n\t};\r\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\n\n\treturn function( elem ) {\n\n\t\tvar name = elem.nodeName.toLowerCase();\n\n\t\treturn name === \"input\" && elem.type === type;\n\n\t};\n\n}", "function createInputPseudo( type ) {\n return function( elem ) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === type;\n };\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n return function( elem ) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === type;\n };\n}", "getCastFn(name) {\n if (name in this.inputs && this.inputs[name].cast) {\n return this.inputs[name].cast;\n }\n return identity;\n }", "function instType(inst) {\n\n var type;\n\n if (inst == (\"add\") || inst == (\"addu\") || inst == (\"and\") ||\n inst == (\"div\") || inst == (\"divu\") ||/*inst == (\"jr\") ||*/\n inst == (\"mfcZ\") || inst == (\"mfhi\") || inst == (\"mflo\") ||\n inst == (\"mtcZ\") || inst == (\"mult\") || inst == (\"multu\") ||\n inst == (\"nor\") || inst == (\"or\") || inst == (\"sll\") ||\n inst == (\"sllv\") || inst == (\"slt\") || inst == (\"sltu\") ||\n inst == (\"sra\") || inst == (\"srav\") || inst == (\"srl\") ||\n inst == (\"srlv\") || inst == (\"sub\") || inst == (\"subu\") ||\n inst == (\"xor\")) {\n\n type = \"r\";\n\n } else if (inst == (\"addi\") || inst == (\"addiu\") || inst == (\"andi\")/*||\n inst == (\"beq\") || inst == (\"bne\")*/ || inst == (\"lb\") ||\n inst == (\"lbu\") || inst == (\"lh\") || inst == (\"lhu\") ||\n inst == (\"lui\") || inst == (\"lw\") || inst == (\"ori\") ||\n inst == (\"sb\") || inst == (\"sh\") || inst == (\"slti\") ||\n inst == (\"sltiu\")|| inst == (\"sw\") || inst == (\"xori\")) {\n\n type = \"i\";\n\n } else if (inst == (\"j\") || inst == (\"jal\")) {\n\n type = \"j\";\n\n } else if (inst == (\"b\") || inst == (\"bal\") || inst == (\"beqz\") ||\n inst == (\"bge\") || inst == (\"bgt\") || inst == (\"bgtu\") ||\n inst == (\"bgtz\") || inst == (\"ble\") || inst == (\"blt\") ||\n inst == (\"clear\") || inst == (\"pdiv\") || inst == (\"la\") ||\n inst == (\"li\") || inst == (\"move\") || inst == (\"mul\") ||\n inst == (\"not\") || inst == (\"rem\") || inst == (\"subi\")) {\n\n type = \"p\";\n\n } else if (inst == (\"break\") || inst == (\"syscall\")) {\n\n type = \"o\";\n\n } else if (inst == (\"noop\")) {\n\n type = \"no\";\n\n }\n\n return type;\n\n}", "function isFunction(input){return\"undefined\"!=typeof Function&&input instanceof Function||\"[object Function]\"===Object.prototype.toString.call(input)}", "function getType(fn){var match=fn&&fn.toString().match(/^\\s*function (\\w+)/);return match?match[1]:'';}", "function getType(fn){var match=fn&&fn.toString().match(/^\\s*function (\\w+)/);return match?match[1]:'';}", "function input(type) {\n const value = typeof type;\n return value;\n}", "function typeOperation(operator, num) {\n if (operator == 'sin') return Math.sin(num)\n else if (operator == 'cos') return Math.cos(num)\n else if (operator == 'ln') return Math.log2(num)\n else if (operator == 'tan') return Math.tan(num)\n else if (operator == 'e') return Math.E\n else if (operator == 'pi') return Math.PI\n else if (operator == 'sqrt') return Math.sqrt(num) \n return num\n}", "function coercion(type) {\n var fn;\n\n switch (type) {\n case 'integer':\n case 'float':\n case 'long':\n case 'double':\n fn = function (data) {\n if (isNaN(data)) {\n return data;\n }\n return Number(data);\n };\n break;\n case 'string':\n fn = String;\n break;\n case 'byte':\n fn = function (data) {\n return isNaN(data) ? new Buffer(data)[0] : Number(data);\n };\n break;\n case 'boolean':\n fn = Boolean;\n break;\n case 'date':\n case 'dateTime':\n fn = Date.parse;\n break;\n }\n\n return fn;\n}", "function getType(fn){var match=fn&&fn.toString().match(/^\\s*function (\\w+)/);return match&&match[1];}", "function type(input) {\n \treturn typeof input\n}", "function convertType()\n{\n console .log ('*********Type conversion***********');\n let str = '58ABC';\n let strf = '58.88ABC';\n let notanum = 'ABC58';\n let num = 56.78;\n let fn = function()\n {\n console.log('this is a function');\n };\n\n console.log(typeof(fn));\n console.log(fn.toString());\n console.log(num.toString());\n console.log(Number.parseInt(str));\n console.log(Number.parseFloat(strf));\n console.log(Number.parseFloat(notanum));\n}", "function isFunction(input) {\n return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }", "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, ocatal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] == 'F') {\n return [\"number\", \"\\\\d*.?\\\\d*\"];\n }\n return [\"text\", \".*\"];\n }", "function input(aType, updateF, attribs) {\n aType = aType.toLowerCase();\n var dispatchTable = { text : text_input,\n password: text_input,\n checkbox: checkbox_input\n //button: button_input,\n //radio: radio_input \n };\n\n if (dispatchTable[aType]) {\n return (dispatchTable[aType])(aType, updateF, attribs);\n }\n else {\n throw new Error(\"js-input: does not currently support type \" + aType);\n }\n }", "function input(aType, updateF, attribs) {\n aType = aType.toLowerCase();\n var dispatchTable = { text : text_input,\n password: text_input,\n checkbox: checkbox_input\n //button: button_input,\n //radio: radio_input \n };\n\n if (dispatchTable[aType]) {\n return (dispatchTable[aType])(aType, updateF, attribs);\n }\n else {\n throw new Error(\"js-input: does not currently support type \" + aType);\n }\n }", "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, octal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] == 'F') {\n return [\"number\", \"\\\\d*.?\\\\d*\"];\n }\n return [\"text\", \".*\"];\n }", "function isFunction(input) {\n\t return (\n\t (typeof Function !== 'undefined' && input instanceof Function) ||\n\t Object.prototype.toString.call(input) === '[object Function]'\n\t );\n\t }", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n }", "function getType (fn) {\n\t\tvar match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t\treturn match ? match[1] : ''\n\t}", "function getType (fn) {\r\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : ''\r\n}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : ''\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : ''\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function isFunction(input) {\n return (\n typeof Function !== 'undefined' && input instanceof Function ||\n Object.prototype.toString.call(input) === '[object Function]');\n\n }", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n }", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n }", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n }", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n }", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n }", "function getType(fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1];\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/)\n\t return match && match[1]\n\t}", "function getType(fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : '';\n\t}", "function getType(fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : '';\n\t}", "async pseudoType () {\n const pseudoFn = `${this.currentAstNode.value.slice(1)}Pseudo`\n if (!this[pseudoFn]) {\n throw Object.assign(\n new Error(`\\`${this.currentAstNode.value\n }\\` is not a supported pseudo selector.`),\n { code: 'EQUERYNOPSEUDO' }\n )\n }\n const nextResults = await this[pseudoFn]()\n this.processPendingCombinator(nextResults)\n }", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : \"\";\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function Input() {}", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n}" ]
[ "0.64144033", "0.63896376", "0.63754016", "0.63754016", "0.63754016", "0.63754016", "0.63666767", "0.6362271", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.63515526", "0.6345567", "0.58834153", "0.58619547", "0.5808492", "0.5787667", "0.5787667", "0.56660736", "0.56531423", "0.56446064", "0.5638159", "0.5601711", "0.55855095", "0.55227715", "0.5466068", "0.545405", "0.545405", "0.5410634", "0.5409441", "0.53556055", "0.5350214", "0.53501225", "0.53394115", "0.53394115", "0.5329672", "0.5329672", "0.5329672", "0.5329672", "0.5329672", "0.5329672", "0.5327636", "0.5326466", "0.5326466", "0.5326466", "0.5326466", "0.53244835", "0.5321403", "0.5320233", "0.5309637", "0.5309637", "0.5305528", "0.5300219", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.5297992", "0.52917254", "0.52865136" ]
0.6371507
6
Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createButtonPseudo(type) {\n return function(elem) {\n var name = elem.nodeName.toLowerCase();\n return (name === \"input\" || name === \"button\") && elem.type === type;\n };\n }", "static get BUTTON_X() {\n return \"x\";\n }", "function createButtonPseudo( type ) {\r\r\n\treturn function( elem ) {\r\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\r\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\r\r\n\t};\r\r\n}", "function ButtonControl() {\n}", "function createButtonPseudo( type ) {\n return function( elem ) {\n var name = elem.nodeName.toLowerCase();\n return (name === \"input\" || name === \"button\") && elem.type === type;\n };\n}", "function createButtonPseudo( type ) {\n return function( elem ) {\n var name = elem.nodeName.toLowerCase();\n return (name === \"input\" || name === \"button\") && elem.type === type;\n };\n}", "function createButtonPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\r\n\t};\r\n}", "function createButtonPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\r\n\t};\r\n}", "function createButtonPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\r\n\t};\r\n}", "function createButtonPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\r\n\t};\r\n}", "function createButtonPseudo( type ) {\n\n\treturn function( elem ) {\n\n\t\tvar name = elem.nodeName.toLowerCase();\n\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\n\t};\n\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}", "function pmMakeButton(title,functionName,params) {\n let paramStr = '';\n if(params !== null && params.length > 0){\n if( typeof params === 'string' ) {\n params = [ params ];\n }\n for (let i = 0;i<params.length;i++){\n paramStr += '\\''+params[i]+'\\'';\n paramStr += ',';\n }\n paramStr = paramStr.slice(0,-1);\n }\n return '<input onclick=\"'+functionName+'('+paramStr+');\" type=\"button\" value=\"'+title+'\"/>';\n}", "function createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === \"input\" || name === \"button\" ) && elem.type === type;\n\t};\n}", "static get BUTTON_A() {\n return \"a\";\n }", "renderFunction(fn) {\n const className = \"fn-\" + OperationsToWords[fn]\n return <CalculatorButton className={className} value={fn} onPress={() => this.evalDouble(fn)}/>\n }", "renderSingle(fn) {\n const className = \"fn-\" + OperationsToWords[fn]\n return <CalculatorButton className={className} value={fn} onPress={() => this.evalSingleOperandFn(fn)}/>\n }", "static get BUTTON_B() {\n return \"b\";\n }", "function new_toogle_button(classButton, textButton){\n\nreturn \"<span class=\\\"padding\\\" style=\\\"cursor:pointer;\\\" onclick=\\\"\"+classButton+\"()\\\" >&nbsp;&nbsp;&nbsp;&nbsp;\"+textButton+\"&nbsp;<img src=\\\"/pics/sort_btn_gray_on.gif\\\" class=\\\"\"+classButton+\"\\\"/></span>\";\n}", "handleButton() {}", "function createButton(btnFunction) {\n\t var btn = document.createElement(\"button\");\n\t var btnDisplay = document.createTextNode(btnFunction);\n\t btn.appendChild(btnDisplay);\n\t \n\t switch (btnFunction) {\n\t\t case \"Up\":\n\t\t\tdocument.getElementById(\"BtnUp\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Down\":\n\t\t\tdocument.getElementById(\"BtnDown\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Left\":\n\t\t\tdocument.getElementById(\"BtnLeft\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Right\":\n\t\t\tdocument.getElementById(\"BtnRight\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Mark Cell\":\n\t\t\tdocument.getElementById(\"BtnMarkCell\").appendChild(btn);\n\t\t\tbreak;\n\t\t default:\n\t\t\tbreak;\n\t }\n}", "function button.crystal1() {\r\n\t// body...\r\n}", "onClick(functionName) {\n return functionName;\n }", "get Joystick5Button14() {}", "static get BUTTON_Y() {\n return \"y\";\n }", "function tambah() {\n var operasi_tambah = new button(\"+\");\n}", "get Joystick3Button14() {}", "static get BUTTON_L() {\n return \"tl\";\n }", "get Joystick1Button14() {}", "get Joystick7Button14() {}", "get Joystick5Button13() {}", "function getCurrentClueButtons() {\n let lfunc = \"cnavPrev()\"\n let lfuncTip = \"Previous clue\"\n let rfunc = \"cnavNext()\"\n let rfuncTip = \"Next clue\"\n return '<span>' +\n '<button class=\"small-button\" ' +\n 'title=\"' + lfuncTip + '\" onclick=\"' + lfunc + '\">' +\n '&lsaquo;</button>&nbsp;' +\n '<button class=\"small-button\" ' +\n 'title=\"' + rfuncTip + '\" onclick=\"' + rfunc + '\">' +\n '&rsaquo;</button></span> ';\n}", "get Joystick2Button14() {}", "get JoystickButton14() {}", "button(text, fcn, id){\n\t\tif (typeof fcn !== \"undefined\" && typeof text !== \"undefined\"){\n\t\t\ttext = String(text);\n\t\t\tfcn = String(fcn);\n\t\t\tlet foo = document.createElement(\"input\");\n\t\t\tfoo.setAttribute(\"type\", \"button\");\n\t\t\tfoo.setAttribute(\"value\", text);\n\t\t\tfoo.setAttribute(\"onclick\", fcn);\n\t\t\tif(typeof id !== \"undefined\"){\n\t\t\t\tid = String(id);\n\t\t\t\tfoo.setAttribute(\"id\", id);\n\t\t\t} // end if\n\t\t\tdocument.body.appendChild(foo);\n\t\t}else {\n\t\t\tconsole.log(\"button - \" + \"(\" + \"ERROR - invalid parameter (text, function, id)\" + \")\");\n\t\t} // end if\n }", "static get BUTTON_R() {\n return \"tr\";\n }", "get Joystick6Button14() {}", "get Joystick7Button13() {}", "initButtons() {\n this.setupButton(\"efecBtn\", (e) => {\n\n })\n\n }", "function commandButtons()\r\n{\r\n return new Array(MM.BTN_OK, \"clickedOK()\", \r\n MM.BTN_Cancel, \"clickedCancel()\", \r\n MM.BTN_Test, \"clickedTest()\", \r\n MM.BTN_Advanced, \"clickedAdvanced()\", \r\n MM.BTN_Help, \"displayHelp()\"); \r\n}", "createButton(x, y, text, callback){\n const button = this.add.text(x, y, text, { fill: '#0f0' });\n button.setOrigin(0.5, 0.5);\n button.setInteractive()\n .on('pointerup', () => callback())\n .on('pointerover', () => this.enterButtonHoverState(button) )\n .on('pointerout', () => this.enterButtonRestState(button) );\n return button;\n }", "get Joystick2Button13() {}", "function ButtonFX(btn, t) {\n\tif (document.getElementById) {\n\tdocument.getElementById(btn).src = (t? eval(btn+\"_on.src\") : eval(btn+\"_off.src\"));\n\t}\n}", "get Joystick7Button1() {}", "get Joystick3Button13() {}", "get Joystick4Button14() {}", "function EXButton(opt)\r\n{\r\n Sprite.Set(opt.bt,Sprite.Expand);\r\n $(opt.bt).addClass(\"clickable\");\r\n opt.bt.Expand=function()\r\n {\r\n Sprite.Set(opt.bt,Sprite.Collapse);\r\n opt.bt.IsExpanded = true;\r\n $(opt.expansion).slideDown(200);\r\n if (opt.OnExpand) opt.OnExpand(opt.bt);\r\n if (opt.OnToggle) opt.OnToggle(opt.bt);\r\n };\r\n opt.bt.Collapse=function()\r\n {\r\n Sprite.Set(opt.bt,Sprite.Expand);\r\n opt.bt.IsExpanded = false;\r\n $(opt.expansion).slideUp(200);\r\n if (opt.OnCollapse) opt.OnExpand(opt.bt);\r\n if (opt.OnToggle) opt.OnToggle(opt.bt);\r\n };\r\n opt.bt.Toggle=function()\r\n {\r\n if (opt.bt.IsExpanded)\r\n opt.bt.Collapse();\r\n else\r\n opt.bt.Expand();\r\n };\r\n $(opt.bt).click(opt.bt.Toggle);\r\n}", "get Joystick5Button11() {}", "get Joystick6Button13() {}", "get Joystick7Button11() {}", "get Joystick6Button1() {}", "getButton() {\n const impure = compose(R.nth(0),\n R.prop('childNodes'),\n R.prop('shadowRoot'));\n\n return impure(this);\n }", "get Joystick1Button17() {}", "get JoystickButton17() {}", "get Joystick1Button0() {}", "get Joystick7Button17() {}", "get Joystick2Button17() {}", "get Joystick7Button12() {}", "get Joystick6Button17() {}", "get Joystick5Button12() {}", "get Joystick5Button17() {}", "get Joystick1Button13() {}", "static get CLICK() {\n return \"click\";\n }", "get Joystick7Button0() {}", "get Joystick7Button15() {}", "get Joystick3Button17() {}", "get Joystick7Button2() {}", "get subscriptButton() {\n return {\n command: \"subscript\",\n icon: \"mdextra:subscript\",\n label: \"Subscript\",\n radio: true,\n type: \"rich-text-editor-button\",\n };\n }", "get Joystick4Button13() {}", "get Joystick2Button15() {}", "get Joystick6Button11() {}", "get Joystick1Button15() {}", "get Joystick1Button12() {}", "get Joystick5Button0() {}", "activateButton(){\n //If the button already exists, we want to remove and rebuilt it\n if(this.button)\n this.button.dispose();\n\n //Create button called but with Activate SpeedBoost as its text\n this.button = Button.CreateSimpleButton(\"but\", \"Activate\\nSpeedBoost\");\n this.button.width = 0.8;\n this.button.height = 0.8;\n this.button.color = \"white\";\n this.button.background = \"red\";\n this.button.alpha = 0.8;\n this.stackPanel.addControl(this.button);\n //Scope these attributes so they can be used below\n var button = this.button;\n var app = this.app;\n\n //Function for if they click it\n //Function is a member of the button object, not of this class\n this.button.onPointerDownObservable.add(function() {\n if(button.textBlock.text != \"Activate\\nSpeedBoost\")\n return;\n app.buttonPressed(\"speedBoost\");\n button.textBlock.text = \"SpeedBoost\\nActivated\";\n }); \n }", "function getButtonText() {\n return 'Click on me!';\n}", "get button () {return this._p.button;}", "get Joystick4Button17() {}", "get JoystickButton13() {}", "get Joystick2Button12() {}", "function addBtnSig(btnId, value)\r\n{\r\n\tlet btnSig = addElemNewSig(btnId, value);\r\n\tbtn = btnSig.elem;\r\n\tsig = btnSig.sig\r\n\tbtn.addEventListener(\"click\", sig.toggle.bind(sig));\t\r\n\r\n\treturn sig;\t\r\n}", "function _button_wrapper(str, title){\n\tvar b = new bbop.widget.display.text_button_sim(str, title, '');\n\treturn b.to_string();\n }", "get Joystick2Button0() {}" ]
[ "0.64884734", "0.64819735", "0.6478148", "0.64756554", "0.6465699", "0.64540684", "0.64501953", "0.64501953", "0.64501953", "0.64501953", "0.6437996", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.6395441", "0.63841695", "0.6329994", "0.62595546", "0.62237227", "0.61581373", "0.6108392", "0.60897493", "0.6018185", "0.6001078", "0.59659386", "0.5943793", "0.59420836", "0.5936431", "0.59208095", "0.59072614", "0.58972794", "0.58963317", "0.5892285", "0.5890259", "0.5885126", "0.58769053", "0.5873622", "0.58622473", "0.5861551", "0.5858692", "0.5855672", "0.58445346", "0.5839525", "0.5836183", "0.5834105", "0.5830671", "0.5824638", "0.5816551", "0.5813057", "0.5802986", "0.5801621", "0.58015585", "0.5799447", "0.57945806", "0.57917315", "0.5788666", "0.5787881", "0.5786282", "0.5785424", "0.57800245", "0.5777439", "0.5776953", "0.5774483", "0.5769315", "0.57691294", "0.5763993", "0.57605386", "0.5759492", "0.5758828", "0.57587844", "0.57562715", "0.5753457", "0.57452303", "0.574087", "0.5740292", "0.573923", "0.5735392", "0.5732768", "0.57323873", "0.57300615", "0.5729609", "0.5727779", "0.57276124", "0.57256925", "0.57248175" ]
0.6529537
0
Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPositionalPseudo(fn) {\n return markFunction(function(argument) {\n argument = +argument;\n return markFunction(function(seed, matches) {\n var j,\n matchIndexes = fn([], seed.length, argument),\n i = matchIndexes.length;\n\n // Match elements found at the specified indexes\n while (i--) {\n if (seed[(j = matchIndexes[i])]) {\n seed[j] = !(matches[j] = seed[j]);\n }\n }\n });\n });\n }", "function createPositionalPseudo( fn ) {\r\r\n\treturn markFunction(function( argument ) {\r\r\n\t\targument = +argument;\r\r\n\t\treturn markFunction(function( seed, matches ) {\r\r\n\t\t\tvar j,\r\r\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\r\r\n\t\t\t\ti = matchIndexes.length;\r\r\n\r\r\n\t\t\t// Match elements found at the specified indexes\r\r\n\t\t\twhile ( i-- ) {\r\r\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\r\r\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t});\r\r\n\t});\r\r\n}", "function createPositionalPseudo( fn ) {\n\n\treturn markFunction(function( argument ) {\n\n\t\targument = +argument;\n\n\t\treturn markFunction(function( seed, matches ) {\n\n\t\t\tvar j,\n\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\n\t\t\t\ti = matchIndexes.length;\n\n\n\n\t\t\t// Match elements found at the specified indexes\n\n\t\t\twhile ( i-- ) {\n\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\n\t});\n\n}", "function createPositionalPseudo( fn ) {\r\n\treturn markFunction(function( argument ) {\r\n\t\targument = +argument;\r\n\t\treturn markFunction(function( seed, matches ) {\r\n\t\t\tvar j,\r\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\r\n\t\t\t\ti = matchIndexes.length;\r\n\r\n\t\t\t// Match elements found at the specified indexes\r\n\t\t\twhile ( i-- ) {\r\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\r\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function createPositionalPseudo( fn ) {\r\n\treturn markFunction(function( argument ) {\r\n\t\targument = +argument;\r\n\t\treturn markFunction(function( seed, matches ) {\r\n\t\t\tvar j,\r\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\r\n\t\t\t\ti = matchIndexes.length;\r\n\r\n\t\t\t// Match elements found at the specified indexes\r\n\t\t\twhile ( i-- ) {\r\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\r\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function createPositionalPseudo( fn ) {\r\n\treturn markFunction(function( argument ) {\r\n\t\targument = +argument;\r\n\t\treturn markFunction(function( seed, matches ) {\r\n\t\t\tvar j,\r\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\r\n\t\t\t\ti = matchIndexes.length;\r\n\r\n\t\t\t// Match elements found at the specified indexes\r\n\t\t\twhile ( i-- ) {\r\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\r\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function createPositionalPseudo( fn ) {\r\n\treturn markFunction(function( argument ) {\r\n\t\targument = +argument;\r\n\t\treturn markFunction(function( seed, matches ) {\r\n\t\t\tvar j,\r\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\r\n\t\t\t\ti = matchIndexes.length;\r\n\r\n\t\t\t// Match elements found at the specified indexes\r\n\t\t\twhile ( i-- ) {\r\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\r\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function createPositionalPseudo( fn ) {\n return markFunction(function( argument ) {\n argument = +argument;\n return markFunction(function( seed, matches ) {\n var j,\n matchIndexes = fn( [], seed.length, argument ),\n i = matchIndexes.length;\n\n // Match elements found at the specified indexes\n while ( i-- ) {\n if ( seed[ (j = matchIndexes[i]) ] ) {\n seed[j] = !(matches[j] = seed[j]);\n }\n }\n });\n });\n}", "function firstClass(base){\n //returns anonymous function evaluating the new paremeter to the power of whatever the base it set to\n return (q) => q ** base;\n}", "function multiplicaPor7() {\n return function(n) { return n*7 }\n}", "function dynamicStatePseudo(name) {\n return function dynamicPseudo(next, _rule, _a) {\n var adapter = _a.adapter;\n var func = adapter[name];\n\n if (typeof func !== \"function\") {\n return boolbase_1.falseFunc;\n }\n\n return function active(elem) {\n return func(elem) && next(elem);\n };\n };\n}", "function dynamicStatePseudo(name) {\n return function dynamicPseudo(next, _rule, _a) {\n var adapter = _a.adapter;\n var func = adapter[name];\n if (typeof func !== \"function\") {\n return boolbase_1.falseFunc;\n }\n return function active(elem) {\n return func(elem) && next(elem);\n };\n };\n }", "function dynamicStatePseudo(name) {\n return function dynamicPseudo(next, _rule, _a) {\n var adapter = _a.adapter;\n var func = adapter[name];\n if (typeof func !== \"function\") {\n return boolbase_1.falseFunc;\n }\n return function active(elem) {\n return func(elem) && next(elem);\n };\n };\n}", "function dynamicStatePseudo(name) {\n return function dynamicPseudo(next, _rule, _a) {\n var adapter = _a.adapter;\n var func = adapter[name];\n if (typeof func !== \"function\") {\n return boolbase_1.falseFunc;\n }\n return function active(elem) {\n return func(elem) && next(elem);\n };\n };\n}", "async pseudoType () {\n const pseudoFn = `${this.currentAstNode.value.slice(1)}Pseudo`\n if (!this[pseudoFn]) {\n throw Object.assign(\n new Error(`\\`${this.currentAstNode.value\n }\\` is not a supported pseudo selector.`),\n { code: 'EQUERYNOPSEUDO' }\n )\n }\n const nextResults = await this[pseudoFn]()\n this.processPendingCombinator(nextResults)\n }", "function yFindProximity(func)\n{\n return YProximity.FindProximity(func);\n}", "function dynamicStatePseudo(name) {\n return function dynamicPseudo(next, _rule, { adapter }) {\n const func = adapter[name];\n if (typeof func !== \"function\") {\n return boolbase.falseFunc;\n }\n return function active(elem) {\n return func(elem) && next(elem);\n };\n };\n}", "function getFunc() { return \"gate\"; }", "operator(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n }", "man() {\n console.log('Peano - Expression := ');\n console.log('0 | ++expr | --expr | definition');\n console.log('definition = <Nom_fonction>(<arg>i, <arg>j, ...) { }');\n console.log('\\n');\n }", "function produceTipCalculator (percentTip) {\n return function (fare) {\n return fare * percentTip;\n }\n}", "function make_expr_fun(expr: string): Function {\n return new Function('$', '\"use strict\"; return (' + expr + ')');\n}", "getMappingFunction() {\n return (v) => {\n const x = v.x*this[0][0] + v.y*this[0][1] + v.z*this[0][2] + this[0][3];\n const y = v.x*this[1][0] + v.y*this[1][1] + v.z*this[1][2] + this[1][3];\n const z = v.x*this[2][0] + v.y*this[2][1] + v.z*this[2][2] + this[2][3];\n const w = v.x*this[3][0] + v.y*this[3][1] + v.z*this[3][2] + this[3][3];\n\n return (w !== 0) ? new Point(x / w, y / w, z / w) : new Point(0, 0, 0);\n };\n }", "function getX(p) {\n return p('get-x');\n}", "function produceTipCalculator(percentage) {\n return function(rideFare) {\n return rideFare * percentage;\n }\n}", "function f(x) {\n /* x^3-cos(x) */\n var eval=x**3-Math.cos(x)\n return eval\n}", "getFunction() {\n const expression = document.getElementById(\"funct\").value.toLowerCase();\n\n if (expression == \"\") {\n console.log(\"empty function field\");\n return;\n }\n // replace('ln(x)', 'log(x, 2.71828182846)')\n const finalexpression = this.scrubln(expression).trim();\n // console.log(finalexpression, expression);\n\n if (!this.functionAlreadyExists(expression)) {\n try {\n const node = math.parse(finalexpression);\n const code = node.compile();\n\n const coords = this.getExpressionValues(code);\n\n this.functionArray.push(\n new FunctionObject(expression, finalexpression, coords, code, this)\n );\n this.addFunctionDetailsDiv();\n this.drawFunctionValuesToGraph(coords);\n } catch (err) {\n console.log(\"input created a problem...\");\n console.log(err);\n }\n }\n console.log(\"expression alreadu input\");\n }", "function Cosine() {\r\n}", "function calc(exp) { return \"calc(\" + exp + \")\"; }", "parameter(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return (datum, _) => interpret(ast, fn, _, datum);\n }", "function AlphaPos () { }", "function Acos() {\r\n}", "function makefunc(x) {\r\n// return function() { return x; }\r\n// return new Function($direct_func_xxx$);\r\n return new Function(\"return x;\")\r\n}", "function mathStart(fn) {\n return function(ctx) {\n let opers = getTypedOperands(this.name, ctx, [ResType.NUM, ResType.NUM]);\n if (!opers) return;\n\n let [a, b] = opers;\n ctx.stack.push(resNumItem(fn(a.content, b.content)));\n }\n}", "function gensymf(prefix) {\n var number = 0;\n return function () {\n number += 1;\n return prefix + number;\n };\n}", "function createFareMultiplier(integar){\nreturn function (Multiplier) {\n return Multiplier * integar;\n }}", "function expr (str, fn){\n var p = unique(props(str))\n if (fn && 'string' == typeof fn) fn = prefixed(fn)\n if (fn) return map(str, p, fn)\n return p\n}", "function func1(x,y) {\n funcion = document.equation.equat.value; \n return (eval(funcion));\n}", "'ev'(env) {\n var args = this.args.map(function (a) {\n return a.ev(env);\n });\n\n for (var i = 0; i < args.length; i++) {\n if (args[i].is === 'undefined') {\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n }\n\n if (this.name in CartoCSS.Tree.functions) {\n if (CartoCSS.Tree.functions[this.name].length <= args.length) {\n var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);\n if (val === null) {\n env.error({\n message: 'incorrect arguments given to ' + this.name + '()',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {is: 'undefined', value: 'undefined'};\n }\n return val;\n } else {\n env.error({\n message: 'incorrect number of arguments for ' + this.name +\n '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n } else {\n var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];\n if (fn === undefined) {\n var functions = toPairs(CartoCSS.Tree.Reference.mapnikFunctions);\n // cheap closest, needs improvement.\n var name = this.name;\n var mean = functions.map(function (f) {\n return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];\n }).sort(function (a, b) {\n return a[1] - b[1];\n });\n env.error({\n message: 'unknown function ' + this.name + '(), did you mean ' +\n mean[0][0] + '(' + mean[0][2] + ')',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n if (fn !== args.length &&\n // support variable-arg functions like `colorize-alpha`\n fn !== -1) {\n env.error({\n message: 'function ' + this.name + '() takes ' +\n fn + ' arguments and was given ' + args.length,\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n } else {\n // Save the evaluated versions of arguments\n this.args = args;\n return this;\n }\n }\n }", "function verifPseudo(){\n var pseudo=$('#pseudo');\n var regex = new RegExp(\"[-_.,*$?!@=+]\");\n if(pseudo.value.length < 2 || pseudo.value.length >= 25 || regex.test(pseudo.value)){\n surligne(pseudo, true);\n return true;\n }else{\n surligne(pseudo, false);\n return false;\n }\n}", "function evaluate(x, funcion) {\n while (funcion.includes(\"sin\")) {\n let sin =\n funcion.match(/sin\\((.)\\)/)[1] === \"x\" ? Math.sin(x) : Math.sin(y);\n let variable = funcion.match(/sin\\((.)\\)/)[1];\n funcion = funcion.replace(\"sin(\" + variable + \")\", sin);\n }\n while (funcion.includes(\"cos\")) {\n let cos =\n funcion.match(/cos\\((.)\\)/)[1] === \"x\" ? Math.cos(x) : Math.cos(y);\n let variable = funcion.match(/cos\\((.)\\)/)[1];\n funcion = funcion.replace(\"cos(\" + variable + \")\", cos);\n }\n while (funcion.includes(\"sqrt\")) {\n let sqrt =\n funcion.match(/sqrt\\((.)\\)/)[1] === \"x\" ? Math.sqrt(x) : Math.sqrt(y);\n let variable = funcion.match(/sqrt\\((.)\\)/)[1];\n funcion = funcion.replace(\"sqrt(\" + variable + \")\", sqrt);\n }\n return eval(funcion);\n }", "function createExpFunc(num) {\n\n}", "function addParenthesisAroundFunctions(targetSide){\n\tvar pArr = outerParenthesisBound(targetSide);\n\tconsole.log('addParenthesisAroundFunctions - pArr: ' + JSON.stringify(pArr));\n\tvar f = memObj.knownFunctions;\n\tvar fl, fc, TtargetSide;\n\tvar newTargetSide = '';\n\tvar pos = 0;\n\tvar Pcount = 0;\n\t\n\tfor (var m in pArr) {\n\t\tfor (var n in f) {\n\t\t\tfl = f[n].length;\n\t\t\tfc = targetSide.substring(pArr[m].left-fl, parseInt(pArr[m].left));\n\t\t\tconsole.log('addParenthesisAroundFunctions - fc: ' + fc + ', fl: ' + fl);\n\t\t\tif ((pArr[m].left-fl >= 0) && (targetSide.substring(pArr[m].left-fl, pArr[m].left) == f[n])) {\n\t\t\t\tconsole.log('addParenthesisAroundFunctions - A0');\n\t\t\t\tnewTargetSide += targetSide.substring(pos, pArr[m].left-fl) + '(' + targetSide.substring(pArr[m].left-fl, pArr[m].right+1) + ')';\n\t\t\t\tpos = pArr[m].right+1;\n\t\t\t\tPcount += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconsole.log('addParenthesisAroundFunctions - m: ' + m + ', n: ' + n + ', newTargetSide: ' + newTargetSide + ', targetSide: ' + targetSide);\n\t}\n\tconsole.log('addParenthesisAroundFunctions - newTargetSide 1: ' + newTargetSide);\n\n\tconsole.log('addParenthesisAroundFunctions - newTargetSide.length: ' + newTargetSide.length + ', Pcount: ' + Pcount + ', targetSide.length: ' + targetSide.length+ ', pos: ' + pos);\n\tnewTargetSide += (pos < targetSide.length)? targetSide.substring(pos) : ''; // append any missing piece of the equation to newTargetSide\n\tconsole.log('addParenthesisAroundFunctions - newTargetSide 2: ' + newTargetSide);\n\n\treturn newTargetSide;\n}", "function p(fnName) {\n\t\t\treturn pfx + fnName;\n\t\t}", "function produceTipCalculator(percent) {\n return function(fare) {\n return percent * fare;\n };\n}", "function createInputPseudo( type ) {\n\n\treturn function( elem ) {\n\n\t\tvar name = elem.nodeName.toLowerCase();\n\n\t\treturn name === \"input\" && elem.type === type;\n\n\t};\n\n}", "[Printing.symbol]() {\n if (!this._content) {\n return null;\n }\n return Printing.getPrintFunction(this._content);\n }", "function F(x){\r\n\tvar funcion=document.getElementById('funcion').value; \r\n\r\n\r\n\r\n\t//REEMPLAZAR EQUIS\r\n\tvar equis = [];\r\n\tfor(var i = 0; i < funcion.length; i++) {\r\n\t\tif (funcion[i].toLowerCase() === \"x\") equis.push(i);\r\n\t}\r\n\r\n\tvar totalX = equis.length;\r\n\r\n\tfor(var i=0; i<totalX; i++){\r\n\t\tfuncion = funcion.replace('x', x)\r\n\t}\r\n\t\r\n\ttry {\r\n\t math.eval(funcion); \r\n\t} catch (e) {\r\n\t if (e instanceof SyntaxError) {\r\n\t alert(e.message);\r\n\t }\r\n\t}\r\n\r\n\tconsole.log(funcion);\r\n\t\r\n return math.eval(funcion);\r\n //6*Math.pow(x,3)-2*Math.pow(x,2)-x-1\r\n\r\n}", "function createInputPseudo( type ) {\r\r\n\treturn function( elem ) {\r\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\r\n\t\treturn name === \"input\" && elem.type === type;\r\r\n\t};\r\r\n}", "function fact(n) {\n var operands =[];\n for(var i =0; i < n; i++) {\n operands.push('m');\n }\n console.log(operands);\n var calc = operands.join('*');\n return new Function(\"m\",\"return \"+calc)\n}", "function addPseudoNode({ parent }) {\n return addNode({\n id: `pseudo-${getNextCount()}`, label: 'pseudo', classes: 'pseudo', parent,\n });\n }", "function getFunction(token, currentLocation)\n\t{\n\t\tvar hasParams = {\n\t\t\tInequality: true,\n\t\t\tUnknownEquality: true,\n\t\t\tBooleanOperator: true\n\t\t};\n\n\t\tvar func = token.getFunction();\t// Function name, which is also the class (in the Equiv namespace)\n\t\tvar params = hasParams[func] ? token.tokenValue : undefined;\t// A few constructors take token.tokenValue as a parameter\n\n //console.log(\"func= \" + func);\n\n\t\tvar op = new tree[func](params);\n\n\t\t// Finally, insert the new node and return the updated currentLocation\n\t\treturn insertNewNode(currentLocation, op)\n\t}", "function transform ( p, fn ) {\n\t\t\t\treturn function () {\n\t\t\t\t\tvar result = p();\n\n\t\t\t\t\treturn result === null ? null : fn( result );\n\t\t\t\t};\n\t\t\t}", "function translateAlong(path, totalLength) {\r\n return function(d, i, a) {\r\n\t\t//console.log('Returning function', d, i, a)\r\n\t\t\r\n return function(t) {\r\n\t\t\t//console.log('Getting point', t)\r\n var p = path.getPointAtLength(t * totalLength);\r\n return \"translate(\" + p.x + \",\" + p.y + \")\";\r\n };\r\n };\r\n}", "P() {\n if (isNumber(this.next)) {\n this.operands.push(new Num(this.next));\n this.consume();\n }\n else if (this.next === '(') {\n this.consume();\n this.operators.push(sentinel);\n this.E();\n this.expect(')');\n this.operators.pop();\n }\n else if (unaryOperators[this.next]) {\n this.pushOperator(unary(this.next));\n this.consume();\n this.P();\n }\n else if (isVariable(this.next)) {\n const name = this.next;\n this.consume();\n\n if (this.next === '(') {\n const fn = new Func(name, 0)\n this.pushOperator(fn);\n this.consume();\n this.operators.push(sentinel);\n this.F(fn);\n this.expect(')');\n this.operators.pop();\n }\n else {\n this.operands.push(new Var(name));\n }\n }\n else error('Invalid syntax at \"' + this.next + '\"');\n }", "function createInputPseudo( type ) {\n\t return function( elem ) {\n\t var name = elem.nodeName.toLowerCase();\n\t return name === \"input\" && elem.type === type;\n\t };\n\t}", "function makeOpFunction(op) {\n if (op.f.constant) {\n return function (s) {\n return function (i) {\n return op.domain.has(i) ? op.f() : s(i);\n };\n };\n } else {\n return function (s) {\n return function (i) {\n return op.domain.has(i) ? op.f(s(i)) : s(i);\n };\n };\n }\n}", "function makeOpFunction(op) {\n if (op.f.constant) {\n return function (s) {\n return function (i) {\n return op.domain.has(i) ? op.f() : s(i);\n };\n };\n } else {\n return function (s) {\n return function (i) {\n return op.domain.has(i) ? op.f(s(i)) : s(i);\n };\n };\n }\n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "function magic(x) {\n\n\t\treturn function calc(x) {\n\t\t\treturn x * 30;\n\t\t}\n\n\t}", "function P(){}", "function potencia(base){\n return function(exp){\n return Math.pow(base, exp)\n }\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "function porDos( n ) {\n return n * 2\n} // ()", "calculateLerpFunction ()\n {\n\n // Get the styles we are interested in using\n let transition = Transition[this.transition];\n let style = Style[this.style];\n\n // Build up the function name and get our function\n let functionName = 'lerpStyle' + transition + style;\n let functionToCall = this.lerpFunctions[functionName];\n\n // Send back our function\n return functionToCall;\n }", "get std_eqn() {\n if (this.type == 0) {\n // parabola\n if (this.o == 0)\n return \"$$(y\"+ (this.k > 0 ? \"-\" : \"+\")+ Math.abs(this.k) +\")^2 = \" + this.lr + \"(x\" + (this.h > 0 ? \"-\" : \"+\") + Math.abs(this.h) + \")$$\"\n else\n return \"$$(x\"+ (this.h > 0 ? \"-\" : \"+\")+ Math.abs(this.h) +\")^2 = \" + this.lr + \"(y\" + (this.k > 0 ? \"-\" : \"+\") + Math.abs(this.k) +\")$$\"\n } else if (this.type == 1) {\n return \"$$\\\\dfrac{(x\"+ (this.h > 0 ? \"-\" : \"+\") + Math.abs(this.h) + \")^2}{\"+this.a+\"^2} + \\\\dfrac{(y\"+(this.k > 0 ? \"-\" : \"+\")+Math.abs(this.k)+\")^2}{\"+this.b+\"^2} = 1$$\"\n } else {\n if (this.o == 0)\n return\"$$\\\\dfrac{(x\"+ (this.h > 0 ? \"-\" : \"+\") + Math.abs(this.h) + \")^2}{\"+this.a+\"^2} - \\\\dfrac{(y\"+(this.k > 0 ? \"-\" : \"+\")+Math.abs(this.k)+\")^2}{\"+this.b+\"^2} = 1$$\"\n else\n return \"$$\\\\dfrac{(y\"+ (this.k > 0 ? \"-\" : \"+\") + Math.abs(this.k) + \")^2}{\"+this.a+\"^2} - \\\\dfrac{(x\"+(this.h > 0 ? \"-\" : \"+\")+Math.abs(this.h)+\")^2}{\"+this.b+\"^2} = 1$$\"\n }\n }", "static _gX(fn, lambda){\n return lambda+\"*(\"+fn+\")+x\";\n }", "function TransformFn( fn , xAdd = 0 , xMul = 1 , yAdd = 0 , yMul = 1 ) {\n\tthis.fn = fn ;\n\tthis.xAdd = xAdd ;\n\tthis.xMul = xMul ;\n\tthis.yAdd = yAdd ;\n\tthis.yMul = yMul ;\n}", "function decoratorLambda(){\n\n var varLabel = [\"x\",\"y\",\"z\",\"u\",\"v\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"r\",\"s\",\"t\",\"w\",\"q\"];\n var varLabelMax = varLabel.length - 1;\n var varLabelCounter = 0;\n var varLabelIndex = 0;\n\n\n\n function nextVariable() {\n var varLabelRem = varLabelIndex % varLabelMax;\n var varLabelQuot = (varLabelIndex - varLabelRem) / varLabelMax;\n if (varLabelIndex < varLabelMax) {\n var output = varLabel[varLabelRem];\n } else {\n var output = varLabel[varLabelRem] + varLabelQuot;\n }\n varLabelIndex +=1;\n return output;\n }\n\n\n// take the mol from \"molexportafter\", if it is not void, else take it from \"molexport\"\n \n var molString = document.getElementById(\"molexportafter\").innerHTML;\n if (molString == \"\") { molString = document.getElementById(\"molexport\").innerHTML;}\n var molStringVect = molString.split(\"<br>\");\n\n// transform it into an array \n var molFinalArray = [], molLine = [];\n\n for (var i=0; i<molStringVect.length; i++) {\n molLine = molStringVect[i].trim().split(\" \");\n if (molLine[0] == '') continue;\n molFinalArray.push(molLine);\n }\n// because the mol is taken from \"molexportafter\", the edges are numbered starting from 1, with no gap\n var molFinalEdgesInDeco = [], molFinalEdgesOutDeco = [], molFinalEdgesDeco = [], molFinalDeco = [], molFinalNodeType;\n var equalRel = [];\n\n molFinalEdgesInDeco[0] = \"init\";\n molFinalEdgesDeco[0] = \"init\";\n\n\n for (var i=0; i<molFinalArray.length; i++) {\n molFinalNodeType = molFinalArray[i][0];\n molFinalDeco[i] = \"\";\n switch (molFinalNodeType) {\n case \"A\":\n molFinalEdgesOutDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesOutDeco[molFinalArray[i][2]] = \"\";\n molFinalEdgesInDeco[molFinalArray[i][3]] = \"\";\n\n molFinalEdgesDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesDeco[molFinalArray[i][2]] = \"\";\n break;\n\n case \"FI\":\n molFinalEdgesOutDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesOutDeco[molFinalArray[i][2]] = \"\";\n molFinalEdgesInDeco[molFinalArray[i][3]] = nextVariable();\n\n molFinalEdgesDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesDeco[molFinalArray[i][2]] = \"\";\n break;\n\n case \"L\":\n molFinalEdgesOutDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesInDeco[molFinalArray[i][2]] = nextVariable();\n molFinalEdgesInDeco[molFinalArray[i][3]] = \"\";\n\n molFinalEdgesDeco[molFinalArray[i][1]] = \"\";\n break;\n\n case \"FO\":\n case \"FOE\":\n molFinalEdgesOutDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesInDeco[molFinalArray[i][2]] = \"\";\n molFinalEdgesInDeco[molFinalArray[i][3]] = \"\";\n\n molFinalEdgesDeco[molFinalArray[i][1]] = \"\";\n break;\n\n case \"Arrow\":\n molFinalEdgesOutDeco[molFinalArray[i][1]] = \"\";\n molFinalEdgesInDeco[molFinalArray[i][2]] = \"\";\n\n molFinalEdgesDeco[molFinalArray[i][1]] = \"\";\n break;\n\n case \"FROUT\":\n case \"T\":\n molFinalEdgesOutDeco[molFinalArray[i][1]] = \"\";\n\n molFinalEdgesDeco[molFinalArray[i][1]] = \"\";\n break;\n\n case \"FRIN\":\n molFinalEdgesInDeco[molFinalArray[i][1]] = nextVariable();\n break; \n }\n }\n\n// propagation of decoration through edges\n\n function edgesDecoPropagation() {\n var output = 0;\n for (var ii=1; ii<molFinalEdgesDeco.length; ii++) {\n if (molFinalEdgesDeco[ii] == \"\") {\n if (molFinalEdgesInDeco[ii] != \"\") {\n if (molFinalEdgesOutDeco[ii] == \"\") {\n molFinalEdgesOutDeco[ii] = molFinalEdgesInDeco[ii];\n } else {\n var eqrel = molFinalEdgesOutDeco[ii] + \" = \" + molFinalEdgesInDeco[ii];\n equalRel.push({elem:\"edge\", id:ii, rel:eqrel});\n }\n molFinalEdgesDeco[ii] = \"deco\";\n output = 1;\n }\n }\n }\n return output;\n }\n\n// propagation of decoration through nodes\n\n function nodesDecoPropagation() {\n var output = 0, leftPortDeco, midPortDeco, rightPortDeco;\n\n for (var ino=0; ino<molFinalDeco.length; ino++) {\n if (molFinalDeco[ino] == \"\") {\n switch (molFinalArray[ino][0]) {\n case \"A\":\n leftPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][1]];\n midPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][2]];\n if ((leftPortDeco != \"\") && (midPortDeco != \"\")) {\n molFinalEdgesInDeco[molFinalArray[ino][3]] = \"(\" + leftPortDeco + \" \" + midPortDeco + \")\";\n molFinalDeco[ino] = \"deco\";\n output = 1;\n }\n break;\n \n case \"L\":\n leftPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][1]];\n midPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][2]];\n if ((leftPortDeco != \"\") && (midPortDeco != \"\")) {\n molFinalEdgesInDeco[molFinalArray[ino][3]] = \"(\\\\\" + midPortDeco + \".\" + leftPortDeco + \")\";\n molFinalDeco[ino] = \"deco\";\n output = 1;\n }\n break;\n \n case \"FO\":\n case \"FOE\":\n leftPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][1]];\n if (leftPortDeco != \"\") {\n molFinalEdgesInDeco[molFinalArray[ino][3]] = leftPortDeco;\n molFinalEdgesInDeco[molFinalArray[ino][2]] = leftPortDeco;\n molFinalDeco[ino] = \"deco\";\n output = 1;\n }\n break;\n \n case \"FI\":\n leftPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][1]];\n midPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][2]];\n if ((leftPortDeco != \"\") && (midPortDeco != \"\")) {\n if (molFinalEdgesInDeco[molFinalArray[ino][3]] == \"\") {\n molFinalEdgesInDeco[molFinalArray[ino][3]] = nextVariable();}\n var eqrel = molFinalEdgesInDeco[molFinalArray[ino][3]] + \" = \" + leftPortDeco;\n equalRel.push({elem:\"node\", id:ino, rel:eqrel});\n var eqrel = molFinalEdgesInDeco[molFinalArray[ino][3]] + \" = \" + midPortDeco;\n equalRel.push({elem:\"node\", id:ino, rel:eqrel});\n molFinalDeco[ino] = \"deco\";\n output = 1;\n }\n break;\n \n case \"Arrow\":\n leftPortDeco = molFinalEdgesOutDeco[molFinalArray[ino][1]];\n if (leftPortDeco != \"\") {\n molFinalEdgesInDeco[molFinalArray[ino][2]] = leftPortDeco;\n molFinalDeco[ino] = \"deco\";\n output = 1;\n }\n break;\n }\n \n }\n } \n return output; \n }\n\n// main decoration loop\n \n var decoEnd = 1;\n\n while (decoEnd != 0) {\n decoEnd = 0;\n decoEnd += edgesDecoPropagation();\n decoEnd += nodesDecoPropagation();\n }\n\n// show the FROUT nodes decoration\n\n var outputDeco = \"\";\n for (var i=0; i<molFinalDeco.length; i++) {\n if (molFinalArray[i][0] == \"FROUT\") {\n// outputDeco += \"FROUT \" + i + \": \" + molFinalEdgesOutDeco[molFinalArray[i][1]] + \"\\n\";\n outputDeco += molFinalEdgesOutDeco[molFinalArray[i][1]] + \"\\n\";\n }\n }\n\n for (var i=0; i<equalRel.length; i++) {\n outputDeco += equalRel[i].rel + \"&nbsp; | &nbsp;\";\n }\n\n document.getElementById(\"evaluation\").innerHTML = outputDeco;\n}", "function makepower(power){\n function powerfn(base){\n return Math.pow(base, power) ;\n }\n return powerfn\n}", "function exprand(lambda){ return (- Math.log(Math.random()) / lambda); }", "function PseudoFunction(callFunc, opt_applyFunc) {\n callFunc = asFunc(callFunc);\n var applyFunc;\n if (opt_applyFunc) {\n applyFunc = asFunc(opt_applyFunc);\n } else {\n applyFunc = markFuncFreeze(function applyFun(self, opt_args) {\n var args = [self];\n if (opt_args !== void 0 && opt_args !== null) {\n args.push.apply(args, opt_args);\n }\n return callFunc.apply(USELESS, args);\n });\n }\n\n var result = primBeget(PseudoFunctionProto);\n result.call = callFunc;\n result.apply = applyFunc;\n result.bind = markFuncFreeze(function bindFun(self, var_args) {\n self = stopEscalation(self);\n var args = [USELESS, self].concat(Array.slice(arguments, 1));\n return markFuncFreeze(callFunc.bind.apply(callFunc, args));\n });\n result.length = callFunc.length -1;\n return result;\n }", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}", "function createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}" ]
[ "0.62299865", "0.6221124", "0.60966897", "0.6070631", "0.6070631", "0.6070631", "0.6070631", "0.60172766", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59685814", "0.59528315", "0.5262731", "0.5243668", "0.5237468", "0.52244306", "0.5195108", "0.5195108", "0.51505816", "0.5117385", "0.5100686", "0.5072679", "0.5050662", "0.504506", "0.5044226", "0.5037405", "0.5017844", "0.49939236", "0.4987049", "0.4977861", "0.4975709", "0.49441728", "0.4916722", "0.49076897", "0.48913535", "0.4872961", "0.48692188", "0.48670563", "0.4860007", "0.48398742", "0.48383456", "0.48324585", "0.4825572", "0.48235735", "0.48194006", "0.4819112", "0.48165232", "0.48129255", "0.48101148", "0.48030856", "0.4799739", "0.47916275", "0.47830293", "0.47793218", "0.4773627", "0.47726312", "0.47724855", "0.47722507", "0.4771312", "0.47616488", "0.4760329", "0.4760329", "0.47577575", "0.47553614", "0.4754369", "0.47487646", "0.47486624", "0.47486624", "0.47486624", "0.47486624", "0.4747203", "0.4747203", "0.474422", "0.47424802", "0.47412327", "0.47390914", "0.47384477", "0.4733695", "0.47288182", "0.47272378", "0.47267047", "0.47142154", "0.47142154", "0.47142154", "0.47142154" ]
0.61324084
2
A painfully simple check to see if an element is disconnected from a document (should be improved, where feasible).
function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDisconnected(node){return !node||!node.parentNode||node.parentNode.nodeType===11;}", "function isDisconnected( node ) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\r\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\r\n}", "function isDisconnected( node ) {\r\r\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\r\r\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n}", "function isDisconnected( node ) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n }", "function isDisconnected(node) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n }", "function isDisconnected(node) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n }", "function isDisconnected(node) {\n return !node || !node.parentNode || node.parentNode.nodeType === 11;\n }", "function isDisconnected(node) {\n\t\treturn !node || !node.parentNode || node.parentNode.nodeType === 11;\n\t}", "function nonEditable( element )\r\n\t{\r\n\t\treturn element.isBlockBoundary() && CKEDITOR.dtd.$empty[ element.getName() ];\r\n\t}", "function shadowTree_isConnected(element) {\n /**\n * An element is connected if its shadow-including root is a document.\n */\n return util_1.Guard.isDocumentNode(TreeAlgorithm_1.tree_rootNode(element, true));\n}", "notifyDisconnection(element) {\n if (element.isConnected || !DesignTokenNode.existsFor(element)) {\n return false;\n }\n\n DesignTokenNode.getOrCreate(element).unbind();\n return true;\n }", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function excludeNode(node, context) {\n if (context.config.analyzeLibDom) {\n return undefined;\n }\n return isLibDom(node);\n}", "function isOrphan(widget) {\n if (widget == window.document) return false;\n var parent = widget.parentNode;\n return !parent || isOrphan(parent);\n }", "function isOrphan(widget) {\n if (widget == window.document) return false;\n var parent = widget.parentNode;\n return !parent || isOrphan(parent);\n }", "function isOffline( el )\r\n\t{\r\n\t\tvar html = el.getDocument().getBody().getParent();\r\n\t\twhile ( el )\r\n\t\t{\r\n\t\t\tif ( el.equals( html ) )\r\n\t\t\t\treturn false;\r\n\t\t\tel = el.getParent();\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function isElement(o) {\n return !!o && o.nodeType === 1;\n}", "function isOffline(el) {\n var html = el.getDocument().getBody().getParent();\n while (el) {\n if (el.equals(html))\n return false;\n el = el.getParent();\n }\n return true;\n }", "function shouldRecycleElement(oldElement, props, tag) {\n return !isTextNode(oldElement) && oldElement.id === \"\" && !nodeTypeDiffers(oldElement, tag);\n}", "function shouldRecycleElement(oldElement, props, tag) {\n return !isTextNode(oldElement) && oldElement.id === \"\" && !nodeTypeDiffers(oldElement, tag);\n}", "function is_dom_element(obj) {\n return !!(obj && obj.nodeType === 1);\n}", "function notAlreadyMarked(node) {\n \"use strict\";\n return ($(node).closest(\"a.gloss\").length === 0);\n}", "function document__POSITION__DISCONNECTED_ques_(documentPosition) /* (documentPosition : documentPosition) -> bool */ {\n return (documentPosition === 1);\n}", "function disconnected(e){var t=\"connected\",n=\"dis\"+t,r=e.Event,a=e.WeakSet,o=!0,i=new a;return function(e){return o&&(o=!o,function(e){var o=null;try{new MutationObserver(l).observe(e,{subtree:!0,childList:!0})}catch(t){var u=0,c=[],s=function(e){c.push(e),clearTimeout(u),u=setTimeout(function(){l(c.splice(u=0,c.length))},0)};e.addEventListener(\"DOMNodeRemoved\",function(e){s({addedNodes:[],removedNodes:[e.target]})},!0),e.addEventListener(\"DOMNodeInserted\",function(e){s({addedNodes:[e.target],removedNodes:[]})},!0)}function l(e){o=new function(){this[t]=new a,this[n]=new a};for(var r,i=e.length,u=0;u<i;u++)f((r=e[u]).removedNodes,n,t),f(r.addedNodes,t,n);o=null}function f(e,t,n){for(var a,o=new r(t),i=e.length,u=0;u<i;1===(a=e[u++]).nodeType&&d(a,o,t,n));}function d(e,t,n,r){i.has(e)&&!o[n].has(e)&&(o[r].delete(e),o[n].add(e),e.dispatchEvent(t));for(var a=e.children||[],u=a.length,c=0;c<u;d(a[c++],t,n,r));}}(e.ownerDocument)),i.add(e),e}}", "function wrong__DOCUMENT__ERR_ques_(domException) /* (domException : domException) -> bool */ {\n return (domException === 4);\n}", "function nonExistantOrLabel(element) {\n return !element || isLabel(element);\n}", "function documentElementCheck () {\n const docNode = document.documentElement.nodeName;\n if (docNode) {\n return docNode.toLowerCase() === 'html';\n }\n return true;\n}", "function nonExistantOrLabel(element) {\n\treturn !element || isLabel(element);\n}", "function checkIfinFrame(element){\n\tif(element.ownerDocument !== document) {\n\t\t//return element.ownerDocument\n\t\treturn \"someiframe\" //For Testing\n\t}else{\n\t\treturn ''\n\t}\n}", "_isElementNode(element) {\n return element.nodeType === this._document.ELEMENT_NODE;\n }", "function isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n}", "function isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n}", "function isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n}", "function isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n}", "function isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n}", "function isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n}", "function noError(elem){\n\t\t\tvar err = $(elem).next();\n\n\t\t\treturn err.html() == '';\n\t\t}", "function isValidElement(elem) {\n return !!elem && elem.nodeType === 1;\n }", "function naive() {\n\n var last = document.getElementsByTagName('*');\n var lastlen = last.length;\n var timer = setTimeout(function check() {\n\n // get current state of the document\n var current = document.getElementsByTagName('*');\n var len = current.length;\n\n // if the length is different\n // it's fairly obvious\n if (len != lastlen) {\n // just make sure the loop finishes early\n last = [];\n }\n\n // go check every element in order\n for (var i = 0; i < len; i++) {\n if (current[i] !== last[i]) {\n callback();\n last = current;\n lastlen = len;\n break;\n }\n }\n\n // over, and over, and over again\n setTimeout(check, delay);\n\n }, delay);\n }", "function naive() {\n\n var last = document.getElementsByTagName('*');\n var lastlen = last.length;\n var timer = setTimeout(function check() {\n\n // get current state of the document\n var current = document.getElementsByTagName('*');\n var len = current.length;\n\n // if the length is different\n // it's fairly obvious\n if (len != lastlen) {\n // just make sure the loop finishes early\n last = [];\n }\n\n // go check every element in order\n for (var i = 0; i < len; i++) {\n if (current[i] !== last[i]) {\n callback();\n last = current;\n lastlen = len;\n break;\n }\n }\n\n // over, and over, and over again\n setTimeout(check, delay);\n\n }, delay);\n }", "function n(e){var n=e?e.ownerDocument||e:document,t=n.defaultView||window;return!(!e||!(\"function\"==typeof t.Node?e instanceof t.Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n}", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n}", "function rangeHasNonTextNodes (range) {\n return range.commonAncestorContainer.nodeName !== '#text'\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function isHidden(_node) {\n var node = _node;\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n return false; // Walked up to document. Not hidden\n }\n\n if (node.nodeType === Node.ELEMENT_NODE && node.classList.contains(_OJ_SUBTREE_HIDDEN_CLASS)) {\n return true;\n }\n\n node = node.parentNode;\n }\n\n return true; // Didn't find document, so it must be detached and therefore hidden.\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n}", "function filterNoDom(n, e) {\n return isNotHidden(e) && nonWeakFilter(n, e) && shouldTraverse(e, false);\n }", "function isUnwrappable(node, options) {\r\n if (!isHtmlElement(node)) {\r\n return false;\r\n }\r\n\r\n if (!isInlineNode(node)) {\r\n return true;\r\n }\r\n\r\n if (!isEditable(node, options)) {\r\n return true;\r\n }\r\n\r\n/*\r\n if (node.nodeType == 3 && options.ignoreWhiteSpace && !/[^\\r\\n\\t ]/.test(node.data)\r\n && (isUnwrappable(node.previousSibling, options) || isUnwrappable(node.nextSibling, options))) {\r\n return true;\r\n }\r\n*/\r\n\r\n return unwrappableTagNamesRegex.test(node.tagName);\r\n }", "function isNodeInDOM(node) {\n var ancestor = node;\n while (ancestor.parentNode) {\n ancestor = ancestor.parentNode;\n }\n // ancestor should be a document\n return !!ancestor.body;\n }", "function isHidden(element) {\n if (false) {}\n return !element || element.offsetParent === null;\n}", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isHidden(element) {\n return (element.offsetParent === null);\n}", "function isHidden(element) {\n if (false) {}\n\n return !element || element.offsetParent === null;\n}", "function isHidden(element) {\n if (false) {}\n\n return !element || element.offsetParent === null;\n}", "function isHidden(element) {\n if (false) {}\n\n return !element || element.offsetParent === null;\n}", "function isHidden(element) {\n if (false) {}\n\n return !element || element.offsetParent === null;\n}", "function isHidden(element) {\n if (false) {}\n\n return !element || element.offsetParent === null;\n}", "function isHidden(element) {\n if (false) {}\n\n return !element || element.offsetParent === null;\n}" ]
[ "0.7232", "0.682839", "0.6804032", "0.6804032", "0.6804032", "0.6804032", "0.67547387", "0.6728325", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6642035", "0.6574424", "0.65609866", "0.65609866", "0.65609866", "0.64866906", "0.61259", "0.60834724", "0.60739195", "0.6019029", "0.6019029", "0.6019029", "0.6019029", "0.60104424", "0.6005646", "0.6005646", "0.59694827", "0.59428513", "0.5935391", "0.59262294", "0.59262294", "0.5916013", "0.5814985", "0.5813754", "0.5778788", "0.5773787", "0.5766193", "0.5728962", "0.5726314", "0.5722033", "0.57214004", "0.57013327", "0.57013327", "0.57013327", "0.57013327", "0.57013327", "0.57013327", "0.5694509", "0.5677834", "0.5675116", "0.5675116", "0.5664451", "0.56605476", "0.56605476", "0.5641705", "0.5641506", "0.5641506", "0.5641506", "0.5641506", "0.5641506", "0.56173486", "0.5608707", "0.55925566", "0.55905753", "0.5583035", "0.5578361", "0.5577021", "0.5577021", "0.5577021", "0.5577021", "0.5577021", "0.5577021", "0.5577021", "0.5577021", "0.5577021", "0.55699575", "0.55585146", "0.55585146", "0.55585146", "0.55585146", "0.55585146", "0.55585146" ]
0.6581669
29
Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem, i ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter() {\n\t}", "filter() {\n\t}", "function filter() {\n \n}", "function filterFunction() {\n \n}", "function Nothing$prototype$filter(pred) {\n return this;\n }", "removeAllFilters() {}", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function compFilter(filtered){\n return function(d){\n var logical = filterProvince(d.province) &&\n filterParty(d.results[0].party) &&\n filterVoteMargin(d.voteMargin) &&\n filterRUParty(d.results[1].party) &&\n filterVoteTurnout(d[\"Percentage of Votes Polled to Registered Voters\"]) &&\n filterNARange(+d.seat.replace(/P[KPBS]-/, \"\"));\n\n if (filtered == true){\n return logical;\n }\n else {\n return !(logical);\n }\n }\n }", "@computed get filteredTodos() {\r\n var matchesFilter = new RegExp(this.filter, \"i\");\r\n //\"i\" means ignore groß und kleinschreibung\r\n return this.todos.filter(\r\n todo => !this.filter || matchesFilter.test(todo.value)\r\n );\r\n // test will test the RegExp, so this.props.store.filter will automtaticly return\r\n // the filtered Value, on the CLient Side\r\n }", "function defaultFilterFunction(thing, params, request) {\n if (Array.isArray(params.exclude) && ap.indexOf.call(params.exclude, thing.id) !== -1) {\n return false;\n }\n if (typeof params.exclude === 'string' && thing.id === params.exclude) {\n return false;\n }\n if (Array.isArray(params.only) && ap.indexOf.call(params.only, thing.id) === -1) {\n return false;\n }\n if (typeof params.only === 'string' && thing.id !== params.only) {\n return false;\n }\n return true;\n}", "function testFilter(self) {\n if (self.filters.tagOptions == \"all\") {\n return function(item) {\n console.log(\"filter run because all\");\n return true;\n }\n } else {\n return function(item) {\n console.log(\"filter run because any\");\n return true;\n }\n }\n}", "function filterNot(a,p){\n\tvar filteredElement = a.filter(isEven);\n\treturn filteredElement; //should return the array [1, 3, 5, 7, 9]\n}", "function NullFilter() {\n\t\t}", "filteredCheck() {\n const { filteredItems, localItems, localFilter } = this\n return { filteredItems, localItems, localFilter }\n }", "function vmCheckFilterForEmpty(filter) {\n\n for (var i in filter) {\n\n if (i != 'pageIndex' && i != 'pageSize') {\n\n if (filter[i])\n return false\n else\n return true\n };\n };\n }", "function filterObject(filter, type, data) { \n filter = _.filter(filter, function(item) {\n return (item !== false) ? item : false;\n }); \n if (filter.length < 1) { return data }\n return _.filter(data, function(item) {\n var boo = false;\n for(var i in filter) { \n if(_.contains(item[type], filter[i])) {\n boo = true;\n } else {\n boo = false;\n break; \n } \n }\n return (boo === true) ? item : false; \n }); \n }", "function compFilter(filtered){\n return function(d){\n // check if result array is empty\n var filt_party = (d.results.length != 0) ? filterParty(d.results[0].party) : true;\n var filt_party_ru = (d.results.length != 0) ? filterRUParty(d.results[1].party) : true;\n var filt_VM = (d.results.length != 0) ? filterVoteMargin(d.voteMargin) : true;\n var logical = filterProvince(d.Province) &&\n // filterParty(d.results[0].party) &&\n // filterVoteMargin(d.voteMargin) &&\n // filterRUParty(d.results[1].party) &&\n filt_party &&\n filt_VM &&\n filt_party_ru &&\n filterVoteTurnout(d[\"Percentage of Votes Polled to Registered Voters\"]) &&\n filterNARange(+d.seat.replace(\"NA-\", \"\"));\n if (filtered == true){\n return logical;\n }\n else {\n return !(logical);\n }\n }\n }", "function filter(array, fn) {\n let filteredArray = [];\n array.forEach(element => {\n if (!fn(element)) {\n filteredArray.push(element);\n }\n });\n console.log(filteredArray); \n}", "function Filter(method) {\n this.truthy = true;\n this.method = method;\n}", "function unifiedFilter(element, index, array) {\n var keep = actionFilter(element, index, array);\n\n if (keep) {\n keep = nameFilter(element, index, array);\n }\n controller.toggleItem($(\"#\" + element), keep ? controller.toggleOnDelay * visible.FILTER_DELAY_SCALE : controller.toggleOffDelay / visible.FILTER_DELAY_SCALE, keep);\n return keep;\n }", "function filterTwos(elem) { return elem !== 2; }", "function filterTwos(elem) { return elem !== 2; }", "function filterByMatch(event) {\n return ;\n}", "function TestFilter(){\n\t\treturn function(arr, param1, param2){\n\t\t\tconsole.log(\"filter called\");\n\t\t\tif(param1){\n\t\t\t\tvar filtered = _.select(arr, function(item) {\n\t \t\t\t\treturn item.indexOf( param1 ) !== -1;\n\t\t\t\t});\t\n\n\t\t\t\treturn filtered;\n\t\t\t} else{\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t};\n\t}", "function filter(pred) {\n return function(rf) { // <- buildArray for example, but also the function in map on line 82\n return function(result, item) {\n if(pred(item))\n return rf(result, item)\n else\n return result\n }\n }\n}", "_filter (entities, params, inputSearch) {\n\t\treturn entities.filter(entity => this._entityVerify(entity, params, inputSearch))\n\t}", "function block() { return new Filter(function () { return false; }); }", "filteredCheck({ filteredItems, localFilter }) {\n // Determine if the dataset is filtered or not\n let isFiltered = false\n if (!localFilter) {\n // If filter criteria is falsey\n isFiltered = false\n } else if (looseEqual(localFilter, []) || looseEqual(localFilter, {})) {\n // If filter criteria is an empty array or object\n isFiltered = false\n } else if (localFilter) {\n // If filter criteria is truthy\n isFiltered = true\n }\n if (isFiltered) {\n this.$emit(EVENT_NAME_FILTERED, filteredItems, filteredItems.length)\n }\n this.isFiltered = isFiltered\n }", "function falsyFilter(){\nfor(var i = 0; i < mixedArray.length; i++) {\n if(mixedArray === true || mixedArray === \"true\" || mixedArray !== false)\n\t {mixedArray.slice(i, 1)}\n else return mixedArray;\n}\n}", "not() {\n\t return _register.call(this, 'not', arguments);\n\t }", "afilter (callback) {\n return this.asArray().filter(callback)\n }", "function doFilter() {\n for (var i = 0; i < items.length; i++) {\n // show all\n items[i].classList.remove('thumb--inactive');\n\n // combine filters\n // - only those items will be displayed who satisfy all filter criterias\n var visible = true;\n\n for (var j = 0; j < visibleItems.length; j++) {\n visible = visible && items[i].classList.contains(visibleItems[j]);\n }\n\n if (!visible) {\n items[i].classList.add('thumb--inactive');\n }\n }\n }", "function filterFuncOriginal(item, index, self) {\n \treturn self.indexOf(item) == index;\n\t}", "function f2() {\n bidar.serialize(obj, filter);\n\n function filter(x) {\n // An arbitrary-but-different hole.\n return { data: filter };\n }\n }", "filter(func) {\n let reArr = [];\n this.each((item) => {\n func(item) ? reArr.push(item) : null;\n });\n return new DomQuery(...reArr);\n }", "filter(func) {\n let reArr = [];\n this.each((item) => {\n func(item) ? reArr.push(item) : null;\n });\n return new DomQuery(...reArr);\n }", "function filterExample(arr) {\n const even = (num) => {\n if (num % 2 == 0) {\n return num\n }\n };\n const odd = (num) => {\n if (num % 2 != 0) {\n return num\n }\n };\n console.log(arr.filter(even));\n console.log(arr.filter(odd));\n\n}", "function filter(field, value)\n {\n \n }", "function filter(pred) {\n return function(xs) {\n return Z.filter (pred, xs);\n };\n }", "function defaultFilter$2() {\n\t return !exports.event.button;\n\t }", "function defaultFilter$2() {\n\t return !exports.event.button;\n\t }", "get filtered() {\n return this._filtered;\n }", "unfilterNoChangeLayers(){\n //get the no change status object\n let no_change_status = this.props.statuses.filter(status => status.key === 'no_change');\n //clear the filter depending on whether it is a global or country view\n let filter = (this.props.view === 'global') ? null : ['in', 'iso3', this.props.country.iso3];\n //iterate through the layers and set the filter\n no_change_status[0].layers.forEach(layer => this.map.setFilter(layer, filter));\n //\n }", "function falsyFilter(){\n for(var i = 0; i < mixedArray.length; i++){\n\tif(mixedArray[i] === false)\n {mixedArray.splice(i, 1)};\n\treturn mixedArray;\n }\n}", "function filterObjectBy(obj,objfilt){\n\n if(!objfilt){\n return true;\n } else if((Object.keys(objfilt).length === 0))\n {\n return true;\n }\n\n var res;\n\n var compareIndividual = function (valueorig,valuefilt){\n\n //console.info(\"typeof valuefilt\",typeof valuefilt);\n if (typeof valuefilt === \"string\") {//se busca sobre un array\n //console.info(\"es un string\",valueorig.toLowerCase().indexOf(valuefilt.toLowerCase()));\n //console.info(\"valueorig\",valueorig);\n if(valueorig && valueorig.toLowerCase().trim().indexOf(valuefilt.toLowerCase().trim()) > -1){\n //console.log(\"son iguales string\");\n return true;\n }\n\n\n }else if(typeof valuefilt === \"boolean\"){\n var value_orig = Boolean(valueorig);\n var value_filt = Boolean(valuefilt);\n //console.info(\"booleanos\",(value_orig === value_filt),value_orig , value_filt);\n if(value_orig === value_filt){\n return true;\n }\n\n }else if(valueorig === valuefilt){\n //console.log(\"son iguales simple\");\n return true;\n }\n //console.info(\"no son iguales\");\n return false;\n\n\n };\n\n\n for(var key in objfilt){\n //console.info(key,obj[key]);\n if(obj[key] !== undefined ){//existe la propiedad en el original\n //console.info(\"existe\",objfilt[key]);\n if (objfilt[key] instanceof Array) {//se busca sobre un array\n //console.info(\"es un array\");\n var array = objfilt[key];\n var length = array.length;\n var resArray = null;\n for (var i = 0; i < length; i++) {\n var item = array[i];\n\n var compareIndividualResult = compareIndividual(obj[key], item);\n resArray = resArray || compareIndividualResult;\n //console.info(\"resArray\",resArray,item,\"compareIndividualResult\",compareIndividualResult);\n }\n res = (res)?(res && resArray):resArray;\n //console.info(\"res\",res,objfilt[key]);\n }else{\n //console.info(\"no es un array\");\n res = compareIndividual(obj[key],objfilt[key]);\n\n }\n\n }else{\n res = false;\n\n }\n if(res){\n continue;\n\n }else{\n break;\n }\n\n }\n //console.info(\"return res\",res);\n return res || false;\n}", "runFilter(callback) {\n\n if (callback === '') {\n this.data = this.dataUntouched;\n } else {\n\n const untouched = cloneArrayOfObjects(this.dataUntouched);;\n\n this.data = untouched.filter((e) => callback(e));\n }\n\n this.settings.offset = 0;\n return this.run();\n\n }", "function filter(filter) { return new Filter(filter); }", "filterProducts() {\n // Crear copia\n let toFilter = [...this.productsArray];\n\n // Se pasa el array por todos los filtros del objeto filters\n Object.values(this.filters).forEach((filter) => {\n toFilter = filter(toFilter) || toFilter;\n });\n\n return toFilter;\n }", "function filterValues(data) \r\n{\r\n data = data.filter(isEligible);\r\n return data;\r\n}", "filterEvent(event) {\n return false;\n }", "function defaultFilter$1() {\n\t return !exports.event.button;\n\t }", "function defaultFilter$1() {\n\t return !exports.event.button;\n\t }", "function filterNoDom(n, e) {\n return isNotHidden(e) && nonWeakFilter(n, e) && shouldTraverse(e, false);\n }", "function filterCallback(pet) {\n let lessThan5 = pet.age < 5;\n let hasS = pet.name[0] == \"S\" || pet.ownerName[0] == \"S\";\n return lessThan5 && (hasS);\n}", "function objFilter(obj, callback) {\n\n}", "function defaultFilter$2() {\n return !exports.event.button;\n}", "function defaultFilter$2() {\n return !exports.event.button;\n}", "function defaultFilter$2() {\n return !exports.event.button;\n}", "function defaultFilter$2() {\n return !exports.event.button;\n}", "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$2() {\n\t return !exports.event.button;\n\t}", "filterAndUpdate( callback, thisArg)\n //------------------------------------------------------------------------------------------------------\n {\n var itemsToRemove = [];\n\n this.forEach( function( item) {\n\n if ( ! callback.call(thisArg, item) ) {\n itemsToRemove.push(item);\n }\n\n }, thisArg);\n\n this.remove(itemsToRemove);\n\n return this;\n }", "function filter(el, filterFn) {\n Array.prototype.filter.call(el, filterFn);\n } //https://jsfiddle.net/w1rktecz/", "function defaultFilter$2() {\n return !exports.event.button;\n }", "setFilterToNone() {\n\t\tthis.props.setFilter(\"\", \"\");\n\t}", "function except(source, filter) {\n return source.filter(key => !filter.includes(key));\n}", "function filter(arr, fn) {\n\tlet test = [];\n\tfor(let item of arr){\n\t\tif(fn(item)){\n\t\t\ttest.push(item);\n\t\t}\n\t\n\t}\n\treturn test;\n}", "getFilteredTodos() {\r\n const {todos, filter} = this.state;\r\n switch(filter) {\r\n case 'Active':\r\n return todos.filter(todo => (todo.active));\r\n case 'Finished':\r\n return todos.filter(todo => (!todo.active))\r\n default:\r\n return todos; \r\n }\r\n }", "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$1() {\n\t return !exports.event.button;\n\t}", "function defaultFilter$1() {\n return !exports.event.button;\n}", "function defaultFilter$1() {\n return !exports.event.button;\n}", "function defaultFilter$1() {\n return !exports.event.button;\n}", "function defaultFilter$1() {\n return !exports.event.button;\n}", "function notModifier (predicate) {\n return function () {\n return !predicate.apply(null, arguments);\n };\n }", "item_filter(self) {\n return function(item) {\n if (self.filters.activeGroups.length == 0 && self.filters.activeTags.length == 0) {\n // If neither group nor tag filters are set, return a filter function that\n // always returns true.\n return true;\n } else if (self.filters.activeGroups.length > 0 && self.filters.activeTags.length == 0) {\n // If only the group filter is set, return a function to check if the\n // group of an item is active\n return $.inArray(item.group_slug,self.filters.activeGroups) > -1;\n } else if (self.filters.activeGroups.length == 0 && self.filters.activeTags.length > 0) {\n // If only the tag filter is set...\n if (self.filters.tagOptions == \"all\") {\n // ...and tag options are set to match all tags, return a function to\n // filter to only items with all of the active tags applied.\n return self.filters.activeTags.every(function(element, index, array) {\n return $.inArray(element,item.tag_slugs) > -1;\n });\n } else {\n // ...and tag options are set to match any active tag, return a function\n // to filter to only items with any active tag applied.\n return self.filters.activeTags.some(function(element, index, array) {\n return $.inArray(element,item.tag_slugs) > -1;\n });\n };\n } else {\n // Both tag filters and group filters are set. Items should be filtered to\n // only those with an active group and any/all active tags, depending on\n // active tag behavior.\n var hasActiveGroup = $.inArray(item.group_slug,self.filters.activeGroups) > -1;\n if (hasActiveGroup) {\n // If the group is active, do the tag checks.\n if (self.filters.tagOptions == \"all\") {\n // Check if all tags are active\n var hasAllTags = self.filters.activeTags.every(function(element, index, array) {\n return $.inArray(element,item.tag_slugs) > -1;\n });\n return hasAllTags;\n } else {\n // Check if any tags are active\n var hasAnyTag = self.filters.activeTags.some(function(element, index, array) {\n return $.inArray(element,item.tag_slugs) > -1;\n });\n return hasAnyTag;\n }\n } else {\n // If the group is not active, don't bother with the tag checks, just\n // return false\n return false;\n }\n }\n }\n }", "function toggleFilter () {\n\t\tvar filterProp = Object.keys(vm.tp.filter());\n\t\tif (!$scope.showFilter && filterProp.length > 0) {\n\t\t\tvm.tp.filter({});\n\t\t}\n\t}", "function defaultFilter() {\n\t return !exports.event.button;\n\t }", "function defaultFilter() {\n\t return !exports.event.button;\n\t }", "function filter(filterFuncs = 'none') {\n\tctx.filter = filterFuncs;\n}", "function britainFilter(items){\n return items.currency_code !== \"USD\";\n }", "function keep() {\n\t var clean = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : filter.ignoreMissing;\n\t\n\t return function (values) {\n\t var cleanValues = clean(values);\n\t if (!cleanValues) return null;\n\t var result = first()(cleanValues);\n\t cleanValues.forEach(function (v) {\n\t if (v !== result) {\n\t return null;\n\t }\n\t });\n\t return result;\n\t };\n\t}", "function defaultFilter$1() {\n return !exports.event.button;\n }", "function myFilter(arr, f){\n let ans = [] ;\n\n for(let i = 0; i < arr.length; i++){\n if(f(arr[i]) == true){\n ans.push(arr[i]) ;\n }\n }\n return ans ;\n}", "filter(keepIf) {\n const self = this;\n return new Seq(function* () {\n for (const element of self)\n if (keepIf(element))\n yield element;\n });\n }", "function defaultFilter() {\n const qgNodeIds = getQNodeIds();\n const filteredResults = answers.filter((row) => {\n const remove = qgNodeIds.find((qnodeId) => {\n const found = row[qnodeId].find((knode) => knode.id && !filter.current[qnodeId][knode.id]);\n if (found) {\n // if found, we want to remove\n return true;\n }\n return false;\n });\n if (remove) {\n // if we want to remove, filter out\n return false;\n }\n return true;\n });\n updateFilteredAnswers(filteredResults);\n // return filteredResults;\n }", "function filter(list, predicateFn) {\n\n}", "function not(predicate) {\n return function (a) { return !predicate(a); };\n}", "function filterAttributes(data){\n let filtered_data = {};\n {conditionalFilter}\n return filtered_data;\n}", "function filterValue ( removeValue ) {\n return function filter ( checkValue ) {\n return checkValue !== removeValue\n }\n}", "static generateFiltersFunction(filters) {\n if (!filters || !filters.length && !filters.count) {\n return FunctionHelper.returnTrue;\n }\n\n return function (candidate) {\n let match = true;\n\n for (const filter of filters) {\n // Skip disabled filters\n if (!filter.disabled) {\n match = filter.filter(candidate);\n }\n\n if (!match) {\n break;\n }\n }\n\n return match;\n };\n }", "filterThis(letters){\n return letters !== 0;\n }", "static generateFiltersFunction(filters) {\n if (!filters || (!filters.length && !filters.count)) {\n return FunctionHelper.returnTrue;\n }\n\n return function(candidate) {\n let match = true;\n\n for (const filter of filters) {\n // Skip disabled filters\n if (!filter.disabled) {\n match = filter.filter(candidate);\n }\n if (!match) {\n break;\n }\n }\n\n return match;\n };\n }", "filter(stats) {\n let { filterFn } = this.options;\n if (filterFn) {\n try {\n // Run the user-specified filter function\n return !!filterFn(stats);\n }\n catch (err) {\n // An error occurred in the user's code.\n // In Sync and Async modes, this will return an error.\n // In Streaming mode, we emit an \"error\" event, but continue processing\n this.emit(\"error\", err);\n }\n }\n else {\n // No filter was specified, so match everything\n return true;\n }\n }" ]
[ "0.7415891", "0.7415891", "0.71924883", "0.68619496", "0.67648804", "0.6652573", "0.64584637", "0.64584637", "0.64584637", "0.64584637", "0.6294628", "0.62928224", "0.6256001", "0.62469697", "0.6207571", "0.61991894", "0.61926854", "0.6190803", "0.6184332", "0.61646616", "0.61499476", "0.6149252", "0.61491513", "0.61387765", "0.61387765", "0.610476", "0.610281", "0.6102132", "0.6089019", "0.60828155", "0.6079076", "0.6048689", "0.60363084", "0.6027018", "0.6016928", "0.60079044", "0.5984307", "0.59779316", "0.59779316", "0.5977443", "0.5960096", "0.5951136", "0.59442943", "0.59442943", "0.5938437", "0.5926806", "0.59263474", "0.59215623", "0.5917913", "0.59173113", "0.59166807", "0.59081596", "0.5901912", "0.5893554", "0.5893554", "0.5884567", "0.58774817", "0.58759105", "0.5873916", "0.5873916", "0.5873916", "0.5873916", "0.5871018", "0.5871018", "0.5871018", "0.5871018", "0.58481944", "0.58442974", "0.5842556", "0.58413076", "0.58384633", "0.58278084", "0.5821621", "0.5821513", "0.5821513", "0.5821513", "0.5821513", "0.5815523", "0.5815523", "0.5815523", "0.5815523", "0.58140934", "0.5806822", "0.5803895", "0.5798791", "0.5798791", "0.5792236", "0.5791012", "0.578383", "0.5773163", "0.57613575", "0.5760552", "0.57519317", "0.5750365", "0.57470524", "0.57405996", "0.57392603", "0.57375896", "0.573541", "0.57310766", "0.5724562" ]
0.0
-1
Used in clean, fixes the defaultChecked property
function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixDefaultChecked( elem ) {\n if ( manipulation_rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n }", "function fixDefaultChecked( elem ) {\n if ( rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n }", "function fixDefaultChecked( elem ) {\n if ( rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n }", "function fixDefaultChecked( elem ) {\n if ( manipulation_rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked(elem) {\n if (rcheckableType.test(elem.type)) {\n elem.defaultChecked = elem.checked;\n }\n }", "function fixDefaultChecked( elem ) {\n\t\tif ( rcheckableType.test( elem.type ) ) {\n\t\t\telem.defaultChecked = elem.checked;\n\t\t}\n\t}", "function fixDefaultChecked( elem ) {\n\t\tif ( rcheckableType.test( elem.type ) ) {\n\t\t\telem.defaultChecked = elem.checked;\n\t\t}\n\t}", "function fixDefaultChecked(elem) {\n if (rcheckableType.test(elem.type)) {\n elem.defaultChecked = elem.checked;\n }\n }", "function fixDefaultChecked(elem) {\n if (rcheckableType.test(elem.type)) {\n elem.defaultChecked = elem.checked;\n }\n }", "function fixDefaultChecked( elem ) {\n if ( rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\n if ( rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\n if ( rcheckableType.test( elem.type ) ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\r\n\tif ( manipulation_rcheckableType.test( elem.type ) ) {\r\n\t\telem.defaultChecked = elem.checked;\r\n\t}\r\n}", "function fixDefaultChecked( elem ) {\n if ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\n if ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\n if ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n elem.defaultChecked = elem.checked;\n }\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( rcheckableType.test( elem.type ) ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}", "function fixDefaultChecked( elem ) {\n\tif ( elem.type === \"checkbox\" || elem.type === \"radio\" ) {\n\t\telem.defaultChecked = elem.checked;\n\t}\n}" ]
[ "0.85473293", "0.84593266", "0.84593266", "0.8428615", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8427636", "0.8395096", "0.8392098", "0.8392098", "0.83566743", "0.83566743", "0.83415395", "0.83415395", "0.83415395", "0.83278763", "0.83153534", "0.83153534", "0.83153534", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.82943845", "0.8287857", "0.8287857", "0.8287857", "0.8287857", "0.8287857", "0.8287857", "0.8287857", "0.8287857" ]
0.8450395
3
return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; }
{ "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[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "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\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\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\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(style,name){ // Shortcut for names that are not vendor prefixed\nif(name in style){return name;} // Check for vendor prefixed names\nvar capName=name[0].toUpperCase() + name.slice(1),origName=name,i=cssPrefixes.length;while(i--) {name = cssPrefixes[i] + capName;if(name in style){return name;}}return origName;}", "function vendorPropName(style,name){// shortcut for names that are not vendor prefixed\n if(name in style){return name;}// check for vendor prefixed names\n var capName=name.charAt(0).toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name;}}return origName;}", "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 ) {\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 ) { // 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(style, name) {\n\n // shortcut for names that are not vendor prefixed\n if (name in style) {\n return name;\n }\n\n // check for vendor prefixed names\n var capName = name.charAt(0).toUpperCase() + name.slice(1),\n origName = name,\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[ i ] + capName;\n if (name in style) {\n return name;\n }\n }\n\n return origName;\n }", "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 // 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 // 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\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.81199294", "0.81199294", "0.78175336", "0.78175336", "0.78175336", "0.78175336", "0.78175336", "0.78175336", "0.78175336", "0.78175336", "0.7741535", "0.77281314", "0.76649904", "0.76344436", "0.76290935", "0.7543812", "0.7490448", "0.74820906", "0.7476511", "0.74624354", "0.74108046", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.740033", "0.7368553", "0.7368553", "0.73661846", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012", "0.7352012" ]
0.0
-1
Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) { if ( elemdisplay[ nodeName ] ) { return elemdisplay[ nodeName ]; } var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), display = elem.css("display"); elem.remove(); // If the simple way fails, // get element's real default display by attaching it to a temp iframe if ( display === "none" || display === "" ) { // Use the already-created iframe if possible iframe = document.body.appendChild( iframe || jQuery.extend( document.createElement("iframe"), { frameBorder: 0, width: 0, height: 0 }) ); // Create a cacheable copy of the iframe document on first call. // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML // document to it; WebKit & Firefox won't allow reusing the iframe document. if ( !iframeDoc || !iframe.createElement ) { iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; iframeDoc.write("<!doctype html><html><body>"); iframeDoc.close(); } elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); display = curCSS( elem, "display" ); document.body.removeChild( iframe ); } // Store the correct default display elemdisplay[ nodeName ] = display; return display; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getElementDefaultDisplay(elem) {\n\t\t// Get the 'visible' display style for the element\n\t\tvar testElem, nodeName,\n\t\t\tgetComputedStyle = global.getComputedStyle,\n\t\t\tcStyle = (elem.currentStyle || getComputedStyle.call(global, elem, \"\")).display;\n\n\t\tif (cStyle === \"none\" && !(cStyle = displayStyles[nodeName = elem.nodeName])) {\n\t\t\t// Currently display: none, and the 'visible' style has not been cached.\n\t\t\t// We create an element to find the correct visible display style for this nodeName\n\t\t\ttestElem = document.createElement(nodeName);\n\t\t\tdocument.body.appendChild(testElem);\n\t\t\tcStyle = (getComputedStyle ? getComputedStyle.call(global, testElem, \"\") : testElem.currentStyle).display;\n\t\t\t// Cache the result as a hash against nodeName\n\t\t\tdisplayStyles[nodeName] = cStyle;\n\t\t\tdocument.body.removeChild(testElem);\n\t\t}\n\t\treturn cStyle;\n\t}", "function css_defaultDisplay(nodeName) {\n if (elemdisplay[nodeName]) {\n return elemdisplay[nodeName];\n }\n\n var elem = jQuery(\"<\" + nodeName + \">\").appendTo(document.body),\n display = elem.css(\"display\");\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if (display === \"none\" || display === \"\") {\n // Use the already-created iframe if possible\n iframe = document.body.appendChild(\n iframe || jQuery.extend(document.createElement(\"iframe\"), {\n frameBorder: 0,\n width: 0,\n height: 0\n })\n );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if (!iframeDoc || !iframe.createElement) {\n iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;\n iframeDoc.write(\"<!doctype html><html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.body.appendChild(iframeDoc.createElement(nodeName));\n\n display = curCSS(elem, \"display\");\n document.body.removeChild(iframe);\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n\n return display;\n }", "function css_defaultDisplay(nodeName) {\n if (elemdisplay[nodeName]) {\n return elemdisplay[nodeName];\n }\n\n var elem = jQuery(\"<\" + nodeName + \">\").appendTo(document.body),\n display = elem.css(\"display\");\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if (display === \"none\" || display === \"\") {\n // Use the already-created iframe if possible\n iframe = document.body.appendChild(\n iframe || jQuery.extend(document.createElement(\"iframe\"), {\n frameBorder: 0,\n width: 0,\n height: 0\n })\n );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if (!iframeDoc || !iframe.createElement) {\n iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;\n iframeDoc.write(\"<!doctype html><html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.body.appendChild(iframeDoc.createElement(nodeName));\n\n display = curCSS(elem, \"display\");\n document.body.removeChild(iframe);\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n\n return display;\n }", "function css_defaultDisplay( nodeName ) {\n if ( elemdisplay[ nodeName ] ) {\n return elemdisplay[ nodeName ];\n }\n\n var elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n display = elem.css(\"display\");\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if ( display === \"none\" || display === \"\" ) {\n // Use the already-created iframe if possible\n iframe = document.body.appendChild(\n iframe || jQuery.extend( document.createElement(\"iframe\"), {\n frameBorder: 0,\n width: 0,\n height: 0\n })\n );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if ( !iframeDoc || !iframe.createElement ) {\n iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n iframeDoc.write(\"<!doctype html><html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n display = curCSS( elem, \"display\" );\n document.body.removeChild( iframe );\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n\n return display;\n }", "function css_defaultDisplay(nodeName) {\n var doc = document,\n display = elemdisplay[nodeName];\n\n if (!display) {\n display = actualDisplay(nodeName, doc);\n\n // If the simple way fails, read from inside an iframe\n if (display === \"none\" || !display) {\n // Use the already-created iframe if possible\n iframe = (iframe || jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css(\"cssText\", \"display:block !important\")).appendTo(doc.documentElement);\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay(nodeName, doc);\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n\n return display;\n }", "function defaultDisplay(nodeName){if(!elemdisplay[nodeName]){var body=document.body,elem=jQuery(\"<\"+nodeName+\">\").appendTo(body),display=elem.css(\"display\");elem.remove(); // If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif(display===\"none\"||display===\"\"){ // No iframe to use yet, so create it\n\tif(!iframe){iframe=document.createElement(\"iframe\");iframe.frameBorder=iframe.width=iframe.height=0;}body.appendChild(iframe); // Create a cacheable copy of the iframe document on first call.\n\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\tif(!iframeDoc||!iframe.createElement){iframeDoc=(iframe.contentWindow||iframe.contentDocument).document;iframeDoc.write((jQuery.support.boxModel?\"<!doctype html>\":\"\")+\"<html><body>\");iframeDoc.close();}elem=iframeDoc.createElement(nodeName);iframeDoc.body.appendChild(elem);display=jQuery.css(elem,\"display\");body.removeChild(iframe);} // Store the correct default display\n\telemdisplay[nodeName]=display;}return elemdisplay[nodeName];}", "function css_defaultDisplay( nodeName ) {\n var doc = document,\n display = elemdisplay[ nodeName ];\n\n if ( !display ) {\n display = actualDisplay( nodeName, doc );\n\n // If the simple way fails, read from inside an iframe\n if ( display === \"none\" || !display ) {\n // Use the already-created iframe if possible\n iframe = ( iframe ||\n jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css( \"cssText\", \"display:block !important\" )\n ).appendTo( doc.documentElement );\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay( nodeName, doc );\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return display;\n}", "function css_defaultDisplay( nodeName ) {\n var doc = document,\n display = elemdisplay[ nodeName ];\n\n if ( !display ) {\n display = actualDisplay( nodeName, doc );\n\n // If the simple way fails, read from inside an iframe\n if ( display === \"none\" || !display ) {\n // Use the already-created iframe if possible\n iframe = ( iframe ||\n jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css( \"cssText\", \"display:block !important\" )\n ).appendTo( doc.documentElement );\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay( nodeName, doc );\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return display;\n}", "function defaultDisplay(nodeName) {\n\n if (!elemdisplay[nodeName]) {\n\n var body = document.body,\n\t\t\telem = jQuery(\"<\" + nodeName + \">\").appendTo(body),\n\t\t\tdisplay = elem.css(\"display\");\n\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if (display === \"none\" || display === \"\") {\n // No iframe to use yet, so create it\n if (!iframe) {\n iframe = document.createElement(\"iframe\");\n iframe.frameBorder = iframe.width = iframe.height = 0;\n }\n\n body.appendChild(iframe);\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if (!iframeDoc || !iframe.createElement) {\n iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;\n iframeDoc.write((document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\") + \"<html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.createElement(nodeName);\n\n iframeDoc.body.appendChild(elem);\n\n display = jQuery.css(elem, \"display\");\n\n body.removeChild(iframe);\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n\n return elemdisplay[nodeName];\n }", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tif ( elemdisplay[ nodeName ] ) {\n\t\treturn elemdisplay[ nodeName ];\n\t}\n\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n\t\tdisplay = elem.css(\"display\");\n\telem.remove();\n\n\t// If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif ( display === \"none\" || display === \"\" ) {\n\t\t// Use the already-created iframe if possible\n\t\tiframe = document.body.appendChild(\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\n\t\t\t\tframeBorder: 0,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t})\n\t\t);\n\n\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\n\t\t\tiframeDoc.close();\n\t\t}\n\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n\t\tdisplay = curCSS( elem, \"display\" );\n\t\tdocument.body.removeChild( iframe );\n\t}\n\n\t// Store the correct default display\n\telemdisplay[ nodeName ] = display;\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n if ( elemdisplay[ nodeName ] ) {\n return elemdisplay[ nodeName ];\n }\n\n var elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n display = elem.css(\"display\");\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if ( display === \"none\" || display === \"\" ) {\n // Use the already-created iframe if possible\n iframe = document.body.appendChild(\n iframe || jQuery.extend( document.createElement(\"iframe\"), {\n frameBorder: 0,\n width: 0,\n height: 0\n })\n );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if ( !iframeDoc || !iframe.createElement ) {\n iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n iframeDoc.write(\"<!doctype html><html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n display = curCSS( elem, \"display\" );\n document.body.removeChild( iframe );\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n\n return display;\n}", "function css_defaultDisplay( nodeName ) {\n if ( elemdisplay[ nodeName ] ) {\n return elemdisplay[ nodeName ];\n }\n\n var elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\n display = elem.css(\"display\");\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if ( display === \"none\" || display === \"\" ) {\n // Use the already-created iframe if possible\n iframe = document.body.appendChild(\n iframe || jQuery.extend( document.createElement(\"iframe\"), {\n frameBorder: 0,\n width: 0,\n height: 0\n })\n );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if ( !iframeDoc || !iframe.createElement ) {\n iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n iframeDoc.write(\"<!doctype html><html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\n\n display = curCSS( elem, \"display\" );\n document.body.removeChild( iframe );\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n\n return display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tDM(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function css_defaultDisplay( nodeName ) {\r\n\tvar doc = document,\r\n\t\tdisplay = elemdisplay[ nodeName ];\r\n\r\n\tif ( !display ) {\r\n\t\tdisplay = actualDisplay( nodeName, doc );\r\n\r\n\t\t// If the simple way fails, read from inside an iframe\r\n\t\tif ( display === \"none\" || !display ) {\r\n\t\t\t// Use the already-created iframe if possible\r\n\t\t\tiframe = ( iframe ||\r\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\r\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\r\n\t\t\t).appendTo( doc.documentElement );\r\n\r\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\r\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\r\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\r\n\t\t\tdoc.close();\r\n\r\n\t\t\tdisplay = actualDisplay( nodeName, doc );\r\n\t\t\tiframe.detach();\r\n\t\t}\r\n\r\n\t\t// Store the correct default display\r\n\t\telemdisplay[ nodeName ] = display;\r\n\t}\r\n\r\n\treturn display;\r\n}", "function css_defaultDisplay( nodeName ) {\r\r\n\tif ( elemdisplay[ nodeName ] ) {\r\r\n\t\treturn elemdisplay[ nodeName ];\r\r\n\t}\r\r\n\r\r\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\r\r\n\t\tdisplay = elem.css(\"display\");\r\r\n\telem.remove();\r\r\n\r\r\n\t// If the simple way fails,\r\r\n\t// get element's real default display by attaching it to a temp iframe\r\r\n\tif ( display === \"none\" || display === \"\" ) {\r\r\n\t\t// Use the already-created iframe if possible\r\r\n\t\tiframe = document.body.appendChild(\r\r\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\r\r\n\t\t\t\tframeBorder: 0,\r\r\n\t\t\t\twidth: 0,\r\r\n\t\t\t\theight: 0\r\r\n\t\t\t})\r\r\n\t\t);\r\r\n\r\r\n\t\t// Create a cacheable copy of the iframe document on first call.\r\r\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\r\r\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\r\r\n\t\tif ( !iframeDoc || !iframe.createElement ) {\r\r\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\r\r\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\r\r\n\t\t\tiframeDoc.close();\r\r\n\t\t}\r\r\n\r\r\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\r\r\n\r\r\n\t\tdisplay = curCSS( elem, \"display\" );\r\r\n\t\tdocument.body.removeChild( iframe );\r\r\n\t}\r\r\n\r\r\n\t// Store the correct default display\r\r\n\telemdisplay[ nodeName ] = display;\r\r\n\r\r\n\treturn display;\r\r\n}", "function css_defaultDisplay( nodeName ) {\r\n\tif ( elemdisplay[ nodeName ] ) {\r\n\t\treturn elemdisplay[ nodeName ];\r\n\t}\r\n\r\n\tvar elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( document.body ),\r\n\t\tdisplay = elem.css(\"display\");\r\n\telem.remove();\r\n\r\n\t// If the simple way fails,\r\n\t// get element's real default display by attaching it to a temp iframe\r\n\tif ( display === \"none\" || display === \"\" ) {\r\n\t\t// Use the already-created iframe if possible\r\n\t\tiframe = document.body.appendChild(\r\n\t\t\tiframe || jQuery.extend( document.createElement(\"iframe\"), {\r\n\t\t\t\tframeBorder: 0,\r\n\t\t\t\twidth: 0,\r\n\t\t\t\theight: 0\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\t// Create a cacheable copy of the iframe document on first call.\r\n\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\r\n\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\r\n\t\tif ( !iframeDoc || !iframe.createElement ) {\r\n\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\r\n\t\t\tiframeDoc.write(\"<!doctype html><html><body>\");\r\n\t\t\tiframeDoc.close();\r\n\t\t}\r\n\r\n\t\telem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );\r\n\r\n\t\tdisplay = curCSS( elem, \"display\" );\r\n\t\tdocument.body.removeChild( iframe );\r\n\t}\r\n\r\n\t// Store the correct default display\r\n\telemdisplay[ nodeName ] = display;\r\n\r\n\treturn display;\r\n}", "function xDisplay(e,s)\r\n{\r\n if ((e=xGetElementById(e)) && e.style && xDef(e.style.display)) {\r\n if (xStr(s)) {\r\n try { e.style.display = s; }\r\n catch (ex) { e.style.display = ''; } // Will this make IE use a default value\r\n } // appropriate for the element?\r\n return e.style.display;\r\n }\r\n return null;\r\n}", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery( \"<iframe frameborder='0' width='0' height='0'/>\" )\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;\n\t\t\tdoc.write( \"<!doctype html><html><body>\" );\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function _elementDisplay($element, value) {\n var display = (value) ? \"block\" : \"none\";\n $element.css(\"display\", display);\n}", "function getComputedDisplay(el, win) {\n var display = getComputedStyleProperty(el, \"display\", win);\n var tagName = el.tagName.toLowerCase();\n return (display == \"block\" &&\n tableCssDisplayBlock &&\n defaultDisplayValueForTag.hasOwnProperty(tagName)) ?\n defaultDisplayValueForTag[tagName] : display;\n }", "function getComputedDisplay(el, win) {\n var display = getComputedStyleProperty(el, \"display\", win);\n var tagName = el.tagName.toLowerCase();\n return (display == \"block\" &&\n tableCssDisplayBlock &&\n defaultDisplayValueForTag.hasOwnProperty(tagName)) ?\n defaultDisplayValueForTag[tagName] : display;\n }", "function getComputedDisplay(el, win) {\n var display = getComputedStyleProperty(el, \"display\", win);\n var tagName = el.tagName.toLowerCase();\n return (display == \"block\"\n && tableCssDisplayBlock\n && defaultDisplayValueForTag.hasOwnProperty(tagName))\n ? defaultDisplayValueForTag[tagName] : display;\n }", "function getComputedDisplay(el, win) {\n var display = getComputedStyleProperty(el, \"display\", win);\n var tagName = el.tagName.toLowerCase();\n return (display == \"block\"\n && tableCssDisplayBlock\n && defaultDisplayValueForTag.hasOwnProperty(tagName))\n ? defaultDisplayValueForTag[tagName] : display;\n }", "function getComputedDisplay(el, win) {\n var display = getComputedStyleProperty(el, \"display\", win);\n var tagName = el.tagName.toLowerCase();\n return (display == \"block\"\n && tableCssDisplayBlock\n && defaultDisplayValueForTag.hasOwnProperty(tagName))\n ? defaultDisplayValueForTag[tagName] : display;\n }", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( jQuery.support.boxModel ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( jQuery.support.boxModel ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( jQuery.support.boxModel ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n\tif ( !elemdisplay[ nodeName ] ) {\n\n\t\tvar body = document.body,\n\t\t\telem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n\t\t\tdisplay = elem.css( \"display\" );\n\t\telem.remove();\n\n\t\t// If the simple way fails,\n\t\t// get element's real default display by attaching it to a temp iframe\n\t\tif ( display === \"none\" || display === \"\" ) {\n\t\t\t// No iframe to use yet, so create it\n\t\t\tif ( !iframe ) {\n\t\t\t\tiframe = document.createElement( \"iframe\" );\n\t\t\t\tiframe.frameBorder = iframe.width = iframe.height = 0;\n\t\t\t}\n\n\t\t\tbody.appendChild( iframe );\n\n\t\t\t// Create a cacheable copy of the iframe document on first call.\n\t\t\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t\t\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\t\t\tif ( !iframeDoc || !iframe.createElement ) {\n\t\t\t\tiframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n\t\t\t\tiframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n\t\t\t\tiframeDoc.close();\n\t\t\t}\n\n\t\t\telem = iframeDoc.createElement( nodeName );\n\n\t\t\tiframeDoc.body.appendChild( elem );\n\n\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\tbody.removeChild( iframe );\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n if ( !elemdisplay[ nodeName ] ) {\n\n var body = document.body,\n elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n display = elem.css( \"display\" );\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if ( display === \"none\" || display === \"\" ) {\n // No iframe to use yet, so create it\n if ( !iframe ) {\n iframe = document.createElement( \"iframe\" );\n iframe.frameBorder = iframe.width = iframe.height = 0;\n }\n\n body.appendChild( iframe );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if ( !iframeDoc || !iframe.createElement ) {\n iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n iframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n iframeDoc.close();\n }\n\n elem = iframeDoc.createElement( nodeName );\n\n iframeDoc.body.appendChild( elem );\n\n display = jQuery.css( elem, \"display\" );\n body.removeChild( iframe );\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n if ( !elemdisplay[ nodeName ] ) {\n\n var body = document.body,\n elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n display = elem.css( \"display\" );\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if ( display === \"none\" || display === \"\" ) {\n // No iframe to use yet, so create it\n if ( !iframe ) {\n iframe = document.createElement( \"iframe\" );\n iframe.frameBorder = iframe.width = iframe.height = 0;\n }\n\n body.appendChild( iframe );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if ( !iframeDoc || !iframe.createElement ) {\n iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n iframeDoc.write( ( document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n iframeDoc.close();\n }\n\n elem = iframeDoc.createElement( nodeName );\n\n iframeDoc.body.appendChild( elem );\n\n display = jQuery.css( elem, \"display\" );\n body.removeChild( iframe );\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return elemdisplay[ nodeName ];\n}", "function defaultDisplay( nodeName ) {\n\n if ( !elemdisplay[ nodeName ] ) {\n\n var body = document.body,\n elem = jQuery( \"<\" + nodeName + \">\" ).appendTo( body ),\n display = elem.css( \"display\" );\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if ( display === \"none\" || display === \"\" ) {\n // No iframe to use yet, so create it\n if ( !iframe ) {\n iframe = document.createElement( \"iframe\" );\n iframe.frameBorder = iframe.width = iframe.height = 0;\n }\n\n body.appendChild( iframe );\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if ( !iframeDoc || !iframe.createElement ) {\n iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;\n iframeDoc.write( ( jQuery.support.boxModel ? \"<!doctype html>\" : \"\" ) + \"<html><body>\" );\n iframeDoc.close();\n }\n\n elem = iframeDoc.createElement( nodeName );\n\n iframeDoc.body.appendChild( elem );\n\n display = jQuery.css( elem, \"display\" );\n body.removeChild( iframe );\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return elemdisplay[ nodeName ];\n}", "function t(e){return!!r(e)||\"block\"===s.dom.getStyle(\"display\").from(e)}", "function actualDisplay( name, doc ) {\n\tvar elem = DM( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = DM.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function getElementDisplay(Element, state) {\n\toElement = createReference(Element)\n if (!isNav) { elementDisp = oElement.display }\t\t//This function does not work in NAV4!\n\treturn elementDisp\n}", "get displayMode() {\n\t\treturn this.nativeElement ? this.nativeElement.displayMode : undefined;\n\t}", "function actualDisplay( name, doc ) {\r\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\r\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\r\n\telem.remove();\r\n\treturn display;\r\n}", "function actualDisplay( name, doc ) {\n var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n display = jQuery.css( elem[0], \"display\" );\n elem.remove();\n return display;\n}", "function actualDisplay( name, doc ) {\n var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n display = jQuery.css( elem[0], \"display\" );\n elem.remove();\n return display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}" ]
[ "0.7472962", "0.72553515", "0.72553515", "0.7111155", "0.7098295", "0.7093641", "0.70717317", "0.70717317", "0.70607156", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.70513785", "0.7050581", "0.7033116", "0.7019926", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.7018497", "0.70050293", "0.69863033", "0.69675213", "0.6961028", "0.69371355", "0.68269885", "0.6788407", "0.6788407", "0.6762417", "0.6762417", "0.6762417", "0.6718012", "0.6718012", "0.6718012", "0.67098", "0.67098", "0.67098", "0.6708685", "0.6708685", "0.6699698", "0.6699698", "0.66995794", "0.669786", "0.6563753", "0.65124094", "0.65016335", "0.63979375", "0.63881785", "0.63881785", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299", "0.638299" ]
0.72743565
1
Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, list, placeBefore, dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ), i = 0, length = dataTypes.length; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression for ( ; i < length; i++ ) { dataType = dataTypes[ i ]; // We control if we're asked to add before // any existing element placeBefore = /^\+/.test( dataType ); if ( placeBefore ) { dataType = dataType.substr( 1 ) || "*"; } list = structure[ dataType ] = structure[ dataType ] || []; // then we add to the structure accordingly list[ placeBefore ? "unshift" : "push" ]( func ); } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.config = Config.ajax;\n this.xhr;\n this.Serialize;\n }", "function AjaxPipelineConstructor() {\r\n BaseObject.call(this,arguments);\r\n }", "function Ajax(__constructor) {\r\n if (Params.env.isFirefox) return GM_xmlhttpRequest(__constructor);\r\n else return new XHR(__constructor);\r\n}", "function ajax_legacy() {\n /* + when */\n jQuery.ajax\n (\n jQuery.extend\n (\n true , {} ,\n settings.ajax ,\n callbacks ,\n {\n url : url ,\n beforeSend : function () {\n XMLHttpRequest = arguments[ 0 ] ;\n \n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader , 'true' ) ;\n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader + '-Area' , settings.area ) ;\n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader + '-CSS' , settings.load.css ) ;\n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader + '-Script' , settings.load.script ) ;\n \n fire( settings.callbacks.ajax.beforeSend , context , [ event , settings.parameter , XMLHttpRequest ] , settings.callbacks.async ) ;\n } ,\n success : function () {\n data = arguments[ 0 ] ;\n dataType = arguments[ 1 ] ;\n XMLHttpRequest = arguments[ 2 ] ;\n \n fire( settings.callbacks.ajax.success , context , [ event , settings.parameter , data , dataType , XMLHttpRequest ] , settings.callbacks.async ) ;\n \n update() ;\n } ,\n error : function () {\n XMLHttpRequest = arguments[ 0 ] ;\n textStatus = arguments[ 1 ] ;\n errorThrown = arguments[ 2 ] ;\n \n /* validate */ var validate = plugin_data[ settings.id ] && plugin_data[ settings.id ].validate ? plugin_data[ settings.id ].validate.clone( { name : 'jquery.pjax.js - drive()' } ) : validate ;\n /* validate */ validate && validate.start() ;\n /* validate */ validate && validate.test( '++', 1, [ url, win.location.href ], 'ajax_legacy()' ) ;\n /* validate */ validate && validate.test( '++', 1, [ XMLHttpRequest, textStatus, errorThrown ], 'ajax error' ) ;\n fire( settings.callbacks.ajax.error , context , [ event , settings.parameter , XMLHttpRequest , textStatus , errorThrown ] , settings.callbacks.async ) ;\n if ( settings.fallback ) { return typeof settings.fallback === 'function' ? settings.fallback( event ) : fallback( event , validate ) ; } ;\n /* validate */ validate && validate.end() ;\n }\n }\n )\n )\n /* - when */\n }", "function getCorsAjaxTransport() {\n var xhrOrXdr;\n\n if (window.XMLHttpRequest || window.ActiveXObject) {\n xhrOrXdr = qq.createXhrInstance();\n\n if (xhrOrXdr.withCredentials === undefined) {\n xhrOrXdr = new XDomainRequest();\n // Workaround for XDR bug in IE9 - https://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment\n xhrOrXdr.onload = function() {};\n xhrOrXdr.onerror = function() {};\n xhrOrXdr.ontimeout = function() {};\n xhrOrXdr.onprogress = function() {};\n }\n }\n\n return xhrOrXdr;\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 }", "useAjax( ajax ) {\n this._ajax = ajax;\n }", "useAjax( ajax ) {\n this._ajax = ajax;\n }", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function WrappedXMLHttpRequest() {\n this._inner = Cc[\"@mozilla.org/xmlextras/xmlhttprequest;1\"].createInstance();\n}", "function $Ajax(uri, fHandler, method) {\r\n\t\tthis.uri = uri || \"\";\r\n\t\tthis.fHandler = fHandler || null;\r\n\t\tthis.method = method || \"GET\";\r\n\t\tthis.xmlHttp = false;\r\n\t\ttry { this.xmlHttp = new XMLHttpRequest(); } catch(e) {}\r\n\t\tif (!this.xmlHttp) try { this.xmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\"); } catch(e) {}\r\n\t\tif (!this.xmlHttp) try { this.xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); } catch(e) {}\r\n\t\tif (!this.xmlHttp) try { this.xmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP.4.0\"); } catch(e) {}\r\n\t}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}}", "function ajaxWithCookieFactory() {\n var jar = request.jar();\n\n return {\n\n addCookie: function(data) {\n jar.add(request.cookie(data));\n },\n\n getCookie: function(name) {\n var i, cookie;\n for (i = 0; i < jar.cookies.length; i += 1) {\n cookie = jar.cookies[i];\n if (cookie.name.localeCompare(name) === 0) {\n return cookie.value;\n }\n }\n },\n\n go: function(jqParams) {\n var options = {};\n if (typeof jqParams === 'string') {\n options.url = jqParams;\n } else {\n options.url = jqParams.url;\n options.method = jqParams.type; \n options.headers = jqParams.headers; \n options[(\"POST\".localeCompare(jqParams.type) === 0) ?\n \"form\" : \"qs\"] = jqParams.data;\n }\n options.jar = jar;\n \n var deferred = $.Deferred();\n request(options, function (error, response, body) {\n response.status = response.statusCode;\n if (!error && response.statusCode == 200) {\n if (\"json\".localeCompare(jqParams.dataType) === 0) {\n body = JSON.parse(body);\n }\n deferred.resolve(body, \"success\", response);\n } else {\n response.responseText = body;\n deferred.reject(response, error);\n }\n });\n return deferred.promise();\n }\n }\n}", "constructor(serverBase: String, idPrefix: String) {\n this.serverBase = serverBase;\n this.idPrefix = idPrefix;\n this.listeners = new Map();\n this.items = new Map();\n this.itemList = undefined;\n\n // Hmm, odd.\n window.$.ajaxSetup({\n scriptCharset: \"utf-8\",\n contentType: \"application/json; charset=utf-8\"\n });\n }", "function NetworkResponseInterceptor() {\n this._originalAjax = $.ajax;\n this._successInterceptors = [];\n this._errorInterceptors = [];\n this._urlPatterns = [];\n}", "function createAJAXObject(ajax) {\n //We want optionPromise to resolve asynchronously so we can use results from other promises in it\n var optionPromise = Promise.resolve({});\n return {\n get: function () { return ajax('get', optionPromise) },\n post: function () { return ajax('post', optionPromise) },\n put: function () { return ajax('put', optionPromise) },\n delete: function () { return ajax('delete', optionPromise) },\n head: function () { return ajax('head', optionPromise) },\n /* options is an object containing optionally the parameters:\n * - headers: (object) the headers to pass along with the request\n * - timeout: (number) the milliseconds following which to cancel the request\n */\n setOptions: function (o) {\n for (var key in o) {\n optionPromise.then(function (options) {\n options[key] = o[key];\n });\n }\n return this;\n },\n setOptionPromise: function (promise) {\n optionPromise = promise;\n return this;\n }\n }\n }", "function createJQueryRestAdapter (){\n // use jQuery to contact the Jive server\n\n var ajaxPath = \"\"; // value replaced when template is rendered\n var osapi = $r(\"osapi\");\n\n var dataFilter = function(data, type) {\n return (type === 'json' && data) ? jQuery.trim(data.replace(/^throw [^;]*;/, '')) : data;\n };\n\n /**\n * @param options.method {String} one of \"GET\", \"PUT\", \"POST\" or \"DELETE\"\n * @param options.endpoint {String} the short REST path, e.g.: \"users/1234?\"\n * @param options.queryParams {Object} map of query params to their values\n * @param options.body {String} body content to send with PUT or POST\n * @constructor\n */\n osapi.Request = function(options) {\n this.options = {\n method: options.method,\n endpoint: options.endpoint,\n ext: options.ext,\n v: options.v\n };\n if (isObjectWithProperties(options.queryParams)) {\n this.options.queryParams = options.queryParams\n }\n if (options.body != null) {\n this.options.body = options.body\n }\n };\n osapi.Request.prototype.execute = function(callback) {\n executeImpl.call(this, null, callback);\n };\n osapi.Request.prototype.executeAs = function(personURI, callback) {\n executeImpl.call(this, \"uri \" + personURI, callback);\n };\n function executeImpl(runAs, callback) {\n callback = callback || function(){};\n var endpoint = this.options.endpoint + buildQueryParams(this.options.queryParams);\n if (endpoint.charAt(0) == '/') {\n endpoint = endpoint.substring(1);\n }\n var path = this.options.ext\n ? \"ext/\" + this.options.ext + \"/\" + (this.options.version || this.options.v)\n : \"v3\";\n var url = [ajaxPath, \"api/core\", path, endpoint].join(\"/\");\n jQuery.ajax({\n url: url,\n type: this.options.method,\n contentType: this.options.body == null ? $u : \"application/json; charset=utf-8\",\n data: this.options.body == null ? $u : this.options.body,\n dataType: \"json\",\n dataFilter: dataFilter,\n beforeSend: function(req) {\n if (runAs != null) {\n req.setRequestHeader(\"X-Jive-Run-As\", runAs);\n }\n },\n success: function(data, textStatus, jqXHR) {\n if(data === null) {\n data = { status : jqXHR.status };\n }\n callback(interceptData(data));\n },\n error: function(xhr) {\n callback(buildErr(500, xhr.status, \"An error occurred while contacting the server\"));\n }\n });\n }\n\n /**\n * Object that may contain several Request objects to be executed in a\n * single REST call.\n * @constructor\n */\n osapi.BatchRequest = function() {\n this._requests = [];\n };\n osapi.BatchRequest.prototype.add = function(key, request) {\n if (this._requests == null) {\n throw \"BatchRequest is no longer valid\";\n }\n this._requests.push({\n key: key,\n request: request.options\n });\n };\n osapi.BatchRequest.prototype.execute = function(callback) {\n executeBatchImpl.call(this, null, callback);\n };\n osapi.BatchRequest.prototype.executeAs = function(personURI, callback) {\n executeBatchImpl.call(this, \"uri \" + personURI, callback);\n };\n function executeBatchImpl(runAs, callback) {\n if (this._requests == null) {\n throw \"BatchRequest is no longer valid\";\n }\n var req = this._requests;\n this._requests = null;\n callback = callback || function(){};\n if (req.length == 0) {\n callback({});\n return;\n }\n var url = [ajaxPath, \"api/core/v3/executeBatch\"].join(\"/\");\n jQuery.ajax({\n url: url,\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(req),\n dataType: \"json\",\n dataFilter: dataFilter,\n beforeSend: function(req) {\n if (runAs != null) {\n req.setRequestHeader(\"X-Jive-Run-As\", runAs);\n }\n },\n success: function(res) {\n var data = {}, i;\n for (i = 0; i < res.length; i++) {\n if (res[i].data) {\n data[res[i].id] = interceptData(res[i].data);\n } else if (res[i].error) {\n data[res[i].id] = buildErr(res[i].error.code || 500, res[i].status || 500, res[i].error.message);\n }\n }\n for (i = 0; i < req.length; i++) {\n if (!(data.hasOwnProperty(req[i].id) && data[req[i].id])) {\n data[req[i].id] = buildErr(500, 500, \"No data was returned from the server\");\n }\n }\n callback(data);\n },\n error: function(xhr) {\n var res = {};\n try {\n res = JSON.parse(xhr.responseText) || {};\n } catch (e) { /* don't care */ }\n var data = {};\n var err = buildErr(res.code || 500, xhr.status, res.message || \"An error occurred while contacting the server\");\n for (var i = 0; i < req.length; i++) {\n data[req[i].key] = err;\n }\n callback(data);\n }\n });\n }\n\n /**\n * Creates a new, empty BatchRequest\n * @return {osapi.BatchRequest}\n */\n osapi.newBatch = function() {\n return new osapi.BatchRequest();\n };\n\n function buildErr(code, status, msg) {\n return {\n error: {\n code: code,\n status: status,\n message: msg\n }\n };\n }\n\n function buildRequest(method, hasBody, options) {\n var o = {\n method: method,\n endpoint: options.href,\n queryParams: options.params\n };\n if (hasBody) {\n o.body = options.body == null ? \"\" : JSON.stringify(options.body);\n }\n if (options.ext) {\n o.ext = options.ext;\n o.v = options.v;\n }\n return new osapi.Request(o);\n }\n\n $r(\"osapi.jive.core\", function() { return {\n \"get\": function(options) {\n return buildRequest(\"GET\", false, options);\n },\n \"post\": function(options) {\n return buildRequest(\"POST\", true, options);\n },\n \"put\": function(options) {\n return buildRequest(\"PUT\", true, options);\n },\n \"delete\": function(options) {\n return buildRequest(\"DELETE\", false, options);\n }\n }});\n\n osapi.jive.core[\"get\"]._intercepted = true;\n osapi.jive.core[\"put\"]._intercepted = true;\n osapi.jive.core[\"post\"]._intercepted = true;\n osapi.jive.core[\"delete\"]._intercepted = true;\n\n initIntercept = bootstrapRest;\n }", "function AjaxUtil_requester() {\n /**\n * @type {String?} url the url of post target\n */\n this.url = null;\n /**\n * @type {String?} type the content-type of http request header\n */\n this.type = null;\n /**\n * @type {Object?} content the content to post\n */\n this.content = null;\n /**\n * @type {Number?}\n */\n this.timeout = null;\n /**\n * @type {Boolean?}\n */\n this.wait = null;\n}", "constructor() {\n //https://javascript.info/xmlhttprequest\n\n // var defs\n this.args = {\n url: false,\n method: false,\n data: false,\n dataType: false, // aka requestType this is either form or json xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n responseType: false, // for clientside processing response data type\n timeout: 0,\n onComplete: false,\n onError: false, // only triggers if the request couldn't be made at all\n onProgress: false,\n onCancel: false,\n username: false,\n password: false\n };\n\n this.url = false;\n this.urlParams = \"\";\n this.xhr = false;\n\n // Process arguments\n if (arguments[0] && typeof (arguments[0]) === \"object\") {\n for (let key in arguments[0]) {\n if (this.args.hasOwnProperty(key)) {\n this.args[key] = arguments[0][key];\n }\n }\n }\n // console.log(this.args);\n\n // Validate\n let valid = true;\n\n if (this.args.url === false) {\n let msg = `XHR(): Usage error: Option \"url\" has not been set!\nPlease enter a valid url to make a request to!`;\n console.error(msg);\n valid = false;\n return false;\n }\n\n if (this.args.method === false) {\n let msg = `XHR(): Usage error: Option \"method\" has not been set!\nValid options are:\n POST,\n GET`;\n console.error(msg);\n valid = false;\n return false;\n }\n\n\n\n\n // log(this.args);\n let showDataTypeError = false;\n if (this.args.data !== false){\n if (this.args.dataType === false){\n showDataTypeError = true;\n } else {\n if (typeof(this.args.dataType) == \"string\"){\n if (\n this.args.dataType.toLowerCase() !== \"json\" &&\n this.args.dataType.toLowerCase() !== \"form\" &&\n this.args.dataType.toLowerCase() !== \"text\"){\n showDataTypeError = true;\n }\n }\n }\n }\n\n\n if (showDataTypeError) {\n let msg = `XHR(): Usage error: Invalid \"dataType\" has been set!\nValid options are:\n JSON - send json string\n FORM - send form object\n TEXT - send url string\n`;\n console.error(msg);\n valid = false;\n return false;\n }\n\n\n\n\n\n let showResponseTypeError = false;\n if (this.args.responseType === false){\n showResponseTypeError = true;\n } else {\n if (typeof(this.args.dataType) == \"string\"){\n if (\n this.args.responseType.toLowerCase() != \"text\" &&\n this.args.responseType.toLowerCase() != \"document\" &&\n this.args.responseType.toLowerCase() != \"json\" &&\n this.args.responseType.toLowerCase() != \"arraybuffer\" &&\n this.args.responseType.toLowerCase() != \"blob\"){\n showResponseTypeError = true;\n }\n }\n }\n\n\n\n if (showResponseTypeError) {\n let msg =\n `XHR(): Usage warning: Option \"responseType\" not set!\nValid options are:\n json \\t\\t\\t JSON (parsed automatically)\n document \\t\\t XML Document (XPath etc),\n text \\t\\t\\t string,\n arraybuffer \\t ArrayBuffer for binary data,\n blob \\t\\t\\t Blob for binary data,\n`;\n console.error(msg);\n valid = false;\n return false;\n }\n\n\n\n\n\n\n if (this.args.onComplete === false) {\n let msg = `XHR(): Usage error: Option \"onComplete\" has not been set!\nYour making a request but are not doing anything with the response? Make sure to supply an onComplete callback function.`;\n console.error(msg);\n valid = false;\n return false;\n }\n\n\n\n if (valid) {\n this.makeRequest();\n }\n }", "function KAJAX()\n{\n\t// ======= OBJECT DELCARATIONS =======\n\tthis._browserDetect = new KAJAX_browserDetect();\n}", "function handleAjaxSetup() {\n jQuery.ajaxSetup(Object.create(null, {\n // Don't worry about the GET request, this option will be ignored by jQuery when using HTTP GET method.\n 'contentType': { value: 'application/json; charset=UTF-8', enumerable: true, writable: true },\n 'headers': { value: csrfToken, enumerable: true, writable: true },\n 'dataType': { value: 'json', enumerable: true, writable: true },\n 'dataFilter': { value: filterAjaxData, enumerable: true, writable: true },\n }));\n }", "constructor( url, jxon=false, method='POST', credential='*' ){ \n super(url, method, credential) \n if(jxon){\n this.parse = function(xhttp){\n var resp = xhttp.response==\"\"?\"{}\":xhttp.response\n return JXON.parse(resp)\n } \n this.stringify = function(obj){ return JXON.stringify(obj) }\n }else{\n this.parse = function(xhttp){\n var resp = xhttp.response==\"\"?\"{}\":xhttp.response\n return JSON.parse(resp)\n } \n this.stringify = function(obj){ return JSON.stringify(obj) }\n }\n }", "function xhrInterceptor() {\n var originalXHR = window.XMLHttpRequest;\n var xhrSend = XMLHttpRequest.prototype.send;\n var xhrOpen = XMLHttpRequest.prototype.open;\n originalXHR.getRequestConfig = [];\n function ajaxEventTrigger(event) {\n var ajaxEvent = new CustomEvent(event, { detail: this });\n window.dispatchEvent(ajaxEvent);\n }\n function customizedXHR() {\n var liveXHR = new originalXHR();\n liveXHR.addEventListener('readystatechange', function () {\n ajaxEventTrigger.call(this, 'xhrReadyStateChange');\n }, false);\n liveXHR.open = function (method, url, async, username, password) {\n this.getRequestConfig = arguments;\n return xhrOpen.apply(this, arguments);\n };\n liveXHR.send = function (body) {\n return xhrSend.apply(this, arguments);\n };\n return liveXHR;\n }\n window.XMLHttpRequest = customizedXHR;\n }", "function NetworkResponseInterceptor () {\n this._originalAjax = $.ajax;\n this._successInterceptors = [];\n this._errorInterceptors = [];\n this._urlPatterns = [];\n}", "function getAjaxTransport() {\n\treturn validFuncOf(\n function() {return new XMLHttpRequest()},\n function() {return new ActiveXObject('Msxml2.XMLHTTP')},\n function() {return new ActiveXObject('Microsoft.XMLHTTP')}\n ) \n}", "constructor(url, method='POST'){\n this.url = url\n this.method = method \n }", "function request() {\n var ajax = new _ajaxRequest.default();\n return ajax.request.apply(ajax, arguments);\n }", "function ajaxSyncInit() { \r\n\tvar localObjRequest;\r\n\r\n\tif (window.XMLHttpRequest) {\r\n\r\n \t\t// Mozilla,Safari, Chrome, IE7+\r\n \t\ttry { \r\n\t \t\tlocalObjRequest = new XMLHttpRequest(); \r\n\t\t} catch(exc) { \r\n\t \talert(\"The browser cannot handler the Ajax resources.\"); \r\n\t \tlocalObjRequest = false; \r\n\t\t}\r\n\r\n\t} else if (window.ActiveXObject) {\r\n\t\t// IE6-\r\n\t\ttry {\r\n\t\t\tlocalObjRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t} catch(e) {\r\n\t\t\ttry { \r\n\t \t\t\tlocalObjRequest = new ActiveXObject(\"Msxml2.XMLHTTP\"); \r\n\t\t\t} catch(ex) { \r\n\t \t\talert(\"The browser cannot handler the Ajax resources.\"); \r\n \t\t\t\tlocalObjRequest = false; \r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn localObjRequest;\r\n}", "function AbstractDataProxy(options)\n{\n\tvar self = this;\n\n\t// default options\n\tself._defaultOpts = {\n\t\tinitMode: \"lazy\", // \"lazy\" or \"full\"\n\t\tservletName: \"\", // name of the servlet to retrieve the actual data (used for AJAX query)\n\t\tdata: {} // actual data, will be used only if it is a full init, i.e {initMode: \"full\"}\n\t};\n\n\tself._queryQueue = new RequestQueue();\n\n\t// merge options with default options to use defaults for missing values\n\tself._options = jQuery.extend(true, {}, self._defaultOpts, options);\n\n\t/**\n\t * Initializes the data proxy with respect to init mode.\n\t */\n\tself.init = function()\n\t{\n\t\tself._queryQueue.init(function(options) {\n\t\t\t$.ajax(options);\n\t\t});\n\n\t\tif (self.isFullInit())\n\t\t{\n\t\t\tself.fullInit(self._options);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself.lazyInit(self._options);\n\t\t}\n\t};\n\n\t/**\n\t * Initializes the proxy without actually grabbing anything from the server.\n\t * Provided servlet name will be used later.\n\t *\n\t * @param options data proxy options\n\t */\n\tself.lazyInit = function(options)\n\t{\n\t\t// no default implementation, can be overridden by subclasses\n\t};\n\n\t/**\n\t * Initializes with full data. Once initialized with full data,\n\t * this proxy class assumes that there will be no additional data.\n\t *\n\t * @param options data proxy options\n\t */\n\tself.fullInit = function(options)\n\t{\n\t\t// method body should be overridden by subclasses\n\t};\n\n\t/**\n\t * Checks if the initialization is full or lazy.\n\t *\n\t * @return {boolean} true if full init, false otherwise\n\t */\n\tself.isFullInit = function()\n\t{\n\t\treturn !(self._options.initMode.toLowerCase() === \"lazy\");\n\t};\n\n\n\t/**\n\t * This function ensures that at most only one ajax request is\n\t * sent from a particular DataProxy instance. This is to prevent\n\t * too many simultaneous requests.\n\t *\n\t * @ajaxOptions jQuery ajax options\n\t */\n\tself.requestData = function(ajaxOptions)\n\t{\n\t\tvar complete = ajaxOptions.complete;\n\n\t\tvar defaultOpts = {\n\t\t\tcomplete: function(request, status)\n\t\t\t{\n\t\t\t\tself._queryQueue.complete();\n\n\t\t\t\tif (_.isFunction(complete))\n\t\t\t\t{\n\t\t\t\t\tcomplete(request, status);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// extend options with default options\n\t\tvar options = jQuery.extend(true, {}, ajaxOptions, defaultOpts);\n\n\t\tself._queryQueue.add(options);\n\t};\n}", "function ajaxExtend(target, src) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[ key ] !== undefined) {\n (flatOptions[ key ] ? target : (deep || (deep = {})))[ key ] = src[ key ];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function request() {\n const ajax = new _ajaxRequest.default();\n return ajax.request(...arguments);\n }", "function cjAjaxClass() {\n this.getTable = cjAjaxGetTable;\n this.getNameArray = cjAjaxGetNameArray;\n this.getNameValue = cjAjaxGetNameValue;\n this.update = cjAjaxUpdate;\n this.data = cjAjaxData;\n this.setVisitProperty = cjAjaxSetVisitProperty;\n this.getVisitProperty = cjAjaxGetVisitProperty;\n this.url = cjAjaxURL;\n this.addon = cjAjaxAddon;\n this.addonCallback = cjAjaxAddonCallback;\n this.qs = cjAjaxQs;\n this.qsCallback = cjAjaxQsCallback;\n}", "function n(e,t,n,o){var i,r,a,s,u,c=t;\n// Ignore repeat invocations\nh||(h=!0,\n// Clear timeout if it exists\np&&_.clearTimeout(p),\n// Dereference transport for early garbage collection\n// (no matter how long the jqXHR object will be used)\nl=void 0,\n// Cache response headers\nd=o||\"\",\n// Set readyState\nT.readyState=0<e?4:0,\n// Determine if successful\ni=200<=e&&e<300||304===e,\n// Get response data\nn&&(s=Z(g,T,n)),\n// Convert no matter what (that way responseXXX fields are always set)\ns=ee(g,s,T,i),\n// If successful, handle type chaining\ni?(\n// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\ng.ifModified&&((u=T.getResponseHeader(\"Last-Modified\"))&&(me.lastModified[f]=u),(u=T.getResponseHeader(\"etag\"))&&(me.etag[f]=u)),\n// if no content\n204===e||\"HEAD\"===g.type?c=\"nocontent\":304===e?c=\"notmodified\":(c=s.state,r=s.data,i=!(a=s.error))):(\n// Extract error from statusText and normalize for non-aborts\na=c,!e&&c||(c=\"error\",e<0&&(e=0))),\n// Set data for the fake xhr object\nT.status=e,T.statusText=(t||c)+\"\",\n// Success/Error\ni?b.resolveWith(v,[r,c,T]):b.rejectWith(v,[T,c,a]),\n// Status-dependent callbacks\nT.statusCode(x),x=void 0,m&&y.trigger(i?\"ajaxSuccess\":\"ajaxError\",[T,g,i?r:a]),\n// Complete\nw.fireWith(v,[T,c]),m&&(y.trigger(\"ajaxComplete\",[T,g]),\n// Handle the global AJAX counter\n--me.active||me.event.trigger(\"ajaxStop\")))}", "function Ajax(opt) {\n var finalCfg = _merge(defaultCfg, opt || {}),\n data = _serializenData(finalCfg.data),\n timeout = null,\n hasTimeout = false,\n supportCors = true,\n xhr, headers, scriptNode, response, data, dataType;\n\n data = _serializenData(finalCfg.data);\n dataType = _getDataType(finalCfg.dataType);\n\n if (finalCfg.method.toLowerCase() === \"get\") {\n if (finalCfg.url.indexOf(\"?\") === -1) {\n finalCfg.url += (\"?\" + data);\n } else {\n finalCfg.url += (\"&\" + data);\n }\n data = null;\n }\n\n // configed the timeout\n if (finalCfg.timeout > 0) {\n timeout = setTimeout(function() {\n if (_typeOf(finalCfg.abort) === \"Function\") {\n finalCfg.abort.call(finalCfg.context, xhr || null);\n }\n hasTimeout = true;\n }, finalCfg.timeout);\n }\n\n // jsonp type request\n if (dataType === \"jsonp\") {\n scriptNode = document.createElement(\"script\");\n scriptNode.type = \"text/javascript\";\n if (finalCfg.url.indexOf(\"?\") > -1 && data !== \"undefined\") {\n finalCfg.url += data;\n } else {\n finalCfg.url += (\"?\" + data);\n }\n scriptNode.src = finalCfg.url;\n head.appendChild(scriptNode);\n scriptNode.onload = function() {\n head.removeChild(scriptNode);\n if (!hasTimeout && timeout) {\n clearTimeout(timeout);\n }\n // excute the success callback\n if (_typeOf(finalCfg.success) === \"Function\") {\n finalCfg.success.call(finalCfg.context, response, null);\n }\n };\n } else {\n xhr = root.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");\n supportCors = \"withCredentials\" in xhr;\n\n for(var i = 0, len = requestInterceptors.length; i < len; i ++) {\n requestInterceptors[i](xhr);\n }\n\n // bind the readystate change event\n xhr.onreadystatechange = function() {\n // already timeout\n if (hasTimeout) {\n return;\n }\n\n for(var i = 0, len = responseInterceptors.length; i < len; i ++) {\n responseInterceptors[i](xhr);\n }\n\n if (xhr.readyState === 4) {\n // setted the time out, and not timeout until now\n if (timeout) {\n clearTimeout(timeout);\n }\n\n response = xhr.responseText;\n\n // 2xx -> success\n // 304 -> not modified\n if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n try {\n if (dataType === \"script\") {\n response = (new Function(\"return \" + response)).call(root);\n } else if (dataType === \"xml\") {\n // responseXML is not empty\n if (xhr.responseXML !== null) {\n response = xhr.responseXML;\n }\n } else if (dataType === \"json\") {\n response = response ? JSON.parse(response) : null;\n } else {\n response = xhr.responseText;\n }\n // excute the success callback\n if (_typeOf(finalCfg.success) === \"Function\") {\n finalCfg.success.call(finalCfg.context, response, xhr);\n }\n } catch (ex) {\n if (_typeOf(finalCfg.error) === \"Function\") {\n // excute the error callback\n finalCfg.error.call(finalCfg.context, response, ex, xhr);\n }\n }\n } else {\n if (_typeOf(finalCfg.error) === \"Function\") {\n // excute the error callback\n finalCfg.error.call(finalCfg.context, response, null, xhr);\n }\n }\n }\n };\n\n // mark this request is a XMLHttpRequest(ajax), not a common request\n // cross domain can not distinguish \"X-Requested-With\"\n if (!finalCfg.withCredentials) {\n finalCfg.headers = _merge(finalCfg.headers, {\n \"X-Requested-With\": \"XMLHttpRequest\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Accept\": typeMaps[dataType].indexOf(\",\") > -1 ? typeMaps[dataType].split(\",\")[0] : typeMaps[dataType]\n });\n } else {\n finalCfg.headers = _merge(finalCfg.headers, {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Accept\": typeMaps[dataType].indexOf(\",\") > -1 ? typeMaps[dataType].split(\",\")[0] : typeMaps[dataType]\n });\n }\n\n // set the withCredentials attribute\n if (supportCors) {\n xhr.withCredentials = finalCfg.withCredentials;\n }\n\n xhr.open(finalCfg.method, finalCfg.url, finalCfg.async);\n _setHeaders(xhr, finalCfg.headers);\n xhr.send(data);\n\n return xhr;\n }\n }", "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 }", "function fXMLHttpRequest() {\n\t\tthis._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tthis._listeners = [];\n\t}", "function fXMLHttpRequest() {\n\t\tthis._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tthis._listeners = [];\n\t}", "function fXMLHttpRequest() {\n this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n this._listeners = [];\n }", "function fXMLHttpRequest() {\n this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n this._listeners = [];\n }", "function wirejQueryInterceptor() {\n $(document).ajaxStart(function () { processRequest(); });\n $(document).ajaxComplete(function () { processResponse(); });\n $(document).ajaxError(function () { processResponse(); });\n }", "function microAjax(B,A){this.bindFunction=function(E,D){return function(){return E.apply(D,[D])}};this.stateChange=function(D){if(this.request.readyState==4){this.callbackFunction(this.request.responseText)}};this.getRequest=function(){if(window.ActiveXObject){return new ActiveXObject(\"Microsoft.XMLHTTP\")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}return false};this.postBody=(arguments[2]||\"\");this.callbackFunction=A;this.url=B;this.request=this.getRequest();if(this.request){var C=this.request;C.onreadystatechange=this.bindFunction(this.stateChange,this);if(this.postBody!==\"\"){C.open(\"POST\",B,true);C.setRequestHeader(\"X-Requested-With\",\"XMLHttpRequest\");C.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");C.setRequestHeader(\"Connection\",\"close\")}else{C.open(\"GET\",B,true)}C.send(this.postBody)}}", "function initFiltersPanel()\n{\n jQuery('div.task_filters ul li a').click(function(){\n jQuery('#search_filter_keys').effect(\"highlight\", {color: '#FF9900'}, 3000);\n jQuery.ajax({\n beforeSend: function(){ showProgress(); },\n complete: function(request){ tasklistReload(); hideProgress(); } ,\n data:'',\n success: function(request){jQuery('#search_filter_keys').html(request);},\n type:'post',\n url: this.href\n });\n return false;\n });\n}", "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL = \"\";\n this.responseHeaders = {};\n }\n\n _createClass(AjaxEngine, [{\n key: \"_call\",\n value: function _call(name) {\n this[name] && this[name].apply(this, [].splice.call(arguments, 1));\n }\n }, {\n key: \"_changeReadyState\",\n value: function _changeReadyState(state) {\n this.readyState = state;\n this._call(\"onreadystatechange\");\n }\n }, {\n key: \"open\",\n value: function open(method, url) {\n this.method = method;\n if (!url) {\n url = location.href;\n } else {\n url = util.trim(url);\n if (url.indexOf(\"http\") !== 0) {\n // Normalize the request url\n if (isBrowser) {\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n }\n this.responseURL = url;\n this._changeReadyState(1);\n }\n }, {\n key: \"send\",\n value: function send(arg) {\n var _this = this;\n\n arg = arg || null;\n var self = this;\n if (adapter) {\n var request = {\n method: self.method,\n url: self.responseURL,\n headers: self.requestHeaders || {},\n body: arg\n };\n util.merge(request, self._options || {});\n if (request.method === \"GET\") {\n request.body = null;\n }\n self._changeReadyState(3);\n var timer = void 0;\n self.timeout = self.timeout || 0;\n if (self.timeout > 0) {\n timer = setTimeout(function () {\n if (self.readyState === 3) {\n _this._call(\"onloadend\");\n self._changeReadyState(0);\n self._call(\"ontimeout\");\n }\n }, self.timeout);\n }\n request.timeout = self.timeout;\n adapter(request, function (response) {\n\n function getAndDelete(key) {\n var t = response[key];\n delete response[key];\n return t;\n }\n\n // If the request has already timeout, return\n if (self.readyState !== 3) return;\n clearTimeout(timer);\n\n // Make sure the type of status is integer\n self.status = getAndDelete(\"statusCode\") - 0;\n\n var responseText = getAndDelete(\"responseText\");\n var statusMessage = getAndDelete(\"statusMessage\");\n\n // Network error, set the status code 0\n if (!self.status) {\n self.statusText = responseText;\n self._call(\"onerror\", { msg: statusMessage });\n } else {\n // Parsing the response headers to array in a object, because\n // there may be multiple values with the same header name\n var responseHeaders = getAndDelete(\"headers\");\n var headers = {};\n for (var field in responseHeaders) {\n var value = responseHeaders[field];\n var key = field.toLowerCase();\n // Is array\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) === \"object\") {\n headers[key] = value;\n } else {\n headers[key] = headers[key] || [];\n headers[key].push(value);\n }\n }\n var cookies = headers[\"set-cookie\"];\n if (isBrowser && cookies) {\n cookies.forEach(function (e) {\n // Remove the http-Only property of the cookie\n // so that JavaScript can operate it.\n document.cookie = e.replace(/;\\s*httpOnly/ig, \"\");\n });\n }\n self.responseHeaders = headers;\n // Set the fields of engine from response\n self.statusText = statusMessage || \"\";\n self.response = self.responseText = responseText;\n self._response = response;\n self._changeReadyState(4);\n self._call(\"onload\");\n }\n self._call(\"onloadend\");\n });\n } else {\n console.error(\"Ajax require adapter\");\n }\n }\n }, {\n key: \"setRequestHeader\",\n value: function setRequestHeader(key, value) {\n this.requestHeaders[util.trim(key)] = value;\n }\n }, {\n key: \"getResponseHeader\",\n value: function getResponseHeader(key) {\n return (this.responseHeaders[key.toLowerCase()] || \"\").toString() || null;\n }\n }, {\n key: \"getAllResponseHeaders\",\n value: function getAllResponseHeaders() {\n var str = \"\";\n for (var key in this.responseHeaders) {\n str += key + \":\" + this.getResponseHeader(key) + \"\\r\\n\";\n }\n return str || null;\n }\n }, {\n key: \"abort\",\n value: function abort(msg) {\n this._changeReadyState(0);\n this._call(\"onerror\", { msg: msg });\n this._call(\"onloadend\");\n }\n }], [{\n key: \"setAdapter\",\n value: function setAdapter(requestAdapter) {\n adapter = requestAdapter;\n }\n }]);\n\n return AjaxEngine;\n }();\n\n return AjaxEngine;\n}", "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL = \"\";\n this.responseHeaders = {};\n }\n\n _createClass(AjaxEngine, [{\n key: \"_call\",\n value: function _call(name) {\n this[name] && this[name].apply(this, [].splice.call(arguments, 1));\n }\n }, {\n key: \"_changeReadyState\",\n value: function _changeReadyState(state) {\n this.readyState = state;\n this._call(\"onreadystatechange\");\n }\n }, {\n key: \"open\",\n value: function open(method, url) {\n this.method = method;\n if (!url) {\n url = location.href;\n } else {\n url = util.trim(url);\n if (url.indexOf(\"http\") !== 0) {\n // Normalize the request url\n if (isBrowser) {\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n }\n this.responseURL = url;\n this._changeReadyState(1);\n }\n }, {\n key: \"send\",\n value: function send(arg) {\n var _this = this;\n\n arg = arg || null;\n var self = this;\n if (adapter) {\n var request = {\n method: self.method,\n url: self.responseURL,\n headers: self.requestHeaders || {},\n body: arg\n };\n util.merge(request, self._options || {});\n if (request.method === \"GET\") {\n request.body = null;\n }\n self._changeReadyState(3);\n var timer = void 0;\n self.timeout = self.timeout || 0;\n if (self.timeout > 0) {\n timer = setTimeout(function () {\n if (self.readyState === 3) {\n _this._call(\"onloadend\");\n self._changeReadyState(0);\n self._call(\"ontimeout\");\n }\n }, self.timeout);\n }\n request.timeout = self.timeout;\n adapter(request, function (response) {\n\n function getAndDelete(key) {\n var t = response[key];\n delete response[key];\n return t;\n }\n\n // If the request has already timeout, return\n if (self.readyState !== 3) return;\n clearTimeout(timer);\n\n // Make sure the type of status is integer\n self.status = getAndDelete(\"statusCode\") - 0;\n\n var responseText = getAndDelete(\"responseText\");\n var statusMessage = getAndDelete(\"statusMessage\");\n\n // Network error, set the status code 0\n if (!self.status) {\n self.statusText = responseText;\n self._call(\"onerror\", { msg: statusMessage });\n } else {\n // Parsing the response headers to array in a object, because\n // there may be multiple values with the same header name\n var responseHeaders = getAndDelete(\"headers\");\n var headers = {};\n for (var field in responseHeaders) {\n var value = responseHeaders[field];\n var key = field.toLowerCase();\n // Is array\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) === \"object\") {\n headers[key] = value;\n } else {\n headers[key] = headers[key] || [];\n headers[key].push(value);\n }\n }\n var cookies = headers[\"set-cookie\"];\n if (isBrowser && cookies) {\n cookies.forEach(function (e) {\n // Remove the http-Only property of the cookie\n // so that JavaScript can operate it.\n document.cookie = e.replace(/;\\s*httpOnly/ig, \"\");\n });\n }\n self.responseHeaders = headers;\n // Set the fields of engine from response\n self.statusText = statusMessage || \"\";\n self.response = self.responseText = responseText;\n self._response = response;\n self._changeReadyState(4);\n self._call(\"onload\");\n }\n self._call(\"onloadend\");\n });\n } else {\n console.error(\"Ajax require adapter\");\n }\n }\n }, {\n key: \"setRequestHeader\",\n value: function setRequestHeader(key, value) {\n this.requestHeaders[util.trim(key)] = value;\n }\n }, {\n key: \"getResponseHeader\",\n value: function getResponseHeader(key) {\n return (this.responseHeaders[key.toLowerCase()] || \"\").toString() || null;\n }\n }, {\n key: \"getAllResponseHeaders\",\n value: function getAllResponseHeaders() {\n var str = \"\";\n for (var key in this.responseHeaders) {\n str += key + \":\" + this.getResponseHeader(key) + \"\\r\\n\";\n }\n return str || null;\n }\n }, {\n key: \"abort\",\n value: function abort(msg) {\n this._changeReadyState(0);\n this._call(\"onerror\", { msg: msg });\n this._call(\"onloadend\");\n }\n }], [{\n key: \"setAdapter\",\n value: function setAdapter(requestAdapter) {\n adapter = requestAdapter;\n }\n }]);\n\n return AjaxEngine;\n }();\n\n return AjaxEngine;\n}", "function AjaxClient(){\n this.client = null;\n try{\n this.client = new XMLHttpRequest();\n } catch (e) {\n try {\n this.client = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n\t\t\t\tthis.client = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} catch (e) {\n\t\t\t\tthis.client = null;\n\t\t\t}\n }\n }\n\n this.request = function(method, url, data, responseHandler){\n if(!this.client){\n window.alert(\"AJAX required, but not supported by your browser. You can no longer use this site.\");\n return ;\n }\n\n if(data){\n // encode both for get and for post requests\n data = JSONtoURL(data);\n }\n if (method == \"GET\"){\n // before opening connection\n // we must know the complete url\n url += \"?\" + (data ? data : \"\");\n console.log(\"GET \" + url);\n }\n this.client.open(method, url, true);\n if (method == \"POST\") {\n // we can only set headers after\n // having opened the connection\n this.client.setRequestHeader(\n 'Content-Type',\n // php $_POST can only be used with :\n // application/x-www-form-urlencoded\n // multipart/form-data\n 'application/x-www-form-urlencoded');\n }\n var thatclient = this.client;\n this.client.onreadystatechange = function(){\n if(thatclient.readyState == 4){\n console.log(thatclient);\n var response = JSON.parse(thatclient.responseText);\n responseHandler(response);\n }\n }\n this.client.send(data);\n }\n\n this.get = function (url, responseHandler) {\n return this.request(\"GET\", url, null, responseHandler);\n }\n\n this.post = function (url, data, responseHandler) {\n return this.request(\"POST\", url, data, responseHandler);\n }\n}", "function http() {\n\tthis.hint = 'url,queryType,dataType,async,data,timeout\\n\\nПри передаче данных в виде аргументов следует соблюдать их порядок, как в примере выше\\n\\nИмя свойств в передаваемом объекте должны быть одноименны с названиями аргументов в примере выше';\n\tthis.control = false;\n\tthis.lastQuery = false;\n\tthis.config = new Object();\n\tthis.defined = {\n\t\turl : '',\n\t\tqueryType : 'POST',\n\t\tdataType : 'json',\n\t\tasync : true,\n\t\tdata : false,\n\t\ttimeout : 500\n\t}\n\tthis.log = new Array();\n\tthis.log.console = true;\n\tthis.log.show = function(){\n\t\tfor (var i=0; i<this.length; i++) {\n\t\t\tconsole.log(this[i]);\n\t\t}\n\t}\n\tthis.log.clean = function(){\n\t\tthis.splice( 0,this.length );\n\t}\n\tthis.fromObject = function(arg) {\n\t\tif( arg != null && typeof(arg) == 'object' && arg.url != undefined ) {\n\t\t\tthis.control = true;\n\t\t\tthis.config.url = arg.url;\n\t\t\targ.queryType ? this.config.queryType = arg.queryType : this.config.queryType = this.defined.queryType;\n\t\t\targ.dataType ? this.config.dataType = arg.dataType : this.config.dataType = this.defined.dataType;\n\t\t\targ.async ? this.config.async = arg.async : this.config.async = this.defined.async;\n\t\t\targ.data ? this.config.data = arg.data : this.config.data = this.defined.data;\n\t\t\targ.timeout ? this.config.timeout = arg.timeout : this.config.timeout = this.defined.timeout;\n\t\t} else {\n\t\t\tif( typeof(arg) == 'string' ) { this.fromArguments(new Array(arg)) }\n\t\t}\n\t}\n\tthis.fromArguments = function(args) {\n\t\tif ( !args[0] ) { console.error('No URL'); return false }\n\t\t\telse { this.config.url = args[0]; this.control = true; }\n\t\tif ( args[1] === undefined ) this.config.queryType = this.defined.queryType;\n\t\t\telse this.config.queryType = args[1];\n\t\tif ( args[2] === undefined ) this.config.dataType = this.defined.dataType;\n\t\t\telse this.config.dataType = args[2];\n\t\tif ( args[3] === undefined ) this.config.async = this.defined.async;\n\t\t\telse this.config.async = args[3];\n\t\tif ( args[4] === undefined ) this.config.data = this.defined.data;\n\t\t\telse this.config.data = args[4];\n\t\tif ( args[5] === undefined ) this.config.timeout = this.defined.timeout;\n\t\t\telse this.config.timeout = args[5];\n\t}\n\tthis.router = function(ARGS){\n\t\tswitch( ARGS.length ) {\n\t\t\tcase 0 : this.lastQuery ? this.control = true : 0; break;\n\t\t\tcase 1 : this.fromObject(ARGS[0]); break;\n\t\t\tdefault : this.fromArguments(ARGS);\n\t\t}\n\t}\n\tthis.request = function() {\n\t\tthis.router(arguments);\n\t\tif( this.control ) {\n\t\t\treturn new Promise( function(resolve,reject) {\n\t\t\t\t$.ajax({\n\t\t\t\t\ttimeout : document.http.config.url,\n\t\t\t\t\turl : document.http.config.url,\n\t\t\t\t\ttype : document.http.config.queryType,\n\t\t\t\t\tdataType : document.http.config.dataType,\n\t\t\t\t\tasync : document.http.config.async,\n\t\t\t\t\tdata : document.http.config.data,\n\t\t\t\t\tsuccess : function( data, control ) { document.http.lastQuery = true; resolve(data) },\n\t\t\t\t\terror : function (xhr, errorType, exception) { var errorMessage = exception || xhr.controlText; reject(errorMessage); },\n\t\t\t\t\tcomplete : function() {\n\t\t\t\t\t\tdocument.http.control = false;\n\t\t\t\t\t\tvar msg = 'Request to ' + document.http.config.url+ ' completed'\n\t\t\t\t\t\tif ( document.http.log.console ) console.log(msg);\n\t\t\t\t\t\tdocument.http.log.push(msg);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} )\n\t\t} else {\n\t\t\tconsole.error('Cannot to request'); return false;\n\t\t}\n\t}\n}", "function _initializeRequestHandler()\n\t{\n\t\t/** Initialize */\n\t\tvar xhr = new XMLHttpRequest();\n\n\t\t/** Check if the XMLHttpRequest object has a \"withCredentials\" property.\n\t\t * \"withCredentials\" only exits on the XMLHttpRequest2 object. */\n \t\tif (\"withCredentials\" in xhr) {\n\t\t\txhr.withCredentials = true; // This is very important for server-side cookies to be sent to the server.\n\t\t\t\treturn xhr;\n\n\t\t/** Check the type of handler available. */\n\t\t} else if (typeof XDomainRequest !== \"undefined\") {\n\t\t\t/** Otherwise, check if XDomainRequest.\n\t\t\t * XDomainRequest only exists in IE, and is IE's way of making CORS requests. */\n\t\t\txhr = new XDomainRequest();\n\t\t\t_isDomainRequest = true;\n\n\t\t\t/** Assigned the jQuery ajax settings. */\n\t\t\t$.ajaxSettings.xhr = function() {\n\t\t\t\ttry {\n\t\t\t\t\tif (xhr)\n\t\t\t\t\t{\n\t\t\t\t\t\txhr.onerror = _failureWrapperIE;\n\t\t\t\t\t\txhr.onload = _successWrapperIE;\n\t\t\t\t\t}\n\t\t\t\t\treturn xhr;\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\t\tSSE.Lib.MessageBox.Critical(SSE.Model.Message.new({\n\t\t\t\t\t\ttitle: \"Exception thrown configuring XDomainRequest\"\n\t\t\t\t\t\t, messageBody: \"The following exception was thrown: \" + e\n\t\t\t\t\t}));\n\n\t\t\t\t\t/** Needs to return something in the event of an error. */\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\t/** Otherwise CORS is not supported in this browser. */\n\t\t\tSSE.Lib.MessageBox.Critical(SSE.Models.Message.new({\n\t\t\t\ttitle: \"Broken Transport\"\n\t\t\t\t, messageBody: 'This client does not support the transport protocol our API uses.\\r\\nPlease use Chrome or FF browser.'\n\t\t\t}));\n\n\t\t\t/** Exit the function. */\n\t\t\treturn null;\n\t\t}\n\n\t\t/** Set default configs. */\n\t\t$.support.cors = true;\n\n\t\t/** Return handler. */\n\t\treturn xhr;\n\t}", "function AJAXICache(method, url, data, callback)\n {\n this._url = url;\n this._data = data;\n this._method = method;\n this._callback = callback;\n }", "function AjaxRequest (url, opts){\r\n var headers = {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n 'X-Prototype-Version': '1.6.1',\r\n 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'\r\n };\r\n var ajax = null;\r\n\r\nif (DEBUG_TRACE_AJAX) logit (\"AJAX: \"+ url +\"\\n\" + inspect (opts, 3, 1)); \r\n \r\n if (window.XMLHttpRequest)\r\n ajax=new XMLHttpRequest();\r\n else\r\n ajax=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \r\n if (opts.method==null || opts.method=='')\r\n method = 'GET';\r\n else\r\n method = opts.method.toUpperCase(); \r\n \r\n if (method == 'POST'){\r\n headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\r\n } else if (method == 'GET'){\r\n addUrlArgs (url, opts.parameters);\r\n }\r\n\r\n ajax.onreadystatechange = function(){\r\n// ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4\r\n if (ajax.readyState==4) {\r\n if (ajax.status >= 200 && ajax.status < 305)\r\n if (opts.onSuccess) opts.onSuccess(ajax);\r\n else\r\n if (opts.onFailure) opts.onFailure(ajax);\r\n } else {\r\n if (opts.onChange) opts.onChange (ajax);\r\n }\r\n } \r\n \r\n ajax.open(method, url, true); // always async!\r\n\r\n for (var k in headers)\r\n ajax.setRequestHeader (k, headers[k]);\r\n if (matTypeof(opts.requestHeaders)=='object')\r\n for (var k in opts.requestHeaders)\r\n ajax.setRequestHeader (k, opts.requestHeaders[k]);\r\n \r\n if (method == 'POST'){\r\n var a = [];\r\n for (k in opts.parameters){\r\n\t if(matTypeof(opts.parameters[k]) == 'object')\r\n\t\tfor(var h in opts.parameters[k])\r\n\t\t\ta.push (k+'['+h+'] ='+ opts.parameters[k][h] );\r\n\t else\r\n a.push (k +'='+ opts.parameters[k] );\r\n\t}\r\n ajax.send (a.join ('&'));\r\n } else {\r\n ajax.send();\r\n }\r\n}", "function easyHTTP() {\n this.http = new XMLHttpRequest();\n}", "function AjaxContextParametersRequester(domEl) {\r\n BaseObject.apply(this, arguments);\r\n this.root = domEl;\r\n for (var e in AjaxContextParameterFlags) {\r\n this[\"get_\" + e] = AjaxContextParametersRequester.$createParamExtractor(AjaxContextParameterFlags[e]);\r\n }\r\n}", "function IAjaxHttpHook() { }", "function XMLHttpRequestAdapter () {\n this.xdr = null;\n this.withCredentials = false;\n this.status = '';\n this.readyState = 0;\n this.responseType = null;\n this.responseText = '';\n this.isXHR = false;\n }", "createRequest(settings) {\n // PERFORMANCE HACK:\n // Reduce OPTIONS preflight requests by removing the Accept-Datetime header\n // on requests for resources that are presumed to have been time-negotiated\n if (this.negotiatedResources[this.removeQuery(settings.url)]) {\n delete settings.headers['accept-datetime'];\n }\n // Create the actual XMLHttpRequest\n const request = new XMLHttpRequest();\n const reqHeaders = settings.headers;\n request.open(settings.method, settings.url, true);\n request.timeout = settings.timeout;\n for (const header in reqHeaders) {\n if (!(header in UNSAFE_REQUEST_HEADERS) && reqHeaders[header]) {\n request.setRequestHeader(header, reqHeaders[header]);\n }\n }\n // Create a proxy for the XMLHttpRequest\n const requestProxy = new events_1.EventEmitter();\n requestProxy.abort = () => { request.abort(); };\n // Handle the arrival of a response\n request.onload = () => {\n // Convert the response into an iterator\n const response = new stream_1.Readable();\n response.push(request.responseText || '');\n response.push(null);\n response.statusCode = request.status;\n response.responseUrl = request.responseURL;\n // Parse the response headers\n response.headers = {};\n const resHeaders = response.headers;\n const rawHeaders = request.getAllResponseHeaders() || '';\n const headerMatcher = /^([^:\\n\\r]+):[ \\t]*([^\\r\\n]*)$/mg;\n let match = headerMatcher.exec(rawHeaders);\n while (match) {\n resHeaders[match[1].toLowerCase()] = match[2];\n match = headerMatcher.exec(rawHeaders);\n }\n // Emit the response\n requestProxy.emit('response', response);\n // If the resource was time-negotiated, store its queryless URI\n // to enable the PERFORMANCE HACK explained above\n if (reqHeaders['accept-datetime'] && resHeaders['memento-datetime']) {\n const resource = this.removeQuery(resHeaders['content-location'] || settings.url);\n if (!this.negotiatedResources[resource]) {\n // Ensure the resource is not a timegate\n const links = resHeaders.link && parseLink(resHeaders.link);\n const timegate = this.removeQuery(links && links.timegate && links.timegate.url);\n if (resource !== timegate) {\n this.negotiatedResources[resource] = true;\n }\n }\n }\n };\n // Report errors and timeouts\n request.onerror = () => {\n requestProxy.emit('error', new Error('Error requesting ' + settings.url));\n };\n request.ontimeout = () => {\n requestProxy.emit('error', new Error('Timeout requesting ' + settings.url));\n };\n // Execute the request\n request.send();\n return requestProxy;\n }", "function inicializa_xhr() {\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n}", "function xhr_function() {\n // Get new xhr object using default factory\n var xhr = jQuery.ajaxSettings.xhr(); /*global jQuery */\n // Copy the browser's native setRequestHeader method\n var setRequestHeader = xhr.setRequestHeader;\n // Replace with a wrapper\n xhr.setRequestHeader = function(name, value) {\n // Ignore the X-Requested-With header\n if (String(name) === \"X-Requested-With\") {\n return;\n }\n // Otherwise call the native setRequestHeader method\n // Note: setRequestHeader requires its 'this' to be the xhr object,\n // which is what 'this' is here when executed.\n setRequestHeader.call(this, name, value);\n };\n // pass it on to jQuery\n return xhr;\n}", "function ajaxExtend( target, src ) { // 8596\n\tvar key, deep, // 8597\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {}; // 8598\n // 8599\n\tfor ( key in src ) { // 8600\n\t\tif ( src[ key ] !== undefined ) { // 8601\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; // 8602\n\t\t} // 8603\n\t} // 8604\n\tif ( deep ) { // 8605\n\t\tjQuery.extend( true, target, deep ); // 8606\n\t} // 8607\n // 8608\n\treturn target; // 8609\n} // 8610", "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 }", "function JsonRpcSenderJquery(url, logger) {\n this.url = url;\n this.method = 'POST';\n this.logger = logger;\n }", "function easyHTTP() {\n this.http = new XMLHttpRequest();\n\n}", "function xAR(options) { return AjaxRequest(options); }", "function Ajax() {\n var xhr = new XMLHttpRequest();\n this.get = function (fetchFunc, options, cb) {\n if (fetchFunc === true) {\n var err,\n response = {};\n fetch(options.url, {\n method: options.method ? options.method : \"get\",\n mode: options.mode ? options.mode : \"\",\n headers: options.headers ? options.headers : {}\n }).then(function (res) {\n response.res = res;\n return res.json();\n }).then(function (data) {\n response.data = data\n return cb(err, response);\n }).catch(function (error) {\n err = error;\n return cb(err, response);\n });\n } else {\n xhr.open(\"get\", options.url, options.async ? options.async: true);\n if (options.type) {\n this.responseType = options.type;\n }\n if (options.headers) {\n Object.keys(options.headers).forEach(function (index) {\n xhr.setRequestHeader(index, options.headers[index]);\n });\n }\n xhr.setRequestHeader(\"ajax\", \"express\");\n xhr.onreadystatechange = function () {\n if (this.readyState === 0) {\n if (options.beforStart) {\n options.beforStart();\n }\n }\n if (this.readyState === 1) {\n if (options.onStart) {\n options.onStart(xhr);\n }\n }\n if (this.readyState === 3) {\n if (options.onProgress) {\n options.onProgress(xhr);\n }\n }\n var err;\n var data;\n if (this.readyState === 4) {\n if (this.status === 404 || this.status === 403 || this.status === 500) {\n err = {status: this.status};\n }\n if (this.readyState === 4 && this.status === 200) {\n data = {response: this.response, responseText: this.responseText, responseUrl: this.responseURL, responseXML: this.responseXML, responseType: this.responseType};\n }\n return cb(err, data);\n }\n };\n xhr.send();\n }\n }\n this.post = function (options, cb) {\n var err;\n var data;\n var formData = new FormData();\n if (options.url) {\n xhr.open(\"post\", options.url, options.async ? options.async : true);\n if (options.headers) {\n Object.keys(options.headers).forEach(function (index) {\n xhr.setRequestHeader(index, options.headers[index]);\n });\n }\n if (options.fullAjax) {\n return fullAjax(this);\n }\n if (options.data) {\n if (options.upload) {\n var file;\n file = options.upload.file;\n Array.from(file).forEach(function (fil) {\n formData.append(options.upload.fileName, fil);\n });\n if (options.upload.onload) {\n xhr.upload.onload = function (e) {\n return options.upload.onload(e);\n }\n }\n if (options.upload.onprogress) {\n xhr.upload.onprogress = function (e) {\n return options.upload.onprogress(e);\n }\n }\n if (options.upload.onerror) {\n xhr.upload.onerror = function (e) {\n return options.upload.onerror(e);\n }\n }\n }\n if (typeof options.data === \"object\") {\n Object.keys(options.data).forEach(function (item) {\n formData.append(item, options.data[item]);\n });\n options.data = formData;\n } else if (typeof options.data === \"string\") {\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n }\n xhr.setRequestHeader(\"ajax\", \"express\");\n if (options.onabort) {\n xhr.onabort = function (e) {\n\n return options.onabort(e);\n };\n }\n xhr.onreadystatechange = function () {\n if (this.readyState === 0) {\n if (options.beforStart) {\n options.beforStart();\n }\n }\n if (this.readyState === 1) {\n if (options.onStart) {\n options.onStart();\n }\n }\n if (this.readyState === 3) {\n if (options.onProgress) {\n options.onProgress();\n }\n }\n\n if (this.status === 404 || this.status === 403 || this.status === 500) {\n err = {status: this.status};\n }\n if (this.readyState === 4 && this.status === 200) {\n data = {response: this.response, responseText: this.responseText, responseUrl: this.responseURL, responseXML: this.responseXML, responseType: this.responseType};\n }\n if (cb) {\n return cb(err, data);\n }\n };\n xhr.send(options.data);\n } else {\n err = new Error(\"bad request\");\n return console.error(\"cannot send empty data\");\n }\n } else {\n err = new Error(\"bad request\");\n return console.error(\"cannot send empty url\");\n }\n }\n }", "function initRequest() {\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n isIE = true;\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n }", "function xhrShim(opts){\n this.xhr = {\n getAllResponseHeaders: function(){ return ''; },\n getResponseHeader: function(){ return 'application/json'; },\n responseText: opts['responseText'],\n status: opts['status']\n };\n return this;\n}", "constructor(){\n super(...arguments);\n this._handlers = {};\n this._proxies = [];\n }", "function xhrFactory() {\n return new XMLHttpRequest();\n }", "function Ajax (options) {\n this.options = options || {};\n if (!this.options.url) return;\n var async = this.options.async === undefined ? true : !!this.options.async;\n this.request = window.XMLHttpRequest ?\n new XMLHttpRequest() :\n new ActiveXObject(\"Microsoft.XMLHTTP\");\n var _this = this;\n\n if (this.options.headers) {\n for (var name in this.options.headers) {\n this.request.setRequestHeader(name, this.options.headers[name]);\n }\n }\n\n this.request.open(this.options.method || CONST.METHOD.GET, this.getUrl(), async);\n var dataToSend = this.options.onrequest &&\n this.options.onrequest(this.options.data, this.request) ||\n this.options.data;\n (typeof dataToSend === CONST.STRING) || (dataToSend = JSON.stringify(dataToSend));\n this.request.send(dataToSend);\n\n if (async) {\n this.request.onreadystatechange = function () {\n if (_this.request.readyState === 4) {\n _this.options.onresponse && _this.options.onresponse(_this.request.responseText, _this.request, _this.options.data);\n }\n }\n } else {\n this.options.onresponse && this.options.onresponse(this.request.responseText, this.request, this.options.data);\n }\n }", "function initAjax(){\n\tif (window.XMLHttpRequest){\n\t\treturn new XMLHttpRequest(); // Firefox, Safari, ...\n\t}\n\telse if (window.ActiveXObject){\n\t\treturn new ActiveXObject('Microsoft.XMLHTTP'); // Internet Explorer \n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function AjaxRequest(token) {\n this.mode = \"ajax\";\n this.token = token;\n }", "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "request( method, endpoint, query = true, data = {}, loading = this.loading ) { \n\n // Validate the endpoint.\n if( this.utils().validate(method, endpoint) ) {\n\n // Save the endpoint and method.\n this.method = method;\n this.endpoint = endpoint;\n\n // Start loading.\n if( loading ) event.trigger('loading', true);\n \n // Generate a unique ID for the request.\n const pid = this.utils().pid();\n\n // Send the request.\n const request = $.ajax({\n dataType: 'json',\n url: this.utils().url(pid, query),\n method: method,\n data: data,\n context: this,\n cache: false\n }).always((response) => {\n \n // Capture response data.\n if( response.hasOwnProperty('paging') ) {\n \n const paging = {increments: this.paging.increments};\n \n this.$set(this, 'paging', $.extend(true, {}, paging, response.paging));\n \n }\n if( response.hasOwnProperty('filter') ) {\n \n this.$set(this, 'filter', $.extend(true, {}, response.filter));\n \n }\n if( response.hasOwnProperty('sort') ) {\n \n this.$set(this, 'sort', $.extend(true, {}, response.sort));\n \n }\n if( response.hasOwnProperty('index') ) {\n \n this.$set(this, 'indexing', $.extend(true, {}, response.index.data));\n this.index.order = response.index.order;\n \n }\n \n // Add the query string to the response data.\n response.query = query ? this.utils().query() : {};\n \n // End the loading animation.\n if( loading ) setTimeout(() => {\n \n event.trigger('loading', false);\n \n }, 250);\n\n });\n\n // Poll for request progress.\n this.progress(pid);\n \n // Return the request.\n return request;\n\n }\n\n }", "function HttpRequestArgs() {\n var _this = this;\n var __arguments = new Array(arguments.length);\n for (var __argumentIndex = 0; __argumentIndex < __arguments.length; ++__argumentIndex) {\n __arguments[__argumentIndex] = arguments[__argumentIndex];\n }\n if (__arguments.length == 0) {\n _this = _super.call(this) || this;\n _this.fmliveswitchHttpRequestArgsInit();\n _this.setTimeout(15000);\n _this.setMethod(fm.liveswitch.HttpMethod.Post);\n _this.__headers = new fm.liveswitch.NameValueCollection();\n }\n else {\n throw new fm.liveswitch.Exception('Constructor overload does not exist with specified parameter count/type combination.');\n }\n return _this;\n }", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n }\n }", "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "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}", "setAjaxData(ajax){\n\t\tif (_.isPlainObject(ajax))\n\t\t\tsuper.setAjaxData(ajax);\n\t\telse\n\t\t\tthis.values.ajax = (ajax===null) ? {} : ajax;\n\t\treturn this;\n\t}", "function Ajax() {\n\t\n\tthis.req = null;\t\t\t\t// XMLHttpRequest object\n\tthis.url = null;\t\t\t\t// Location of Server Script\n\tthis.method = \"POST\";\t\t\t// Method of delivery\n\tthis.async = true;\t\t\t\t// Continue JS execution\n\tthis.status = null;\t\t\t// HTTP status code\n\tthis.statusText = \"\";\t\t\t// HTTP status text\n\tthis.postData = null;\t\t\t// Data to send\n\tthis.readyState = null;\t\t// 0:Open, 1:loading, 2:loaded, 3:downloading, 4:completed\n\tthis.responseText = null;\t\t// Response as a String\n\tthis.responseXML = null;\t\t// Response as XML document\n\tthis.handleResp = null;\t\t// Response handler\n\tthis.responseFormat = \"text\"; \t// text, xml, object\n\tthis.mimeType = null;\t\t\t// Our MimeType\n\t\n\t\n\t// Init function\n\t// Create the XMLHttpRequest Object\n\tthis.init = function() {\n\t\tif(!this.req) {\n\t\t\ttry {\n\t\t\t\t// Try to create object for Firefox, Safari, IE7\n\t\t\t\tthis.req = new XMLHttpRequest();\n\t\t\t} catch(e) {\n\t\t\t\ttry {\n\t\t\t\t\t// Try to create object for later versions of IE\n\t\t\t\t\tthis.req = new ActiveXObject(\"MSXML2.XMLHTTP\");\n\t\t\t\t} catch(e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Try to create object for early versions of IE\n\t\t\t\t\t\tthis.req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// Could not create an XMLHttpRequest object\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.req;\n\t};\n\t\n\t// doReq function\n\t// Call init, prepare request, send and error if fail \n\t// Also deal with readyStates\n\tthis.doReq = function() {\n\t\tif(!this.init()) {\n\t\t\talert(\"ERROR: Could not create XMLHttpRequest object\");\n\t\t\treturn;\n\t\t}\n\t\tthis.req.open(this.method, this.url, this.async);\n\t\t\n\t\tif(this.mimeType) {\n\t\t\ttry {\n\t\t\t\treq.overrideMimeType(this.mimeType);\n\t\t\t} catch(e) {\n\t\t\t\talert(\"ERROR: Couldn't override MIME type\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar self = this; // Fix loss of scope\n\t\tthis.req.onreadystatechange = function() {\n\t\t\t\n\t\t\t// Switch on current ready state\n\t\t\tswitch(self.req.readyState) {\n\t\t\t\tcase 0: // open\n\t\t\t\t\t// Handle open\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: // loading\n\t\t\t\t\t// Handle loading\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: // loaded\n\t\t\t\t\t// Handle loaded\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3: // downloading\n\t\t\t\t\t// Handle downloading\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4: // completed\n\t\t\t\t\t\n\t\t\t\t\tswitch(self.responseFormat) {\n\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\t\tresp = self.req.responseText;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"xml\":\n\t\t\t\t\t\t\tresp = self.req.responseXML;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tresp = req;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(self.req.status >= 200 && self.req.status <=299) {\n\t\t\t\t\t\tself.handleResp(resp);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.handleErr(resp);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\talert(\"ERROR: Fatal readyState\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\t\n\t\tthis.req.send(this.postData);\n\t};\n\t\n\t// setMimeType Function\n\t// Set our MimeType\n\tthis.sexMimeType = function(mimeType) {\n\t\tthis.mimeType = mimeType;\n\t};\n\t\n\t// handleErr Function\n\t// Handle an error\n\tthis.handleErr = function() {\n\t\tvar errorWin;\n\t\ttry {\n\t\t\t//errorWin = window.open(\"\", \"errorWin\");\n\t\t\t//errorWin.document.body.innerHTML = this.responseText;\n\t\t} catch(e) {\n\t\t\talert( \"ERROR: An error occurred, but the error message cannot \"\n\t\t\t\t +\"be displayed.\\nPopup blockers must be disabled to see it.\\n\"\n\t\t\t\t +\"Status Code: \"+this.req.status+\"\\n\"\n\t\t\t\t +\"Status Description: \"+this.req.statusText);\n\t\t}\n\t};\n\t\n\t// setHandlerErr Function\n\t// Custom error handler\n\tthis.setHandlerErr = function(funcRef) {\n\t\tthis.handleErr = funcRef;\n\t};\n\t\n\t// setHandlerBoth Function\n\t// Handle both successes and errors\n\tthis.setHandlerBoth = function(funcRef) {\n\t\tthis.handleResp = funcRef;\n\t\tthis.handleErr = funcRef;\n\t};\n\t\n\t// abort Function\n\t// Stop a bad script\n\tthis.abort = function() {\n\t\tif(this.req) {\n\t\t\tthis.req.onreadystatechange = function() { };\n\t\t\tthis.req.abort();\n\t\t\tthis.req = null;\n\t\t}\n\t};\n\t\n\t// doGet Function\n\t// User function to call ajax script\n\tthis.doGet = function(url, hand, format) {\n\t\tthis.url = url;\n\t\tthis.handleResp = hand;\n\t\tthis.responseFormat = format || \"text\";\n\t\tthis.doReq();\n\t};\n}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "constructor () {\n this.xhr = new XMLHttpRequest(); //(AJAX ISLEMINI BASLATMAK ICIN XHR xhr objemizi olusturduk\n }", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "create() {\n const opts = pick(this.opts, \"agent\", \"enablesXDR\", \"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(opts);\n\n try {\n debug(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n\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) {} // ie6 check\n\n\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 = () => {\n this.onLoad();\n };\n\n xhr.onerror = () => {\n this.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = () => {\n if (4 !== xhr.readyState) return;\n\n if (200 === xhr.status || 1223 === xhr.status) {\n this.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(() => {\n this.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(() => {\n this.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 }", "function createAJAXObj() {\n\t\t try {\n\t\t return new XMLHttpRequest();\n\t\t } catch (er1) {\n\t\t try {\n\t\t return new ActiveXObject(\"Msxml3.XMLHTTP\");\n\t\t } catch (er2) {\n\t\t try {\n\t\t return new ActiveXObject(\"Msxml2.XMLHTTP.6.0\");\n\t\t } catch (er3) {\n\t\t try {\n\t\t return new ActiveXObject(\"Msxml2.XMLHTTP.3.0\");\n\t\t } catch (er4) {\n\t\t try {\n\t\t return new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t } catch (er5) {\n\t\t try {\n\t\t return new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t } catch (er6) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t}", "function ajaxExtend( target, src ) {\r\r\n\tvar key, deep,\r\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\r\n\tfor ( key in src ) {\r\r\n\t\tif ( src[ key ] !== undefined ) {\r\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\r\n\t\t}\r\r\n\t}\r\r\n\tif ( deep ) {\r\r\n\t\tjQuery.extend( true, target, deep );\r\r\n\t}\r\r\n}", "function XMLHttpRequest0() {\n \tthis._requestHeaders = [];\n \tthis.responseHeaders = {};\n \tthis.withCredentials = false;\n }" ]
[ "0.6993283", "0.6822893", "0.6371214", "0.6163058", "0.59267855", "0.58393145", "0.5837328", "0.5837328", "0.5829274", "0.5829274", "0.5829274", "0.5829274", "0.5829274", "0.5829274", "0.5797885", "0.5787472", "0.5787472", "0.5744089", "0.573186", "0.5730097", "0.5662906", "0.56445134", "0.5642058", "0.5613432", "0.5601278", "0.55907404", "0.55870044", "0.5569613", "0.5569158", "0.55649734", "0.55547005", "0.5553603", "0.5551985", "0.5550103", "0.55334634", "0.5513902", "0.5513846", "0.5508403", "0.54871905", "0.54863393", "0.5470554", "0.5465644", "0.545972", "0.54564315", "0.54564315", "0.5450024", "0.5450024", "0.5441593", "0.5440527", "0.5431956", "0.5430715", "0.5430715", "0.54293644", "0.54279023", "0.54130065", "0.5405024", "0.5391476", "0.538936", "0.53709555", "0.536825", "0.53595054", "0.5353768", "0.5353539", "0.53393835", "0.5337664", "0.5318846", "0.53145176", "0.53145176", "0.5309544", "0.5306551", "0.5305737", "0.53027254", "0.5296538", "0.52959466", "0.52911854", "0.5290887", "0.52789766", "0.5272836", "0.52709466", "0.52709466", "0.52709466", "0.52588433", "0.5251721", "0.52489495", "0.52484894", "0.5243877", "0.52422446", "0.52386326", "0.52386326", "0.5222714", "0.5221991", "0.5221991", "0.5217938", "0.52136517", "0.519859", "0.5191817", "0.519124", "0.5185227", "0.5181932", "0.51801836", "0.5169941" ]
0.0
-1
Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, dataType /* internal */, inspected /* internal */ ) { dataType = dataType || options.dataTypes[ 0 ]; inspected = inspected || {}; inspected[ dataType ] = true; var selection, list = structure[ dataType ], i = 0, length = list ? list.length : 0, executeOnly = ( structure === prefilters ); for ( ; i < length && ( executeOnly || !selection ); i++ ) { selection = list[ i ]( options, originalOptions, jqXHR ); // If we got redirected to another dataType // we try there if executing only and not done already if ( typeof selection === "string" ) { if ( !executeOnly || inspected[ selection ] ) { selection = undefined; } else { options.dataTypes.unshift( selection ); selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, selection, inspected ); } } } // If we're only executing or nothing was selected // we try the catchall dataType if not done already if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, "*", inspected ); } // unnecessary when only executing (prefilters) // but it'll be ignored by the caller in that case return selection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\n\n var inspected = {},\n seekingTransport = (structure === transports);\n\n function inspect(dataType) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each(structure[ dataType ] || [], function (_, prefilterOrFactory) {\n var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);\n if (typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ]) {\n options.dataTypes.unshift(dataTypeOrTransport);\n inspect(dataTypeOrTransport);\n return false;\n } else if (seekingTransport) {\n return !(selected = dataTypeOrTransport);\n }\n });\n return selected;\n }\n\n return inspect(options.dataTypes[ 0 ]) || !inspected[ \"*\" ] && inspect(\"*\");\n }", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { // 8567\n // 8568\n\tvar inspected = {}, // 8569\n\t\tseekingTransport = ( structure === transports ); // 8570\n // 8571\n\tfunction inspect( dataType ) { // 8572\n\t\tvar selected; // 8573\n\t\tinspected[ dataType ] = true; // 8574\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { // 8575\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); // 8576\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && // 8577\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) { // 8578\n // 8579\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport ); // 8580\n\t\t\t\tinspect( dataTypeOrTransport ); // 8581\n\t\t\t\treturn false; // 8582\n\t\t\t} else if ( seekingTransport ) { // 8583\n\t\t\t\treturn !( selected = dataTypeOrTransport ); // 8584\n\t\t\t} // 8585\n\t\t} ); // 8586\n\t\treturn selected; // 8587\n\t} // 8588\n // 8589\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" ); // 8590\n} // 8591", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n \tvar inspected = {},\n \t\tseekingTransport = ( structure === transports );\n\n \tfunction inspect( dataType ) {\n \t\tvar selected;\n \t\tinspected[ dataType ] = true;\n \t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n \t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n \t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n \t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n \t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n \t\t\t\tinspect( dataTypeOrTransport );\n \t\t\t\treturn false;\n \t\t\t} else if ( seekingTransport ) {\n \t\t\t\treturn !( selected = dataTypeOrTransport );\n \t\t\t}\n \t\t} );\n \t\treturn selected;\n \t}\n\n \treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\t\tvar inspected = {},\n\t\t\t\tseekingTransport = ( structure === transports );\n\n\t\t\tfunction inspect( dataType ) {\n\t\t\t\tvar selected;\n\t\t\t\tinspected[ dataType ] = true;\n\t\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn selected;\n\t\t\t}\n\n\t\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n \n var inspected = {},\n seekingTransport = ( structure === transports );\n \n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n \n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\r\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t} );\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\r\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t} );\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}", "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}" ]
[ "0.6271232", "0.62278324", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.607385", "0.60586876", "0.60586876", "0.6036968", "0.601241", "0.601241", "0.601241", "0.601241", "0.601241", "0.60117346", "0.60117346", "0.60115844", "0.601093", "0.601093", "0.6002863", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5991916", "0.5987543", "0.59847116", "0.59779847", "0.59711784", "0.59711784", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5951495", "0.5948276", "0.5947033", "0.5947033", "0.5947033", "0.5947033", "0.5947033", "0.5947033", "0.5947033", "0.5947033", "0.5947033", "0.5947033" ]
0.0
-1
A special extend for ajax options that takes "flat" options (not to be deep extended) Fixes 9887
function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "function ajaxExtend(target, src) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[ key ] !== undefined) {\n (flatOptions[ key ] ? target : (deep || (deep = {})))[ key ] = src[ key ];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function K(e,t){var n,o,i=me.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:o||(o={}))[n]=t[n]);return o&&me.extend(!0,e,o),e}", "function ajaxExtend( target, src ) { // 8596\n\tvar key, deep, // 8597\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {}; // 8598\n // 8599\n\tfor ( key in src ) { // 8600\n\t\tif ( src[ key ] !== undefined ) { // 8601\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; // 8602\n\t\t} // 8603\n\t} // 8604\n\tif ( deep ) { // 8605\n\t\tjQuery.extend( true, target, deep ); // 8606\n\t} // 8607\n // 8608\n\treturn target; // 8609\n} // 8610", "function R(a,b){var c,d,e=fa.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&fa.extend(!0,a,d),a}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\r\n\t\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\t\tfor (key in src) {\r\n\t\t\tif (src[key] !== undefined) {\r\n\t\t\t\t(flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (deep) {\r\n\t\t\tjQuery.extend(true, target, deep);\r\n\t\t}\r\n\t\treturn target;\r\n\t}", "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n}", "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "function ajaxExtend(target, src) {\n var deep,\n key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n ( flatOptions[key] ? target : ( deep || ( deep = {} ) ) )[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n }", "function ajaxExtend( target, src ) {\r\r\n\tvar key, deep,\r\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\r\n\tfor ( key in src ) {\r\r\n\t\tif ( src[ key ] !== undefined ) {\r\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\r\n\t\t}\r\r\n\t}\r\r\n\tif ( deep ) {\r\r\n\t\tjQuery.extend( true, target, deep );\r\r\n\t}\r\r\n}", "function ajaxExtend( target, src ) {\n \tvar key, deep,\n \t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n \tfor ( key in src ) {\n \t\tif ( src[ key ] !== undefined ) {\n \t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n \t\t}\n \t}\n \tif ( deep ) {\n \t\tjQuery.extend( true, target, deep );\n \t}\n\n \treturn target;\n }", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n}", "function L(a,b){var c,d,e=_.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&_.extend(!0,a,d),a}", "function ajaxExtend( target, src ) {\n\t\t\tvar key, deep,\n\t\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\t\tfor ( key in src ) {\n\t\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( deep ) {\n\t\t\t\tjQuery.extend( true, target, deep );\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}", "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n \n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n \n return target;\n }", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n }", "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n }", "function ajaxExtend(target, src) {\r\n\t\tvar deep, key,\r\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\t\tfor (key in src) {\r\n\t\t\tif (src[key] !== undefined) {\r\n\t\t\t\t(flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (deep) {\r\n\t\t\tjQuery.extend(true, target, deep);\r\n\t\t}\r\n\r\n\t\treturn target;\r\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n ( flatOptions[key] ? target : ( deep || (deep = {}) ) )[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend(target, src) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n ( flatOptions[key] ? target : ( deep || ( deep = {} ) ) )[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}" ]
[ "0.76664", "0.76095086", "0.7565319", "0.7565319", "0.7565319", "0.7565319", "0.7565319", "0.7565319", "0.7546114", "0.7546114", "0.7526265", "0.74551934", "0.7317776", "0.7311058", "0.72911924", "0.7255344", "0.72409916", "0.723997", "0.723997", "0.72252256", "0.7218871", "0.7215205", "0.72097415", "0.72058845", "0.72033715", "0.72023594", "0.7198855", "0.7198855", "0.7198855", "0.7198855", "0.7175169", "0.71743375", "0.71712226", "0.7170416", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167999", "0.7167607", "0.7167607", "0.716692", "0.71661043", "0.71661043", "0.71566975", "0.7152728", "0.7152728", "0.7152728", "0.71511775", "0.71471924", "0.7145359", "0.7143643", "0.7143643", "0.7143643", "0.7143643", "0.7143643", "0.7143643", "0.7143643", "0.7143643", "0.71395236", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904", "0.71338904" ]
0.7290337
15
Callback for when everything is done It is defined here because jslint complains if it is declared at the end of the function (which would be more logical and readable)
function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ ifModifiedKey ] = modified; } modified = jqXHR.getResponseHeader("Etag"); if ( modified ) { jQuery.etag[ ifModifiedKey ] = modified; } } // If not modified if ( status === 304 ) { statusText = "notmodified"; isSuccess = true; // If we have data } else { isSuccess = ajaxConvert( s, response ); statusText = isSuccess.state; success = isSuccess.data; error = isSuccess.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( !statusText || status ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AllDone(){\n \n}", "function done() {}", "complete() {}", "_onEnd() {}", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function finished(err){\n }", "done() {}", "onFinish() {}", "done () {}", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "async onFinished() {}", "afterHandling() {}", "function onFinish() {\n console.log('finished!');\n}", "function onCompletion(err) {\n if (err) { return console.error(err);}\n else { console.log(\"All done.\") }\n}", "function complete() {\n\tconsole.log('Completed');\n}", "function checkDone() {\r\n\t\t\tif (todo===0) {\r\n\t\t\t\tresultCallback(unmarshalledTable);\r\n\t\t\t}\r\n\t\t}", "loadComplete() {\n // Nothing\n }", "function tryOnComplete() {\n if (numCallbacks == numComplete && allCallbacksCreated) {\n onComplete();\n }\n }", "function finalizeUploading() {\n\n}", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\n }", "function allDone(){\n\t\tinitCalculator(currenciesData,feesData,userData);\n\t}", "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 3){\t\t\t\t//CHANGE IF FUNCTIONS BEING CALLED CHANGES!!\r\n res.render('search_topic', context);\r\n }\r\n\r\n }", "_taskComplete() {\n //\n }", "_onTasksDone() {\n // meant to be implemented by subclass if needed\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "_done() {\n this.worker = this.task = -1;\n this.callbacks = []; this.callback = 0;\n }", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "function onAllCallbacksCreated() {\n allCallbacksCreated = true;\n tryOnComplete();\n }", "function tellMeWhenDone(callback) {\n\tconsole.log('I\\'m done, now let\\'s run the call back!');\n\tconsole.log('------');\n\n\tcallback();\n}", "function defaultcallback(){\n} // end defaultcallback()", "function done(doneItem){\n \n}", "function callbackDone() {\n module.presentation.set('contents', module.contents);\n module.callback(module.command);\n }", "function onFinish() {\n\t\tclbk();\n\t}", "function done() {\n self._server = null;\n\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "finish() {}", "function final() { console.log('Done and Final'); process.exit() ; }", "function onProcessFinal() {\n chai_1.expect(loopResult, 'LoopResult should contain 10').to.contain(10);\n chai_1.expect(loopResult, 'LoopResult should contain 5').to.contain(5);\n chai_1.expect(loopResult, 'LoopResult should contain 1').to.contain(1);\n done();\n }", "function finish(){\n if( settings.onFinish ) {\n settings.onFinish( data );\n }\n }", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if (document.addEventListener || event.type === \"load\" || document.readyState === \"complete\") {\n detach();\n jQuery.ready();\n }\n }", "function readyCallBack() {\n}", "function postCleanup() {\n\n }", "function check_done() {\n\t\t\tif (!controller_done || interface_source === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(interface_source);\n\t\t}", "function executeCallbacks(){\n\t\t\t\t\t\tcallbacks[lib].forEach(function(cb) {\n\t\t\t\t\t\t\tcb();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tloading[lib].status = 1;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}", "function completed() {\n\t\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\t\twindow.removeEventListener( \"load\", completed );\n\t\t\tjQuery.ready();\n\t\t}", "function onComplete() {\n if (typeof successCb === \"function\") successCb(redirPath);\n }", "completed(data) {}", "function done() {\r\n\tif (verbose) console.log('done function')\r\n\tcurrentSong = tallyVotes()\r\n\tvotes = []\r\n}", "_postProcessing() {\n // None yet...\n }", "function maybeFinish() {\n if (waiting) return;\n callback();\n }", "onEnd() {\n\t\tthis.debug('onEnd');\n\t}", "function desugarReady() {\n desugarQueue.forEach(function(d) {\n d.callback(desugar(d.input));\n });\n }", "function uploadCompleteHandler() {\n console.log(\"Upload finished.\");\n getAllFiles();\n /*\n Do what you like here.\n */\n}", "finish() {\n this.done = true;\n }", "function $w_completed() {\r\n\tconsole.log(\"$w_completed\");\r\n\tif ($d.addEventListener || event.type === \"load\" || $d.readyState === \"complete\" ) {\r\n\t\t$w_detach();\r\n\t\tif(!Whaty.isReady){\r\n\t\t\tconsole.log(\"Whaty.isReady---:\"+Whaty.isReady);\r\n\t\t\tWhaty.isReady = true;\r\n\t\t\t$w_init();\r\n\t\t}\r\n\t}\r\n}", "cleanup() {\n\n\t}", "function my_callback(json_result) {\n console.log(\"Done\");\n }", "onloadend() {}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "function narrDone(){}", "function allDone(){\n under = false;\n done = true;\n displayDealer(houseHand);\n dealerLogic(houseHand);\n}//end of allDone()", "function onAllFinished() {\n //we're finished crawling so we set the endtime to the current time and still crawling to false\n endTime = new Date().getTime();\n stillCrawling = false;\n //clear the console for final output since stillCrawling is now false reportCrawling will not write again\n console.clear();\n //output how many urls wer crawld and how long it took\n console.log(`Finished crawling ${crawler.crawledUrls.length} urls in ${(endTime - startTime) / 1000} seconds\\n`);\n //if pages have been added to errorPages we will print them\n if (errorPages.length > 0) {\n console.log('The Following Pages Had Errors:');\n printErrors();\n } \n //else we congratulate the user\n else {\n console.log('Congratulations There Were No Errors!');\n }\n}", "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", completed);\n\t\twindow.removeEventListener(\"load\", completed);\n\t\tjQuery.ready();\n\t}", "function onLoadComplete() {\n}", "function _finishedLoading() {\n if ( that.lastFunction ){\n that.lastFunction();\n that.lastFunction = false;\n }\n that.ajaxBusy = false;\n\n // make sure the search menu is completed in error cases\n if ( that.currentControl === \"SEARCH_COLUMN\" && that.searchMenuCallback ) {\n that.searchMenuCallback( false );\n that.searchMenuCallback = null;\n that.searchMenu = null;\n }\n } // _finishedLoading", "function _onAllFilesProcessed()\n {\n process.exit(0);\n }", "function doneFunc(pParams){\n Util.exec(pParams.callback);\n \n var lNum = done.pop (pParams.number);\n if(!lNum){\n Util.exec(pCallback);\n }\n }", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}", "function completed() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\t\twindow.removeEventListener( \"load\", completed );\n\t\tjQuery.ready();\n\t}" ]
[ "0.74679637", "0.72341937", "0.7091543", "0.6931611", "0.6861432", "0.6861432", "0.68613994", "0.6860473", "0.68484855", "0.6700876", "0.66732866", "0.66682667", "0.66682667", "0.66682667", "0.66682667", "0.66297436", "0.66241944", "0.65894485", "0.65657556", "0.6506549", "0.65023124", "0.6459667", "0.6442763", "0.642838", "0.64205974", "0.6361201", "0.63507724", "0.6350767", "0.6340142", "0.63394123", "0.6339319", "0.6339319", "0.6339319", "0.6339319", "0.6339319", "0.6339319", "0.6339319", "0.6339319", "0.6333184", "0.6332524", "0.6332524", "0.6332524", "0.6332524", "0.6332524", "0.6294759", "0.628928", "0.62801766", "0.6279504", "0.6266095", "0.6256813", "0.62504053", "0.6239737", "0.62259966", "0.6218623", "0.61843747", "0.6170609", "0.61611253", "0.6144086", "0.6141148", "0.6138667", "0.61384964", "0.6117255", "0.6106027", "0.60998136", "0.60990703", "0.6098427", "0.609833", "0.609226", "0.6087363", "0.6081923", "0.6079601", "0.6072404", "0.6069464", "0.6067925", "0.6058724", "0.6053132", "0.60468554", "0.60468554", "0.60468554", "0.6044876", "0.60353315", "0.6034205", "0.6033152", "0.6033152", "0.6033152", "0.6033152", "0.6025621", "0.60246533", "0.6014687", "0.60127383", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368", "0.6010368" ]
0.0
-1
Handles responses to an ajax request: sets all responseXXX fields accordingly finds the right dataType (mediates between contenttype and expected dataType) returns the corresponding response
function ajaxHandleResponses( s, jqXHR, responses ) { var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\nif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\nfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\nwhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\nif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\nif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\nfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\nfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\n\tfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\r\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\r\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\r\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\r\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\r\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\n while(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\n if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\n if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\n for(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\n finalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\n if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields,ct,type,finalDataType,firstDataType; // Fill responseXXX fields\n\tfor(type in responseFields){if(type in responses){jqXHR[responseFields[type]]=responses[type];}} // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"content-type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\n\tfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}} // Chain conversions given the request and the original response", "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[ 0 ] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[ type ] && contents[ type ].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[ 0 ] in responses) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[ 0 ]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[ finalDataType ];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\r\r\n\r\r\n\tvar ct, type, finalDataType, firstDataType,\r\r\n\t\tcontents = s.contents,\r\r\n\t\tdataTypes = s.dataTypes,\r\r\n\t\tresponseFields = s.responseFields;\r\r\n\r\r\n\t// Fill responseXXX fields\r\r\n\tfor ( type in responseFields ) {\r\r\n\t\tif ( type in responses ) {\r\r\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\t// Remove auto dataType and get content-type in the process\r\r\n\twhile( dataTypes[ 0 ] === \"*\" ) {\r\r\n\t\tdataTypes.shift();\r\r\n\t\tif ( ct === undefined ) {\r\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\t// Check if we're dealing with a known content-type\r\r\n\tif ( ct ) {\r\r\n\t\tfor ( type in contents ) {\r\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\r\n\t\t\t\tdataTypes.unshift( type );\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\t// Check to see if we have a response for the expected dataType\r\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\r\n\t} else {\r\r\n\t\t// Try convertible dataTypes\r\r\n\t\tfor ( type in responses ) {\r\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\r\n\t\t\t\tfinalDataType = type;\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t}\r\r\n\t\t\tif ( !firstDataType ) {\r\r\n\t\t\t\tfirstDataType = type;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// Or just use first one\r\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\r\n\t}\r\r\n\r\r\n\t// If we found a dataType\r\r\n\t// We add the dataType to the list if needed\r\r\n\t// and return the corresponding response\r\r\n\tif ( finalDataType ) {\r\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\r\n\t\t\tdataTypes.unshift( finalDataType );\r\r\n\t\t}\r\r\n\t\treturn responses[ finalDataType ];\r\r\n\t}\r\r\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\tvar firstDataType, ct, finalDataType, type,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes,\r\n\t\tresponseFields = s.responseFields;\r\n\r\n\t// Fill responseXXX fields\r\n\tfor ( type in responseFields ) {\r\n\t\tif ( type in responses ) {\r\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\r\n\t\t}\r\n\t}\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes,\r\n\t\tresponseFields = s.responseFields;\r\n\r\n\t// Fill responseXXX fields\r\n\tfor ( type in responseFields ) {\r\n\t\tif ( type in responses ) {\r\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\r\n\t\t}\r\n\t}\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType,\n ct,\n finalDataType,\n type,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n // Fill responseXXX fields\n for (type in responseFields) {\n if (type in responses) {\n jqXHR[responseFields[type]] = responses[type];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"content-type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[ type ] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n \n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n \n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n \n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n \n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for (type in responseFields) {\n if (type in responses) {\n jqXHR[responseFields[type]] = responses[type];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"content-type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for (type in responseFields) {\n if (type in responses) {\n jqXHR[responseFields[type]] = responses[type];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"content-type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\t\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\t\tcontents = s.contents,\n\t\t\t\tdataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif ( ct === undefined ) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif ( ct ) {\n\t\t\t\tfor ( type in contents ) {\n\t\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we have a response for the expected dataType\n\t\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor ( type in responses ) {\n\t\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif ( finalDataType ) {\n\t\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t\t}\n\t\t\t\treturn responses[ finalDataType ];\n\t\t\t}\n\t\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n \tvar ct, type, finalDataType, firstDataType,\n \t\tcontents = s.contents,\n \t\tdataTypes = s.dataTypes;\n\n \t// Remove auto dataType and get content-type in the process\n \twhile ( dataTypes[ 0 ] === \"*\" ) {\n \t\tdataTypes.shift();\n \t\tif ( ct === undefined ) {\n \t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n \t\t}\n \t}\n\n \t// Check if we're dealing with a known content-type\n \tif ( ct ) {\n \t\tfor ( type in contents ) {\n \t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n \t\t\t\tdataTypes.unshift( type );\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n\n \t// Check to see if we have a response for the expected dataType\n \tif ( dataTypes[ 0 ] in responses ) {\n \t\tfinalDataType = dataTypes[ 0 ];\n \t} else {\n\n \t\t// Try convertible dataTypes\n \t\tfor ( type in responses ) {\n \t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n \t\t\t\tfinalDataType = type;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif ( !firstDataType ) {\n \t\t\t\tfirstDataType = type;\n \t\t\t}\n \t\t}\n\n \t\t// Or just use first one\n \t\tfinalDataType = finalDataType || firstDataType;\n \t}\n\n \t// If we found a dataType\n \t// We add the dataType to the list if needed\n \t// and return the corresponding response\n \tif ( finalDataType ) {\n \t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n \t\t\tdataTypes.unshift( finalDataType );\n \t\t}\n \t\treturn responses[ finalDataType ];\n \t}\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\r\n\t\tvar firstDataType, ct, finalDataType, type,\r\n\t\t\tcontents = s.contents,\r\n\t\t\tdataTypes = s.dataTypes;\r\n\r\n\t\t// Remove auto dataType and get content-type in the process\r\n\t\twhile (dataTypes[0] === \"*\") {\r\n\t\t\tdataTypes.shift();\r\n\t\t\tif (ct === undefined) {\r\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check if we're dealing with a known content-type\r\n\t\tif (ct) {\r\n\t\t\tfor (type in contents) {\r\n\t\t\t\tif (contents[type] && contents[type].test(ct)) {\r\n\t\t\t\t\tdataTypes.unshift(type);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check to see if we have a response for the expected dataType\r\n\t\tif (dataTypes[0] in responses) {\r\n\t\t\tfinalDataType = dataTypes[0];\r\n\t\t} else {\r\n\r\n\t\t\t// Try convertible dataTypes\r\n\t\t\tfor (type in responses) {\r\n\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\r\n\t\t\t\t\tfinalDataType = type;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (!firstDataType) {\r\n\t\t\t\t\tfirstDataType = type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Or just use first one\r\n\t\t\tfinalDataType = finalDataType || firstDataType;\r\n\t\t}\r\n\r\n\t\t// If we found a dataType\r\n\t\t// We add the dataType to the list if needed\r\n\t\t// and return the corresponding response\r\n\t\tif (finalDataType) {\r\n\t\t\tif (finalDataType !== dataTypes[0]) {\r\n\t\t\t\tdataTypes.unshift(finalDataType);\r\n\t\t\t}\r\n\t\t\treturn responses[finalDataType];\r\n\t\t}\r\n\t}", "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}" ]
[ "0.8111879", "0.8111879", "0.8100981", "0.8067477", "0.8064683", "0.7991785", "0.79761744", "0.7961755", "0.7951462", "0.79122376", "0.7894264", "0.789335", "0.78847694", "0.78478056", "0.7846795", "0.7814707", "0.7780932", "0.7780549", "0.7780549", "0.7780549", "0.77747554", "0.7771458", "0.77637625", "0.7755986", "0.7755986", "0.7755986", "0.7755986", "0.7755986", "0.7755986", "0.7755986", "0.7755986", "0.7744262", "0.7740356", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.77347016", "0.7733362", "0.7733362", "0.77326655", "0.77326655", "0.7729714", "0.7729714", "0.7729714", "0.7729714", "0.7729714", "0.77288634", "0.7726706", "0.7725694", "0.7725694", "0.7725694", "0.7725694", "0.7725694", "0.77252007", "0.77252007", "0.77158976", "0.7705027", "0.76985604", "0.76985604", "0.76985604", "0.76985604", "0.76985604", "0.76985604", "0.76985604", "0.76985604", "0.7690687", "0.7684653", "0.76842815", "0.76842815", "0.768229", "0.7679486", "0.76792306", "0.76792073", "0.76792073", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.7667079", "0.766013", "0.765461", "0.7653105", "0.76500934", "0.76500934", "0.76462823", "0.76462823", "0.76462823", "0.7632507", "0.7632507" ]
0.77580947
23
Chain conversions given the request and the original response
function ajaxConvert( s, response ) { var conv, conv2, current, tmp, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(), prev = dataTypes[ 0 ], converters = {}, i = 0; // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } // Convert to each sequential dataType, tolerating list modification for ( ; (current = dataTypes[++i]); ) { // There's only work to do if current dataType is non-auto if ( current !== "*" ) { // Convert response if prev dataType is non-auto and differs from current if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split(" "); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.splice( i--, 0, current ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s["throws"] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } // Update prev for next iteration prev = current; } } return { state: "success", data: response }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift(); // Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;} // Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){ // There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev; // Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){ // Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current]; // If none found, seek a pair\nif(!conv){for(conv2 in converters){ // If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){ // If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){ // Condense equivalence converters\nif(conv===true){conv=converters[conv2]; // Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}} // Apply converter (if not an equivalence)\nif(conv!==true){ // Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else {try{response=conv(response);}catch(e){return {state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return {state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s[\"throws\"]){// jscs:ignore requireDotNotation\nresponse=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters) {converters[conv.toLowerCase()] = s.converters[conv];}}current = dataTypes.shift(); // Convert to each sequential dataType\nwhile(current) {if(s.responseFields[current]){jqXHR[s.responseFields[current]] = response;} // Apply the dataFilter if provided\nif(!prev && isSuccess && s.dataFilter){response = s.dataFilter(response,s.dataType);}prev = current;current = dataTypes.shift();if(current){ // There's only work to do if current dataType is non-auto\nif(current === \"*\"){current = prev; // Convert response if prev dataType is non-auto and differs from current\n}else if(prev !== \"*\" && prev !== current){ // Seek a direct converter\nconv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\nif(!conv){for(conv2 in converters) { // If conv2 outputs current\ntmp = conv2.split(\" \");if(tmp[1] === current){ // If prev can be converted to accepted input\nconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];if(conv){ // Condense equivalence converters\nif(conv === true){conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n}else if(converters[conv2] !== true){current = tmp[0];dataTypes.unshift(tmp[1]);}break;}}}} // Apply converter (if not an equivalence)\nif(conv !== true){ // Unless errors are allowed to bubble, catch and return them\nif(conv && s[\"throws\"]){response = conv(response);}else {try{response = conv(response);}catch(e) {return {state:\"parsererror\",error:conv?e:\"No conversion from \" + prev + \" to \" + current};}}}}}}return {state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\n\tdataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\n\tif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift(); // Convert to each sequential dataType\n\twhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;} // Apply the dataFilter if provided\n\tif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){ // There's only work to do if current dataType is non-auto\n\tif(current===\"*\"){current=prev; // Convert response if prev dataType is non-auto and differs from current\n\t}else if(prev!==\"*\"&&prev!==current){ // Seek a direct converter\n\tconv=converters[prev+\" \"+current]||converters[\"* \"+current]; // If none found, seek a pair\n\tif(!conv){for(conv2 in converters){ // If conv2 outputs current\n\ttmp=conv2.split(\" \");if(tmp[1]===current){ // If prev can be converted to accepted input\n\tconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){ // Condense equivalence converters\n\tif(conv===true){conv=converters[conv2]; // Otherwise, insert the intermediate dataType\n\t}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}} // Apply converter (if not an equivalence)\n\tif(conv!==true){ // Unless errors are allowed to bubble, catch and return them\n\tif(conv&&s.throws){response=conv(response);}else {try{response=conv(response);}catch(e){return {state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return {state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\tdataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\r\n\tif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\r\n\twhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\r\n\tif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\r\n\tif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\r\n\t}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\r\n\tconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\r\n\tif(!conv){for(conv2 in converters){// If conv2 outputs current\r\n\ttmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\r\n\tconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\r\n\tif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\r\n\t}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\r\n\tif(conv!==true){// Unless errors are allowed to bubble, catch and return them\r\n\tif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\n if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\n while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\n if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\n if(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n }else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\n conv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\n if(!conv){for(conv2 in converters){// If conv2 outputs current\n tmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\n conv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\n if(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n }else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\n if(conv!==true){// Unless errors are allowed to bubble, catch and return them\n if(conv&&s[\"throws\"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}// Install script dataType", "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\n\tdataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\n\tif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\n\twhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\n\tif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\n\tif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n\t}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\n\tconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\n\tif(!conv){for(conv2 in converters){// If conv2 outputs current\n\ttmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\n\tconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\n\tif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n\t}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\n\tif(conv!==true){// Unless errors are allowed to bubble, catch and return them\n\tif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "function ajaxConvert( s, response ) {\n\n // Apply the dataFilter if provided\n if ( s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n var dataTypes = s.dataTypes,\n converters = {},\n i,\n key,\n length = dataTypes.length,\n tmp,\n // Current and previous dataTypes\n current = dataTypes[ 0 ],\n prev,\n // Conversion expression\n conversion,\n // Conversion function\n conv,\n // Conversion functions (transitive conversion)\n conv1,\n conv2;\n\n // For each dataType in the chain\n for ( i = 1; i < length; i++ ) {\n\n // Create converters map\n // with lowercased keys\n if ( i === 1 ) {\n for ( key in s.converters ) {\n if ( typeof key === \"string\" ) {\n converters[ key.toLowerCase() ] = s.converters[ key ];\n }\n }\n }\n\n // Get the dataTypes\n prev = current;\n current = dataTypes[ i ];\n\n // If current is auto dataType, update it to prev\n if ( current === \"*\" ) {\n current = prev;\n // If no auto and dataTypes are actually different\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Get the converter\n conversion = prev + \" \" + current;\n conv = converters[ conversion ] || converters[ \"* \" + current ];\n\n // If there is no direct converter, search transitively\n if ( !conv ) {\n conv2 = undefined;\n for ( conv1 in converters ) {\n tmp = conv1.split( \" \" );\n if ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n conv2 = converters[ tmp[1] + \" \" + current ];\n if ( conv2 ) {\n conv1 = converters[ conv1 ];\n if ( conv1 === true ) {\n conv = conv2;\n } else if ( conv2 === true ) {\n conv = conv1;\n }\n break;\n }\n }\n }\n }\n // If we found no converter, dispatch an error\n if ( !( conv || conv2 ) ) {\n jQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n }\n // If found converter is not an equivalence\n if ( conv !== true ) {\n // Convert with 1 or 2 converters accordingly\n response = conv ? conv( response ) : conv2( conv1(response) );\n }\n }\n }\n return response;\n}", "function ajaxConvert( s, response ) {\n\n // Apply the dataFilter if provided\n if ( s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n var dataTypes = s.dataTypes,\n converters = {},\n i,\n key,\n length = dataTypes.length,\n tmp,\n // Current and previous dataTypes\n current = dataTypes[ 0 ],\n prev,\n // Conversion expression\n conversion,\n // Conversion function\n conv,\n // Conversion functions (transitive conversion)\n conv1,\n conv2;\n\n // For each dataType in the chain\n for ( i = 1; i < length; i++ ) {\n\n // Create converters map\n // with lowercased keys\n if ( i === 1 ) {\n for ( key in s.converters ) {\n if ( typeof key === \"string\" ) {\n converters[ key.toLowerCase() ] = s.converters[ key ];\n }\n }\n }\n\n // Get the dataTypes\n prev = current;\n current = dataTypes[ i ];\n\n // If current is auto dataType, update it to prev\n if ( current === \"*\" ) {\n current = prev;\n // If no auto and dataTypes are actually different\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Get the converter\n conversion = prev + \" \" + current;\n conv = converters[ conversion ] || converters[ \"* \" + current ];\n\n // If there is no direct converter, search transitively\n if ( !conv ) {\n conv2 = undefined;\n for ( conv1 in converters ) {\n tmp = conv1.split( \" \" );\n if ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n conv2 = converters[ tmp[1] + \" \" + current ];\n if ( conv2 ) {\n conv1 = converters[ conv1 ];\n if ( conv1 === true ) {\n conv = conv2;\n } else if ( conv2 === true ) {\n conv = conv1;\n }\n break;\n }\n }\n }\n }\n // If we found no converter, dispatch an error\n if ( !( conv || conv2 ) ) {\n jQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n }\n // If found converter is not an equivalence\n if ( conv !== true ) {\n // Convert with 1 or 2 converters accordingly\n response = conv ? conv( response ) : conv2( conv1(response) );\n }\n }\n }\n return response;\n}", "function ajaxConvert( s, response ) {\n\n // Apply the dataFilter if provided\n if ( s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n var dataTypes = s.dataTypes,\n converters = {},\n i,\n key,\n length = dataTypes.length,\n tmp,\n // Current and previous dataTypes\n current = dataTypes[ 0 ],\n prev,\n // Conversion expression\n conversion,\n // Conversion function\n conv,\n // Conversion functions (transitive conversion)\n conv1,\n conv2;\n\n // For each dataType in the chain\n for ( i = 1; i < length; i++ ) {\n\n // Create converters map\n // with lowercased keys\n if ( i === 1 ) {\n for ( key in s.converters ) {\n if ( typeof key === \"string\" ) {\n converters[ key.toLowerCase() ] = s.converters[ key ];\n }\n }\n }\n\n // Get the dataTypes\n prev = current;\n current = dataTypes[ i ];\n\n // If current is auto dataType, update it to prev\n if ( current === \"*\" ) {\n current = prev;\n // If no auto and dataTypes are actually different\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Get the converter\n conversion = prev + \" \" + current;\n conv = converters[ conversion ] || converters[ \"* \" + current ];\n\n // If there is no direct converter, search transitively\n if ( !conv ) {\n conv2 = undefined;\n for ( conv1 in converters ) {\n tmp = conv1.split( \" \" );\n if ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n conv2 = converters[ tmp[1] + \" \" + current ];\n if ( conv2 ) {\n conv1 = converters[ conv1 ];\n if ( conv1 === true ) {\n conv = conv2;\n } else if ( conv2 === true ) {\n conv = conv1;\n }\n break;\n }\n }\n }\n }\n // If we found no converter, dispatch an error\n if ( !( conv || conv2 ) ) {\n jQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n }\n // If found converter is not an equivalence\n if ( conv !== true ) {\n // Convert with 1 or 2 converters accordingly\n response = conv ? conv( response ) : conv2( conv1(response) );\n }\n }\n }\n return response;\n}", "function ajaxConvert( s, response ) {\n\n var conv, conv2, current, tmp,\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(),\n prev = dataTypes[ 0 ],\n converters = {},\n i = 0;\n\n // Apply the dataFilter if provided\n if ( s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n // Convert to each sequential dataType, tolerating list modification\n for ( ; (current = dataTypes[++i]); ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current !== \"*\" ) {\n\n // Convert response if prev dataType is non-auto and differs from current\n if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.splice( i--, 0, current );\n }\n\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[\"throws\"] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n\n // Update prev for next iteration\n prev = current;\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n var conv, conv2, current, tmp,\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(),\n prev = dataTypes[ 0 ],\n converters = {},\n i = 0;\n\n // Apply the dataFilter if provided\n if ( s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n // Convert to each sequential dataType, tolerating list modification\n for ( ; (current = dataTypes[++i]); ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current !== \"*\" ) {\n\n // Convert response if prev dataType is non-auto and differs from current\n if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.splice( i--, 0, current );\n }\n\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[\"throws\"] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n\n // Update prev for next iteration\n prev = current;\n }\n }\n\n return { state: \"success\", data: response };\n}", "function transformResponse() {\n console.log('Transform Response');\n}", "function transformResponse() {\n console.log('Transform Response');\n}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n // jscs:ignore requireDotNotation\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function transformResponse(data) {\n return data;\n }", "function ajaxConvert( s, response ) {\n\n var conv, conv2, current, tmp,\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(),\n prev = dataTypes[ 0 ],\n converters = {},\n i = 0;\n\n // Apply the dataFilter if provided\n if ( s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n // Convert to each sequential dataType, tolerating list modification\n for ( ; (current = dataTypes[++i]); ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current !== \"*\" ) {\n\n // Convert response if prev dataType is non-auto and differs from current\n if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.splice( i--, 0, current );\n }\n\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[\"throws\"] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n\n // Update prev for next iteration\n prev = current;\n }\n }\n\n return { state: \"success\", data: response };\n }", "function ajaxConvert(s, response) {\n\n var conv, conv2, current, tmp,\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(),\n prev = dataTypes[0],\n converters = {},\n i = 0;\n\n // Apply the dataFilter if provided\n if (s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n // Convert to each sequential dataType, tolerating list modification\n for (;\n (current = dataTypes[++i]);) {\n\n // There's only work to do if current dataType is non-auto\n if (current !== \"*\") {\n\n // Convert response if prev dataType is non-auto and differs from current\n if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.splice(i--, 0, current);\n }\n\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n\n // Update prev for next iteration\n prev = current;\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response) {\n\n var conv, conv2, current, tmp,\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(),\n prev = dataTypes[0],\n converters = {},\n i = 0;\n\n // Apply the dataFilter if provided\n if (s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n // Convert to each sequential dataType, tolerating list modification\n for (; (current = dataTypes[++i]);) {\n\n // There's only work to do if current dataType is non-auto\n if (current !== \"*\") {\n\n // Convert response if prev dataType is non-auto and differs from current\n if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.splice(i--, 0, current);\n }\n\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n\n // Update prev for next iteration\n prev = current;\n }\n }\n\n return {state: \"success\", data: response};\n }", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n \n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n \n current = dataTypes.shift();\n \n // Convert to each sequential dataType\n while ( current ) {\n \n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n \n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n \n prev = current;\n current = dataTypes.shift();\n \n if ( current ) {\n \n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n \n current = prev;\n \n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n \n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n \n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n \n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n \n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n \n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n \n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n \n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n \n return { state: \"success\", data: response };\n }", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; ( current = dataTypes[ ++i ] ); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\tvar conv2, current, conv, tmp,\n\t\tconverters = {},\n\t\ti = 0,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ];\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[ 1 ]) {\n for (conv in s.converters) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[ current ]) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[ 1 ] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[ conv2 ] !== true) {\n current = tmp[ 0 ];\n dataTypes.unshift(tmp[ 1 ]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[ \"throws\" ]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current};\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "function ajaxConvert( s, response ) {\r\n\r\n\tvar conv, conv2, current, tmp,\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\tdataTypes = s.dataTypes.slice(),\r\n\t\tprev = dataTypes[ 0 ],\r\n\t\tconverters = {},\r\n\t\ti = 0;\r\n\r\n\t// Apply the dataFilter if provided\r\n\tif ( s.dataFilter ) {\r\n\t\tresponse = s.dataFilter( response, s.dataType );\r\n\t}\r\n\r\n\t// Create converters map with lowercased keys\r\n\tif ( dataTypes[ 1 ] ) {\r\n\t\tfor ( conv in s.converters ) {\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\n\t\t}\r\n\t}\r\n\r\n\t// Convert to each sequential dataType, tolerating list modification\r\n\tfor ( ; (current = dataTypes[++i]); ) {\r\n\r\n\t\t// There's only work to do if current dataType is non-auto\r\n\t\tif ( current !== \"*\" ) {\r\n\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\r\n\r\n\t\t\t\t// Seek a direct converter\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\n\r\n\t\t\t\t// If none found, seek a pair\r\n\t\t\t\tif ( !conv ) {\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\n\r\n\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\ttmp = conv2.split(\" \");\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\n\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\n\t\t\t\t\t\t\tif ( conv ) {\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\n\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\tif ( conv !== true ) {\r\n\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\r\n\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t\t} catch ( e ) {\r\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Update prev for next iteration\r\n\t\t\tprev = current;\r\n\t\t}\r\n\t}\r\n\r\n\treturn { state: \"success\", data: response };\r\n}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\n\n\tvar conv, conv2, current, tmp,\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice(),\n\t\tprev = dataTypes[ 0 ],\n\t\tconverters = {},\n\t\ti = 0;\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\t// Convert to each sequential dataType, tolerating list modification\n\tfor ( ; (current = dataTypes[++i]); ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\tif ( current !== \"*\" ) {\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\t// Update prev for next iteration\n\t\t\tprev = current;\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "function ajaxConvert( s, response ) {\r\n\tvar conv2, current, conv, tmp,\r\n\t\tconverters = {},\r\n\t\ti = 0,\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\tdataTypes = s.dataTypes.slice(),\r\n\t\tprev = dataTypes[ 0 ];\r\n\r\n\t// Apply the dataFilter if provided\r\n\tif ( s.dataFilter ) {\r\n\t\tresponse = s.dataFilter( response, s.dataType );\r\n\t}\r\n\r\n\t// Create converters map with lowercased keys\r\n\tif ( dataTypes[ 1 ] ) {\r\n\t\tfor ( conv in s.converters ) {\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\n\t\t}\r\n\t}\r\n\r\n\t// Convert to each sequential dataType, tolerating list modification\r\n\tfor ( ; (current = dataTypes[++i]); ) {\r\n\r\n\t\t// There's only work to do if current dataType is non-auto\r\n\t\tif ( current !== \"*\" ) {\r\n\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\r\n\r\n\t\t\t\t// Seek a direct converter\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\n\r\n\t\t\t\t// If none found, seek a pair\r\n\t\t\t\tif ( !conv ) {\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\n\r\n\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\ttmp = conv2.split(\" \");\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\n\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\n\t\t\t\t\t\t\tif ( conv ) {\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\n\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\tif ( conv !== true ) {\r\n\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\r\n\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t\t} catch ( e ) {\r\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Update prev for next iteration\r\n\t\t\tprev = current;\r\n\t\t}\r\n\t}\r\n\r\n\treturn { state: \"success\", data: response };\r\n}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s.throws ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "function ajaxConvert( s, response, jqXHR, isSuccess ) { // 8674\n\tvar conv2, current, conv, tmp, prev, // 8675\n\t\tconverters = {}, // 8676\n // 8677\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion // 8678\n\t\tdataTypes = s.dataTypes.slice(); // 8679\n // 8680\n\t// Create converters map with lowercased keys // 8681\n\tif ( dataTypes[ 1 ] ) { // 8682\n\t\tfor ( conv in s.converters ) { // 8683\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ]; // 8684\n\t\t} // 8685\n\t} // 8686\n // 8687\n\tcurrent = dataTypes.shift(); // 8688\n // 8689\n\t// Convert to each sequential dataType // 8690\n\twhile ( current ) { // 8691\n // 8692\n\t\tif ( s.responseFields[ current ] ) { // 8693\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response; // 8694\n\t\t} // 8695\n // 8696\n\t\t// Apply the dataFilter if provided // 8697\n\t\tif ( !prev && isSuccess && s.dataFilter ) { // 8698\n\t\t\tresponse = s.dataFilter( response, s.dataType ); // 8699\n\t\t} // 8700\n // 8701\n\t\tprev = current; // 8702\n\t\tcurrent = dataTypes.shift(); // 8703\n // 8704\n\t\tif ( current ) { // 8705\n // 8706\n\t\t\t// There's only work to do if current dataType is non-auto // 8707\n\t\t\tif ( current === \"*\" ) { // 8708\n // 8709\n\t\t\t\tcurrent = prev; // 8710\n // 8711\n\t\t\t// Convert response if prev dataType is non-auto and differs from current // 8712\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) { // 8713\n // 8714\n\t\t\t\t// Seek a direct converter // 8715\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ]; // 8716\n // 8717\n\t\t\t\t// If none found, seek a pair // 8718\n\t\t\t\tif ( !conv ) { // 8719\n\t\t\t\t\tfor ( conv2 in converters ) { // 8720\n // 8721\n\t\t\t\t\t\t// If conv2 outputs current // 8722\n\t\t\t\t\t\ttmp = conv2.split( \" \" ); // 8723\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) { // 8724\n // 8725\n\t\t\t\t\t\t\t// If prev can be converted to accepted input // 8726\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] || // 8727\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ]; // 8728\n\t\t\t\t\t\t\tif ( conv ) { // 8729\n // 8730\n\t\t\t\t\t\t\t\t// Condense equivalence converters // 8731\n\t\t\t\t\t\t\t\tif ( conv === true ) { // 8732\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ]; // 8733\n // 8734\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType // 8735\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) { // 8736\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ]; // 8737\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] ); // 8738\n\t\t\t\t\t\t\t\t} // 8739\n\t\t\t\t\t\t\t\tbreak; // 8740\n\t\t\t\t\t\t\t} // 8741\n\t\t\t\t\t\t} // 8742\n\t\t\t\t\t} // 8743\n\t\t\t\t} // 8744\n // 8745\n\t\t\t\t// Apply converter (if not an equivalence) // 8746\n\t\t\t\tif ( conv !== true ) { // 8747\n // 8748\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them // 8749\n\t\t\t\t\tif ( conv && s.throws ) { // 8750\n\t\t\t\t\t\tresponse = conv( response ); // 8751\n\t\t\t\t\t} else { // 8752\n\t\t\t\t\t\ttry { // 8753\n\t\t\t\t\t\t\tresponse = conv( response ); // 8754\n\t\t\t\t\t\t} catch ( e ) { // 8755\n\t\t\t\t\t\t\treturn { // 8756\n\t\t\t\t\t\t\t\tstate: \"parsererror\", // 8757\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current // 8758\n\t\t\t\t\t\t\t}; // 8759\n\t\t\t\t\t\t} // 8760\n\t\t\t\t\t} // 8761\n\t\t\t\t} // 8762\n\t\t\t} // 8763\n\t\t} // 8764\n\t} // 8765\n // 8766\n\treturn { state: \"success\", data: response }; // 8767\n} // 8768", "function ajaxConvert(s, response) {\n\n // Apply the dataFilter if provided\n if (s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n var dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n // Current and previous dataTypes\n\t\tcurrent = dataTypes[0],\n\t\tprev,\n // Conversion expression\n\t\tconversion,\n // Conversion function\n\t\tconv,\n // Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n // For each dataType in the chain\n for (i = 1; i < length; i++) {\n\n // Create converters map\n // with lowercased keys\n if (i === 1) {\n for (key in s.converters) {\n if (typeof key === \"string\") {\n converters[key.toLowerCase()] = s.converters[key];\n }\n }\n }\n\n // Get the dataTypes\n prev = current;\n current = dataTypes[i];\n\n // If current is auto dataType, update it to prev\n if (current === \"*\") {\n current = prev;\n // If no auto and dataTypes are actually different\n } else if (prev !== \"*\" && prev !== current) {\n\n // Get the converter\n conversion = prev + \" \" + current;\n conv = converters[conversion] || converters[\"* \" + current];\n\n // If there is no direct converter, search transitively\n if (!conv) {\n conv2 = undefined;\n for (conv1 in converters) {\n tmp = conv1.split(\" \");\n if (tmp[0] === prev || tmp[0] === \"*\") {\n conv2 = converters[tmp[1] + \" \" + current];\n if (conv2) {\n conv1 = converters[conv1];\n if (conv1 === true) {\n conv = conv2;\n } else if (conv2 === true) {\n conv = conv1;\n }\n break;\n }\n }\n }\n }\n // If we found no converter, dispatch an error\n if (!(conv || conv2)) {\n jQuery.error(\"No conversion from \" + conversion.replace(\" \", \" to \"));\n }\n // If found converter is not an equivalence\n if (conv !== true) {\n // Convert with 1 or 2 converters accordingly\n response = conv ? conv(response) : conv2(conv1(response));\n }\n }\n }\n return response;\n }", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s.throws ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) { // jscs:ignore requireDotNotation\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) { // jscs:ignore requireDotNotation\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) { // jscs:ignore requireDotNotation\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "function ajaxConvert( s, response ) {\r\r\n\r\r\n\tvar conv, conv2, current, tmp,\r\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\r\n\t\tdataTypes = s.dataTypes.slice(),\r\r\n\t\tprev = dataTypes[ 0 ],\r\r\n\t\tconverters = {},\r\r\n\t\ti = 0;\r\r\n\r\r\n\t// Apply the dataFilter if provided\r\r\n\tif ( s.dataFilter ) {\r\r\n\t\tresponse = s.dataFilter( response, s.dataType );\r\r\n\t}\r\r\n\r\r\n\t// Create converters map with lowercased keys\r\r\n\tif ( dataTypes[ 1 ] ) {\r\r\n\t\tfor ( conv in s.converters ) {\r\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\t// Convert to each sequential dataType, tolerating list modification\r\r\n\tfor ( ; (current = dataTypes[++i]); ) {\r\r\n\r\r\n\t\t// There's only work to do if current dataType is non-auto\r\r\n\t\tif ( current !== \"*\" ) {\r\r\n\r\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\r\n\t\t\tif ( prev !== \"*\" && prev !== current ) {\r\r\n\r\r\n\t\t\t\t// Seek a direct converter\r\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\r\n\r\r\n\t\t\t\t// If none found, seek a pair\r\r\n\t\t\t\tif ( !conv ) {\r\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\r\n\r\r\n\t\t\t\t\t\t// If conv2 outputs current\r\r\n\t\t\t\t\t\ttmp = conv2.split(\" \");\r\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\r\n\r\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\r\n\t\t\t\t\t\t\tif ( conv ) {\r\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\r\n\r\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\r\n\t\t\t\t\t\t\t\t\tdataTypes.splice( i--, 0, current );\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\r\r\n\t\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\r\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\r\n\t\t\t\tif ( conv !== true ) {\r\r\n\r\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\r\n\t\t\t\t\tif ( conv && s[\"throws\"] ) {\r\r\n\t\t\t\t\t\tresponse = conv( response );\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\ttry {\r\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\r\n\t\t\t\t\t\t} catch ( e ) {\r\r\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t// Update prev for next iteration\r\r\n\t\t\tprev = current;\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\treturn { state: \"success\", data: response };\r\r\n}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n \tvar conv2, current, conv, tmp, prev,\n \t\tconverters = {},\n\n \t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n \t\tdataTypes = s.dataTypes.slice();\n\n \t// Create converters map with lowercased keys\n \tif ( dataTypes[ 1 ] ) {\n \t\tfor ( conv in s.converters ) {\n \t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n \t\t}\n \t}\n\n \tcurrent = dataTypes.shift();\n\n \t// Convert to each sequential dataType\n \twhile ( current ) {\n\n \t\tif ( s.responseFields[ current ] ) {\n \t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n \t\t}\n\n \t\t// Apply the dataFilter if provided\n \t\tif ( !prev && isSuccess && s.dataFilter ) {\n \t\t\tresponse = s.dataFilter( response, s.dataType );\n \t\t}\n\n \t\tprev = current;\n \t\tcurrent = dataTypes.shift();\n\n \t\tif ( current ) {\n\n \t\t\t// There's only work to do if current dataType is non-auto\n \t\t\tif ( current === \"*\" ) {\n\n \t\t\t\tcurrent = prev;\n\n \t\t\t// Convert response if prev dataType is non-auto and differs from current\n \t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n \t\t\t\t// Seek a direct converter\n \t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n \t\t\t\t// If none found, seek a pair\n \t\t\t\tif ( !conv ) {\n \t\t\t\t\tfor ( conv2 in converters ) {\n\n \t\t\t\t\t\t// If conv2 outputs current\n \t\t\t\t\t\ttmp = conv2.split( \" \" );\n \t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n \t\t\t\t\t\t\t// If prev can be converted to accepted input\n \t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n \t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n \t\t\t\t\t\t\tif ( conv ) {\n\n \t\t\t\t\t\t\t\t// Condense equivalence converters\n \t\t\t\t\t\t\t\tif ( conv === true ) {\n \t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n \t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n \t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n \t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n \t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n\n \t\t\t\t// Apply converter (if not an equivalence)\n \t\t\t\tif ( conv !== true ) {\n\n \t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n \t\t\t\t\tif ( conv && s.throws ) {\n \t\t\t\t\t\tresponse = conv( response );\n \t\t\t\t\t} else {\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tresponse = conv( response );\n \t\t\t\t\t\t} catch ( e ) {\n \t\t\t\t\t\t\treturn {\n \t\t\t\t\t\t\t\tstate: \"parsererror\",\n \t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n \t\t\t\t\t\t\t};\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n\n \treturn { state: \"success\", data: response };\n }", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s[\"throws\"]) {\n\t\t\t\t\t\t\t// jscs:ignore requireDotNotation\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\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}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor ( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor ( key in s.converters ) {\n\t\t\t\tif ( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif ( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor ( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor ( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor ( key in s.converters ) {\n\t\t\t\tif ( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif ( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor ( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor ( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor ( key in s.converters ) {\n\t\t\t\tif ( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif ( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor ( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor ( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor ( key in s.converters ) {\n\t\t\t\tif ( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif ( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor ( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor ( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor ( key in s.converters ) {\n\t\t\t\tif ( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif ( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor ( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor( key in s.converters ) {\n\t\t\t\tif( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor( key in s.converters ) {\n\t\t\t\tif( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor( key in s.converters ) {\n\t\t\t\tif( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor( key in s.converters ) {\n\t\t\t\tif( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert( s, response ) {\n\n\t// Apply the dataFilter if provided\n\tif ( s.dataFilter ) {\n\t\tresponse = s.dataFilter( response, s.dataType );\n\t}\n\n\tvar dataTypes = s.dataTypes,\n\t\tconverters = {},\n\t\ti,\n\t\tkey,\n\t\tlength = dataTypes.length,\n\t\ttmp,\n\t\t// Current and previous dataTypes\n\t\tcurrent = dataTypes[ 0 ],\n\t\tprev,\n\t\t// Conversion expression\n\t\tconversion,\n\t\t// Conversion function\n\t\tconv,\n\t\t// Conversion functions (transitive conversion)\n\t\tconv1,\n\t\tconv2;\n\n\t// For each dataType in the chain\n\tfor( i = 1; i < length; i++ ) {\n\n\t\t// Create converters map\n\t\t// with lowercased keys\n\t\tif ( i === 1 ) {\n\t\t\tfor( key in s.converters ) {\n\t\t\t\tif( typeof key === \"string\" ) {\n\t\t\t\t\tconverters[ key.toLowerCase() ] = s.converters[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get the dataTypes\n\t\tprev = current;\n\t\tcurrent = dataTypes[ i ];\n\n\t\t// If current is auto dataType, update it to prev\n\t\tif( current === \"*\" ) {\n\t\t\tcurrent = prev;\n\t\t// If no auto and dataTypes are actually different\n\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t// Get the converter\n\t\t\tconversion = prev + \" \" + current;\n\t\t\tconv = converters[ conversion ] || converters[ \"* \" + current ];\n\n\t\t\t// If there is no direct converter, search transitively\n\t\t\tif ( !conv ) {\n\t\t\t\tconv2 = undefined;\n\t\t\t\tfor( conv1 in converters ) {\n\t\t\t\t\ttmp = conv1.split( \" \" );\n\t\t\t\t\tif ( tmp[ 0 ] === prev || tmp[ 0 ] === \"*\" ) {\n\t\t\t\t\t\tconv2 = converters[ tmp[1] + \" \" + current ];\n\t\t\t\t\t\tif ( conv2 ) {\n\t\t\t\t\t\t\tconv1 = converters[ conv1 ];\n\t\t\t\t\t\t\tif ( conv1 === true ) {\n\t\t\t\t\t\t\t\tconv = conv2;\n\t\t\t\t\t\t\t} else if ( conv2 === true ) {\n\t\t\t\t\t\t\t\tconv = conv1;\n\t\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\t\t\t}\n\t\t\t// If we found no converter, dispatch an error\n\t\t\tif ( !( conv || conv2 ) ) {\n\t\t\t\tjQuery.error( \"No conversion from \" + conversion.replace(\" \",\" to \") );\n\t\t\t}\n\t\t\t// If found converter is not an equivalence\n\t\t\tif ( conv !== true ) {\n\t\t\t\t// Convert with 1 or 2 converters accordingly\n\t\t\t\tresponse = conv ? conv( response ) : conv2( conv1(response) );\n\t\t\t}\n\t\t}\n\t}\n\treturn response;\n}", "function ajaxConvert(s, response, jqXHR, isSuccess) {\r\n\t\tvar conv2, current, conv, tmp, prev,\r\n\t\t\tconverters = {},\r\n\r\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\t\tdataTypes = s.dataTypes.slice();\r\n\r\n\t\t// Create converters map with lowercased keys\r\n\t\tif (dataTypes[1]) {\r\n\t\t\tfor (conv in s.converters) {\r\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcurrent = dataTypes.shift();\r\n\r\n\t\t// Convert to each sequential dataType\r\n\t\twhile (current) {\r\n\r\n\t\t\tif (s.responseFields[current]) {\r\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\r\n\t\t\t}\r\n\r\n\t\t\t// Apply the dataFilter if provided\r\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\r\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\r\n\t\t\t}\r\n\r\n\t\t\tprev = current;\r\n\t\t\tcurrent = dataTypes.shift();\r\n\r\n\t\t\tif (current) {\r\n\r\n\t\t\t\t// There's only work to do if current dataType is non-auto\r\n\t\t\t\tif (current === \"*\") {\r\n\r\n\t\t\t\t\tcurrent = prev;\r\n\r\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\r\n\r\n\t\t\t\t\t// Seek a direct converter\r\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\r\n\r\n\t\t\t\t\t// If none found, seek a pair\r\n\t\t\t\t\tif (!conv) {\r\n\t\t\t\t\t\tfor (conv2 in converters) {\r\n\r\n\t\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\r\n\t\t\t\t\t\t\tif (tmp[1] === current) {\r\n\r\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] ||\r\n\t\t\t\t\t\t\t\t\tconverters[\"* \" + tmp[0]];\r\n\t\t\t\t\t\t\t\tif (conv) {\r\n\r\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\t\tif (conv === true) {\r\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\r\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\r\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\t\tif (conv !== true) {\r\n\r\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\t\tif (conv && s[\"throws\"]) { // jscs:ignore requireDotNotation\r\n\t\t\t\t\t\t\tresponse = conv(response);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tresponse = conv(response);\r\n\t\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\r\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn { state: \"success\", data: response };\r\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}", "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\t\tvar conv2, current, conv, tmp, prev,\n\t\t\tconverters = {},\n\t\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\t\n\t\t// Create converters map with lowercased keys\n\t\tif ( dataTypes[ 1 ] ) {\n\t\t\tfor ( conv in s.converters ) {\n\t\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t\t}\n\t\t}\n\t\n\t\tcurrent = dataTypes.shift();\n\t\n\t\t// Convert to each sequential dataType\n\t\twhile ( current ) {\n\t\n\t\t\tif ( s.responseFields[ current ] ) {\n\t\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t\t}\n\t\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t\t}\n\t\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\t\n\t\t\tif ( current ) {\n\t\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif ( current === \"*\" ) {\n\t\n\t\t\t\t\tcurrent = prev;\n\t\n\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif ( !conv ) {\n\t\t\t\t\t\tfor ( conv2 in converters ) {\n\t\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\t\tif ( conv ) {\n\t\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\n\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif ( conv !== true ) {\n\t\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn { state: \"success\", data: response };\n\t}" ]
[ "0.6620599", "0.6620599", "0.660552", "0.6539198", "0.6532621", "0.64428306", "0.6426713", "0.64198816", "0.6414336", "0.62829214", "0.62829214", "0.62829214", "0.62757075", "0.6273467", "0.6246295", "0.6246295", "0.6244782", "0.6244782", "0.6244782", "0.6244782", "0.6244782", "0.62345356", "0.62345356", "0.62345356", "0.6226955", "0.6218918", "0.6208521", "0.6190073", "0.6179669", "0.6153857", "0.61282706", "0.61282706", "0.61266166", "0.6125526", "0.6125526", "0.6125526", "0.6125526", "0.6125526", "0.6125526", "0.6125526", "0.6125526", "0.6124513", "0.6124513", "0.6124513", "0.61240095", "0.61230683", "0.6121267", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61117023", "0.61108005", "0.610893", "0.610478", "0.60971177", "0.60952985", "0.60934806", "0.60906476", "0.60824835", "0.6081691", "0.60779697", "0.6073162", "0.6064884", "0.6064884", "0.6057984", "0.6057984", "0.6057984", "0.6050276", "0.6029637", "0.59414697", "0.5924332", "0.5924332", "0.5924332", "0.5924332", "0.59144753", "0.58901364", "0.58901364", "0.58901364", "0.58901364", "0.58901364", "0.58878887", "0.58878887", "0.58878887", "0.58878887", "0.58878887", "0.58787054", "0.58754504", "0.58754504", "0.58730924", "0.58730924", "0.58730924", "0.5871536", "0.5871536", "0.5871536" ]
0.615026
30
Functions to create xhrs
function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTime(h, i, s, ms) {\n\treturn parseInt(h, 10) * 60 * 60 \n\t\t+ parseInt(i, 10) * 60\n\t\t+ parseInt(s, 10) \n\t\t+ parseInt(ms, 10) / 1000 ;\n}", "function xToHour(x) {\n var hour = (Math.floor(times[0] + parseInt(x) / hourSpace)) % 24;\n return (hour >= 10) ? hour : \"0\" + hour;\n}", "function createTimeStamp8pm(){\n let today = new Date();\n \n var ms = today.getTime();\n var msPerDay = 86400 * 1000;\n var msto8pm = 72000000;\n let eightPMToday = ms - (ms % msPerDay) + msto8pm;\n return eightPMToday; \n }", "function twelve_hour_time(h){\n\n if(h > 12){\n h = h - 12;\n AM_or_PM = \" PM\";\n }\n return h;\n\n }", "function hours(hour){\n if (hour == 0){\n hour = '12am'\n }\n else if (hour < 12){\n hour = hour + 'am'\n }\n else if (hour == 12){\n hour = '12pm'\n }\n else {\n hour = (hour - 12) + 'pm'\n }\n return hour\n}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function createTimeStamp9am(){\n let today = new Date();\n \n var ms = today.getTime();\n var msPerDay = 86400 * 1000;\n var msto9am = 32400000;\n let nineAMToday = ms - (ms % msPerDay) + msto9am;\n return nineAMToday; \n }", "function time_report(s){ // turn seconds into a Xm Xs string; if >1 hr, return Xh Xm string\n if(s>3600) {\n var hours=Math.floor(s/3600);\n return hours.toFixed(0)+\"h \"+Math.floor((s-(hours*3600))/60).toFixed(0)+\"m\";\n }\n return Math.floor((s/60)).toFixed(0)+\"m \"+(s%60).toFixed(0)+\"s\"\n}", "function generate_time(half_hours, show_seconds)\n{\n var today = new Date();\n\n //get the time values\n var hours = today.getHours();\n var minutes = today.getMinutes();\n var seconds = show_seconds ? today.getSeconds() : undefined;\n\n var hours_suffix = half_hours && !show_seconds ? hours >= 12 ? \" PM\" : \" AM\" : \"\";\n\n hours = hours >= 12 && half_hours ? hours - 12 : hours;\n hours = hours < 10 ? \"0\" + String(hours) : String(hours);\n\n minutes = \":\" + (minutes < 10 ? \"0\" + String(minutes) : String(minutes));\n\n seconds = seconds < 10 ? \":0\" + String(seconds) : seconds ? \":\" + String(seconds) : \"\";\n\n return hours + minutes + seconds + hours_suffix;\n}", "function countTime(t, x) {\n let gio = Number(t.substring(0, 2));\n let phut = Number(t.substring(3, 5));\n let giay = Number(t.substring(6, 8));\n let temp = gio * 3600 + phut * 60 + giay + x;\n let newGio = Math.floor(temp / 3600);\n let newPhut = Math.floor((temp % 3600) / 60);\n let newGiay = Math.floor((temp % 3600) % 60);\n while (newGio >= 24) {\n newGio = newGio - 24;\n }\n console.log(`Thời gian mới là ${newGio}:${newPhut}:${newGiay}`);\n}", "function turnHoursToMinutes() {\n\n}", "function hourById(id){\n var h = id/2;\n var hf;\n var exp;\n\n if (id%2 != 0){\n hf = Math.ceil(h) + \":00\";\n h = Math.floor(h) + \":30\";\n }\n else {\n hf = Math.floor(h) + \":30\";\n h = h + \":00\";\n }\n\n exp = \"De \"+h+\" a \"+hf+\" \";\n\n return exp;\n\n}", "function generateTime()\n {\n var milisecond = time % 1000;\n var second = Math.floor(time / 1000) % 60;\n var minute = Math.floor(time / 60000) % 60;\n var hour = Math.floor(time / 3600000) % 60;\n \n if (milisecond < 10) {\n milisecond = '00' + milisecond;\n }\n else if (milisecond < 100) {\n milisecond = '0' + milisecond;\n }\n \n second = (second < 10) ? '0'+second : second;\n minute = (minute < 10) ? '0'+minute : minute;\n hour = (hour < 10) ? '0' + hour : hour;\n \n \n \n $('div.timer span.milisecond').html(milisecond);\n $('div.timer span.second').html(second);\n $('div.timer span.minute').html(minute);\n $('div.timer span.hour').html(hour);\n }", "function timeTemplate(hours, mins) {\n return `<i class=\"far fa-clock mr-2\"></i><p>${hours} Hours, ${mins} Minutes`;\n }", "makeTime(minutes) {\n let hours = Math.floor(minutes / 60)\n let rest = minutes - (hours * 60)\n let mins = rest.toString()\n let hoursS = hours.toString()\n if (hoursS.length < 2) {\n hoursS = \"0\" + hours\n }\n if (mins.length < 2) {\n mins = \"0\" + mins\n }\n\n return hoursS + \":\" + mins\n }", "function hours(a) {\nreturn a *60*60;\n}", "function TimeManager(value){\n var content = value.split(\":\");\n var hora = parseInt(content[0]);\n var minuto = parseInt(content[1]);\n var segundos = parseInt(content[2]);\n\n if(segundos<59)\n segundos=segundos+1;\nelse if(segundos==59){\n segundos=00;\n if(minuto<59)\n minuto=minuto+1;\n else if(minuto==59){\n minuto=00;\n hora=hora+1;\n }\n}\n\n if(segundos<10)\n segundos = \"0\"+segundos;\n if(minuto<10)\n minuto = \"0\"+minuto;\n if(hora<10)\n hora = \"0\"+hora;\n\n return hora+\":\"+minuto+\":\"+segundos;\n}", "timeString(hours, minutes) {\n if (hours == 0) {\n return (hours + 12) + \":\" + minutes + \" AM\";\n } else if (hours < 12) {\n return hours + \":\" + minutes + \" AM\";\n } else if (hours == 12) {\n return hours + \":\" + minutes + \" PM\";\n } else {\n return (hours - 12) + \":\" + minutes + \" PM\";\n }\n }", "function string_makeTime(hours, minutes) {\n hours = string_pad(hours, 2);\n minutes = string_pad(minutes, 2);\n return hours + \":\" + minutes;\n}", "function setHours() {\n if (hourNow >=11) {\n hour = hourNow - 12\n }\n else {\n hour = hourNow;\n }\n if (minNow > 30) {\n\t\thour++;\n }\n return arrHours[hour];\n}", "function renderTime(){\n let times = [];\n for (let i = timeStart; i <= timeEnd; i+=1){\n times.push(`${i}:00`)\n times.push(`${i}:30`)\n }\n const markup = timesMarkup(times)\n return markup\n }", "function twelveHr(hour) {\n if (hour > 12) {\n return hour - 12 + \"PM\";\n } else {\n return hour + \"AM\";\n }\n }", "function horas() {\n var date = new Date();\n var hours = date.getHours() < 10 ? \"0\" + date.getHours() : date.getHours();\n var minutes = date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes();\n var seconds = date.getSeconds() < 10 ? \"0\" + date.getSeconds() : date.getSeconds();\n time = hours + \":\" + minutes + \":\" + seconds;\n return time;\n }", "function time(num)\r\n { \r\n var hours = Math.floor(num / 60); \r\n var minutes = num % 60;\r\n return hours + \":\" + minutes; \r\n}", "function setTime(){\n var myDate = new Date();\n var heure = myDate.getHours();\n var minute = myDate.getMinutes(); \n if(heure < 10){ \n heure = \"0\"+ heure.toString();\n } \n if(minute < 10){\n minute = \"0\"+ minute.toString();\n }\n\n return heure.toString() +\":\"+ minute.toString(); \n }", "function helper(time) {\n if (time < 9) time = \"0\" + time;\n return time;\n}", "_toHHMMSS(ms) {\n return new Date(ms).toISOString().slice(11, -1);\n // console.log( time(1234567890) ); // \"06:56:07.890\"\n }", "randomHours() {\n const earliestTime = 6;\n let openAt = earliestTime + Math.floor(Math.random() * 5);\n let closeAt = Math.floor(Math.random() * 6);\n return <h2>Hours: {openAt}am – {openAt - closeAt}pm</h2>\n }", "function padHours(Hours) {\n \n return (Hours < 10 ? '0' : '') + Hours;\n}", "function time_update(hour, min){\n if (min<10 & hour<10){\n time.innerText = \"0\" + hour + \":\" + \"0\" + min;\n }\n else if (min>10 & hour<10){\n time.innerText = \"0\" + hour + \":\" + min;\n }\n else if (mine<10 & hour>10){\n time.innerText = hour + \":\" + \"0\" + min;\n }\n else{\n time.innerText = hour + \":\" + min;\n }\n}", "function timeConvert(n) {\n\t\t\t\t\t\t\tvar num = n;\n\t\t\t\t\t\t\tvar hours = (num / 60);\n\t\t\t\t\t\t\tvar rhours = Math.floor(hours);\n\t\t\t\t\t\t\tvar minutes = (hours - rhours) * 60;\n\t\t\t\t\t\t\tvar rminutes = Math.round(minutes);\n\t\t\t\t\t\t\treturn rhours + \"hour \" + rminutes + \" mins\";\n\t\t\t\t\t\t}", "function getTime(){\n \n hr = hour();\n mn = minute();\n sc = second();\n}", "function makeHMTM (hour, minute = 0) {\n return { hour, minute, totalminutes: hour * 60 + minute }\n}", "function formatear_tiempo(s){\r\n\t\tif(s > -1){\r\n\t\t\tvar horas = Math.floor(s/3600);\r\n\t\t\tvar minutos = Math.floor(s/60) % 60;\r\n\t\t\tvar segundos = s % 60;\r\n\t\t\tvar t = horas + \":\" + LZ(minutos) + \":\" + LZ(segundos);\r\n\t\t}else var t = \"0:00:0?\";\r\n\t\treturn t;\r\n\t}", "function time_conversion( minutes ) {\n\tvar hours = 0\n\t var resultTime = hours + \":\" + minutes\n\n\tif (minutes < 60) {\n\t\thours = \"0\";\n\t\tconsole.log(resultTime);\n\t} else if ( minutes >= 60 ) {\n\t\thours ++;\n\t\tminutes -= 60;\n\t\tconsole.log(resultTime);\n\t}\n\treturn resultTime;\n}", "function to12Hrs(hour){\r\n\t\tif(hour === 0) return [12, \"am\"];\r\n\t\telse if(hour == 12) return [12, \"pm\"];\r\n\t\telse if(hour >= 1 && hour < 12) return [hour, \"am\"];\r\n\t\telse return [hour - 12, \"pm\"];\r\n\t}", "hh (date) {\n return pad(this.h(date))\n }", "function convertTime(h) {\n if (h == 0) return (\"12 am\");\n if (h == 12) return (\"12 pm\");\n return (h < 12) ? h + \" am\" : (h - 12) + \" pm\";\n}", "function myHour(hour){\n let minutes = hour * 60;\n let seconds = minutes * 60;\n // return seconds;\n return hour * 60 * 60;\n}", "function _outputTime24h(time) {\n\t\treturn _padZero(time.getHours()) + \":\" + _padZero(time.getMinutes());\n\t}", "function checkTime(i) { // this function is a helper for StartTime function to wrap 0's on minutes and seconds. \n if (i < 10) { i = \"0\" + i };\n return i;\n}", "function formatTime(x) {\r\n\tif (x < 10) {\r\n\t\tx = \"0\" + x;\r\n\t}\r\n\treturn x;\r\n}", "function renderTime(time){\n var timerSpans = document.querySelectorAll(\".timer .act-tim-digit\");\n\n if (time[0]>-1){ // hour\n if (time[0]>9)\n timerSpans[0].innerHTML=time[0]\n else\n timerSpans[0].innerHTML=\"0\"+time[0];\n }\n\n if (time[1]>-1){ // min\n if (time[1]>9)\n timerSpans[1].innerHTML=time[1]\n else\n timerSpans[1].innerHTML=\"0\"+time[1];\n }\n\n if (time[2]>-1){ // sec\n if (time[2]>9)\n timerSpans[2].innerHTML=time[2]\n else\n timerSpans[2].innerHTML=\"0\"+time[2];\n }\n\n}", "function makeTime() {\n let x = new Date;\n return x.getHours()+\":\"+String(x.getMinutes()).padStart(2, '0')+\":\"+String(x.getSeconds()).padStart(2, '0')+\":\"+ String(x.getMilliseconds()).padStart(3, '0');\n}", "function fixTime(hours, minutes){\n var AM = true;\n if(hours > 12){\n hours -= 12;\n AM = false;\n }else if(hours == 12){\n AM = false;\n }else if(hours == 0){\n hours = 12;\n }\n return (hours) + \":\" + ((minutes<10)?\"0\":\"\")+minutes+\" \"+(AM?\"AM\":\"PM\");\n }", "function fixTime(hours, minutes){\n var AM = true;\n if(hours > 12){\n hours -= 12;\n AM = false;\n }else if(hours == 12){\n AM = false;\n }else if(hours == 0){\n hours = 12;\n }\n return (hours) + \":\" + ((minutes<10)?\"0\":\"\")+minutes+\" \"+(AM?\"AM\":\"PM\");\n }", "function populateTime() {\n var halfHours = ['00', '30'];\n var times = [];\n for (let h = 0; h < 2; h++) {\n let meridiem;\n h === 0 ? (meridiem = 'am') : (meridiem = 'pm');\n for (var i = 0; i < 12; i++) {\n let hour;\n i === 0 ? (hour = 12) : (hour = i);\n for (var j = 0; j < 2; j++) {\n const time = ('0' + hour).slice(-2) + ':' + halfHours[j] + meridiem;\n times.push(time);\n }\n }\n }\n return times;\n}", "timeConvert(numOfMins){\n //create a variable to for hours and make it round down and divide it by 3600 seconds\n var hours = Math.floor(numOfMins/3600);\n //create a variable for minutes. Once you get hours, then divide it by 60 minutes to get minutes\n var minutes = Math.floor((numOfMins % 3600)/60);\n //create a variable. Minutes divided by 60 seconds\n var seconds = minutes/60;\n //After calculation, make sure it returns the proper time format\n return hours + \":\" + minutes + \":\" + seconds;\n }", "function formatear_tiempo(s){\n\t\tif(s > -1){\n\t\t\tvar horas = Math.floor(s/3600);\n\t\t\tvar minutos = Math.floor(s/60) % 60;\n\t\t\tvar segundos = s % 60;\n\t\t\tvar t = horas + \":\" + LZ(minutos) + \":\" + LZ(segundos);\n\t\t}else var t = \"0:00:0?\";\n\t\treturn t;\n\t}", "function get10BaseTimeHoure(){\n return getDate10baseHoure();\n}", "function countT() {\n ++Seconds;\n var hour = Math.floor(Seconds /3600);\n var minute = Math.floor((Seconds - hour*3600)/60);\n var xseconds = Seconds - (hour*3600 + minute*60);\n document.getElementById(\"time\").innerHTML = hour + \":\" + minute + \":\" + xseconds;\n}", "function makeMilitary(slot) {\n return moment(slot, 'h:mm:ss A').format('HH:mm:ss');\n}", "function updateTime(k) {\r\n if (k < 10) {\r\n return \"0\" + k;\r\n } else {\r\n return k;\r\n }\r\n}", "function hhmmss(secs) {\n minutes = Math.floor(secs / 60);\n hours = Math.floor(minutes / 60);\n minutes = minutes % 60;\n }", "evening() {\n this.time.setHours(17);\n }", "function setTimeDisplay(time) {\n if (time <= 12) {\n toDoHour = time + \"am\";\n } else {\n toDoHour = (time - 12) + \"pm\";\n }\n}", "function reloj12hrs(hr) {\n var hrs = hr.split(\":\"), hrReturn = '';\n if (parseInt(hrs[0]) === 0) {\n hrReturn = \"12:\" + hrs[1] + \" a.m.\";\n } else if (parseInt(hrs[0]) > 12) {\n hrReturn = (((parseInt(hrs[0]) - 12) < 10) ? \"0\" + (parseInt(hrs[0]) - 12).toString() : (parseInt(hrs[0]) - 12).toString()) + \":\" + hrs[1] + \" p.m.\";\n } else {\n hrReturn = ((parseInt(hrs[0]) < 10) ? \"0\" + parseInt(hrs[0]).toString() : hrs[0]) + \":\" + hrs[1] + \" a.m.\";\n }\n return hrReturn;\n}", "HH (date) {\n return pad(date.getHours())\n }", "hourTime() {\n var hoursText = document.getElementById(\"hoursnumber\");\n var hours = parseInt(hoursText.textContent, 10);\n\n if (hours >= 24) {\n hoursText.textContent = \"1\";\n } else {\n var hours = (hours + 1).toString();\n hoursText.textContent = hours;\n }\n }", "function get_time(long) {var date=new Date().addHours(0);var hour=date.getHours();hour=(hour<10?\"0\":\"\")+hour;var min=date.getMinutes();min=(min<10?\"0\":\"\")+min;return hour+((long)?\":\":\"\")+min;}", "function strtotime(time)\n{\nvar horas = Math.floor(time / 3600);\t\nvar minutos = Math.floor((time - horas*3600)/60);\t\nvar segundos = time - horas * 3600 - minutos * 60;\nvar txt = '';\n\nif (horas>0) txt = horas +'h ';\nif (horas>0 || minutos>0) {\n\tif (minutos<10) {txt = txt + '0'+ minutos +'m ';} else {txt = txt + minutos +'m ';}\n}\nif (horas>0 || minutos>0 || segundos>0) {\n\tif (segundos<10) {txt = txt + '0' +segundos +'s ';} else {txt = txt + segundos +'s ';}\n}\nif (time <=0) txt = 'AGOTADO';\n\t\nreturn txt;\t\n}", "function fillTimeText(dom) {\n\tvar startTime = 9;\n\tfor (var i = 0; i <= 24; i++) {\n\t\tvar timeSlot = document.createElement('div');\n\t\tvar hour = startTime + Math.floor(i / 2);\n\t\tvar minute = i % 2 === 0 ? '00' : '30';\n\t\tif (minute === '00') {\n\t\t\tif (hour < 12) {\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute + ' AM')\n\t\t\t} else {\n\t\t\t\tif (hour > 12) {\n\t\t\t\t\thour = hour % 12;\n\t\t\t\t}\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute + ' PM')\n\t\t\t}\n\t\t\ttimeSlot.className = 'timeSlotRound';\n\t\t\ttimeSlot.appendChild(timeText);\n\t\t\tdom.append(timeSlot);\n\t\t} else {\n\t\t\tif (hour < 12) {\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute);\n\t\t\t} else {\n\t\t\t\tif (hour > 12) {\n\t\t\t\t\thour = hour % 12;\n\t\t\t\t}\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute);\n\t\t\t}\n\t\t\ttimeSlot.className = 'timeSlotHalf';\n\t\t\ttimeSlot.appendChild(timeText);\n\t\t\tdom.append(timeSlot);\n\t\t}\n\t}\n}", "function get_time() {\r\ntime_now = new Date();\r\nwday_now = time_now.getDay() + 1;\r\nmsec_now = time_now.getTime();\r\nday_now = time_now.getDate();\r\nmonth_now = time_now.getMonth() + 1;\r\nyear_now = time_now.getFullYear();\r\nhours_now = time_now.getHours();\r\nhours_mil = time_now.getHours();\r\nmins_now = time_now.getMinutes();\r\nsecs_now = time_now.getSeconds();\r\nif (mins_now < 10)\r\n{\r\nmin1 = mins_now;\r\nmin2 = 0;\r\n}\r\nelse\r\n{\r\nmin2 = parseInt(mins_now/10);\r\nmin1 = mins_now - (min2 * 10);\r\n}\r\nif (secs_now < 10)\r\n{\r\nsp_0 = secs_now;\r\nsp_1 = 0;\r\n}\r\nelse\r\n{\r\nsp_1 = parseInt(secs_now/10);\r\nsp_0 = secs_now - (sp_1 * 10);\r\n}\r\nif(hours_now > 11)\r\n{\r\nam_pm = \"PM\";\r\n}\r\nelse\r\n{\r\nam_pm = \"AM\";\r\n}\r\nif (hours_now < 10 && hours_now > 0 )\r\n{\r\nhur1 = hours_now;\r\nhur2 = \"\";\r\n}\r\nelse if (hours_now == 0)\r\n{\r\nhur1 = 2;\r\nhur2 = 1;\r\n}\r\nelse if ( hours_now > 12)\r\n{\r\nhours_now = hours_now - 12;\r\nhur2 = parseInt(hours_now/10);\r\nhur1 = hours_now - (hur2 * 10);\r\nif(hur2==0){hur2 = \"\";}\r\n}\r\nelse\r\n{\r\nhur2 = parseInt(hours_now/10);\r\nhur1 = hours_now - (hur2 * 10);\r\n}\r\n//week days\r\nswitch(wday_now){\r\ncase 1:\r\nweek_day=\"Sun\";\r\nwday_new = 7;\r\nbreak;\r\ncase 2:\r\nweek_day=\"Mon\";\r\nwday_new = 1;\r\nbreak;\r\ncase 3:\r\nweek_day=\"Tue\";\r\nwday_new = 2;\r\nbreak;\r\ncase 4:\r\nweek_day=\"Wed\";\r\nwday_new = 3;\r\nbreak;\r\ncase 5:\r\nweek_day=\"Thu\";\r\nwday_new = 4;\r\nbreak;\r\ncase 6:\r\nweek_day=\"Fri\";\r\nwday_new = 5;\r\nbreak;\r\ncase 7:\r\nweek_day=\"Sat\";\r\nwday_new = 6;\r\nbreak;\r\n}\r\n//\r\n//month\r\nswitch(month_now){\r\ncase 1:\r\ncurr_month=\"January\";\r\nbreak;\r\ncase 2:\r\ncurr_month=\"February\";\r\nbreak;\r\ncase 3:\r\ncurr_month=\"March\";\r\nbreak;\r\ncase 4:\r\ncurr_month=\"April\";\r\nbreak;\r\ncase 5:\r\ncurr_month=\"May\";\r\nbreak;\r\ncase 6:\r\ncurr_month=\"June\";\r\nbreak;\r\ncase 7:\r\ncurr_month=\"July\";\r\nbreak;\r\ncase 8:\r\ncurr_month=\"August\";\r\nbreak;\r\ncase 9:\r\ncurr_month=\"September\";\r\nbreak;\r\ncase 10:\r\ncurr_month=\"October\";\r\nbreak;\r\ncase 11:\r\ncurr_month=\"November\";\r\nbreak;\r\ncase 12:\r\ncurr_month=\"December\";\r\nbreak;\r\n}\r\n//\r\nget_wn();\r\n//\r\nmins_gone = parseInt(100*mins_now/60);\r\nhours_gone = parseInt(100*(hours_mil+(mins_gone/100))/24);\r\ndays_gone = parseInt(100*(wday_new-1+(hours_gone/100))/7);\r\nmonth_gone = parseInt(100*(day_now-1+(hours_gone/100))/31);\r\nyear_gone = parseInt(100*day_num/366);\r\n//\r\nstatus_time = \"<b>\" + hur2 + hur1 + \":\" + min2 + min1 + \":\" + sp_1 + sp_0 + \" - \" + am_pm + \"</b><br/>\" + day_now + \" - \" + week_day + \"<br/>\" + \"Week of Year - \" + week_num + \"<br/>\" + curr_month + \" - \" + year_now;\r\ntime_gone = \"<ul><li>\" + mins_gone + \" % Hour Dribbled</li><li>\" + hours_gone + \" % Day Trickled</li><li>\" + days_gone + \" % Week Filled</li><li>\" + month_gone + \" % Month Over</li><li>\" + year_gone + \" % Year Passed</li></ul>\";\r\nmin_show.style.width = parseInt(secs_now*2.5);\r\nhour_show.style.width = mins_gone*1.5;\r\nday_show.style.width = hours_gone*1.5;\r\nweek_show.style.width = days_gone*1.5;\r\nmonth_show.style.width = month_gone*1.5;\r\nyear_show.style.width = year_gone*1.5;\r\nlinktext[0] = secs_now + \" S\";\r\nlinktext[1] = mins_now + \" M\";\r\nlinktext[2] = hours_mil + \" H\";\r\nlinktext[3] = (wday_new-1) + \" WD\";\r\nlinktext[4] = (day_now-1) + \" MD\";\r\nlinktext[5] = (day_nos-1) + \" D\";\r\nshow_text(0,'min_val');\r\nshow_text(1,'hour_val');\r\nshow_text(2,'day_val');\r\nshow_text(3,'week_val');\r\nshow_text(4,'month_val');\r\nshow_text(5,'year_val');\r\n}", "function time(){\n\tvar\thours = dateobj.getHours(),\n\t\tminutes = dateobj.getMinutes(),\n\t\tseconds = dateobj.getSeconds();\n\n\t//make clock a 12 hour clock instead of 24 hour clock\n\thours = (hours > 12) ? (hours - 12) : hours;\n\thours = (hours === 0) ? 12 : hours;\n\n\t//invokes function to make sure number has at least two digits\n\thours = addZero(hours);\n\tminutes = addZero(minutes);\n\tseconds = addZero(seconds);\n\n\t//changes the html to match results\n\tdocument.getElementsByClassName('hours')[0].innerHTML = hours;\n\tdocument.getElementsByClassName('minutes')[0].innerHTML = minutes;\n\tdocument.getElementsByClassName('seconds')[0].innerHTML = seconds;\n}", "h (date) {\n const hours = date.getHours();\n return hours === 0\n ? 12\n : (hours > 12 ? hours % 12 : hours)\n }", "setUpHours() {\n this._.each(this.vendor.hours, (day) => {\n //handle no open or close times\n if(!day || !day.opening_time || !day.closing_time) {\n day.open = new Date();\n day.close = new Date();\n day.closed = true;\n return;\n }\n // create js time object from string\n let openPeriod = day && day.opening_time && day.opening_time.split(':')[1].slice(2, 4),\n closePeriod = day.closing_time.split(':')[1].slice(2, 4),\n openHour = (openPeriod.toLowerCase() === 'pm') ? Number(day.opening_time.split(':')[0]) + 12 : day.opening_time.split(':')[0],\n openMinutes = day.opening_time.split(':')[1].slice(0, 2),\n closeHour = (closePeriod.toLowerCase() === 'pm') ? Number(day.closing_time.split(':')[0]) + 12 : day.closing_time.split(':')[0],\n closeMinutes = day.closing_time.split(':')[1].slice(0, 2),\n open = new Date(),\n close = new Date();\n //set time\n open.setHours(openHour);\n close.setHours(closeHour);\n\n open.setMinutes(openMinutes);\n close.setMinutes(closeMinutes);\n //set open close times for ui\n day.open = open;\n day.close = close;\n\n }, this);\n return this.vendor.hours;\n }", "function time(){\n\tvar date = new Date(),\n\t\thours = date.getHours(),\n\t\tminutes = date.getMinutes(),\n\t\tseconds = date.getSeconds();\n\n\t//make clock a 12 hour clock instead of 24 hour clock\n\thours = (hours > 12) ? (hours - 12) : hours;\n\n\t//invokes function to make sure number has at least two digits\n\thours = addZero(hours);\n\tminutes = addZero(minutes);\n\tseconds = addZero(seconds);\n\n\t//changes the html to match results\n\tdocument.getElementsByClassName('hours')[0].innerHTML = hours;\n\tdocument.getElementsByClassName('minutes')[0].innerHTML = minutes;\n\tdocument.getElementsByClassName('seconds')[0].innerHTML = seconds;\n\n}", "function convertToTime(hours = '00', minutes = '00') {\r\n return Settings.isClock24Hour ?\r\n `${hours}:${minutes}` :\r\n `${+hours % 12 || 12}:${minutes}${+hours >= 12 ? 'PM' : 'AM'}`;\r\n}", "timeConvert(num) {\n //calculate number of hours\n // divide by 60\n //rounding down\n let hours = Math.floor(num / 60);\n\n //calculate number of minutes\n // find the remainder after dividing by 60\n let mins = num % 60;\n //craft the output\n let convertedTime = `${hours}:${mins}`;\n\n return convertedTime;\n }", "timeConvert(numOfMins){\n // Divide the entered by 60 to return the value for hours\n let hours = numOfMins/60;\n let hoursRounded = Math.floor(hours);\n \n let mins = numOfMins%60;\n let minsRounded = Math.floor(mins);\n let minsConvert = minsRounded%60\n \n // Save the whole number(hours) and remainder returned into two separate variables\n let seconds = mins*60;\n let secondsRemainder = seconds%60;\n \n // Return all three values with a colon between each \n return hoursRounded + \":\" + minsConvert + \":\" + secondsRemainder; \n }", "function fancyTimeFormat(time)\n{ \n // Hours, minutes and seconds\n var hrs =Math.floor(time / 3600);\n var mins = Math.floor((time % 3600) / 60);\n var secs = time % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function as12HourTime(number) {\n\t\tif (number == 0 || number == 24) {\n\t\t\treturn \"midnight\";\n\t\t}\n\t\tif (number < 12) {\n\t\t\treturn number + \"am\";\n\t\t}\n\t\tif (number == 12) {\n\t\t\treturn \"noon\";\n\t\t} else {\n\t\t\treturn (number - 12) + \"pm\";\n\t\t}\n\t}", "function formatTime(time) {\n if (time > 9) {\n return time;\n } else {\n return \"0\" + time;\n }\n }", "function extendTimestringWith (number) {\n if (timeobject.hours.substr(0, 1) == '0') {\n timeobject.hours = timeobject.hours.substr(1)\n + timeobject.minutes.substr(0, 1);\n timeobject.minutes = timeobject.minutes.substr(1)\n + timeobject.seconds.substr(0, 1);\n timeobject.seconds = timeobject.seconds.substr(1) + number;\n printTimedisplayFromTimeobject(timeobject);\n };\n}", "function secondsTimeSpanToH(s) {\n\tvar h = Math.floor(s / 3600); //Get whole hours\n\ts -= h * 3600;\n\tvar m = Math.floor(s / 60); //Get remaining minutes\n\ts -= m * 60;\n\treturn h + \" Hours \";\n}", "function showTime() {\n\n let date = new Date();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n\n //AM/PM format\n let formatHours = convertFormat(hours);\n\n //!2400HR format\n hours = checkTime(hours);\n\n //addZero before single numbers\n hours = addZero(hours);\n minutes = addZero(minutes);\n secondss = addZero(seconds);\n\n document.getElementById('clock').innerHTML = `${hours} : ${minutes} : ${seconds} ${formatHours}`;\n}", "function FormatTime(time)\n{\n \n if (time < 10)\n {\n time= '0'+time;\n }\n return time; \n}", "function r(t,a,l){var o={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},M=\" \";return(t%100>=20||t>=100&&t%100==0)&&(M=\" de \"),t+M+o[l]}", "timeConvert(num){\n // find number of hours and round down\n let hours = Math.floor(num/60);\n // find remaining minutes in addition to number of hours\n let mint = (num % 60);\n // combine both hours and minutes seprating them using colon\n let result = (hours + \":\" + mint);\n return result;\n }", "function createTimeStamp(timeStamp) {\n let date = new Date(timeStamp * 1000);\n let hours = date.getHours();\n let minutes = \"0\" + date.getMinutes();\n\n let calculatedTime = ((hours-2) * 60) + minutes;\n console.log(calculatedTime);\n return calculatedTime; \n // determineSetting(calculatedTime); \n}", "function time_convert(num) {\n var hours = Math.floor(num / 3600);\n var minutes = Math.floor(num / 60);\n if (hours > 0) {\n return hours + \" hours \" + minutes + \" minutes\";\n }\n else{\n return minutes + \" minutes\";\n }\n }", "function getX(timeValue, day) {\n var hour = Math.floor(timeValue / 100);\n var min = timeValue % 100;\n return ((hour + 72 - times[0]) % 24) * hourSpace + day * 24 * hourSpace + min * minSpace;\n}", "function horloge(){\n\tvar date = new Date();\n\tvar heure = date.getHours();\n\tvar minutes = date.getMinutes();\n\tvar secondes = date.getSeconds();\n\tvar minutes_time = heure*60 + minutes;\n\n\tif (heure < 10) {\n\t\theure = '0' + heure;\n\t}\n\tif (minutes < 10) {\n\t\tminutes = '0' + minutes;\n\t}\n\tif (secondes < 10) {\n\t\tsecondes = '0' + secondes;\n\t}\n\n\tdocument.getElementById(\"time\").innerHTML = heure + ':' + minutes + ':' + secondes;\t\n\tsetTimeout(horloge, 1000);\n\n\treveil_veille(minutes_time);\n\t\n\t}", "function sc_ore_hm(ore_dec){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). \n // scomposizione delle ore decimali [ore_dec] in ore|minuti. - tronca i decimali dei minuti senza applicare arrotondamenti.\n // La funzione restituisce la stringa [ore_hm].\n // ATTENZIONE!! La funzione riporta le ore all'interno dell'intervallo: 0-24.\n \n\t var ored=ore_24(ore_dec); // Intervallo ore: 0-24\n\n var ore= parseInt(ored); // Ore.\n var minuti= parseInt((ored-ore)*60); // Minuti.\n \n ore= String(ore); // trasforma il numero in stringa.\n minuti= String(minuti ); // trasforma il numero in stringa. \n\n if (ore.length<2 ){ ore='0'+ore;}\n if (minuti.length<2 ){ minuti='0'+minuti;}\n \n var ore_hm=ore+\"h. \"+minuti+\"m.\"; \n \nreturn ore_hm;\n\n}", "toHHMMSS( num ) {\n let hours = Math.floor(num / 3600);\n let minutes = Math.floor((num - (hours * 3600)) / 60);\n let seconds = num - (hours * 3600) - (minutes * 60);\n \n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n return hours+':'+minutes+':'+seconds;\n }", "function timeString(){\r\n var date = new Date()\r\n var current_hour = date.toLocaleString()\r\n current_hour = pad(current_hour, 23, 1, \" \")\r\n return current_hour\r\n}", "function temporizador (time){\n\t\ttiempo=tiempo-1; \n\t\tminutos = Math.floor(tiempo/60);\n\t\tsegundos = Math.floor(tiempo % 60);\n\t\tif (segundos < 10){\n\t\t\tsegundos=\"0\" + segundos;\n\t\t}\n\t\t$(\"#timer\").text(minutos + \":\" + segundos);\n\t\tif (tiempo <= 0){\n\t\t\tgameOver();\n\t\t}\n\t}", "function getNewTimeDisplay(time){\n if(isNaN(time))\n return \"00:00\";\n time=parseInt(time)\n var minutes = Math.floor( time / 60 );\n var seconds = time % 60;\n minutes = minutes < 10 ? '0' + minutes : minutes;\n seconds = seconds < 10 ? '0' + seconds : seconds;\n if (minutes==\"NaN\" && seconds==\"NaN\"){\n return \"00:00\";\n }\n return minutes + \":\" + seconds; \n}", "function h2s( h ) {\n\t\treturn m2s( h * 60 );\n\t}", "function t(a,r,_){var l={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},h=\" \";return(a%100>=20||a>=100&&a%100==0)&&(h=\" de \"),a+h+l[_]}", "formatTime(time) {\n return (time >= 10) ? time : `0${time}`;\n }", "function convert24to12hr(time){\n var hrs = parseInt(time.split(':')[0]);\n var suffix = (hrs >= 12) ? \" PM\" : \" AM\";\n hrs = (hrs >= 13) ? hrs-12: hrs;\n return '' + hrs + ':' + time.split(':')[1] + suffix;\n}", "function correctTime(time){\n return time > 9 ? time : `0${time}`;\n }", "function format_time(hour){\n if(hour > 23){ \n hour -= 24; \n } \n let amPM = (hour > 11) ? \"pm\" : \"am\"; \n if(hour > 12) { \n hour -= 12; \n } \n if(hour == 0) { \n hour = \"12\"; \n } \n return hour + amPM;\n}", "function TimeUtils() {}" ]
[ "0.6773095", "0.67282486", "0.65836316", "0.6557948", "0.6520314", "0.65039384", "0.65039384", "0.65039384", "0.65039384", "0.65039384", "0.65039384", "0.65039384", "0.64763576", "0.64381844", "0.64357316", "0.64100814", "0.6404843", "0.6399019", "0.63961005", "0.6384597", "0.63685876", "0.6365134", "0.63103217", "0.63020134", "0.6289733", "0.6286118", "0.62829024", "0.6225907", "0.61945915", "0.6189094", "0.6187687", "0.61681104", "0.6153113", "0.61503166", "0.614918", "0.6148157", "0.61470735", "0.6129861", "0.61059326", "0.6097767", "0.60781074", "0.6068506", "0.6067308", "0.6064692", "0.6060972", "0.6055048", "0.60545754", "0.60477656", "0.60469204", "0.6043642", "0.6035699", "0.6035699", "0.6034782", "0.6034", "0.60290396", "0.6020341", "0.6017976", "0.6013695", "0.60134363", "0.60111904", "0.60100454", "0.60020787", "0.59996223", "0.5990464", "0.5988609", "0.5978113", "0.5977194", "0.5974905", "0.59722483", "0.59710056", "0.59692734", "0.5967182", "0.5959512", "0.59580034", "0.5953587", "0.5952262", "0.5951413", "0.5948783", "0.59475124", "0.59447175", "0.5935159", "0.5933807", "0.59317666", "0.59312314", "0.5929276", "0.5928427", "0.59278476", "0.5927359", "0.59111065", "0.59101534", "0.59100485", "0.59075505", "0.5903583", "0.59013873", "0.58990526", "0.5897016", "0.5896318", "0.58960646", "0.5894196", "0.5891755", "0.5891561" ]
0.0
-1
Animations created synchronously will run synchronously
function createFxNow() { setTimeout(function() { fxNow = undefined; }, 0 ); return ( fxNow = jQuery.now() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "createAnimations() {\r\n //#region Idle animation\r\n // Idle front\r\n this.anims.create({\r\n key: 'idle_front',\r\n frames: [\r\n {\r\n key: 'idle_front_0'\r\n },\r\n {\r\n key: 'idle_front_1'\r\n },\r\n {\r\n key: 'idle_front_2'\r\n },\r\n {\r\n key: 'idle_front_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle back\r\n this.anims.create({\r\n key: 'idle_back',\r\n frames: [\r\n {\r\n key: 'idle_back_0'\r\n },\r\n {\r\n key: 'idle_back_1'\r\n },\r\n {\r\n key: 'idle_back_2'\r\n },\r\n {\r\n key: 'idle_back_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle side\r\n this.anims.create({\r\n key: 'idle_side',\r\n frames: [\r\n {\r\n key: 'idle_side_0'\r\n },\r\n {\r\n key: 'idle_side_1'\r\n },\r\n {\r\n key: 'idle_side_2'\r\n },\r\n {\r\n key: 'idle_side_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n\r\n //#region Run animations\r\n\r\n // Run front\r\n this.anims.create({\r\n key: 'run_front',\r\n frames: [\r\n {\r\n key: 'run_front_0'\r\n },\r\n {\r\n key: 'run_front_1'\r\n },\r\n {\r\n key: 'run_front_2'\r\n },\r\n {\r\n key: 'run_front_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run back\r\n this.anims.create({\r\n key: 'run_back',\r\n frames: [\r\n {\r\n key: 'run_back_0'\r\n },\r\n {\r\n key: 'run_back_1'\r\n },\r\n {\r\n key: 'run_back_2'\r\n },\r\n {\r\n key: 'run_back_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run side\r\n this.anims.create({\r\n key: 'run_side',\r\n frames: [\r\n {\r\n key: 'run_side_0'\r\n },\r\n {\r\n key: 'run_side_1'\r\n },\r\n {\r\n key: 'run_side_2'\r\n },\r\n {\r\n key: 'run_side_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n }", "requestUpdateAnimations () {\n this.animationsUpdateNeeded = true;\n }", "animation() {}", "initAnimations() {\n this.animations = [];\n let interpolant = new TransformationInterpolant();\n\n for (var key in this.graph.animations) {\n if (this.graph.animations.hasOwnProperty(key)) {\n let animation = this.graph.animations[key];\n let keyframes = animation.keyframes;\n let keyframeTrack = new TransformationTrack(keyframes, interpolant);\n this.animations[key] = new KeyframeAnimation(keyframeTrack);\n }\n }\n\n this.interface.addAnimations();\n }", "updateAnimation() {\n this.animator.animate();\n }", "InitAnims() {\n this.scene.anims.create({\n key: 'idle',\n frames: this.scene.anims.generateFrameNumbers('player_idle', { start: 0, end: 5 }),\n frameRate: 8,\n repeat: -1\n });\n this.scene.anims.create({\n key: 'run',\n frames: this.scene.anims.generateFrameNumbers('player_run', { start: 0, end: 39 }),\n frameRate: 60,\n repeat: -1\n });\n this.scene.anims.create({\n key: 'jump',\n frames: [{ key: 'player_jump', frame: 0 }],\n frameRate: 24\n });\n this.scene.anims.create({\n key: 'attack',\n frames: this.scene.anims.generateFrameNumbers('player_attack', { start: 0, end: 7 }),\n frameRate: 24,\n showOnStart: true,\n hideOnComplete: true\n });\n this.scene.anims.create({\n key: 'death',\n frames: this.scene.anims.generateFrameNumbers('player_death', { start: 0, end: 7 }),\n frameRate: 4,\n showOnStart: true,\n hideOnComplete: false\n });\n }", "async function playAnimationSequence() {\n\ttry {\n\t\tdocument.getElementById(\"map-container\").innerHTML = \"\"; // clear any existing content\n\n\t\t// await renderSVGPromiseWrapper('roads', \"scenario-sync\", 10);\n\t\t// await renderSVGPromiseWrapper('parks', \"sync\", 120);\n\t\t// await renderSVGPromiseWrapper('buildings', \"delayed\", 120);\n\t\t// await renderSVGPromiseWrapper('trees', \"sync\", 15);\n\t\t// await renderSVGPromiseWrapper('blocks', \"scenario-sync\", 5);\n\t\t// await renderSVGPromiseWrapper('lots', \"sync\", 10);\n\n\n\t\t// console.log('animation complete.');\n\t} catch (error) {\n\t\tconsole.error(\"ERROR:\" + error);\n\t}\n}", "function runAnimay(){\n ropAnimation();\n headAnimation();\n bodyAnimation();\n larmAnimation();\n rarmAnimation();\n llegAnimation();\n rlegAnimation();\n}", "addAnimations() {\n\n // eyes animations (moving eyes of the inspector)\n let frameRate = 50; // frame rate of the animation\n\n // from mid to right\n this.anims.create({\n key: 'midToRight',\n frames: this.anims.generateFrameNames('eyes', {frames: [0, 1, 2, 3, 4, 5]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from right to mid\n this.anims.create({\n key: 'rightToMid',\n frames: this.anims.generateFrameNames('eyes', {frames: [5, 4, 3, 2, 1, 0]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from mid to left\n this.anims.create({\n key: 'midToLeft',\n frames: this.anims.generateFrameNames('eyes', {frames: [0, 6, 7, 8, 9, 10]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from left to mid\n this.anims.create({\n key: 'leftToMid',\n frames: this.anims.generateFrameNames('eyes', {frames: [10, 9, 8, 7, 6, 0]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from left to right\n this.anims.create({\n key: 'leftToRight',\n frames: this.anims.generateFrameNames('eyes', {frames: [10, 9, 8, 7, 6, 0, 1, 2, 3, 4, 5]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from right to left\n this.anims.create({\n key: 'rightToLeft',\n frames: this.anims.generateFrameNames('eyes', {frames: [5, 4, 3, 2, 1, 0, 6, 7, 8, 9, 10]}),\n frameRate: frameRate,\n paused: true\n });\n\n }", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function createAnimation(elems, values, duration, onFinishFn) {\n nativeGlobal.setTimeout(function() {\n var newAnimation = animate.animateTransforms(elems, values, duration, onFinishFn);\n runningAnimations.push(newAnimation);\n }, 18); // Wait one frame, for Firefox\n\n}", "updateAnimation() {\n return;\n }", "function animate (params) {\n // add new animation task to task queue\n tasks.push(new animationTask(params));\n\n if (tasks.length == 1) {\n // start animation interval timer since this is the first item in the task queue\n start();\n }\n }", "function fireInitialAnimations() {\n $mdUtil.nextTick(function() {\n $animate.addClass($element, 'md-noop');\n });\n }", "function animate() {\n requestAnimationFrame(animate);\n\n clockDelta = clock.getDelta();\n \n // update controls, including auto-rotation\n controls.update();\n\n // run each custom animation function.\n if (enableAnimation) {\n for (var x = 0; x < animFunctions.length; x++) {\n animFunctions[x]();\n }\n }\n\n // render with the composer\n composer.render();\n}", "function initAnimation() {\n}", "function animationManager () {\n for (var i = tasks.length; i--;) {\n if (tasks[i].step() == false) {\n // remove animation tasks\n logToScreen(\"remove animation\");\n tasks.splice(i, 1);\n }\n }\n }", "initAnimations() {\n this.animations = new Map();\n\n for (let [id, animation] of this.graph.animations) {\n let anim = new MyKeyframeAnimation(animation.keyframes);\n this.animations.set(id, anim);\n }\n }", "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "function test_animate() {\n //Do the preview (IS THIS NEEDED?)\n if (AUTO_ANIM) {\n for (var i = 0; i < NODES.length; i++) {\n if (NODES[i].parent) {\n var r = Math.min(Math.max(parseFloat(atob(NODES[i].id)), 0.3), 0.7);\n NODES[i].th = NODES[i].th0 + Math.sin((new Date()).getTime() * 0.003 / r + r * Math.PI * 2) * r * 0.5;\n } else {\n NODES[i].th = NODES[i].th0\n }\n }\n }\n doodleMeta.forwardKinematicsNodes(NODES);\n doodleMeta.calculateSkin(SKIN);\n\n //Do the transfered drawings\n if (AUTO_ANIM) {\n for (let i = 0; i < drawings.length; i++) {\n drawings[i].animate();\n }\n }\n //anim_render();\n master_render();\n}", "function animate() {\n requestAnimationFrame(animate);\n render();\n update();\n }", "function animate() {\r\n\tif (runAnim) {\r\n\t\trequestAnimationFrame(animate);\r\n\t}\r\n\trender();\r\n}", "createSpriteAnimations() {\n const haloFrames = this.anims.generateFrameNames('haloHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Halo_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'haloHit', frames: haloFrames, frameRate: 60, repeat: 0 });\n\n const sparkFrames = this.anims.generateFrameNames('sparkHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Spark_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'sparkHit', frames: sparkFrames, frameRate: 60, repeat: -1 });\n }", "static fromFrames(frames) {\nvar anim;\n//----------\nanim = new CASAnimation();\nanim.setFromFrames(frames);\nreturn anim;\n}", "addAnimation(anims,timeBetween = 1, loop = true){\n var animArr = []\n for (var i = 0; i < anims.length; i++){\n animArr[i] = new Image(this.width, this.height)\n animArr[i].src = anims[i]\n animArr[i].width = this.width\n animArr[i].height = this.height\n }\n\n this.animIndex = 0\n this.animsArray[this.numberOfAnimations] = animArr\n this.numberOfAnimations++;\n if (this.animsArray.length === 1){\n this.anims = animArr;\n this.timeBetweenAnim = timeBetween\n setInterval(function(){\n this.image = this.anims[this.animIndex];\n this.animIndex++;\n if (this.animIndex >=this.anims.length){\n this.animIndex =0\n }\n }.bind(this), this.timeBetweenAnim)\n }\n }", "function animate() {\n\n\t\tconst mixer = editor.mixer;\n\t\tconst delta = clock.getDelta();\n\n\t\tlet needsUpdate = false;\n\n\n\t\t//yomotsu camera\n\t\tneedsUpdate = controls.update( delta );\n\n\t\t// Animations\n\n\n\t\tconst actions = mixer.stats.actions;\n\n\t\tif ( actions.inUse > 0 || prevActionsInUse > 0 ) {\n\n\t\t\tprevActionsInUse = actions.inUse;\n\n\t\t\tmixer.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\t// View Helper\n\n\t\tif ( viewHelper.animating === true ) {\n\n\t\t\tviewHelper.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( vr.currentSession !== null ) {\n\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( needsUpdate === true ) render();\n\n\t}", "function addAnimation() {\n const Burst1 = new mojs.Burst({\n parent: animationDiv,\n top: '50%',\n left: '50%',\n radius: {0: 80},\n count: 8,\n children: {\n shape: 'circle',\n fill: {'red': 'blue'},\n strokeWidth: 1,\n duration: 600,\n stroke: {'red': 'blue'}\n }\n });\n\n\n const Burst2 = new mojs.Burst({\n parent: animationDiv,\n top: '50%',\n left: '50%',\n radius: {0: 100},\n count: 4,\n children: {\n shape: 'rect',\n fill: 'white',\n strokeWidth: 1,\n duration: 300,\n stroke: 'white'\n }\n });\n\n\n const circle1 = new mojs.Shape({\n radius: {0: 40},\n parent: animationDiv,\n fill: 'none',\n stroke: 'white',\n strokeWidth: 15,\n duration: 300,\n opacity: {1: 0}\n });\n\n const circle2 = new mojs.Shape({\n radius: {0: 50},\n parent: animationDiv,\n fill: 'none',\n stroke: 'red',\n strokeWidth: 5,\n duration: 400,\n opacity: {1: 0}\n });\n\n\n const circle3 = new mojs.Shape({\n radius: {0: 60},\n parent: animationDiv,\n fill: 'none',\n stroke: 'blue',\n strokeWidth: 5,\n duration: 500,\n opacity: {1: 0}\n });\n\n const circle4 = new mojs.Shape({\n radius: {0: 70},\n parent: animationDiv,\n fill: 'white',\n\n stroke: 'white',\n strokeWidth: 5,\n duration: 600,\n opacity: {1: 0}\n });\n\n const timeline = new mojs.Timeline({\n\n repeat: 0\n }).add(circle4, circle1, circle2, circle3, Burst1, Burst2);\n\n timeline.play();\n }", "function animateButtons() {\n for (var i = 0; i < game.sequence.length; i++) {\n delayedAnimation(game.sequence[i], i * game.delayBetweenAnimations);\n console.log('here', game.sequence);\n }\n}", "function animate(){\n\t\trequestAnimationFrame( animate );\n\t\trender();\n\t}", "function createObjectAnimations() {\r\n this.anims.create({\r\n key: 'jewelAnims',\r\n frames: this.anims.generateFrameNumbers('jewel', { start: 0, end: 4 }),\r\n frameRate: 10,\r\n repeat: -1,\r\n });\r\n\r\n this.anims.create({\r\n key: 'cherryAnims',\r\n frames: this.anims.generateFrameNumbers('cherry', { start: 0, end: 6 }),\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n}", "initiateAnimation() {\n let previousPosition = this.gameOrchestrator.gameboard.getPiecePosition(this.firstTile.col, this.firstTile.row);\n previousPosition[1] = 0; //in the start position, the height is not needed \n\n let nextPosition = this.gameOrchestrator.gameboard.getPiecePosition(this.secondTile.col, this.secondTile.row)\n\n let animation = new PieceAnimation(this.gameOrchestrator.scene, previousPosition, nextPosition, MOVE_SPEED);\n\n this.animations.push(animation);\n\n this.gameOrchestrator.gameboard.setPieceAnimation(this.firstTile.col, this.firstTile.row, animation);\n }", "updateAnimations() {\n this.animations.forEach((animation, index) => {\n if (animation.finished) {\n this.animations.splice(index, 1);\n }\n });\n }", "function animate() { \n console.log('animate')\n \n gsap.registerEffect({\n name: \"fadeIn\",\n effect: (targets, config) => {\n var tlEffect = gsap.timeline();\n tlEffect.from(targets, {duration: config.duration, y:config.y, force3D:true, rotation: 0.01, stagger:config.stagger, ease:\"power2\"})\n .from(targets, {duration: config.duration, stagger:config.stagger, alpha:0, ease:\"none\"}, \"<\")\n return tlEffect;\n },\n defaults: {duration: 1.5, y:\"-=7\", stagger:4.5},\n extendTimeline: true,\n });\n \n gsap.to(plantWraps, {duration:25, rotation:\"+=20\", ease:\"none\"})\n gsap.to(flowerWraps, {duration:25, rotation:\"+=100\", ease:\"none\"})\n \n var imageDivs = selectAll('.imageDiv');\n // logoIntro = false;\n\n\t\t\ttl\n .to(bannerCover, {duration:0.7, alpha:0, ease:\"none\"})\n \n .from(plants, {duration:3, drawSVG:\"50% 50%\", ease:\"sine.inOut\"}, \"<\")\n .from(flowers, {duration:2, alpha:0, ease:\"none\"}, \"<\")\n \n if(logoIntro) {\n tl\n .from(letter_w, {duration:0.5, drawSVG: 0, ease:\"sine.in\"}, \"<\")\n .from(letter_y, {duration:0.3, drawSVG: 0, ease:\"sine.in\"}, \">\")\n .from(letter_nn, {duration:0.8, drawSVG: 0, ease:\"sine.inOut\"}, \">\")\n .from(lasvegas, {duration:0.7, y:\"-=10\", alpha: 0, ease:\"sine\"}, \">\")\n .from(sign_r, {duration:0.5, alpha: 0, ease:\"none\"}, \"<\")\n\n .to(logo, {duration:0.7, alpha:0, ease:\"none\"}, \">1\")\n .set(logo, {scale: 0.37, y:99, x:-60}, \">\")\n } else {\n tl\n .set(logo, {scale: 0.37, alpha:0,y:99, x:-60}, \"<\")\n }\n \n tl\n .from(imageDivs, {duration:1.3, stagger:4, alpha:0, blur:10, force3D:true, rotation: 0.01, ease:\"none\"}, \"<\")\n \n .fadeIn(text_head, \"<0.4\")\n .fadeIn(text_subHead,{y:\"0\", duration: 1,},\"<0.6\")\n .to(logo, {duration:1, alpha:1, ease:\"none\"}, \"<0.4\")\n .from(cta, {duration:0.8, alpha: 0, ease:\"none\"}, \"<\")\n .from(cta, {duration:1.6, rotateX:90, ease:\"power2\"}, \"<\") \n\t\t}", "animateInorderNodes() {\r\n let queue = [];\r\n let animations = [];\r\n animations.push(new Animation(\"display\", \"Traversing Inorder\", \"\"));\r\n\r\n this.animateInorderNodesHelper(this.root, queue, animations);\r\n\r\n animations.push(new Animation(\"display\", \"Finished Travering\", \"\"));\r\n\r\n return [queue, animations];\r\n }", "function start () {\n animationInt = window.setInterval(animationManager, animatorIntervalTime);\n }", "addAnimations(...animations) {\n animations.forEach(animation => {\n Object.keys(animation).forEach(key => {\n UI.animations[key] = animation[key];\n });\n });\n }", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function animate() {\n // render\n controls0.update();\n controls1.update();\n controls2.update();\n controls3.update();\n\n if (ready) {\n renderer0.render(sceneScreen0, camera0);\n renderer1.render(sceneScreen1, camera1);\n renderer2.render(sceneScreen2, camera2);\n renderer3.render(sceneScreen3, camera3);\n }\n\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "get importAnimation() {}", "queueVisualEffect(action, isAnimated) {\n if (this.isInAnimation) {\n // queue\n this.visualEffectQueue.push({\n isAnimated: isAnimated,\n action: action,\n });\n } else {\n // execute\n this.isInAnimation = isAnimated;\n action();\n }\n }", "function animate() {\n var timeNow = new Date().getTime();\n\n if (animate.timeLast) {\n var elapsed = timeNow - animate.timeLast;\n\n\n for (var i = 0; i < items.length; i++) {\n items[i].animate();\n }\n }\n animate.timeLast = timeNow;\n}", "function animate() {\n // if (stackHelper) {\n // stackHelper.index += 1;\n // if (stackHelper.outOfBounds === true) {\n // stackHelper.orientation = (stackHelper.orientation + 1) % 3;\n // stackHelper.index = 0;\n // }\n // }\n\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "runAnimation() {\n const animate = () => {\n const duration = this.getAnimationDuration();\n setStyle(this.slider, 'transform', 'translateX(0%)');\n setStyle(this.slider, 'transition', `transform ${duration}ms linear`);\n setStyle(this.slider, 'transform', 'translateX(-100%)');\n\n this.animationTimer = setTimeout(() => {\n this.stopAnimation();\n requestAnimationFrame(() => animate());\n }, duration / 2);\n };\n\n animate();\n }", "function animate() {\n\trequestAnimationFrame(animate);\n\trender();\n}", "function tick(){\n //iterate through animations and check for active state\n //if active, run position calculation on animations\n var activityCheck = false;\n var now = $.now();\n //console.log('$.animation.tick', now );\n\n for (var k in animations){\n //console.log(' ',k,animations[k].isActive());\n if (animations[k].isActive()){\n activityCheck = true;\n if ( !animations[k].isComplete() ){\n //console.log(' ','not complete');\n animations[k].enterFrame( now );\n }\n else{\n //console.log(' ','complete');\n //catch complete on next tick\n $.event.trigger(animations[k],'animationcomplete',false,false);\n delete animations[k];\n freeAnimationIds.push( parseInt(k) );\n }\n }\n }\n\n if (activityCheck){\n requestTick();\n }\n else {\n active = false;\n }\n }", "function loadEvents() {\r\n\r\n\t\t// Transition from 1st to 2nd sequence\r\n\t\t$('#ir-anim-container #white-circle').on('click', function() {\r\n\t\t\t$('#ir-anim-container #white-circle').css('background', 'white');\r\n\t\t\tsequence = 0;\r\n\r\n\t\t\t$('#ir-anim-container #gifts').fadeOut();\r\n\t\t\t$('#ir-anim-container #white-circle').find('h1, h2').fadeOut(function() {\r\n\r\n\t\t\t\t// Fallback for browsers without CSS animations\r\n\t\t\t\tif (Modernizr.cssanimations) {\r\n\t\t\t\t\t$('#ir-anim-container #white-circle').animate({ backgroundColor: 'white' }, 300);\r\n\t\t\t\t $('#ir-anim-container #white-circle').addClass('zoom');\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$('#ir-anim-container #white-circle').animate({ left: '-250px', top: '-250px', width: '1000px', height: '1000px' }, 500);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tphysics.debugDraw.SetFlags(0);\r\n\r\n\t\t\t\t// Dummy animation to delay the start of the particle generation\r\n\t\t\t\t$('#ir-anim-container #white-circle').animate({'color':'#FFF'}, 500, function() {\r\n\r\n\t\t\t\t\tclearInterval(physics.generator);\r\n\t\t\t\t\tdelete physics.world;\r\n\t\t\t\t\tsequence = 2;\r\n\r\n\t\t\t\t\t$('body').css('background', '#FFF'); // This line is only for the demo. Remove on integration\r\n\t\t\t\t\t$('#ir-anim-container').css('background', '#FFF');\r\n\t\t\t\t\t$('#ir-anim-container #white-circle').remove();\r\n\r\n\t\t\t\t\t// Start assembling the gift after 5 secounds\r\n\t\t\t\t\tvar timer = setTimeout(function() {\r\n\r\n\t\t\t\t\t\tif (!initialized) {\r\n\t\t\t\t\t\t\tassembleShape();\r\n\r\n\t\t\t\t\t\t\tvar len = nodes.length;\r\n\r\n\t\t\t\t\t\t\t// Update the size of the nodes\r\n\t\t\t\t\t\t\twhile (len--) {\r\n\t\t\t\t\t\t\t\tnodes[len].fadeOut = true;\r\n\t\t\t\t\t\t\t\tnodes[len].speedScale = (Math.random() * 2.8) + 0.5;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tinitialized = true;\r\n\t\t\t\t\t\t\tsetTimeout(function() { $('#ir-anim-container #congrats').fadeIn() }, 4000);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 5000); // Display the gift after 5 seconds\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t}", "function animate() {\n requestAnimationFrame(animate);\n update();\n render();\n }", "animatePreorderNodes() {\r\n let queue = [];\r\n let animations = [];\r\n animations.push(new Animation(\"display\", \"Traversing Preorder\", \"\"));\r\n\r\n this.aniamtePreorderNodesHelper(this.root, queue, animations);\r\n\r\n animations.push(new Animation(\"display\", \"Finished Traversing\", \"\"));\r\n\r\n return [queue, animations];\r\n }", "function animate() {\n requestAnimationFrame( animate );\n controls.update();\n render();\n }", "function startAnim() {\n console.log('startAnim');\n\n //TweenMax.from(closeButton, fadeTime/2, {delay:0, autoAlpha:0, ease:animTypeIn});\n\n TweenMax.from(bg1, fadeTime, {\n delay: 0,\n autoAlpha: 0,\n ease: animTypeIn\n });\n TweenMax.to(bg1, imagePanTime, {\n delay: 0,\n y: -50,\n ease: imagePanAnimType\n });\n\n TweenMax.from([bookmarkBase, map, location1, bookmarkDivider, pnzSmall], animTimeIn, {\n delay: 1,\n autoAlpha: 0,\n y: -animOffsetDist,\n ease: animTypeIn\n });\n TweenMax.from(headline1, animTimeIn, {\n delay: 1,\n autoAlpha: 0,\n y: animOffsetDist,\n ease: animTypeIn\n });\n TweenMax.from(mapMarker1, mapMarkerAnimTime, {\n delay: 2,\n autoAlpha: 0,\n scale: 0,\n ease: mapMarkerAnimType\n });\n\n TweenMax.from(expandButton, animTimeIn, {\n delay: 2,\n autoAlpha: 0,\n y: animOffsetDist,\n ease: animTypeIn\n });\n\n TweenMax.delayedCall(6, frame2);\n}", "loadAnimations() {\n for (var i = 0; i < 5; i++) { //Action State: 0-idle,1-walking,2-attacking,3-jumping,4-running\n this.animations.push([]);\n for (var j = 0; j < 2; j++) { //Direction State: 0-right, 1-left\n this.animations[i].push([]);\n for (var k = 0; k < 3; k++) { //Weapon State: 0-unequipped, 1-sword, 2-bow\n this.animations[i][j].push([]);\n }\n }\n }\n for (var h = 0; h < 3; h++) {\n this.deadAnimL.push([]);\n this.deadAnimR.push([]);\n }\n //idle animation for state 0\n // facing right\n this.animations[0][0][0] = new Animator(this.spritesheet, 35, 16, 65, 91, 12,\n 0.05, 125.05, false, true);\n\n // facing left\n this.animations[0][1][0] = new Animator(this.spritesheet, 30, 115, 75, 91, 12,\n 0.05, 115.05, true, true);\n\n //walking animation for state 1\n // facing right\n this.animations[1][0][0] = new Animator(this.spritesheet, 25, 218, 65, 91, 12,\n 0.05, 125.05, false, true);\n\n // facing left\n this.animations[1][1][0] = new Animator(this.spritesheet, 45, 322, 70, 91, 12,\n 0.05, 120.05, true, true);\n\n //attacking animation\n // facing right\n this.animations[2][0][0] = new Animator(this.spritesheet, 35, 630, 95, 91, 10,\n 0.038, 95.05, false, true);\n\n // facing left\n this.animations[2][1][0] = new Animator(this.spritesheet, 50, 735, 95, 91, 10,\n 0.038, 95.05, true, true);\n\n //jumping\n // facing right\n this.animations[3][0][0] = new Animator(this.spritesheet, 12, 1170, 90, 100, 1,\n .2, 100.05, false, true);\n //facing left\n this.animations[3][1][0] = new Animator(this.spritesheet, 20, 1270, 100, 100, 1,\n .2, 90.05, false, true);\n\n //running\n // facing right\n this.animations[4][0][0] = new Animator(this.spritesheet, 43, 415, 65, 91, 8,\n 0.07, 125.05, false, true);\n\n // facing left\n this.animations[4][1][0] = new Animator(this.spritesheet, 33, 520, 75, 91, 8,\n 0.05, 115.05, true, true);\n\n //death\n // facing right\n this.deadAnimR[0] = new Animator(this.spritesheet, 0, 860, 105, 120, 11,\n .07, 85.05, false, false);\n //facing left\n this.deadAnimL[0] = new Animator(this.spritesheet, 18, 1000, 105, 120, 11,\n .07, 85.05, true, false);\n\n //------------------------------for sword animations ---------------------------------\n\n //idle animation for state 0\n // facing right\n this.animations[0][0][1] = new Animator(this.spritesheetSword, 6, 16, 105, 91, 6,\n 0.09, 85.05, false, true);\n\n // facing left\n this.animations[0][1][1] = new Animator(this.spritesheetSword, 5, 115, 105, 91, 6,\n 0.09, 85.05, true, true);\n\n //walking animation for state 1\n // facing right\n this.animations[1][0][1] = new Animator(this.spritesheetSword, 25, 214, 105, 91, 10,\n 0.05, 85.05, false, true);\n\n // facing left\n this.animations[1][1][1] = new Animator(this.spritesheetSword, 10, 318, 105, 91, 12,\n 0.05, 85.05, true, true);\n\n //attacking animation\n // facing right\n this.animations[2][0][1] = new Animator(this.spritesheetSword, 18, 615, 155, 105, 10,\n 0.045, 35.05, false, true);\n\n // facing left\n this.animations[2][1][1] = new Animator(this.spritesheetSword, 0, 722, 155, 105, 10,\n 0.045, 35.05, true, true);\n\n //jumping\n // facing right\n this.animations[3][0][1] = new Animator(this.spritesheetSword, 12, 1155, 140, 100, 1,\n .2, 50.05, false, true);\n //facing left\n this.animations[3][1][1] = new Animator(this.spritesheetSword, 5, 1270, 140, 100, 1,\n .2, 50.05, false, true);\n\n //running\n // facing right\n this.animations[4][0][1] = new Animator(this.spritesheetSword, 43, 415, 105, 91, 8,\n 0.06, 85.05, false, true);\n\n // facing left\n this.animations[4][1][1] = new Animator(this.spritesheetSword, 0, 520, 105, 91, 8,\n 0.06, 85.05, true, true);\n\n //death\n // facing right\n this.deadAnimR[1] = new Animator(this.spritesheetSword, 0, 837, 115, 150, 12,\n .06, 75.05, false, false);\n //facing left\n this.deadAnimL[1] = new Animator(this.spritesheetSword, 50, 986, 125, 150, 9,\n .06, 65.05, true, false);\n\n this.swordEquipR = new Animator(this.spritesheetSword, 402, 1148, 105, 91, 7,\n .04, 85, false, false);\n this.swordEquipL = new Animator(this.spritesheetSword, 402, 1270, 105, 91, 7,\n .04, 85, true, false);\n\n\n //for bow animations ---------------------------------\n //idle animation for state 0\n // facing right\n this.animations[0][0][2] = new Animator(this.spritesheetBow, 2, 5, 85, 91, 6,\n 0.07, 105.05, false, true);\n\n // facing left\n this.animations[0][1][2] = new Animator(this.spritesheetBow, 8, 106, 75, 91, 6,\n 0.08, 115.05, true, true);\n\n //walking animation for state 1\n // facing right\n this.animations[1][0][2] = new Animator(this.spritesheetBow, 7, 216, 85, 91, 12,\n 0.05, 105.05, false, true);\n\n // facing left\n this.animations[1][1][2] = new Animator(this.spritesheetBow, 7, 320, 85, 91, 12,\n 0.05, 105.05, true, true);\n\n //attacking animation\n // facing right\n this.animations[2][0][2] = new Animator(this.spritesheetBow, 25, 630, 95, 91, 15,\n 0.05, 94.95, false, true);\n\n // facing left\n this.animations[2][1][2] = new Animator(this.spritesheetBow, 20, 743, 95, 91, 15,\n 0.05, 94.95, true, true);\n\n //jumping\n // facing right\n this.animations[3][0][2] = new Animator(this.spritesheetBow, 12, 1170, 100, 100, 1,\n .2, 90.05, false, true);\n //facing left\n this.animations[3][1][2] = new Animator(this.spritesheetBow, 20, 1270, 100, 100, 1,\n .2, 90.05, false, true);\n\n //running\n // facing right\n this.animations[4][0][2] = new Animator(this.spritesheetBow, 43, 420, 85, 91, 8,\n 0.07, 105.05, false, true);\n\n // facing left\n this.animations[4][1][2] = new Animator(this.spritesheetBow, 27, 525, 85, 91, 8,\n 0.05, 105.05, true, true);\n\n //death\n // facing right\n this.deadAnimR[2] = new Animator(this.spritesheetBow, 15, 845, 155, 135, 9,\n .07, 35.05, false, false);\n //facing left\n this.deadAnimL[2] = new Animator(this.spritesheetBow, 40, 1000, 155, 135, 9,\n .07, 35.05, true, false);\n\n\n }", "function animate() {\n\t\t\t\t\t\trequestAnimationFrame(animate);\n\t\t\t\t\t\tupdate();\n\t\t\t\t\t\trender();\n\t\t\t\t\t}", "preload() {\n this.anims.create({\n key: \"idle\", \n frameRate: 10, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [0,1]\n })\n });\n\n this.anims.create({\n key: \"idleLeft\", \n frameRate: 5, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [1,0]\n })\n });\n\n this.anims.create({\n key: \"runRight\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n //frames: [2,3,4,5,6,7]\n frames: [0,1]\n })\n });\n \n this.anims.create({\n key: \"runLeft\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"RUN\", {\n frames: [7,6,5,4,3,2]\n })\n });\n\n this.anims.create({\n key: \"slash\", \n frameRate: 60, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"SLASH\", {\n frames: [0,1,2,3,4,5,6,7,8]\n })\n });\n \n this.load.image(\"ground\", \"./assets/ground.png\");\n }", "if (m_bInitialAnim) { return; }", "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "function startAnimations(i) {\n\tsetInterval(function() {\n \tbetta = beta;\n \taalpha = alpha;\n \tanimateDiv(betta, aalpha, i);\n \t}, 1000);\n}", "createAnimation() {\n this.scene.anims.create({\n key: 'bullet-hit',\n frames: this.scene.anims.generateFrameNumbers('bullet-hit', {\n start: 0,\n end: 10\n }),\n frameRate: FRAMERATE\n });\n }", "function animate() {\r\n\r\n\trequestAnimationFrame( animate );\r\n\trender();\r\n\r\n}", "run() {\n\t\tif(this.element.style.webkitAnimationPlayState !== 'running'){\n\t\t\tthis.element.style.webkitAnimationPlayState = 'running';\n\t\t\tthis.startTime = (new Date()).getTime();\n\t\t}\n\t}", "handleAnimation() {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 1000,\n }).start();\n }", "function animate() {\n requestAnimationFrame( animate );\n render();\n}", "update() {\n this.animation.update()\n }", "function doAnimate() {\n start = Date.now();\n do {\n if ((Date.now() - start) < 20000 && sunnySet == false) {\n setSceneSunny();\n sunnySet = true;\n console.log((Date.now() - start));\n }\n else if (((Date.now() - start) > 20000) && ((Date.now() - start) < 40000) && cloudSet == false) {\n cancelAnimationFrame( id );\n console.log((Date.now() - start));\n setSceneCloudy();\n cloudSet = true;\n }\n else if ((Date.now() - start) > 40000 && (Date.now() - start) < 60000 && rainSet == false) {\n cancelAnimationFrame( id );\n console.log((Date.now() - start));\n setSceneRain();\n rainSet = true;\n }\n else if ((Date.now() - start) > 60000 && (Date.now() - start) < 80000 && snowSet == false) {\n cancelAnimationFrame( id );\n console.log((Date.now() - start));\n setSceneSnow();\n snowSet = true;\n }\n else if ((Date.now() - start) > 80000 && (Date.now() - start) < 100000 && nightSet == false) {\n cancelAnimationFrame( id );\n console.log((Date.now() - start));\n setSceneNight();\n nightSet = true;\n }\n } while (playAnimationBool == true);\n }", "handleAnimationOn(index) {\n //TODO: test adding text instead of animation on the same classes\n const animatedFrame = document.getElementsByClassName(\"itemOnTheList\");\n animatedFrame[index].classList.add('loadingAnimation');\n console.dir(animatedFrame[index]);\n this.setState({\n animationFrame: true\n })\n }", "async wait() {\n this.waitingAnimationFinish = true;\n await Utils.delay(1000);\n this.waitingAnimationFinish = false;\n }", "function addAnimator(animator) {\n animatorList.push(animator);\n if (animatorList.length === 1) {\n start();\n }\n }", "function addAnimator(animator) {\n animatorList.push(animator);\n if (animatorList.length === 1) {\n start();\n }\n }", "function animate() {\n requestAnimationFrame(animate);\n render();\n}", "function animate() {\n requestAnimationFrame(animate);\n render();\n}", "function addAnimation(){\n const Burst1 = new mojs.Burst ({\n parent: animationDiv,\n top: '50%',\n left: '50%', \n radius: {0: 80},\n count: 8,\n children: {\n shape: 'circle',\n fill: {'red':'blue'},\n strokeWidth: 1,\n duration: 600,\n stroke: {'red':'blue'}\n }\n });\n\n\n const Burst2 = new mojs.Burst ({\n parent: animationDiv,\n top: '50%',\n left: '50%', \n radius: {0: 100},\n count: 4,\n children: {\n shape: 'rect',\n fill: 'white',\n strokeWidth: 1,\n duration: 300,\n stroke: 'white'\n }\n });\n\n\n\n const circle1= new mojs.Shape ({\n radius: {0:40},\n parent: animationDiv,\n fill: 'none',\n stroke: 'white',\n strokeWidth:15,\n duration: 300,\n opacity: {1: 0}\n });\n\n const circle2= new mojs.Shape ({\n radius: {0:50},\n parent: animationDiv,\n fill: 'none',\n stroke: 'red',\n strokeWidth:5,\n duration: 400,\n opacity: {1: 0}\n });\n\n\n const circle3= new mojs.Shape ({\n radius: {0:60},\n parent: animationDiv,\n fill: 'none',\n stroke: 'blue',\n strokeWidth:5,\n duration: 500,\n opacity: {1: 0}\n });\n\n const circle4= new mojs.Shape ({\n radius: {0:70},\n parent: animationDiv,\n fill: 'white',\n \n stroke: 'white',\n strokeWidth:5,\n duration: 600,\n opacity: {1: 0}\n });\n\n const timeline = new mojs.Timeline ({\n \n repeat: 0\n }).add(circle4,circle1,circle2,circle3,Burst1,Burst2);\n\n timeline.play();\n}", "function animator() {\n var delay, speed;\n $('.animated').each(function() {\n var el = $(this);\n //console.log( elements[i] , i );\n if (el.visible(true)) {\n if (el.data('animtype') == 'animate-progress') {\n\n el.css('opacity', 1);\n el.addClass('animatedVisi');\n el.css('opacity', 1);\n el.css('width', el.attr('aria-valuenow'));\n //el.find('.progress .progress-bar').html(el.data('progress-to'));\n\n return;\n }\n\n delay = el.data('animdelay');\n if (!delay) {\n delay = 0;\n }\n\n el.css('-webkit-animation-delay', delay);\n el.css('-moz-animation-delay', delay);\n el.css('-o-animation-delay', delay);\n el.css('animation-delay', delay);\n\n speed = el.data('animspeed');\n\n if (!speed) {\n speed = 0.5;\n }\n\n el.css('-webkit-animation-duration', speed);\n el.css('-moz-animation-duration', speed);\n el.css('-o-animation-duration', speed);\n el.css('animation-duration', speed);\n\n if (el.data('animtype')) {\n el.addClass(el.data('animtype'));\n }\n\n el.addClass('animatedVisi');\n // que.push(this);\n }\n else if (el.data('animrepeat') == '1') {\n el.removeClass(el.data('animtype'));\n el.removeClass('animatedVisi');\n }\n });\n}", "function modalAnimation() {}", "function animate(){\r\n\t\t\t\r\n\t\t\tif (t == dur){\r\n\t\t\t\tif(cb) cb();\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\tanimate();\r\n\t\t\t},20)\r\n\t\t}", "function animateRestart() {\n animation1.restart();\n animation2.restart();\n animation3.restart();\n animation4.restart();\n}", "initAnimations() {\n var idle = this.level.player.animations.add('idle', [0, 1, 2, 3], 5);\n var walk_left = this.level.player.animations.add('walk_left', [5, 6, 7, 8]);\n var walk_right = this.level.player.animations.add('walk_right', [10, 11, 12, 13]);\n var jump = this.level.player.animations.add('jump', [15, 16, 17, 18]);\n var attack_left = this.level.player.animations.add('attack_left', [20, 21, 22, 23, 24]);\n var attack_right = this.level.player.animations.add('attack_right', [25, 26, 27, 28, 29]);\n }", "function animate(){\n\n\tanimateCloth();\n\trender();\n\trequestAnimationFrame( animate );\n\n\t\n}", "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "function initScene() {\n animate();\n}", "function animate() {\n /*\n Apply animations\n */\n animator.execute();\n\n /*\n Update VR headset position and apply to camera.\n */\n controls.update();\n\n /*\n Render the scene through the VREffect.\n */\n effect.render( scene, camera );\n\n requestAnimationFrame( animate );\n}", "initAnimation() {\n\t\t// Create new AnimationMixer for clip playback\n\t\tthis.animMixer = new THREE.AnimationMixer( this.scene );\n\n\t\t// Create AnimationClips for each C4DLinkObject.\n\t\tthis.linkObjects.forEach( linkObject => {\n\t\t\tlinkObject.setLinkTargetFromScene( this.scene );\n\t\t\tlinkObject.setSourceClipFromClipArray( this.animClips );\n\n\t\t\tconst linkedClip = linkObject.getLinkedAnimationClip();\n\t\t\tif ( linkedClip ) this.animClips.push( linkedClip );\n\t\t});\n\n\t\t// Get the duration of the entire animation, which is the duration of the longest clip\n\t\tthis.animClips.forEach( clip => {\n\t\t\tthis.duration = Math.max( this.duration, clip.duration );\n\t\t});\n\n\t\t// Create AnimationActions for each clip\n\t\tthis.animActions = this.animClips.map( clip => {\n\t\t\treturn this.animMixer.clipAction( clip );\n\t\t});\n\n\t\t// Configure AnimationAction playback properties\n\t\tthis.animActions.forEach( action => {\n\t\t\taction.clampWhenFinished = true;\n\t\t\taction.loop = THREE.LoopOnce;\n\t\t\taction.play();\n\t\t});\n\n\t\t// Tick the mixer forward one frame, then reset immediately.\n\t\t// This ensures that the animation will pause at the first frame\n\t\t// until the play() function is called.\n\t\tthis.animMixer.update( 1 / 60 );\n\t\tthis.animMixer.stopAllAction();\n\t}", "async function displayAnimations(bars, index1, index2) {\r\n bars[index1].style.backgroundColor = 'red';\r\n bars[index2].style.backgroundColor = 'red';\r\n await new Promise(r => setTimeout(r, 20));\r\n bars[index1].style.backgroundColor = 'darkturquoise';\r\n bars[index2].style.backgroundColor = 'darkturquoise';\r\n}", "function animate() {\n // render\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "function animateIt($elements) {\n $elements.each( function( i, el ) {\n\n var $el = $( el ),\n animationClass = $el.data( 'animation' );\n\n $el.addClass( animationClass );\n $el.addClass( 'animated' );\n $el.addClass( 'wait-animation' );\n\n $el.one( 'inview', function() {\n $el.removeClass( 'wait-animation' );\n $el.addClass( 'done-animation' );\n });\n });\n}", "function contentAnimation() {\n\n var tl = gsap.timeline();\n tl.from('.is-animated', { duration: 1, translateY: 60, opacity: 0, stagger: 0.4 });\n tl.from('.fadein', { duration: 0.5, opacity: 0.9 });\n}", "_createAnimatables() {\n // Create new animatables\n const oldAnimatables = [...this._babylonAnimatables];\n this._babylonAnimatables.length = 0;\n this._babylonAnimations.forEach(targetedAnimation => {\n const animatable = this._babylonScene.beginDirectAnimation(\n targetedAnimation.target,\n [targetedAnimation.animation],\n this._from,\n this._to,\n this._loopCount > 1,\n 0,\n this._onFinishedEvent,\n this._onLoopEvent,\n babylonBlendModes[this._blendMode]\n );\n animatable.weight = this._internalWeight;\n animatable.disposeOnEnd = false;\n this._babylonAnimatables.push(animatable);\n });\n\n // Dispose of the old animatables\n oldAnimatables.forEach(animatable => {\n animatable.stop();\n });\n }", "apply() {\n this.scene.multMatrix(this.animTransform);\n }", "threeAnimate() {\n if (this._.updateTimerRunning) {\n requestAnimationFrame(this.threeAnimate);\n this.threeUpdate();\n this.threeRender();\n }\n }", "function startAnimation() {\n waited += new Date().getTime() - stopTime\n stopAnim = false;\n Animation();\n}", "onTransitionEnd() {\n this.isInAnimation = false;\n // if any method in queue, then invoke it\n if (this.visualEffectQueue.length) {\n let action = this.visualEffectQueue.shift(); // remove method from queue and invoke it\n this.isInAnimation = action.isAnimated;\n action.action();\n }\n }", "function Animated() {\n this.payload = void 0;\n // This makes \"isAnimated\" return true.\n setAnimated(this, this);\n }", "function animate() {\n // render\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "function animate() {\n requestAnimationFrame(animate);\n renderer.render(stage);\n //checkHelp();\n}", "function loadAnims(){\n\tlog(\"load \" + animations.length + \" animations\");\t\n\tif(animations.length>0){\t\n\t\tyepnope([{\n\t\t\tload: animations,\n\t\t\tcallback: function (url, result, key) {\n\t\t\t\tprogress(\"loaded: \" + url);\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tlog(\"loading animations complete\"); \n\t\t\t\tstartNemoScript();\n\t\t\t}\n\t\t}]);\n\t}else{\n\t\tstartNemoScript();\n\t}\n}", "function animate() {\n\t\trequestAnimFrame(function(){\n animate();\n });\n\t\t\n\t\tplaceHover();\n\t\titemHover();\n\t\titemDrag();\n\t\t//$('#place').text(getSceneMembers(self.places));\n\t\t//$('#sticky').text(self.items);\n\t\t\n\t\t\n\n self.renderer.render(self.scene, self.camera);\n //self.controls.update(self.clock.getDelta());\n\t\t\n\t}", "function animate() {\n\t// render the 3D scene\n\trender();\n\t// relaunch the 'timer' \n\trequestAnimationFrame( animate );\n\t// update the stats\n\tstats.update();\n\t// update the tweens from TWEEN library\n\tTWEEN.update();\n}", "function addAnimations( FBXTree, connections, sceneGraph ) {\n \n sceneGraph.animations = [];\n \n var rawClips = parseAnimations( FBXTree, connections );\n \n if ( rawClips === undefined ) return;\n \n \n for ( var key in rawClips ) {\n \n var rawClip = rawClips[ key ];\n \n var clip = addClip( rawClip );\n \n sceneGraph.animations.push( clip );\n \n }\n \n }", "async restartAnimation() {\n await this.updateComplete;\n this.animationReady = false;\n await new Promise(requestAnimationFrame);\n this.animationReady = true;\n await this.updateComplete;\n }" ]
[ "0.72304296", "0.71728456", "0.67521536", "0.6703089", "0.66503274", "0.6645787", "0.66425407", "0.65776545", "0.6516832", "0.64954275", "0.64914846", "0.64082175", "0.6393736", "0.6383406", "0.6378035", "0.6375194", "0.6370166", "0.6353008", "0.6350212", "0.63320714", "0.63223475", "0.6316432", "0.6284524", "0.62636936", "0.62582904", "0.6250762", "0.62276894", "0.62246454", "0.6217887", "0.62153023", "0.6209721", "0.6209322", "0.62082", "0.6199283", "0.61965305", "0.61906505", "0.6187789", "0.6179034", "0.6178421", "0.6178421", "0.6174966", "0.61732143", "0.61665946", "0.6159856", "0.6156709", "0.61555797", "0.6154102", "0.6149438", "0.6142003", "0.61411595", "0.6135432", "0.6132409", "0.6125228", "0.61229205", "0.6122525", "0.61113054", "0.6106469", "0.6105332", "0.6104207", "0.6094702", "0.6094564", "0.6093398", "0.60901135", "0.60817254", "0.6054252", "0.6053542", "0.60476893", "0.60414416", "0.60390896", "0.60390896", "0.60377294", "0.60377294", "0.6034986", "0.60319793", "0.603073", "0.60274005", "0.60262764", "0.60261345", "0.60250473", "0.60123456", "0.60007715", "0.59999895", "0.59971446", "0.59885496", "0.5988355", "0.59835863", "0.59777975", "0.5977218", "0.59703964", "0.59703064", "0.5970281", "0.5949413", "0.5945658", "0.59435225", "0.5942936", "0.59343916", "0.5931914", "0.5928193", "0.5922903", "0.59210646", "0.5916057" ]
0.0
-1
Generate parameters to create a standard animation
function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setParameters() {\n params.viscosity = 0.02;\n params.u0 = -amplitude;\n params.one36th = 1 / 36;\n params.one9th = 1 / 9;\n params.four9ths = 4 / 9;\n params.gridSize = 5;\n params.m = int(height / params.gridSize);\n params.n = int(width / params.gridSize);\n}", "function generateAnimationParams(animation) {\n const timeReg = /^(\\d+)?(\\.)?\\d+m?s$/i\n const loopReg = /^(\\d|infinite|forwards|steps\\(\\d+\\))$/i\n const timeConvert = n => parseFloat(n) * (/ms$/.test(n) ? 1 : 1e3)\n\n if (!animation) {\n return []\n }\n\n return animation\n .replace(/to\\((.*?)\\)/g, (_, $1) => `to(${$1.replace(/\\s*,\\s*/g, '__SPLIT__')})`)\n .split(',')\n .filter(item => !!item)\n .map(raw => {\n const params = raw.trim().replace(/\\s+/g, ' ').split(' ')\n return params.reduce(\n (ret, str) => {\n // the first parameter should be `aniName`\n if (ret.__aniName === undefined) {\n return { ...ret, __aniName: str }\n }\n // if the parameter satisfies time, it may be `duration` or `delay`\n if (timeReg.test(str)) {\n const type = ret.duration === undefined ? 'duration' : 'delay'\n return { ...ret, [type]: timeConvert(str) }\n }\n // it the parameter satisfies loop properties\n if (ret.duration !== undefined && loopReg.test(str)) {\n return { ...ret, loop: convertValue(str) }\n }\n // otherwise it may be easing name or bezier\n return { ...ret, easing: str }\n },\n {}\n )\n })\n}", "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "function generateAnim(type, size)\n{\n animObj['type'] = type;\n animObj['size'] = size;\n animObj['red'] = paintColor[0];\n animObj['green'] = paintColor[1];\n animObj['blue'] = paintColor[2];\n}", "animation() {}", "function build(){\n\n if ( parseInt( cfg.move ) !== 0 ){\n initial += ' translate' + cfg.axis + '(' + cfg.move + ')';\n target += ' translate' + cfg.axis + '(0)';\n }\n\n if ( parseInt( cfg.scale.power ) !== 0 ){\n\n if ( cfg.scale.direction === 'up' ){\n cfg.scale.value = 1 - ( parseFloat( cfg.scale.power ) * 0.01 );\n } else if ( cfg.scale.direction === 'down' ){\n cfg.scale.value = 1 + ( parseFloat( cfg.scale.power ) * 0.01 );\n }\n\n initial += ' scale(' + cfg.scale.value + ')';\n target += ' scale(1)';\n }\n\n if ( cfg.rotate.x ){\n initial += ' rotateX(' + cfg.rotate.x + ')';\n target += ' rotateX(0)';\n }\n\n if ( cfg.rotate.y ){\n initial += ' rotateY(' + cfg.rotate.y + ')';\n target += ' rotateY(0)';\n }\n\n if ( cfg.rotate.z ){\n initial += ' rotateZ(' + cfg.rotate.z + ')';\n target += ' rotateZ(0)';\n }\n\n initial += '; opacity: ' + cfg.opacity + '; ';\n target += '; opacity: 1; ';\n }", "function initAnimation() {\n}", "function AnimationParser() {}", "function AnimationStaggerMetadata() { }", "function AnimationStaggerMetadata() { }", "createSpriteAnimations() {\n const haloFrames = this.anims.generateFrameNames('haloHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Halo_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'haloHit', frames: haloFrames, frameRate: 60, repeat: 0 });\n\n const sparkFrames = this.anims.generateFrameNames('sparkHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Spark_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'sparkHit', frames: sparkFrames, frameRate: 60, repeat: -1 });\n }", "createanims(){\n Object.keys(this.mp()).forEach(key=>{\n let config = [\n {\n key: `${key}stand`,\n frames: this.anims.generateFrameNames('players', {\n start: 1,\n end: 1,\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 8,\n repeat: -1\n },\n {\n key: `${key}down`,\n frames: this.anims.generateFrameNames('players', {\n start: 0,\n end: 2,\n frames: [1,2,1,0],\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 8,\n repeat: -1,\n },\n {\n key: `${key}up`,\n frames: this.anims.generateFrameNames('players', {\n start: 3,\n end: 5,\n frames: [4,5,4,3],\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 8,\n repeat: -1\n },\n {\n key: `${key}left`,\n frames: this.anims.generateFrameNames('players', {\n start: 6,\n end: 8,\n frames: [7,8,7,6],\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 8,\n repeat: -1\n },\n {\n key: `${key}attack`,\n frames: this.anims.generateFrameNames('players', {\n start: 9,\n end: 10,\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 2,\n repeat: 0\n },\n {\n key: `${key}idle`,\n frames: this.anims.generateFrameNames('players', {\n start: 35,\n end: 37,\n frames: [36,37,36,35],\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 4,\n repeat: -1\n },\n {\n key: `${key}hurt`,\n frames: this.anims.generateFrameNames('players', {\n start: 11,\n end: 11,\n prefix: `${this.mp()[key]}/`\n }),\n frameRate: 4,\n repeat: 0\n },\n ];\n config.forEach(anim=> this.anims.create(anim));\n })\n }", "function shapeSettings(){\n rectMode(CENTER);\n noStroke();\n waveWidth = width;\n increment = (TWO_PI / period) * xSpacing;\n periodYValues = new Array( floor(waveWidth / xSpacing) );\n}", "function ParameterReader (parametersList) {\n\n return getAnimationInfo ();\n\n function getAnimationInfo () {\n var animationsInfo = [];\n for (var i = 0; i < parametersList.length; i++) {\n animationsInfo.push (readParameters(parametersList[i]));\n }\n return animationsInfo;\n };\n\n function readParameters (parameters = {}){\n var columns, rows, animation, depth, primaryImage, secondaryImage, transition, start, end, colorType, colorValue, opacity;\n var dimensions, color;\n\n rows = parameters.rows || 10;\n columns = parameters.columns || 10;\n animation = parameters.animation || \"scroll\";\n depth = parameters.depth || 1;\n primaryImage = parameters.image || parameters.primaryImage || './images/picasso.jpg';\n secondaryImage = parameters.secondaryImage || './images/picasso.jpg';\n transition = parameters.transition || 'exit';\n start = parameters.start || 0;\n end = parameters.end || 10;\n colorType = parameters.colorType || \"rainbow\";\n colorValue = parameters.colorValue || \"blue\";\n opacity = parameters.opacity || 1;\n\n dimensions = {\n rows: rows,\n columns: columns\n };\n\n color = {\n type: colorType,\n value: colorValue,\n opacity: opacity\n };\n\n if (isSideAnimation(animation)) {\n depth = 1;\n }\n\n return {\n dimensions,\n primaryImage,\n secondaryImage,\n animation,\n depth,\n transition,\n start,\n end,\n color,\n };\n };\n\n function isSideAnimation(animation) {\n return animation == \"slideshow\" ||\n animation == \"spiral\";\n };\n}", "function generatePathFrameParameters() {\n var path_sizes = [20, 50, 200, 300, 400];\n var quantities = [10, 20, 50, 100, 500, 1000, 2000];\n var shadow_blurs = [0, 1, 10, 20];\n\n // Only draw combinations that contain shadows with this probability\n // to reduce the number of permutations.\n var shadowedPermutationProbability = 0.1;\n\n var list_of_frame_parameters = [];\n\n for (shape_type in SHAPE_TYPE) {\n for (var size_i = 0; size_i < path_sizes.length; size_i++) {\n for (var qty_i = 0; qty_i < quantities.length; qty_i++) {\n for (var sh_i = 0; sh_i < shadow_blurs.length; sh_i++) {\n for (fill_style in SHAPE_STYLE) {\n if (shadow_blurs[sh_i] == 0\n || getTrueWithProbability(shadowedPermutationProbability)) {\n\n list_of_frame_parameters.push([\n new DrawParameter(CALL_TYPE.PATH, shape_type,\n path_sizes[size_i], shadow_blurs[sh_i],\n quantities[qty_i], fill_style)]);\n }\n }\n }\n }\n }\n }\n return list_of_frame_parameters;\n}", "function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();}// Generate parameters to create a standard animation", "function getParameters(mode_num){\n\t\tswitch(android_interpolator.interpolatorTypesAry[mode_num].name) {\n\t\t\tcase \"CustomSpring\":\n\t\t\t\tprefixParameters = 'var factor = '+factor1.toString()+'; \\n';\n\t\t\t\tbreak;\n\t\t\tcase \"CustomBounce\":\n\t\t\t\tprefixParameters = 'var mTension = '+factor1.toString()+';\\nvar mFriction = '+factor2.toString()+';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"CustomDamping\":\n\t\t\t\tprefixParameters = 'var mTension = '+factor1.toString()+';\\nvar mFriction = '+factor2.toString()+';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"CustomMocosSpring\":\n\t\t\t\tprefixParameters = 'var tension = '+factor1.toString()+';\\nvar damping = '+factor2.toString()+';\\nvar v0 = '+factor3.toString()+';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"AndroidSpring\":\n\t\t\t\tprefixParameters = 'var mStiffness = '+factor1.toString()+';\\nvar mDampingRatio = '+factor2.toString()+';\\nvar mVelocity = '+factor3.toString()+';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"AndroidFling\":\n\t\t\t\tprefixParameters = 'var mStartVelocity = '+factor1.toString()+';\\nvar mDampingRatio = '+factor2.toString()+';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"Origami_POP_Spring\":\n\t\t\t\tOrigamiSpringConverter(factor1,factor2);\n\t\t\t\tprefixParameters = 'var mStiffness = '+ mStiffness.toString() +';\\nvar mDampingRatio = '+ mDampingRatio.toString() +';\\nvar mVelocity = 0;\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"Framer_RK4_Spring\":\n\t\t\t\tFramerRK4Converter(factor1,factor2);\n\t\t\t\tprefixParameters = 'var mStiffness = '+ mStiffness.toString() +';\\nvar mDampingRatio = '+ mDampingRatio.toString() +';\\nvar mVelocity = 0;\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"Framer_DHO_Spring\":\n\t\t\t\tFramerDHOConverter(factor1,factor2,factor3,factor4);\n\t\t\t\tprefixParameters = 'var mStiffness = '+ mStiffness.toString() +';\\nvar mDampingRatio = '+ mDampingRatio.toString() +';\\nvar mVelocity = ' + factor4.toString() +';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"CASpringAnimation\":\n\t\t\t\tFramerDHOConverter(factor1,factor2,factor3,factor4);\n\t\t\t\tprefixParameters = 'var mStiffness = '+ mStiffness.toString() +';\\nvar mDampingRatio = '+ mDampingRatio.toString() +';\\nvar mVelocity =' + factor4.toString() +';\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"UIViewSpringAnimation\":\n\t\t\t\tUIViewSpringConverter(factor1,factor2);\n\t\t\t\tprefixParameters = 'var mStiffness = '+ mStiffness.toString() +';\\nvar mDampingRatio = '+ mDampingRatio.toString() +';\\nvar mVelocity = 0;\\n';\n\t\t\t\tbreak;\n\t\t\tcase \"Protopie_Spring\":\n\t\t\t\tFramerRK4Converter(factor1,factor2);\n\t\t\t\tprefixParameters = 'var mStiffness = '+ mStiffness.toString() +';\\nvar mDampingRatio = '+ mDampingRatio.toString()+ ';\\nvar mVelocity = 0;\\n';\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tif(android_interpolator.interpolatorTypesAry[mode_num].defaultPara == null){\n\t\t\t\t\tprefixParameters = '';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tprefixParameters = 'var factor = '+factor1.toString()+';\\n';\n\t\t\t\t}\n\n\t\t}\n\t}", "function generate_trial_parameters(A_l, process_init, process_noise, observ_noise, observ_scale) {\n var duration = truncated_geometric(p, t_max - t_min) + t_min;;\n var x = sample_lds_states(A_l, process_init, process_noise, duration);\n var z = make_observations(x, observ_noise, observ_scale);\n \n // convert the sampled values to pixel space and present in usable format\n var posX = [];\n var posY = [];\n for (var ii=0; ii < z.length; ii ++){ \n posX.push(z[ii][0] + 350/2);\n posY.push(z[ii][1] + 350/2);\n }\n return {posX : posX, posY: posY, color_sequence: palette('tol', t_max + 1)}\n }", "addAnimations() {\n\n // eyes animations (moving eyes of the inspector)\n let frameRate = 50; // frame rate of the animation\n\n // from mid to right\n this.anims.create({\n key: 'midToRight',\n frames: this.anims.generateFrameNames('eyes', {frames: [0, 1, 2, 3, 4, 5]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from right to mid\n this.anims.create({\n key: 'rightToMid',\n frames: this.anims.generateFrameNames('eyes', {frames: [5, 4, 3, 2, 1, 0]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from mid to left\n this.anims.create({\n key: 'midToLeft',\n frames: this.anims.generateFrameNames('eyes', {frames: [0, 6, 7, 8, 9, 10]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from left to mid\n this.anims.create({\n key: 'leftToMid',\n frames: this.anims.generateFrameNames('eyes', {frames: [10, 9, 8, 7, 6, 0]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from left to right\n this.anims.create({\n key: 'leftToRight',\n frames: this.anims.generateFrameNames('eyes', {frames: [10, 9, 8, 7, 6, 0, 1, 2, 3, 4, 5]}),\n frameRate: frameRate,\n paused: true\n });\n\n // from right to left\n this.anims.create({\n key: 'rightToLeft',\n frames: this.anims.generateFrameNames('eyes', {frames: [5, 4, 3, 2, 1, 0, 6, 7, 8, 9, 10]}),\n frameRate: frameRate,\n paused: true\n });\n\n }", "function ANIMATE($anim) {\n var that = this, an = {}, myData = {}, styleCur = {}, isOverflowOnNode;\n /**\n * FUNCTION CLASS\n */\n /**\n * CHECK & INITIALIZATION ANIMATION\n */\n function Init() {\n /**\n * SETUP VARIABLE AT FIRST\n */\n an.rubyID = DB.GetRubyID($anim);\n myData = that.data = vData[an.rubyID];\n // Setup initialization timer of object\n if (myData.tsInit == UNDE)\n myData.tsInit = VA.tsCur;\n // Properties & options of object\n var prop = myData.prop, opts = myData.opts;\n an.propEnd = prop[prop.length - 1];\n an.optsEnd = opts[opts.length - 1];\n /**\n * SETUP AFTER START ANIMATION\n */\n SetupStyleBegin();\n Start();\n }\n /**\n * SETUP VALUE OF STYLE & TRANSFORM AT FIRST\n */\n function SetupStyleBegin() {\n // Setup properties of normal Style\n StyleBegin();\n // Setup properties of transform CSS\n TransformBegin();\n }\n /**\n * SETUP VALUE OF STYLE AT FIRST\n */\n function StyleBegin() {\n var styleBegin = an.optsEnd.styleBegin, styleEnd = an.optsEnd.styleEnd, opts = myData.opts, isAnimMulti = opts.length > 1;\n /**\n * LOOP TO SETUP VALUE NOT BE TRANSFORM CSS\n */\n for (var name in an.propEnd) {\n if ($.inArray(name, VA.nameTf) === -1) {\n /**\n * SETUP STYLE END\n * + Parse & convert value of StyleEnd\n */\n var valueCur = an['propEnd'][name];\n styleEnd[name] = M.ParseCssStyle(valueCur);\n /**\n * SETUP STYLE BEGIN\n */\n // Case: name of properties have fixed value -> inherit value of tfEnd\n if ($.inArray(name, VA.propFixed) !== -1) {\n styleBegin[name] = styleEnd[name];\n }\n else {\n // Parse & convert value of StyleBegin\n valueCur = $anim.css(name);\n styleBegin[name] = M.ParseCssStyle(valueCur);\n }\n }\n }\n // Inherit StyleEnd of animation before\n if (isAnimMulti)\n styleBegin = $.extend(styleBegin, opts[opts.length - 2]['styleEnd']);\n // Inherit properties of CSS Style 'point' have setup before\n if (myData.cssStyle !== null) {\n styleBegin = $.extend(true, styleBegin, myData.cssStyle);\n // Remove properties CSS Style after inherit\n myData.cssStyle = null;\n }\n /**\n * SETUP INHERIT PROPERTIES OF STYLE-END FROM STYLE-BEGIN\n */\n for (var name in styleBegin) {\n if (styleEnd[name] === UNDE) {\n styleEnd[name] = styleBegin[name];\n }\n }\n }\n /**\n * SETUP VALUE OF TRANSFORM AT FIRST\n */\n function TransformBegin() {\n var opts = myData.opts;\n /**\n * GET TRANSFORM OF OBJECT AT FIRST\n */\n // Case: have many continuous animation\n var tfBegin;\n if (opts.length > 1) {\n // Get Transform-begin from Transform-end before\n tfBegin = $.extend({}, opts[opts.length - 2]['tfEnd']);\n }\n else {\n tfBegin = myData.tfCur;\n if (tfBegin == UNDE) {\n var matrixBegin = MATRIX.getFromItem($anim);\n /**\n * PARSE MATRIX TO INITIAL PROPERTIES\n */\n tfBegin = MATRIX.parse(matrixBegin);\n }\n }\n // Inherit the properties CSS Transform 'point' have setup before\n if (myData.cssTf !== null) {\n tfBegin = $.extend(true, tfBegin, myData.cssTf);\n // Remove CSS Transform property after inherit\n myData.cssTf = null;\n }\n /**\n * GET TRANSFORM-END FROM SETUP PROPERTIES\n */\n var tfEnd = TF.FromProp(an.propEnd);\n /**\n * SETUP TRANSFORM INHERIT FROM PROPERTIES BEFORE\n */\n // Inherit 'tfBegin' properties but 'tfEnd' does not have, order of Transform depends on options\n tfEnd = TF.Extend(tfBegin, tfEnd, an.optsEnd);\n var tfDefault = VA.tfDefault;\n for (var name in tfEnd) {\n /**\n * ADDITIONAL PROPERTIES WITH TRANSFORM-BEGIN\n */\n if (tfBegin[name] === UNDE) {\n // Case: value of properties !== default value\n if (tfEnd[name] != tfDefault[name]) {\n // Case: name of property has fixed value -> inherit value from 'tfEnd'\n if ($.inArray(name, VA.propFixed) !== -1)\n tfBegin[name] = tfEnd[name];\n else\n tfBegin[name] = tfDefault[name];\n }\n else {\n delete tfEnd[name];\n }\n }\n /**\n * REMOVE PROPERTIES ON TRANSFORM BEGIN - END SIMILAR TO DEFAULT PROPERTIES\n */\n if (tfBegin[name] == tfDefault[name] && tfEnd[name] == tfDefault[name]) {\n delete tfBegin[name];\n delete tfEnd[name];\n }\n }\n an.optsEnd.tfBegin = tfBegin;\n an.optsEnd.tfEnd = tfEnd;\n }\n /**\n * SETUP VALUE WHEN BEGIN ANIMATION\n */\n function Start() {\n /**\n * INSERT STYLE 'OVERFLOW' AT FIRST: FIXED FOR OLD BROWSER\n */\n var style = $anim.attr('style');\n isOverflowOnNode = style && style.indexOf('overflow') !== -1;\n // Unavailable\n // !isOverflowOnNode && $anim.css('overflow', 'hidden');\n /**\n * EXECUTE FUNCTION 'START' AT FIRST\n */\n !!an.optsEnd.start && an.optsEnd.start();\n }\n /**\n * SETUP NEXT VALUE OF OBJECT, CALL FUNCTION FROM 'TWEEN'\n * @param boolean isForceAnim Allways setup style for object\n */\n that.next = function (isForceAnim) {\n /**\n * SETUP CURRENT TIME\n * @param Int an.xCur Current time, in range [0, 1]\n * @param Boolean isAnimate Check setup current animation\n */\n var opts = myData.opts, isAnimate = false, isComplete = false, tCur = myData.tCur = VA.tsCur - myData.tsInit;\n for (var i = 0, len = opts.length; i < len; i++) {\n var optsCur = opts[i];\n // Case: tCur at the forward position the first Aniamtion\n if (tCur < optsCur.tPlay && i == 0) {\n // Case: allways setup Style of object\n if (isForceAnim) {\n an.optsPos = i;\n an.xCur = 0;\n }\n else\n an.xCur = null;\n break;\n }\n else if (tCur > optsCur.tEnd && i == len - 1) {\n an.optsPos = i;\n an.xCur = 1;\n isComplete = true;\n break;\n }\n else if (optsCur.tPlay <= tCur && tCur <= optsCur.tEnd) {\n an.optsPos = i;\n an.xCur = $.GSGDEasing[optsCur.easing](null, tCur - optsCur.tPlay, 0, 1, optsCur.duration);\n isAnimate = true;\n break;\n }\n else if (!!opts[i + 1] && optsCur.tEnd < tCur && tCur < opts[i + 1].tPlay) {\n an.optsPos = i;\n an.xCur = 1;\n break;\n }\n }\n /**\n * SETUP VALUE OF CURRENT STYLE ON OBJECT\n */\n if (an.xCur !== null && opts.length) {\n // First, reset size of Item\n GetSizeItem();\n // Reset variable 'styleCur'\n styleCur = {};\n // Setup current Style value of the object\n StyleNormalCur();\n StyleTransformCur();\n $anim.css(styleCur);\n }\n /**\n * EXECUTE OPTION 'COMPLETE'\n */\n if (isComplete) {\n var optsCur = opts[an.optsPos];\n !!optsCur.complete && optsCur.complete();\n }\n /**\n * Return value check have Animation\n */\n return isAnimate;\n };\n /**\n * CONVERT VALUE HAS OTHER UNIT TO 'PX'\n * + Support convert '%' to 'px'\n */\n function ConvertValue(name, valueCur) {\n /*\n * CASE: STRING\n */\n if (typeof valueCur == 'string') {\n /**\n * CASE: UNIT IS 'PX'\n */\n if (/px$/.test(valueCur)) {\n valueCur = parseFloat(valueCur);\n }\n else if (/\\%$/.test(valueCur)) {\n // Name of property exist in conversion system\n var nameSizeFn = VA.percentRef[name];\n if (nameSizeFn !== UNDE) {\n var sizeCur = an['size'][nameSizeFn];\n valueCur = sizeCur * parseFloat(valueCur) / 100;\n }\n }\n }\n /**\n * RETURN VALUE AFTER SETUP\n */\n return valueCur;\n }\n /**\n * GET SIZE OF ITEM IN CURRENT TIME\n */\n function GetSizeItem() {\n an.size = {\n 'OuterWidth': M.OuterWidth($anim),\n 'OuterHeight': M.OuterHeight($anim)\n };\n }\n /**\n * SETUP VALUE PLUS DEPENDS ON PROPERTY NAME\n */\n function ValueCurForNumber(name, valueBegin, valueEnd) {\n var nameToFloat = ['opacity'], plus = (valueEnd - valueBegin) * an.xCur;\n // Case: rounded number float\n if ($.inArray(name, nameToFloat) !== -1) {\n plus = Math.round(plus * 1000) / 1000;\n }\n else {\n /**\n * ADDITIONAL 1 FRACTION : ANIMATE SMOOTHER\n */\n plus = Math.round(plus * 10) / 10;\n }\n return valueBegin + plus;\n }\n /**\n * SETUP VALUE OF PROPERTY IS ARRAY[]\n */\n function ValueCurForArray(name, valueBegin, valueEnd) {\n var aValue = [];\n /**\n * SETUP EACH VALUE IN ARRAY[]\n * + Remove element >= 2 : Browser not support Transform 3D\n */\n for (var i = 0, len = valueEnd.length; i < len && !(i >= 2 && !VA.isTf3D); i++) {\n /**\n * CONVERT VALUE BEGIN - END\n */\n var vaEndCur = ConvertValue(name + i, valueEnd[i]), vaBeginCur = ConvertValue(name + i, valueBegin[i]);\n // Case: value 'begin' not exist\n if (vaBeginCur === UNDE)\n vaBeginCur = vaEndCur;\n /**\n * SETUP CURRENT VALUE + STORE IN ARRAY[]\n */\n var plus = (vaEndCur - vaBeginCur) * an.xCur, valueCur = Math.round((vaBeginCur + plus) * 10) / 10;\n aValue.push(valueCur + 'px');\n }\n /**\n * CONVERT ARRAY TO STRING\n */\n return aValue.join(' ');\n }\n /**\n * SETUP NORMAL PROPERTIES AT THE CURRENT TIME\n */\n function StyleNormalCur() {\n var optsCur = myData['opts'][an.optsPos];\n for (var name in optsCur['styleBegin']) {\n var valueBegin = optsCur['styleBegin'][name], valueEnd = optsCur['styleEnd'][name], valueCur;\n /**\n * CASE: PROPERTY HAS VALUE IS ARRAY[]\n */\n if ($.isArray(valueBegin)) {\n valueCur = ValueCurForArray(name, valueBegin, valueEnd);\n }\n else {\n // Convert value String to Number (if posible)\n valueBegin = ConvertValue(name, valueBegin);\n valueEnd = ConvertValue(name, valueEnd);\n // Case: value of property is Number\n if ($.isNumeric(valueBegin) && $.isNumeric(valueEnd)) {\n valueCur = ValueCurForNumber(name, valueBegin, valueEnd);\n }\n else {\n valueCur = valueBegin;\n }\n }\n /**\n * REMOVE STYLES HAVE DEFAULT VALUE\n */\n if (optsCur.isClearStyleDefault && VA['styleDefault'][name] === valueCur) {\n valueCur = '';\n }\n /**\n * STORE VALUE OF CURRENT PROPERTY\n */\n styleCur[name] = valueCur;\n }\n }\n /**\n * SETUP 'TRANSFORM' IN CURRENT TIME\n */\n function StyleTransformCur() {\n /**\n * SETUP CURRENT VALUE EACH TRANSFORM PROPERTIES\n */\n var optsCur = myData['opts'][an.optsPos], tfBegin = optsCur.tfBegin, tfEnd = optsCur.tfEnd, tfCur = {};\n for (var name in tfEnd) {\n // Setup value 'plus' of each properties\n var tfBeginCur = TF.ConvertValueToPX($anim, name, tfBegin[name]), tfEndCur = TF.ConvertValueToPX($anim, name, tfEnd[name]), valuePlus = (tfEndCur - tfBeginCur) * an.xCur, valueCur = tfBeginCur + valuePlus;\n // Value of current property\n tfCur[name] = valueCur;\n }\n /**\n * CONVERT PARTICULAR PROPERTY OF TRANSFORM TO CSS\n */\n var cssTf = TF.ToCss(tfCur, optsCur);\n /**\n * STORE CURRENT TRANSFORM CSS\n */\n var nameTf = VA.prefix + 'transform';\n styleCur[nameTf] = cssTf;\n // Store current Transform into system\n myData.tfCur = tfCur;\n }\n // Initialize Animation\n Init();\n }", "constructor(spacing, width, theta, amplitude, period) {\n this.spacing = 2;\n this.size = 20;\n this.width = 800;\n this.theta = 0;\n this.amplitude = 175;\n this.period = 600;\n this.objs = [];\n }", "function AnimationMetadata() { }", "function AnimationMetadata() { }", "function Legato_Animation( element, run_time )\r\n{\r\n\r\n\t// Store the values.\r\n\tthis.element = $( element );\r\n\tthis.element_properties = Object();\r\n\tthis.run_time = run_time;\r\n\tthis.controller = new Legato_Animation_Controller();\r\n\r\n\tthis.onStart = null;\r\n\tthis.onInterval = null;\r\n\tthis.onAdvance = null;\r\n\tthis.onEventFrame = null;\r\n\tthis.onStop = null;\r\n\tthis.onFinish = null;\r\n\r\n\t// These values are used by the Legato_Animation system internally.\r\n\tthis.status = false;\r\n\tthis.event_frames = new Array();\r\n\r\n\tthis.start_time = null;\r\n\tthis.current_time = null;\r\n\r\n\tthis.begin_width = null;\r\n\tthis.begin_height = null;\r\n\tthis.begin_pos = null;\r\n\tthis.begin_back_color = null;\r\n\tthis.begin_border_color = null;\r\n\tthis.begin_text_color = null;\r\n\tthis.begin_opacity = null;\r\n\r\n\tthis.offset_width = null;\r\n\tthis.offset_height = null;\r\n\tthis.offset_pos = new Legato_Structure_Point();\r\n\tthis.offset_back_color = new Legato_Structure_Color();\r\n\tthis.offset_border_color = new Legato_Structure_Color();\r\n\tthis.offset_text_color = new Legato_Structure_Color();\r\n\tthis.offset_opacity = null;\r\n\r\n\tthis.desired_width = null;\r\n\tthis.desired_height = null;\r\n\tthis.desired_pos = new Legato_Structure_Point();\r\n\tthis.desired_back_color = null;\r\n\tthis.desired_border_color = null;\r\n\tthis.desired_text_color = null;\r\n\tthis.desired_opacity = null;\r\n\r\n}", "create() {\n this.hero = this.matter.add.sprite(this.game.config.width / 2, this.game.config.height / 2, 'hero');\n this.hero.depth = 1200;\n\n this.matter.world.setBounds(0, 0, game.config.width, game.config.height);\n\n this.anims.create({\n key: 'south_stop',\n frames: [{ key: 'hero', frame: '1.png' }]\n });\n\n this.anims.create({\n key: 'north_stop',\n frames: [{ key: 'hero', frame: '17.png' }]\n });\n\n this.anims.create({\n key: 'west_stop',\n frames: [{ key: 'hero', frame: '9.png' }]\n });\n\n this.anims.create({\n key: 'east_stop',\n frames: [{ key: 'hero', frame: '25.png' }]\n });\n\n this.anims.create({\n key: 'south_walk', // southeast in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 1, end: 4 }),\n frameRate: 4,\n repeat: -1\n });\n this.anims.create({\n key: 'north_walk', // northwest in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 17, end: 20 }),\n frameRate: 4,\n repeat: -1\n });\n this.anims.create({\n key: 'west_walk', // southwest in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 9, end: 12 }),\n frameRate: 4,\n repeat: -1\n });\n this.anims.create({\n key: 'east_walk', // northeast in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 25, end: 28 }),\n frameRate: 4,\n repeat: -1\n });\n\n // sorcerer.animations.add('southeast', ['1.png','2.png','3.png','4.png'], 6, true);\n // sorcerer.animations.add('south', ['5.png','6.png','7.png','8.png'], 6, true);\n // sorcerer.animations.add('southwest', ['9.png','10.png','11.png','12.png'], 6, true);\n // sorcerer.animations.add('west', ['13.png','14.png','15.png','16.png'], 6, true);\n // sorcerer.animations.add('northwest', ['17.png','18.png','19.png','20.png'], 6, true);\n // sorcerer.animations.add('north', ['21.png','22.png','23.png','24.png'], 6, true);\n // sorcerer.animations.add('northeast', ['25.png','26.png','27.png','28.png'], 6, true);\n // sorcerer.animations.add('east', ['29.png','30.png','31.png','32.png'], 6, true);\n\n //this.cameras.main.startFollow(this.hero);\n\n this.keyUp = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.UP, true, true);\n this.keyUp.on('down', this.key_down_callback, this);\n this.keyUp.on('up', this.key_up_callback, this);\n\n this.keyDown = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.DOWN, true, true);\n this.keyDown.on('down', this.key_down_callback, this);\n this.keyDown.on('up', this.key_up_callback, this);\n\n this.keyLeft = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.LEFT, true, true);\n this.keyLeft.on('down', this.key_down_callback, this);\n this.keyLeft.on('up', this.key_up_callback, this);\n\n this.keyRight = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.RIGHT, true, true);\n this.keyRight.on('down', this.key_down_callback, this);\n this.keyRight.on('up', this.key_up_callback, this);\n }", "function addAnimation(){\n const Burst1 = new mojs.Burst ({\n parent: animationDiv,\n top: '50%',\n left: '50%', \n radius: {0: 80},\n count: 8,\n children: {\n shape: 'circle',\n fill: {'red':'blue'},\n strokeWidth: 1,\n duration: 600,\n stroke: {'red':'blue'}\n }\n });\n\n\n const Burst2 = new mojs.Burst ({\n parent: animationDiv,\n top: '50%',\n left: '50%', \n radius: {0: 100},\n count: 4,\n children: {\n shape: 'rect',\n fill: 'white',\n strokeWidth: 1,\n duration: 300,\n stroke: 'white'\n }\n });\n\n\n\n const circle1= new mojs.Shape ({\n radius: {0:40},\n parent: animationDiv,\n fill: 'none',\n stroke: 'white',\n strokeWidth:15,\n duration: 300,\n opacity: {1: 0}\n });\n\n const circle2= new mojs.Shape ({\n radius: {0:50},\n parent: animationDiv,\n fill: 'none',\n stroke: 'red',\n strokeWidth:5,\n duration: 400,\n opacity: {1: 0}\n });\n\n\n const circle3= new mojs.Shape ({\n radius: {0:60},\n parent: animationDiv,\n fill: 'none',\n stroke: 'blue',\n strokeWidth:5,\n duration: 500,\n opacity: {1: 0}\n });\n\n const circle4= new mojs.Shape ({\n radius: {0:70},\n parent: animationDiv,\n fill: 'white',\n \n stroke: 'white',\n strokeWidth:5,\n duration: 600,\n opacity: {1: 0}\n });\n\n const timeline = new mojs.Timeline ({\n \n repeat: 0\n }).add(circle4,circle1,circle2,circle3,Burst1,Burst2);\n\n timeline.play();\n}", "function setUpAnim(){\r\n\tanimInstruction = animInstructionsRaw.split(',');\r\n\tanimCurrentInst = 0;\r\n\tmainInput.style.display = \"none\";\r\n\t//\t\tcreate 10 placerholder arrays for points on each line\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\tanimPoints.push([]);\r\n\t\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n\tanimPointPos.push([]);\r\n}", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function addAnimation() {\n const Burst1 = new mojs.Burst({\n parent: animationDiv,\n top: '50%',\n left: '50%',\n radius: {0: 80},\n count: 8,\n children: {\n shape: 'circle',\n fill: {'red': 'blue'},\n strokeWidth: 1,\n duration: 600,\n stroke: {'red': 'blue'}\n }\n });\n\n\n const Burst2 = new mojs.Burst({\n parent: animationDiv,\n top: '50%',\n left: '50%',\n radius: {0: 100},\n count: 4,\n children: {\n shape: 'rect',\n fill: 'white',\n strokeWidth: 1,\n duration: 300,\n stroke: 'white'\n }\n });\n\n\n const circle1 = new mojs.Shape({\n radius: {0: 40},\n parent: animationDiv,\n fill: 'none',\n stroke: 'white',\n strokeWidth: 15,\n duration: 300,\n opacity: {1: 0}\n });\n\n const circle2 = new mojs.Shape({\n radius: {0: 50},\n parent: animationDiv,\n fill: 'none',\n stroke: 'red',\n strokeWidth: 5,\n duration: 400,\n opacity: {1: 0}\n });\n\n\n const circle3 = new mojs.Shape({\n radius: {0: 60},\n parent: animationDiv,\n fill: 'none',\n stroke: 'blue',\n strokeWidth: 5,\n duration: 500,\n opacity: {1: 0}\n });\n\n const circle4 = new mojs.Shape({\n radius: {0: 70},\n parent: animationDiv,\n fill: 'white',\n\n stroke: 'white',\n strokeWidth: 5,\n duration: 600,\n opacity: {1: 0}\n });\n\n const timeline = new mojs.Timeline({\n\n repeat: 0\n }).add(circle4, circle1, circle2, circle3, Burst1, Burst2);\n\n timeline.play();\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 animations() {\n\tarthur.srcX = arthur.currentFrame * arthur.width;\n\tif (arthur.goRight) {\n\t\tarthur.srcY = arthur.goRowRight * arthur.height;\n\t} else if (arthur.goLeft) {\n\t\tarthur.srcY = arthur.goRowLeft * arthur.height;\n\t} else if (arthur.duckRight) {\n\t\tarthur.srcY = arthur.duckRowRight * arthur.height;\n\t} else if (arthur.atkRight) {\n\t\tarthur.srcY = arthur.atkRowRight * arthur.height;\n\t} else if (arthur.jumpRight) {\n\t\tarthur.srcY = arthur.jumpRowRight * arthur.height;\n\t} else if (arthur.die) {\n\t\tarthur.srcY = arthur.dieRowRight * arthur.height;\n\t}\n}", "function animation_frame() {\n var datalen = animationState.order.length,\n styles = animationState.styleArrays,\n curTime = Date.now(), genTime, updateTime,\n position, i, idx, p;\n timeRecords.frames.push(curTime);\n animationState.raf = null;\n position = ((curTime - animationState.startTime) / animationState.duration) % 1;\n if (position < 0) {\n position += 1;\n }\n animationState.position = position;\n\n for (idx = 0; idx < datalen; idx += 1) {\n i = animationState.order[idx];\n p = idx / datalen + position;\n if (p > 1) {\n p -= 1;\n }\n styles.p[i] = p;\n }\n if (animationStyles.fill) {\n for (i = 0; i < datalen; i += 1) {\n styles.fill[i] = styles.p[i] >= 0.1 ? false : true;\n }\n }\n if (animationStyles.fillColor) {\n for (i = 0; i < datalen; i += 1) {\n p = styles.p[i];\n if (p >= 0.1) {\n styles.fillColor[i].r = 0;\n styles.fillColor[i].g = 0;\n styles.fillColor[i].b = 0;\n } else {\n styles.fillColor[i].r = p * 10;\n styles.fillColor[i].g = p * 8.39;\n styles.fillColor[i].b = p * 4.39;\n }\n }\n }\n if (animationStyles.fillOpacity) {\n for (i = 0; i < datalen; i += 1) {\n p = styles.p[i];\n styles.fillOpacity[i] = p >= 0.1 ? 0 : 1.0 - p * 10; // 1 - 0\n }\n }\n if (animationStyles.radius) {\n for (i = 0; i < datalen; i += 1) {\n p = styles.p[i];\n styles.radius[i] = p >= 0.1 ? 0 : 2 + 100 * p; // 2 - 12\n }\n }\n if (animationStyles.stroke) {\n for (i = 0; i < datalen; i += 1) {\n styles.stroke[i] = styles.p[i] >= 0.1 ? false : true;\n }\n }\n if (animationStyles.strokeColor) {\n for (i = 0; i < datalen; i += 1) {\n p = styles.p[i];\n if (p >= 0.1) {\n styles.strokeColor[i].r = 0;\n styles.strokeColor[i].g = 0;\n styles.strokeColor[i].b = 0;\n } else {\n styles.strokeColor[i].r = p * 8.51;\n styles.strokeColor[i].g = p * 6.04;\n styles.strokeColor[i].b = 0;\n }\n }\n }\n if (animationStyles.strokeOpacity) {\n for (i = 0; i < datalen; i += 1) {\n p = styles.p[i];\n styles.strokeOpacity[i] = p >= 0.1 ? 0 : 1.0 - p * p * 100; // (1 - 0) ^ 2\n }\n }\n if (animationStyles.strokeWidth) {\n for (i = 0; i < datalen; i += 1) {\n p = styles.p[i];\n styles.strokeWidth[i] = p >= 0.1 ? 0 : 3 - 30 * p; // 3 - 0\n }\n }\n var updateStyles = {};\n $.each(animationStyles, function (key, use) {\n if (use) {\n updateStyles[key] = styles[key];\n }\n });\n genTime = Date.now();\n pointFeature.updateStyleFromArray(updateStyles, null, true);\n updateTime = Date.now();\n timeRecords.generate.push(genTime - curTime);\n timeRecords.update.push(updateTime - genTime);\n show_framerate();\n if (animationState.mode === 'play') {\n animationState.raf = window.requestAnimationFrame(animation_frame);\n }\n }", "function AnimationSequenceMetadata() { }", "function AnimationSequenceMetadata() { }", "function getAnimSteps(data) {\n\n\t\t\t\t\t\tvar paramarray = data.split(\"animation:\");\n\t\t\t\t\t\tvar params = new Object();\n\n\t\t\t\t\t\tparams.animation = getAnimDatas(newAnimObject(),paramarray[1]);\n\t\t\t\t\t\tvar customarray = paramarray[0].split(';');\n\n\t\t\t\t\t\tjQuery.each(customarray,function(index,param) {\n\t\t\t\t\t\t\tparam = param.split(\":\")\n\t\t\t\t\t\t\tvar w = param[0],\n\t\t\t\t\t\t\t\tv = param[1];\n\t\t\t\t\t\t\tif (w==\"typ\") params.typ = v;\n\t\t\t\t\t\t\tif (w==\"speed\") params.speed = parseInt(v,0)/1000;\n\t\t\t\t\t\t\tif (w==\"start\") params.start = parseInt(v,0)/1000;\n\t\t\t\t\t\t\tif (w==\"elementdelay\") params.elementdelay = parseFloat(v);\n\t\t\t\t\t\t\tif (w==\"ease\") params.ease = v;\n\t\t\t\t\t\t})\n\n\t\t\t\t\treturn params;\n\t\t\t\t}", "function getAnimSteps(data) {\n\n\t\t\t\t\t\tvar paramarray = data.split(\"animation:\");\n\t\t\t\t\t\tvar params = new Object();\n\n\t\t\t\t\t\tparams.animation = getAnimDatas(newAnimObject(),paramarray[1]);\n\t\t\t\t\t\tvar customarray = paramarray[0].split(';');\n\n\t\t\t\t\t\tjQuery.each(customarray,function(index,param) {\n\t\t\t\t\t\t\tparam = param.split(\":\")\n\t\t\t\t\t\t\tvar w = param[0],\n\t\t\t\t\t\t\t\tv = param[1];\n\t\t\t\t\t\t\tif (w==\"typ\") params.typ = v;\n\t\t\t\t\t\t\tif (w==\"speed\") params.speed = parseInt(v,0)/1000;\n\t\t\t\t\t\t\tif (w==\"start\") params.start = parseInt(v,0)/1000;\n\t\t\t\t\t\t\tif (w==\"elementdelay\") params.elementdelay = parseFloat(v);\n\t\t\t\t\t\t\tif (w==\"ease\") params.ease = v;\n\t\t\t\t\t\t})\n\n\t\t\t\t\treturn params;\n\t\t\t\t}", "function sobrePage(do_sobre) {\r\n function startAnimation(element) {\r\n var animationData = {\r\n assets: [],\r\n v: \"4.2.0\",\r\n ddd: 0,\r\n layers: [{\r\n ddd: 0,\r\n ind: 0,\r\n ty: 4,\r\n nm: \"mask\",\r\n td: 1,\r\n ks: {\r\n o: {\r\n k: 100\r\n },\r\n r: {\r\n k: 0\r\n },\r\n p: {\r\n k: [9, 9, 0]\r\n },\r\n a: {\r\n k: [0, 0, 0]\r\n },\r\n s: {\r\n k: [50, 50, 100]\r\n }\r\n },\r\n shapes: [{\r\n ty: \"gr\",\r\n it: [{\r\n ind: 0,\r\n ty: \"sh\",\r\n closed: !0,\r\n ks: {\r\n k: [{\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 0,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [0, -24.375],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [17.125, -.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }]\r\n }, {\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 4,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [17.125, -.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [.125, 26.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }]\r\n }, {\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 8,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [.125, 26.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [-28.5, -.125],\r\n [7.538, 38.672],\r\n [35.125, 33.875]\r\n ]\r\n }]\r\n }, {\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 12,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [-28.5, -.125],\r\n [7.538, 38.672],\r\n [35.125, 33.875]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [.375, -18.25],\r\n [-50.212, 7.672],\r\n [19.75, 38]\r\n ]\r\n }]\r\n }, {\r\n t: 16.0000006516934\r\n }]\r\n },\r\n nm: \"Path 1\"\r\n }, {\r\n ty: \"fl\",\r\n fillEnabled: !0,\r\n c: {\r\n k: [.05, 1, 0, 1]\r\n },\r\n o: {\r\n k: 100\r\n },\r\n nm: \"Fill 1\"\r\n }, {\r\n ty: \"tr\",\r\n p: {\r\n k: [0, 0],\r\n ix: 2\r\n },\r\n a: {\r\n k: [0, 0],\r\n ix: 1\r\n },\r\n s: {\r\n k: [100, 100],\r\n ix: 3\r\n },\r\n r: {\r\n k: 0,\r\n ix: 6\r\n },\r\n o: {\r\n k: 100,\r\n ix: 7\r\n },\r\n sk: {\r\n k: 0,\r\n ix: 4\r\n },\r\n sa: {\r\n k: 0,\r\n ix: 5\r\n },\r\n nm: \"Transform\"\r\n }],\r\n nm: \"Shape 1\"\r\n }],\r\n bounds: {\r\n l: -51,\r\n t: -25,\r\n b: 39,\r\n r: 36\r\n },\r\n ip: 0,\r\n op: 600.000024438501,\r\n st: 0\r\n }, {\r\n ddd: 0,\r\n ind: 1,\r\n ty: 4,\r\n nm: \"circle cheio\",\r\n tt: 1,\r\n ks: {\r\n o: {\r\n k: 100\r\n },\r\n r: {\r\n k: 0\r\n },\r\n p: {\r\n k: [9.01, 9.045, 0]\r\n },\r\n a: {\r\n k: [-12.49, -7.08, 0]\r\n },\r\n s: {\r\n k: [50, 50, 100]\r\n }\r\n },\r\n shapes: [{\r\n ty: \"gr\",\r\n it: [{\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n ty: \"fl\",\r\n fillEnabled: !0,\r\n c: {\r\n k: [1, 1, 1, 1]\r\n },\r\n o: {\r\n k: 100\r\n },\r\n nm: \"Fill 1\"\r\n }, {\r\n ty: \"tr\",\r\n p: {\r\n k: [-12.49, -7.08],\r\n ix: 2\r\n },\r\n a: {\r\n k: [0, 0],\r\n ix: 1\r\n },\r\n s: {\r\n k: [100, 100],\r\n ix: 3\r\n },\r\n r: {\r\n k: 0,\r\n ix: 6\r\n },\r\n o: {\r\n k: 100,\r\n ix: 7\r\n },\r\n sk: {\r\n k: 0,\r\n ix: 4\r\n },\r\n sa: {\r\n k: 0,\r\n ix: 5\r\n },\r\n nm: \"Transform\"\r\n }],\r\n nm: \"Ellipse 1\"\r\n }],\r\n bounds: {\r\n l: -31,\r\n t: -26,\r\n b: 11,\r\n r: 6\r\n },\r\n ip: 1.00000004073083,\r\n op: 128.000005213547,\r\n st: 1.00000004073083\r\n }, {\r\n ddd: 0,\r\n ind: 2,\r\n ty: 4,\r\n nm: \"circle\",\r\n ks: {\r\n o: {\r\n k: 100\r\n },\r\n r: {\r\n k: 0\r\n },\r\n p: {\r\n k: [9.01, 9.045, 0]\r\n },\r\n a: {\r\n k: [-12.49, -7.08, 0]\r\n },\r\n s: {\r\n k: [50, 50, 100]\r\n }\r\n },\r\n shapes: [{\r\n ty: \"gr\",\r\n it: [{\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n ty: \"st\",\r\n fillEnabled: !0,\r\n c: {\r\n k: [1, 1, 1, 1]\r\n },\r\n o: {\r\n k: 100\r\n },\r\n w: {\r\n k: 2\r\n },\r\n lc: 1,\r\n lj: 1,\r\n ml: 4,\r\n nm: \"Stroke 1\"\r\n }, {\r\n ty: \"tr\",\r\n p: {\r\n k: [-12.49, -7.08],\r\n ix: 2\r\n },\r\n a: {\r\n k: [0, 0],\r\n ix: 1\r\n },\r\n s: {\r\n k: [100, 100],\r\n ix: 3\r\n },\r\n r: {\r\n k: 0,\r\n ix: 6\r\n },\r\n o: {\r\n k: 100,\r\n ix: 7\r\n },\r\n sk: {\r\n k: 0,\r\n ix: 4\r\n },\r\n sa: {\r\n k: 0,\r\n ix: 5\r\n },\r\n nm: \"Transform\"\r\n }],\r\n nm: \"Ellipse 1\"\r\n }],\r\n bounds: {\r\n l: -33,\r\n t: -28,\r\n b: 13,\r\n r: 8\r\n },\r\n ip: 0,\r\n op: 127.000005172816,\r\n st: 0\r\n }],\r\n ip: 0,\r\n op: 17.0000006924242,\r\n fr: 29.9700012207031,\r\n w: 18,\r\n h: 18\r\n };\r\n loaderHighPic = bodymovin.loadAnimation({\r\n container: element,\r\n renderer: \"svg\",\r\n loop: !1,\r\n autoplay: !1,\r\n animationData: animationData\r\n })\r\n } /*functions*/\r\n function initHeaderAnim(type) {\r\n \"init\" == type && (TweenMax.set($pageHeader.find(\"h2\"), {\r\n opacity: 0,\r\n y: \"50px\"\r\n }), TweenMax.set($pageHeader.find(\".circle-btn\"), {\r\n scale: 0,\r\n opacity: 1\r\n })), \"start\" == type && (TweenMax.to($pageHeader.find(\"h2\"), 1, {\r\n opacity: 1,\r\n y: \"0px\",\r\n ease: Circ.easeOut\r\n }, .1), TweenMax.to($pageHeader.find(\".circle-btn\"), 1, {\r\n scale: 1,\r\n delay: .5,\r\n ease: Elastic.easeOut.config(1, 1),\r\n onComplete: function() {\r\n TweenMax.set($pageHeader.find(\".circle-btn\"), {\r\n clearProps: \"scale\"\r\n })\r\n }\r\n }), $.doTimeout(700, function() {\r\n $pageHeader.find(\".circle-btn .arrow-down path\").addClass(\"active\")\r\n }))\r\n }\r\n\r\n function scrollTweens() {\r\n 0 == window.pageYOffset ? ($jsMaskDownWrapper.each(function() {\r\n var $this = $(this),\r\n $mask = $(\"<span class='mask-bg'></span>\");\r\n $mask.css({\r\n display: \"block\",\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n \"background-color\": \"#ffffff\"\r\n }), $this.find(\".js-mask-down\").append($mask)\r\n }), $jsMaskLeftWrapper.each(function() {\r\n var $this = $(this),\r\n $mask = $(\"<span class='mask-bg'></span>\");\r\n $mask.css({\r\n display: \"block\",\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n \"background-color\": \"#ffbb02\"\r\n }), $this.find(\".js-mask-left\").append($mask)\r\n }), $jsAnimUpGroup.each(function() {\r\n var $this = $(this);\r\n TweenMax.set($this.children(), {\r\n y: \"50px\",\r\n opacity: 0\r\n })\r\n }), $jsAnimUp.each(function() {\r\n var $this = $(this);\r\n TweenMax.set($this, {\r\n y: \"50px\",\r\n opacity: 0\r\n })\r\n }), $jsAnimReveal.each(function() {\r\n var $this = $(this);\r\n if (\"left\" == $this.attr(\"data-from\")) var offset_x = \"100px\",\r\n offset_y = \"0px\";\r\n if (\"right\" == $this.attr(\"data-from\")) var offset_x = \"-100px\",\r\n offset_y = \"0px\";\r\n if (\"top\" == $this.attr(\"data-from\")) var offset_y = \"100px\",\r\n offset_x = \"0px\";\r\n if (\"down\" == $this.attr(\"data-from\")) var offset_y = \"-100px\",\r\n offset_x = \"0px\";\r\n TweenMax.set($this, {\r\n x: offset_x,\r\n y: offset_y,\r\n opacity: 0\r\n })\r\n })) : ($jsMaskLeftWrapper.addClass(\"js-animated\"), $jsMaskDownWrapper.addClass(\"js-animated\"))\r\n } /*Animation Loop*/\r\n function sobrePage_scroll() {\r\n _raf_loop_id = _rAF_loop(sobrePage_scroll_rAF)\r\n }\r\n\r\n function sobrePage_scroll_rAF() {\r\n var $pageScrollHeader = $(\".page-scroll-header\");\r\n // Avoid calculations if not needed\r\n lastPosition != window.pageYOffset && (window.pageYOffset > lastPosition ? direction = \"down\" : direction = \"up\", lastPosition = window.pageYOffset, $thumbnail.hasClass(\"js-hover\") && $thumbnail.trigger(\"mouseleave\"), lastPosition > 10 && \"down\" == direction && !$_body.hasClass(\"js-scrolled-down\") && ($_body.addClass(\"js-scrolled-down\"), $pageScrollHeader.addClass(\"active\")), lastPosition < 10 && ($_body.removeClass(\"js-scrolled-down\"), $pageScrollHeader.removeClass(\"active\")), verge.inY($sobreTitle, -300) && $sobreTitle.find(\".picto\").addClass(\"active\"), $jsAnimUpGroup.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this.children(), 1, {\r\n y: 0,\r\n opacity: 1,\r\n ease: Power2.easeOut\r\n }, .2))\r\n }), $jsAnimUp.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this, 1, {\r\n y: 0,\r\n opacity: 1,\r\n ease: Power2.easeOut\r\n }, .2))\r\n }), $jsAnimReveal.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated active\"), TweenMax.staggerTo($this, 1, {\r\n x: 0,\r\n y: 0,\r\n opacity: 1,\r\n ease: Expo.easeOut\r\n }, .2))\r\n }), $jsMaskDownWrapper.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this.find(\".mask-bg\"), 1, {\r\n y: \"100%\",\r\n ease: Circ.easeInOut\r\n }, .2))\r\n }), $jsMaskLeftWrapper.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -700) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this.find(\".mask-bg\"), .8, {\r\n x: \"101%\",\r\n ease: Circ.easeInOut\r\n }, .1))\r\n }))\r\n }\r\n if (!do_sobre) return $_window.off(\"scroll.sobrePage\"), $_body.removeClass(\"sobre-page\"), !1;\r\n $_window.on(\"scroll.sobrePage\", sobrePage_scroll), $_body.addClass(\"sobre-page\");\r\n var loaderHighPic, lastPosition = -1,\r\n $pageHeader = $(\".page-header\"),\r\n $fullImages = $(\".full-images\"),\r\n $thumbnail = $(\".thumbnail\"),\r\n $jsMaskDownWrapper = ($(\".slideshow-container\"), $(\".js-mask-down-wrapper\")),\r\n $jsMaskLeftWrapper = $(\".js-mask-left-wrapper\"),\r\n $hiddenProtocols = $(\".hidden-protocols\"),\r\n $showHideProtocols = $(\".show-more-protocols\");\r\n $sobreTitle = $(\".sobre-title\"), $jsAnimUpGroup = $(\".js-anim-up-group\"), $jsAnimUp = $(\".js-anim-up\"), $jsAnimReveal = $(\".js-anim-reveal\"), /*Initializations*/\r\n initHeaderAnim(\"init\"), initHeaderAnim(\"start\"), pressAnime(), scrollTweens(), /*events*/\r\n $_body.hasClass(\"mobile\") ? (window.innerWidth > 767 ? $(\".slideshow-container\").vTicker({\r\n speed: 500,\r\n pause: 1500,\r\n height: 60,\r\n mousePause: !1\r\n }) : $(\".slideshow-container\").vTicker({\r\n speed: 500,\r\n pause: 1500,\r\n height: 40,\r\n mousePause: !1\r\n }), $thumbnail.on(\"click\", function() {\r\n var $this = $(this),\r\n $bgHover = $this.find(\".bg-hover\"),\r\n $goAnime = $this.find(\".go-anime\"),\r\n $closeToolTip = $this.find(\".close-tooltip\");\r\n if (!$this.hasClass(\"active\")) {\r\n if ($.each($thumbnail, function() {\r\n $(this).hasClass(\"active\") && ($(this).toggleClass(\"active\"), TweenMax.to($(this).find(\".close-tooltip\"), .1, {\r\n autoAlpha: 0,\r\n y: 0\r\n }), TweenMax.to($(this).find(\".bg-hover\"), .1, {\r\n delay: .35,\r\n autoAlpha: 0\r\n }), TweenMax.staggerTo($(this).find(\".go-anime\"), .4, {\r\n opacity: 0,\r\n y: 0\r\n }, .2))\r\n }), $this.addClass(\"js-hover\"), !$this.hasClass(\"js-hover\")) return !1;\r\n $this.hasClass(\"active\") || ($this.toggleClass(\"active\"), TweenMax.set($closeToolTip, {\r\n y: 10\r\n }), TweenMax.to($closeToolTip, .1, {\r\n delay: .25,\r\n autoAlpha: 1,\r\n y: 0\r\n }), TweenMax.to($bgHover, .1, {\r\n autoAlpha: 1\r\n }), TweenMax.staggerTo($goAnime, .4, {\r\n opacity: 1,\r\n y: -10,\r\n delay: .15\r\n }, .2))\r\n }\r\n }), $(document).on(\"click\", \".thumbnail.active .close-tooltip\", function() {\r\n var $this = $(this),\r\n $thisThumb = $this.parent(\".thumbnail\"),\r\n $bgHover = $this.parent(\".thumbnail\").find(\".bg-hover\"),\r\n $goAnime = $this.parent(\".thumbnail\").find(\".go-anime\");\r\n $thisThumb.toggleClass(\"active\"), TweenMax.to($this, .1, {\r\n autoAlpha: 0,\r\n y: 10\r\n }), TweenMax.to($bgHover, .1, {\r\n delay: .35,\r\n autoAlpha: 0\r\n }), TweenMax.staggerTo($goAnime, .4, {\r\n opacity: 0,\r\n y: 0\r\n }, .2)\r\n })) : ($(\".slideshow-container\").vTicker({\r\n speed: 500,\r\n pause: 1500,\r\n height: 60,\r\n mousePause: !1\r\n }), $thumbnail.on(\"mouseenter\", function(e) {\r\n var $this = $(this),\r\n $bgHover = $this.find(\".bg-hover\"),\r\n $goAnime = $this.find(\".go-anime\"),\r\n imageTarget = $this.attr(\"data-image-target\"),\r\n $loader = $this.find(\".loader\"),\r\n offset = $(this).offset();\r\n e.pageX - offset.left, e.pageY - offset.top;\r\n // relativeX = relativeX-$bgHover.width()/2;\r\n // relativeY = relativeY-$bgHover.height()/2;\r\n // $bgHover.css({\r\n // \"left\": 0,\r\n // \"top\": 0,\r\n // 'width':'100%',\r\n // 'height':'100%'\r\n // \"transform\": \"scale(2)\",\r\n // \"-webkit-transform\": \"scale(2)\"\r\n // });\r\n //TweenMax.to($bgHover, .1, {autoAlpha:.9});\r\n return startAnimation($loader[0]), $this.find(\"img\").hide(), $this.addClass(\"js-hover\"), !!$this.hasClass(\"js-hover\") && (TweenMax.to($bgHover, .1, {\r\n opacity: .9,\r\n visibility: \"visible\"\r\n }), TweenMax.staggerTo($goAnime, .4, {\r\n opacity: 1,\r\n y: 0,\r\n delay: .15\r\n }, .2), void $.doTimeout(0, function() {\r\n return !!$this.hasClass(\"js-hover\") && ($loader.css(\"opacity\", 1), loaderHighPic.play(), void loaderHighPic.addEventListener(\"complete\", function() {\r\n $(\".titles-columns\").css(\"opacity\", 0), $thumbnail.css(\"opacity\", .15), $this.css(\"opacity\", 1), $loader.css(\"opacity\", 0), TweenMax.to($fullImages.find(\".image-wrapper[data-image='\" + imageTarget + \"']\"), .2, {\r\n autoAlpha: 1,\r\n ease: Power4.easeOut,\r\n onComplete: function() {\r\n $fullImages.find(\".image-wrapper[data-image='\" + imageTarget + \"']\").addClass(\"js-scale\")\r\n }\r\n })\r\n }))\r\n }))\r\n }).on(\"mouseleave\", function(e) {\r\n var $this = $(this),\r\n $bgHover = $this.find(\".bg-hover\"),\r\n $loader = $this.find(\".loader\"),\r\n $goAnime = $this.find(\".go-anime\");\r\n $this.find(\".close-tooltip\");\r\n $this.removeClass(\"js-hover\"), $this.find(\"img\").show(), $(\".titles-columns\").css(\"opacity\", 1), TweenMax.to($bgHover, .1, {\r\n autoAlpha: 0\r\n }), TweenMax.killTweensOf($goAnime), TweenMax.killTweensOf($fullImages.find(\".image-wrapper\")), $thumbnail.css(\"opacity\", \"\"), TweenMax.to($fullImages.find(\".image-wrapper\"), .2, {\r\n autoAlpha: 0,\r\n ease: Power4.easeOut\r\n }), $fullImages.find(\".image-wrapper\").removeClass(\"js-scale\"), $loader.css(\"opacity\", 0), loaderHighPic.destroy(),\r\n // $bgHover.css({\r\n // \"transform\": \"scale(0)\",\r\n // \"-webkit-transform\": \"scale(0)\"\r\n // });\r\n TweenMax.to($goAnime, .2, {\r\n opacity: 0,\r\n y: 10\r\n })\r\n })), $showHideProtocols.on(\"click\", function() {\r\n var $this = $(this);\r\n $hiddenProtocols.toggleClass(\"active\"), TweenMax.set($hiddenProtocols.find(\"p\"), {\r\n y: \"20px\"\r\n }), $hiddenProtocols.hasClass(\"active\") ? ($this.text(\"Esconder\"), TweenMax.to($hiddenProtocols, 1.2, {\r\n autoAlpha: 1,\r\n height: $hiddenProtocols.find(\"p\").height() * $hiddenProtocols.find(\"p\").length,\r\n ease: Expo.easeOut\r\n }), TweenMax.staggerTo($hiddenProtocols.find(\"p\"), .5, {\r\n y: \"0px\",\r\n autoAlpha: 1,\r\n ease: Power4.easeOut\r\n }, .05)) : ($this.text(\"Mostrar Mais\"), TweenMax.set($hiddenProtocols.find(\"p\"), {\r\n y: \"20px\",\r\n autoAlpha: 0\r\n }), TweenMax.to($hiddenProtocols, .3, {\r\n autoAlpha: 0,\r\n height: \"0\"\r\n }))\r\n })\r\n}", "buildParams() {\n const classOpts = {\n flip: this.flip,\n spin: this.spin,\n pulse: this.pulse,\n border: this.border,\n inverse: this.inverse,\n size: this.size || null,\n pull: this.pull || null,\n rotate: this.rotate || null,\n fixedWidth: this.fixedWidth,\n };\n const parsedTransform = typeof this.transform === 'string' ? _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_3__[\"parse\"].transform(this.transform) : this.transform;\n return {\n transform: parsedTransform,\n classes: [...faClassList(classOpts), ...this.classes],\n title: this.title,\n styles: this.styles,\n };\n }", "function AnimationAnimateMetadata() { }", "function AnimationAnimateMetadata() { }", "static fromFrames(frames) {\nvar anim;\n//----------\nanim = new CASAnimation();\nanim.setFromFrames(frames);\nreturn anim;\n}", "function initStage015(stage){\n\nvar item;\n\n// Percent of one unit. if you want to change unit size, change this.\nvar u=8;\n\n/////Animation Parameter/////\n//\n//dsp :display (true/false) startIndex.... display or hide\n//x : position x (percent)\n//y : position y (percent)\n//w : width (percent)\n//h : height (percent)\n//bgc : background-color\n//bdc : border-color\n//img : background-image (filename)\n//opc : opacity (0.0....1.0) default=1.0\n//z : z-index (default=2)\n//wd : character of word\n\n//Answer String\n//helper original string=kkfh\" abc defghi\"kklkk0\" abc defghi\"kkfe\" abc defghi\"kk\nstage.setAnsStr(\"kkfhkklkk0kkfekk\");\nitem=stage.createNewItem();\n\n//class name\nitem.setName(\"vimrio\");\n\n//frame offset. default startindex=0\nitem.setFrameStartIndex(0);\nstage.addItem(item);\n\n//first frame\n//1 start\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":11*u,\"w\":u,\"h\":u,\"bgc\":\"transparent\",\"bdc\":\"blue\",\"img\":\"vimrio01.png\",\"z\":5,\"opc\":1.0,\"wd\":\"\"});\n//following next frames\n\n//2 k\nitem.addAnimation({\"y\":10*u});\n//3 k\nitem.addAnimation({\"y\":9*u});\n//4 f\nitem.addAnimation({\"x\":10*u});\n//5 k\nitem.addAnimation({\"y\":8*u});\n//6 k\nitem.addAnimation({\"y\":7*u});\n//7 l\nitem.addAnimation({\"x\":11*u});\n//8 k\nitem.addAnimation({\"y\":6*u});\n//9 k\nitem.addAnimation({\"y\":5*u});\n//10 0\nitem.addAnimation({\"x\":1*u});\n//11 k\nitem.addAnimation({\"y\":4*u});\n//12 k\nitem.addAnimation({\"y\":3*u});\n//13 f\nitem.addAnimation({\"x\":7*u});\n//14 k\nitem.addAnimation({\"y\":2*u});\n//15 k\nitem.addAnimation({\"y\":1*u});\n\n//1 goal\nitem=stage.createNewItem();\nitem.setName(\"goal\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"goal01.png\",\"bgc\":\"yellow\",\"bdc\":\"yellow\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" abc defghi\" [a] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"a\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [b] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"b\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [c] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"c\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [ ] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" abc defghi\" [d] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"d\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [e] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"e\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [f] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"f\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [g] 9\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"g\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [h] 10\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"h\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [i] 11\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"i\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" abc defghi\" [a] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"a\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [b] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"b\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [c] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"c\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [ ] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" abc defghi\" [d] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"d\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [e] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"e\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [f] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"f\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [g] 9\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"g\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [h] 10\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"h\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [i] 11\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"i\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" abc defghi\" [a] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"a\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [b] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"b\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [c] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"c\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [ ] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" abc defghi\" [d] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"d\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [e] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"e\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [f] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"f\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [g] 9\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"g\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [h] 10\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"h\"});\nstage.addItem(item);\n\n//word \" abc defghi\" [i] 11\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"i\"});\nstage.addItem(item);\n\n\n\n//wall 1\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 2\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 3\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":0*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 4\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 5\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 6\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 7\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 8\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 9\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 10\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 11\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 12\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 13\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 14\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 15\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 16\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 17\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 18\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 19\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 20\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 21\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 22\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 23\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 24\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 25\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 26\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 27\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 28\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 29\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 30\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 31\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 32\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 33\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 34\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 35\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 36\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 37\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 38\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 39\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 40\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 41\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 42\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 43\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 44\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 45\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 46\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 47\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 48\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 49\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 50\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 51\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 52\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 53\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 54\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 55\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 56\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 57\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 58\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 59\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 60\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 61\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 62\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 63\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 64\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 65\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 66\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 67\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 68\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 69\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 70\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 71\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 72\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 73\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":12*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 74\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 75\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 76\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 77\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 78\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":12*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n\n}", "function randomizeParameters() {\n CS.strokeS=randomRGBA();\n CS.fillS=randomRGBA();\n CS.lineW=Math.floor(Math.random()*9)+1;\n CS.brushSize=Math.floor(Math.random()*99)+1;\n updateControls();\n // canvas.dispatchEvent(new Event('mousemove')); // trigger updating in place of the brush on the preview layer\n //TODO trigger redraw \"in-place\" on new random event\n }", "function createFxNow(){setTimeout(function(){fxNow = undefined;});return fxNow = jQuery.now();} // Generate parameters to create a standard animation", "function Animations() {\n this.x = 0;\n this.y = 0;\n this.scale = 0\n this.\n}", "function page_animations() {\n\n var headerTl = new TimelineMax();\n\n headerTl.to('header', 0.25 ,{ opacity: 1})\n .to('header .logo h2', 0.25 ,{ opacity: 1})\n .staggerTo($('.color-box'), 0.3 ,{ opacity: 1}, 0.15, \"header\")\n .staggerTo($('#raw, #build'), 0.3 ,{ opacity: 0.3}, 0.15)\n .staggerTo($('.preview-window, .status'), 0.5 ,{ opacity: 1}, 0.15, \"header\")\n .to($('.tutorial, .about, footer'), 0.25 ,{ opacity: 1}, \"header\");\n\n\n\n // Animates footer heart.\n TweenMax.to('#heart', 1, {scale: 1.2, repeat: -1});\n\n // Animates Tutorial navigation.\n // Mouse in and out need to be monitored.\n $('.tutorial nav img').hover(over, out);\n function over(){\n TweenMax.to(this, 0.25, {y:5});\n //TweenMax.to('.tutorial_slides img', 1, {rotationY:360, immediateRender: false});\n }\n function out(){\n TweenMax.to(this, 0.25, {y:0});\n //TweenMax.to('.tutorial_slides img', 0, {rotationY:0});\n }\n\n}", "function genFx(type,includeWidth){var which,attrs={height:type},i=0;// if we include width, step value is 1 to do all cssExpand values,\n// if we don't include width, step value is 2 to skip over Left and Right\n includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs[\"margin\"+which]=attrs[\"padding\"+which]=type;}if(includeWidth){attrs.opacity=attrs.width=type;}return attrs;}// Generate shortcuts for custom animations", "createAnimations() {\r\n //#region Idle animation\r\n // Idle front\r\n this.anims.create({\r\n key: 'idle_front',\r\n frames: [\r\n {\r\n key: 'idle_front_0'\r\n },\r\n {\r\n key: 'idle_front_1'\r\n },\r\n {\r\n key: 'idle_front_2'\r\n },\r\n {\r\n key: 'idle_front_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle back\r\n this.anims.create({\r\n key: 'idle_back',\r\n frames: [\r\n {\r\n key: 'idle_back_0'\r\n },\r\n {\r\n key: 'idle_back_1'\r\n },\r\n {\r\n key: 'idle_back_2'\r\n },\r\n {\r\n key: 'idle_back_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle side\r\n this.anims.create({\r\n key: 'idle_side',\r\n frames: [\r\n {\r\n key: 'idle_side_0'\r\n },\r\n {\r\n key: 'idle_side_1'\r\n },\r\n {\r\n key: 'idle_side_2'\r\n },\r\n {\r\n key: 'idle_side_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n\r\n //#region Run animations\r\n\r\n // Run front\r\n this.anims.create({\r\n key: 'run_front',\r\n frames: [\r\n {\r\n key: 'run_front_0'\r\n },\r\n {\r\n key: 'run_front_1'\r\n },\r\n {\r\n key: 'run_front_2'\r\n },\r\n {\r\n key: 'run_front_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run back\r\n this.anims.create({\r\n key: 'run_back',\r\n frames: [\r\n {\r\n key: 'run_back_0'\r\n },\r\n {\r\n key: 'run_back_1'\r\n },\r\n {\r\n key: 'run_back_2'\r\n },\r\n {\r\n key: 'run_back_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run side\r\n this.anims.create({\r\n key: 'run_side',\r\n frames: [\r\n {\r\n key: 'run_side_0'\r\n },\r\n {\r\n key: 'run_side_1'\r\n },\r\n {\r\n key: 'run_side_2'\r\n },\r\n {\r\n key: 'run_side_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n }", "constructor(){\n this.inProgressAnimation;\n this.elementToAnimate;\n this.animationDuration;\n }", "getSignAndFrameInfo() {\n//------------------\n// Handle frame beyond end of animation\nif (this.fCur === this.fCount) {\nreturn [\"[none]\", this.signs.length, this.fCur];\n} else {\n// Rely on @frameCur being set according to @fCur\nreturn [this.frameCur.sign.gloss, this.frameCur.sign.i, this.fCur];\n}\n}", "static create(aframes, fps) {\nvar aa;\n//------\naa = new AmbientAnim();\naa.set(aframes, fps);\nreturn aa;\n}", "function createAnimation(begin, easing, attribute, fill, from, to, dur) {\n\t //Create the animation\n\t var animation = document.createElement('a-animation');\n\n\t //Set all of the given attributes\n\t begin && animation.setAttribute('begin', begin);\n\t easing && animation.setAttribute('easing', easing);\n\t attribute && animation.setAttribute('attribute', attribute);\n\t fill && animation.setAttribute('fill', fill);\n\t from && animation.setAttribute('from', from);\n\t to && animation.setAttribute('to', to);\n\t dur && animation.setAttribute('dur', dur);\n\n\t return animation;\n\t}", "generateGhostAnimation(sprite) {\n this.createAnimation(`${sprite}WalkLeft`, -1, 5, sprite, 'side_walk_');\n this.createAnimation(`${sprite}WalkRight`, -1, 5, sprite, 'right_walk_');\n this.createAnimation(`${sprite}WalkBackLeft`, -1, 5, sprite, 'back_side_walk_');\n this.createAnimation(`${sprite}WalkBackRight`, -1, 5, sprite, 'back_right_walk_');\n this.createAnimation(`${sprite}WalkBack`, -1, 5, sprite, 'back_walk_');\n this.createAnimation(`${sprite}WalkForward`, -1, 5, sprite, 'front_walk_');\n this.createAnimation(`${sprite}IdleForward`, -1, 5, sprite, 'front_stand_');\n this.createAnimation(`${sprite}IdleBack`, -1, 5, sprite, 'back_stand_');\n this.createAnimation(`${sprite}Hit`, -1, 5, sprite, 'front_hurt_');\n this.createAnimation(`${sprite}LeftHit`, -1, 5, sprite, 'side_hurt_');\n this.createAnimation(`${sprite}RightHit`, -1, 5, sprite, 'right_hurt_');\n this.createAnimation(`${sprite}BackHit`, -1, 5, sprite, 'back_hurt_');\n }", "putAnimationBoxes() {\n let cf = this.working_model.frames[this.current_frame];\n\n this.animation_display.selection = {\n x: cf.x,\n y: cf.y,\n w: cf.width,\n h: cf.height\n };\n this.animation_display.sprite_origin = {\n x: cf.offset_x,\n y: cf.offset_y\n };\n }", "function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();} // Generate parameters to create a standard animation", "function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return fxNow=jQuery.now();} // Generate parameters to create a standard animation", "setAnimation(levelName,entityName=`entity${this.data.id}`){ \n this.animationName = entityName // Set animation name as member variable\n $.keyframe.define([{ // Dynamically create keyframe animation\n name: `${levelName}_${entityName}_anim`,\n '100%': {'background-position': `-${this.data.entity.crop}px`} \n }]);\n }", "function initConstants()\n {\n constants.delay = 12; \n constants.initialTheta = 0;\n constants.thetaDelta = 0.3;\n svgElement = document.getElementById(\"svgElement\");\n transformObject = svgElement.createSVGTransform();\n transformObject2 = svgElement.createSVGTransform();\n }", "function renderAnimation(ctx, width, height, angle, length) {\n length = length * 200;\n // Attachment of the pendulum\n var baseX = width / 2;\n var baseY = 50;\n var weightX = baseX + length * Math.sin(angle);\n var weightY = baseY + length * Math.cos(angle);\n ctx.clearRect(0, 0, width, height);\n ctx.beginPath();\n ctx.fillStyle = \"#2B2\";\n ctx.arc(baseX, baseY, 5, 0, 2 * Math.PI);\n ctx.fill();\n ctx.beginPath();\n ctx.strokeStyle = \"#000\";\n ctx.moveTo(baseX, baseY);\n ctx.lineTo(weightX, weightY);\n ctx.stroke();\n ctx.beginPath();\n ctx.fillStyle = \"#22B\";\n ctx.arc(weightX, weightY, 10, 0, 2 * Math.PI);\n ctx.fill();\n}", "setFrameProperties(numberOfAnimations, indexAnimation) {\n this.frame.width = this.img.width / this.numberOfFrames\n this.frame.height = this.img.height / numberOfAnimations\n this.frame.posX = 0\n this.frame.posY = this.frame.height * indexAnimation\n }", "function output5() {\n var element = document.getElementById(\"output\");\n element.innerHTML = \"/*CSS*/ <br />\"\n + \".scenario5 { <br />\"\n + g_tab + scenarioTransformValues + \"<br />\"\n + g_tab + scenarioDurationValues + \"<br />\"\n + g_tab + scenarioDelayValues + \"<br />\"\n + g_tab + scenarioTimFunValues + \"<br />\"\n + \"}<br />\"\n + \"@keyframes animation2D { <br />\"\n + d_tab + scenarioKeyfrom + \"<br />\"\n + d_tab + scenarioKey50 + \"<br />\"\n + d_tab + scenarioKeyto + \"<br />\"\n + g_tab + \"} <br />\";\n }", "function animate_NAff() {\n defo= (defo+1.0) % 180\n loadVertices();\n}", "function animationSetUp() {\n // Pacman's frames\n for (let i = 0; i < 5; i++) {\n for (let j = 0; j < 4; j++) {\n let frame = pacmanImg.get(j * 32, i * 32, 32, 32)\n pacmanFrames.push(frame)\n }\n }\n\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 2; j++) {\n leftImages.push(leftGhosts.get(j * 32, i * 32, 32, 32))\n rightImages.push(rightGhosts.get(j * 32, i * 32, 32, 32))\n upImages.push(upGhosts.get(j * 32, i * 32, 32, 32))\n downImages.push(downGhosts.get(j * 32, i * 32, 32, 32))\n }\n }\n}", "function initialisationOfVariables() {\n gravity = 9.8; /** Initial graviational value of environmetn */\n mass_of_flywheel = 5; /** Initial mass of fly wheel */\n diameter_of_flywheel = 10; /** Initial diameterof fly wheel */\n mass_of_rings = 200; /** Initial mass of hanging weight */\n diameter_of_axle = 2; /** Initial diameter of axl of fly wheel */\n no_of_wound = 1; /** Initial number of wounds on fly wheel */\n rotation_speed = wheel_rotation_speed = 33600/4; /** Initially speed rate of fly wheel in milli seconds */\n speed_correction = 2.0001; /** Speed correction value for adjusting the speed of fly wheel */\n thread_anim_frame = 0; /** First frame of thread animation image */\n time_slots =[]; /** Array store the time taken for each rotation */\n time_slot_indx = 0; /** Index of time slot array */\n line_mask = new createjs.Shape();\n line_mask.name = \"line_mask\";\n rotation = 0;\n rotation_decimal = 0;\n line_mask.graphics.drawRect(300, 0, 200, 555);\n line_mask.y = 0;\n long_string.mask = line_mask;\n thread_anim_width = 199.869; /** Variable to indicate the width of each frame of thread animation image */\n wound = new createjs.Shape(); /** Shape object to create wound over axl of fly wheel */\n string_x_pos = 0; /** Initial position of string wounded over axl of fly wheel */\n itration = 0; /** Variable to increment the length of long string while releasing string */\n x_decrement = 0; /** Variable to set the horizontal position of long string whilw releasing the string */\n drawLongString(385); /** Function to draw hanging string */\n rolling = false; /** Variable to indicate that strating of fly wheel rotation, and it used to differentiate initial wheel rotation and wheel rotation after pause */\n INTERVAL = 0.2; /** Basic time interval of simulation(200 milli second) */\n total_rotation = 360; /** One roation of fly wheel */\n angular_velocity = 0; /** Initial value of angular velocity */\n angular_distance = 0; /** Initial value of angular distance */\n number_of_rotation = 0; /** Initial value of number of rotation */\n final_rotation = false;\n getChildName(\"height_txt\").text = \"02cm\";\n}", "function setItemParams(themeNames) {\n\n themes.beach.items.beachball = {\n posX: 300, posY: 250, scale: 1, rotation: 10,\n movX: 20, movY: 70, scaleTo: 1, duration: 2, \n easing: \"BounceEaseOut\"};\n \n themes.beach.items.bucket = {posX: 200, posY: 300, scale: 0.6, rotation: 10,\n movX: 0, movY: 0, scaleTo: 0.6, duration: 1, easing: \"StrongEaseInOut\"};\n themes.beach.items.crab = {posX: 300, posY: 300, scale: 0.9,\n movX: 30, movY: 0, scaleTo: 0.9, duration: 1, easing: \"EaseOut\"};\n themes.beach.items.jellyfish = {posX: 300, posY: 100, scale: 1,\n movX: 30, movY: -40, scaleTo: 1, duration: 2, easing: \"EaseInOut\"};\n themes.beach.items.lifeguard = {posX: 300, posY: 200, scale: 1.1,\n movX: -20, movY: 0, scaleTo: 1.1, duration: 2, easing: \"Linear\"};\n themes.beach.items.sandcastle = {posX: 350, posY: 500, scale: 0.1,\n movX: 0, movY: -100, scaleTo: 0.9, duration: 4, easing: \"StrongEaseInOut\"};\n themes.beach.items.seagull = {posX: 200, posY: 100, scale: 0.7, rotation: 5,\n movX: -100, movY: 50, scaleTo: 0.8, duration: 2, easing: \"EaseInOut\"};\n themes.beach.items.seashell = {posX: 400, posY: 280, scale: 0.4,\n movX: 0, movY: 20, scaleTo: 1.1, duration: 2, easing: \"Linear\"};\n themes.beach.items.towel = {posX: 100, posY: 350, scale: 0,\n movX: 00, movY: 0, scaleTo: 1.2, duration: 1, easing: \"StrongEaseInOut\"};\n themes.beach.items.umbrella = {posX: 80, posY: -40, scale: 1,\n movX: 10, movY: 20, scaleTo: 1, duration: 1, easing: \"StrongEaseInOut\"};\n\n themes.home.items.backyard = {posX: 100, posY: 0, scale: 0.88,\n movX: 0, movY: 0, scaleTo: 0.9, duration: 1, easing: \"Linear\"};\n themes.home.items.bath = {posX: 100, posY: 200, scale: .99,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.bed = {posX: 80, posY: 250, scale: .99,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.fridge = {posX: 200, posY: 20, scale: 0.97,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.lounge = {posX: 190, posY: 170, scale: 0.99,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.oven = {posX: 100, posY: 200, scale: 0.9,\n movX: 0, movY: 0, scaleTo: 0.92, duration: 1, easing: \"Linear\"};\n themes.home.items.parents = {posX: 270, posY: 250, scale: 0.9,\n movX: 0, movY: 20, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.toilet = {posX: 280, posY: 180, scale: 0.99,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.tv = {posX: 280, posY: 60, scale: .99,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.home.items.washing_machine = {posX: 400, posY: 160, scale: 0.98,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n\n themes.farm.items.chicken = {posX: 675, posY: 420, scale: 0.8,\n movX: -20, movY: 0, scaleTo: 0.8, duration: 1, easing: \"EaseInOut\"};\n themes.farm.items.cow = {posX: 350, posY: 350, scale: 1,\n movX: -20, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.farm.items.duck = {posX: 540, posY: 380, scale: 1,\n movX: -20, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.farm.items.farmer = {posX: 600, posY: 380, scale: 0.97,\n movX: 0, movY: 5, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.farm.items.horse = {posX: 260, posY: 150, scale: 1,\n movX: -20, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.farm.items.goat = {posX: 380, posY: 340, scale: 1,\n movX: 20, movY: 0, scaleTo: 1, duration: 1, easing: \"EaseInOut\"};\n themes.farm.items.pig = {posX: 350, posY: 380, scale: 1,\n movX: 20, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.farm.items.scarecrow = {posX: 300, posY: 280, scale: 1,\n movX: 0, movY: 0, scaleTo: 1.2, duration: 1, easing: \"EaseInOut\"};\n themes.farm.items.sheep = {posX: 350, posY: 370, scale: 1,\n movX: -20, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.farm.items.tractor = {posX: 230, posY: 250, scale: 0.98,\n movX: -20, movY: 10, scaleTo: 1, duration: 1, easing: \"Linear\"};\n\n themes.pets.items.bird = {posX: 180, posY: 390, scale: 1,\n movX: 20, movY: 0, scaleTo: 1, duration: 1, easing: \"EaseInOut\"};\n themes.pets.items.goldfish = {posX: 280, posY: 280, scale: 1,\n movX: -30, movY: 0, scaleTo: 1, duration: 2, easing: \"Linear\"};\n themes.pets.items.guineapig = {posX: 290, posY: 200, scale: 1,\n movX: -20, movY: 0, scaleTo: 1, duration: 4, easing: \"Linear\"};\n themes.pets.items.hermitcrab = {posX: 310, posY: 290, scale: 1,\n movX: 20, movY: 0, scaleTo: 1, duration: 4, easing: \"Linear\"};\n themes.pets.items.kitten = {posX: 430, posY: 370, scale: 0.95,\n movX: 0, movY: 0, scaleTo: 1, duration: 4, easing: \"Linear\"};\n themes.pets.items.lamb = {posX: 430, posY: 270, scale: 1,\n movX: 20, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.pets.items.mouse = {posX: 420, posY: 220, scale: 1,\n movX: 0, movY: -20, scaleTo: 1, duration: 4, easing: \"Linear\"};\n themes.pets.items.puppy = {posX: 385, posY: 280, scale: 1, rotation: -3,\n movX: -5, movY: 10, scaleTo: 1, duration: 1, easing: \"EaseInOut\"};\n themes.pets.items.rabbit = {posX: 290, posY: 270, scale: 1,\n movX: 10, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.pets.items.turtle = {posX: 390, posY: 251, scale: 1, rotation: 3,\n movX: 10, movY: 0, scaleTo: 1, duration: 2, easing: \"Linear\"};\n\n themes.picnic.items.ants = {posX: 180, posY: 320, scale: 1,\n movX: 50, movY: 0, scaleTo: 1, duration: 2, easing: \"EaseInOut\"};\n themes.picnic.items.bbq = {posX: 180, posY: 320, scale: 0,\n movX: 50, movY: 0, scaleTo: 0, duration: 2, easing: \"EaseInOut\"};\n themes.picnic.items.boomerang = {posX: 270, posY: 150, scale: 1, rotation: 360,\n movX: -200, movY: 0, scaleTo: 0.8, duration: 2, easing: \"Linear\"};\n themes.picnic.items.park_bench = {posX: 80, posY: 30, scale: 0.9,\n movX: 0, movY: 0, scaleTo: 0.9, duration: 1, easing: \"Linear\"};\n themes.picnic.items.picnic_basket = {posX: 120, posY: 320, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 4, easing: \"Linear\"};\n themes.picnic.items.picnic_blanket = {posX: 240, posY: 260, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 4, easing: \"Linear\"};\n themes.picnic.items.tennisball = {posX: 380, posY: 210, scale: 1,rotation: 90,\n movX: -130, movY: 20, scaleTo: 1, duration: 2, easing: \"Linear\"};\n \n themes.playground.items.slide = {posX: 200, posY: 50, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.playground.items.swings = {posX: 150, posY: 130, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.playground.items.trampoline = {posX: 230, posY: 120, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.playground.items.tunnel = {posX: 260, posY: 150, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n\n themes.school.items.blackboard = {posX: 240, posY: 80, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.school.items.lunchbox = {posX: 320, posY: 170, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.school.items.pencils = {posX: 530, posY: 400, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.school.items.singing = {posX: 230, posY: 200, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n\n themes.shops.items.icecream_truck = {posX: 40, posY: 180, scale: 1,rotation: -4,\n movX: -200, movY: 100, scaleTo: 1, duration: 4, easing: \"EaseIn\"};\n themes.shops.items.money = {posX: 250, posY: 90, scale: 1.1,\n movX: 0, movY: 0, scaleTo: 1.1, duration: 1, easing: \"Linear\"};\n themes.shops.items.vegetables = {posX: 190, posY: 265, scale: 0,\n movX: 0, movY: 0, scaleTo: 0, duration: 4, easing: \"Linear\"};\n\n themes.sport.items.basketball = {posX: 320, posY: 130, scale: 1,\n movX: 0, movY: -20, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.sport.items.cricket = {posX: 200, posY: 290, scale: 1,\n movX: 0, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n themes.sport.items.football = {posX: 500, posY: 500, scale: 0.5,rotation: 180,\n movX: -100, movY: -440, scaleTo: 0.1, duration: 2, easing: \"EaseInOut\"};\n themes.sport.items.gymnastics = {posX: 280, posY: 120, scale: 1,\n movX: 10, movY: 0, scaleTo: 1, duration: 2, easing: \"Linear\"};\n themes.sport.items.netball = {posX: 300, posY: 100, scale: 1,\n movX: 10, movY: -20, scaleTo: 1, duration: 1, easing: \"EaseIn\"};\n themes.sport.items.soccer = {posX: 230, posY: 250, scale: 1,\n movX: 10, movY: 10, scaleTo: 1.1, duration: 1, easing: \"Linear\"};\n themes.sport.items.tennis = {posX: 100, posY: 230, scale: 1,\n movX: 10, movY: 0, scaleTo: 1, duration: 1, easing: \"Linear\"};\n\n themes.transport.items.bicycle = {posX: 360, posY: 220, scale: 1, rotation: 5,\n movX: 55, movY: 15, scaleTo: 1, duration: 1, easing: \"EaseOut\"};\n themes.transport.items.bus = {posX: 380, posY: 270, scale: 1, rotation: -2,\n movX: -40, movY: 0, scaleTo: 1, duration: 2, easing: \"Linear\"};\n themes.transport.items.car = {posX: 50, posY: 90, scale: .4, rotation: -3,\n movX: -40, movY: 30, scaleTo: .4, duration: 2, easing: \"Linear\"};\n themes.transport.items.motorcycle = {posX: 390, posY: 370, scale: 1,\n movX: -50, movY: 0, scaleTo: 1, duration: 2, easing: \"EaseInOut\"};\n themes.transport.items.plane = {posX: 40, posY: 170, scale: .4,rotation: 5,\n movX: 100, movY: 0, scaleTo: 1, duration: 2, easing: \"Linear\"};\n themes.transport.items.rocket = {posX: 100, posY: 380,rotation: -5,\n movX: 700, movY: -230, scale: 1, scaleTo: 0, duration: 4, easing: \"EaseOut\", };\n themes.transport.items.scooter = {posX: 220, posY: 150, scale: 0.96,\n movX: -60, movY: 10, scaleTo: 1, duration: 2, easing: \"EaseOut\"};\n themes.transport.items.ship = {posX: 200, posY: 280, scale: 0.9, rotation: -5,\n movX: 80, movY: 0, scaleTo: 1, duration: 2, easing: \"Linear\"};\n themes.transport.items.train = {posX: 260, posY: 230, scale: 1.17,rotation: -2,\n movX: -16, movY: 0, scaleTo: 1.24, duration: 1, easing: \"Linear\"};\n themes.transport.items.tram = {posX: 120, posY: 180, scale: 1.2,\n movX: -150, movY: 0, scaleTo: 1.2, duration: 3, easing: \"EaseOut\"};\n\n $.each(themeNames, function(themeName, items) {\n $.each(items, function(idx, item) {\n themes[themeName].items[item].imgName = item;\n themes[themeName].items[item].imgSrc = docUrl + \"themes/\" + themeName\n + \"/items/\" + item + \".png\";\n themes[themeName].items[item].callback = function() {\n };\n drawImage(themes[themeName].items[item]);\n });\n });\n}", "function createObjectAnimations() {\r\n this.anims.create({\r\n key: 'jewelAnims',\r\n frames: this.anims.generateFrameNumbers('jewel', { start: 0, end: 4 }),\r\n frameRate: 10,\r\n repeat: -1,\r\n });\r\n\r\n this.anims.create({\r\n key: 'cherryAnims',\r\n frames: this.anims.generateFrameNumbers('cherry', { start: 0, end: 6 }),\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n}", "function InitValues_L2(){\n ggbApplet.setCoords(\"A\", 0.0, 3.5);\n ggbApplet.setCoords(\"B\", 1.5, 2.0);\n ggbApplet.setCoords(\"C\", 1.5, 4.0);\n ggbApplet.setCoords(\"D\", 2.5, 1.5);\n ggbApplet.setCoords(\"E\", 4.5, 2.5);\n ggbApplet.evalCommand(\"u = Vector(D, E)\");\n ggbApplet.evalCommand(\"t1 = Polygon(A, B, C)\");\n\n posA = [0.0, 3.5];\n posB = [1.5, 2.0];\n posC = [1.5, 4.0];\n posD = [2.5, 1.5];\n posE = [4.5, 2.5];\n vector = [2, 1];\n \n ggbApplet.stopAnimation();\n if(ggbApplet.exists(\"sldAnimation\") != true) {\n ggbApplet.evalCommand('sldAnimation = Slider('+ANIMATION_MIN+','+ANIMATION_MAX+','+ ANIMATION_INTERVAL+','+ANIMATION_SPEED+', 100, false, true, true, false)');\n }\n ggbApplet.evalCommand('sldAnimation = 0');\n}", "getAnimationStyle () {\n\n if ( this.sortableAnimation === 0 ) {\n return {};\n }\n\n const secs = this.sortableAnimation / 1000;\n\n return {\n transition: `all ${ secs }s ease-in`\n };\n\n }", "function setupAnimation(){\n\t// create canvas\n\tvar ctx = animation.persist.ctx = lib.canvas.create('canvas1');\n\n\twindow.requestAnimationFrame(animation.draw);\n}", "function animation() {\n\t\t\t\t// track time\n\t\t\t\tcurrent = Date.now();\n\t\t\t\telapsed = (current - lastTime) / 1000;\n\t\t\t\tif (elapsed > max_elapsed_wait) {\n\t\t\t\t\telapsed = max_elapsed_wait;\n\t\t\t\t}\n\n\n\t\t\t\tif (counter_time > time_step) {\n\n\n\n\t\t\t\t}\n\t\t\t\t//METEORITOS\n\t\t\t\tif(ygrados>-100000 && temp==1){\n\t\t\t\t\tygrados = ygrados - 0.01 * 70;\n\n\t\t\t\t\tmono.setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.translate(new CG.Vector3(10,0,250)),CG.Matrix4.scale(new CG.Vector3(3,3,3))),CG.Matrix4.rotateY((Math.radians(ygrados)))));\n\t\t\t\t\tgeometry[0].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(0,0,-1))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\n\t\t\t\t\tgeometry[4].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(10,0,30))),CG.Matrix4.rotateZ((Math.radians(ygrados)))))\n\n\n\t\t\t\t\tgeometry[5].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(50,0,-50))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t\tgeometry[7].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(80,40,-50))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t\tgeometry[8].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(30,20,50))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t\tgeometry[9].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(50,-80,20))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t\tgeometry[10].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(70,-150,-20))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t\tgeometry[11].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(20,100,-70))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t\tgeometry[12].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(20,10,-50))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\n\t\t\t\t\tgeometry[13].setT(CG.Matrix4.multiply(CG.Matrix4.multiply(CG.Matrix4.rotateX(90*(-Math.PI/180)),CG.Matrix4.translate(new CG.Vector3(80,60,-20))),CG.Matrix4.rotateZ((Math.radians(ygrados)))));\n\n\t\t\t\t}\n\n\n\t\t\t\tdraw();\n\t\t\t\tcounter_time = 0;\n\t\t\t}", "function AnimationStyleMetadata() { }", "function AnimationStyleMetadata() { }", "function Animation(logistics) {\n _classCallCheck(this, Animation);\n\n var time = 0;\n this.startTime = 0;\n this.currentTime = time;\n this.begin = logistics.begin;\n this.loop = logistics.loop;\n this.timeToFinish = logistics.timeToFinish;\n this.propsBegin = logistics.propsBegin;\n this.propsEnd = logistics.propsEnd;\n this.propsCurrent = {};\n this.complete = false;\n\n var propKeys = Object.keys(this.propsBegin);\n for (var i = 0; i < propKeys.length; i++) {\n var key = propKeys[i];\n this.propsCurrent[key] = this.propsBegin[key];\n }\n }", "function main() {\n var N = 22; //Number of animation frames from 0 e.g. N=1 is the same as having two images which swap...\n Conf.augment ? Conf.animate += 1 : Conf.animate -= 1;\n if(Conf.animate === 0 || Conf.animate === N) {\n Conf.augment ? Conf.augment = false : Conf.augment = true;\n }\n }", "keyFrameAnimate(){\n\t\tlet animationRules = '';\n\t\tthis.keyFrameStyle = document.createElement('style');\n\t\tthis.keyFrameStyle.type = 'text/css';\n\n\t\t//create proper keyframe string for style element\n\t\tthis.animationProperties\n\t\t\t.map(obj => this.keyFrameStateFrom(obj))\n\t\t\t.map(styleObj => this.stringify(styleObj))\n\t\t\t.forEach(stringified => animationRules += stringified);\n\n\t\tthis.keyFrameStyle.innerHTML = `@keyframes ${this.animationName} {${animationRules}}`;\n\t\tdocument.getElementsByTagName('head')[0].appendChild(this.keyFrameStyle);\n\n\t\t//cache the time when animation starts\n\t\tthis.element.addEventListener(\"animationstart\", () => this.startTime = (new Date()).getTime());\n\n\t\t//set styles of animation configs\n\t\tObject.assign(this.animationConfig, {'animation-name': this.animationName});\n\t\tthis.appendCssClass(`${this.animationName}_class`, this.animationConfig);\n\n\t\t//If button and range were provided set event handlers(range is pointless without animation-duration)\n\t\tif(this.playPauseButton !== null && !this.isPlayPauseEventAttached){\n\t\t\tthis.isPlayPauseEventAttached = true;\n\t\t\tthis.playPauseButton.addEventListener('click', this.switchRunningState.bind(this));\n\t\t}\n\t\tif(!this.isSeekEventAttached && this.seekRange !== null && this.animationConfig.hasOwnProperty('animation-duration')){\n\t\t\tthis.isSeekEventAttached = true;\n\t\t\tconst duration = +this.animationConfig['animation-duration'].split('s')[0];\n\t\t\tthis.seekRange.setAttribute('min', 0);\n\t\t\tthis.seekRange.setAttribute('max', 100);\n\t\t\tthis.seekRange.addEventListener('mousedown', this.pause.bind(this));\n\t\t\tthis.seekRange.addEventListener('input', this.seek(duration*1000).bind(this));\n\t\t\tthis.seekRange.addEventListener('mouseup', this.run.bind(this));\n\t\t}\n\t}", "function initValues_Step14(){\n valuesStep14 = {\n posistion: {x:37.5, y:-4, z:182},\n scale: {x:4, y:4, z:1},\n quat: {x:1, y:0, z:0,w:1},\n mass: 0,\n frictions: 0.9,\n restitution: 0.8,\n howMany: 2,\n placeObjectPosition: {x:0,y:0,z:7},\n groundMaterial : new THREE.MeshPhongMaterial( { color: 0x09F099, side: THREE.DoubleSide } )\n }\n}", "function Animation(opciones)\n{\n // Most of these opciones are null because the defaults are different depending on the type of animacion.\n let opcionesDefecto = {\n 'type' : 'spinOngoing', // For now there are only supported types are spinOngoing (continuous), spinToStop, spinAndBack, custom.\n 'direction' : 'clockwise', // clockwise or anti-clockwise.\n 'propertyName' : null, // The name of the winning wheel property to be affected by the animacion.\n 'propertyValue' : null, // The value the property is to be set to at the end of the animacion.\n 'duration' : 10, // Duration of the animacion.\n 'yoyo' : false, // If the animacion is to reverse back again i.e. yo-yo.\n 'repeat' : null, // The number of times the animacion is to repeat, -1 will cause it to repeat forever.\n 'easing' : null, // The easing to use for the animacion, default is the best for spin to stop. Use Linear.easeNone for no easing.\n 'stopAngle' : null, // Used for spinning, the angle at which the wheel is to stop.\n 'spins' : null, // Used for spinning, the number of complete 360 degree rotations the wheel is to do.\n 'limpiarElCanvas' : null, // If set to true the canvas1 will be cleared before the wheel is re-drawn, false it will not, null the animacion will abide by the value of this property for the parent wheel object.\n 'callbackFinished' : null, // Function to callback when the animacion has finished.\n 'callbackBefore' : null, // Function to callback before the wheel is drawn each animacion loop.\n 'callbackAfter' : null, // Function to callback after the wheel is drawn each animacion loop.\n 'callbackSound' : null, // Function to callback if a sound should be triggered on change of segment or pin.\n 'soundTrigger' : 'segment' // Sound trigger type. Default is segment which triggers when segment changes, can be pin if to trigger when pin passes the pointer.\n };\n\n // Now loop through the default opciones and create properties of this class set to the value for\n // the option passed in if a value was, or if not then set the value of the default.\n for (let llave in opcionesDefecto) {\n if ((opciones != null) && (typeof(opciones[llave]) !== 'undefined')) {\n this[llave] = opciones[llave];\n } else {\n this[llave] = opcionesDefecto[llave];\n }\n }\n\n // Also loop though the passed in opciones and add anything specified not part of the class in to it as a property.\n if (opciones != null) {\n for (let llave in opciones) {\n if (typeof(this[llave]) === 'undefined') {\n this[llave] = opciones[llave];\n }\n }\n }\n}", "init() {\n this.docElementNS = document.createElementNS(this.xmlns, 'animate');\n if (this.attributeName) {\n this.docElementNS.setAttribute('attributeName', this.attributeName);\n }\n if (this.attributeType) {\n this.docElementNS.setAttribute('attributeType', this.attributeType);\n }\n if (this.from) {\n this.docElementNS.setAttribute('from', this.from);\n }\n if (this.to) {\n this.docElementNS.setAttribute('to', this.to);\n }\n if (this.dur) {\n this.docElementNS.setAttribute('dur', this.dur);\n }\n if (this.values) {\n this.docElementNS.setAttribute('values', this.values);\n }\n if (this.repeatCount) {\n this.docElementNS.setAttribute('repeatCount', this.repeatCount);\n }\n if (this.autoBind) {\n this.bind();\n }\n }", "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animation',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1000,\n duration:1000\n }).add({\n targets:'.animation h1',\n scale:[1.4, 1],\n duration:1000,\n easing :'easeOutExpo'\n },80);\n\n \n }", "InitAnims() {\n this.scene.anims.create({\n key: 'idle',\n frames: this.scene.anims.generateFrameNumbers('player_idle', { start: 0, end: 5 }),\n frameRate: 8,\n repeat: -1\n });\n this.scene.anims.create({\n key: 'run',\n frames: this.scene.anims.generateFrameNumbers('player_run', { start: 0, end: 39 }),\n frameRate: 60,\n repeat: -1\n });\n this.scene.anims.create({\n key: 'jump',\n frames: [{ key: 'player_jump', frame: 0 }],\n frameRate: 24\n });\n this.scene.anims.create({\n key: 'attack',\n frames: this.scene.anims.generateFrameNumbers('player_attack', { start: 0, end: 7 }),\n frameRate: 24,\n showOnStart: true,\n hideOnComplete: true\n });\n this.scene.anims.create({\n key: 'death',\n frames: this.scene.anims.generateFrameNumbers('player_death', { start: 0, end: 7 }),\n frameRate: 4,\n showOnStart: true,\n hideOnComplete: false\n });\n }", "preload() {\n this.anims.create({\n key: \"idle\", \n frameRate: 10, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [0,1]\n })\n });\n\n this.anims.create({\n key: \"idleLeft\", \n frameRate: 5, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [1,0]\n })\n });\n\n this.anims.create({\n key: \"runRight\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n //frames: [2,3,4,5,6,7]\n frames: [0,1]\n })\n });\n \n this.anims.create({\n key: \"runLeft\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"RUN\", {\n frames: [7,6,5,4,3,2]\n })\n });\n\n this.anims.create({\n key: \"slash\", \n frameRate: 60, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"SLASH\", {\n frames: [0,1,2,3,4,5,6,7,8]\n })\n });\n \n this.load.image(\"ground\", \"./assets/ground.png\");\n }", "constructor(p, data, startHrs, startMins, am, width, height, fogTimes) {\n this.p = p;\n this.baseTimeMinutes = timeInMins(startHrs, startMins);\n this.ampm = am;\n this.data = data;\n this.fogTimes = fogTimes;\n\n /**\n * ANIMATION TIME CONSTANTS\n */\n /* Canvas will refresh 60 times a second */\n this.fRate = 60;\n /* A 'minute' in the animation will last 100 frames. */\n this.framesPerMin = 100;\n /** The length of this animation, in minutes. \n * Based on latest departure time of any visitor in the data array.\n * Add 5 to allow time for the latest departure to exit the screen\n * before restarting the animation. */\n this.durationInMins = 5 + getLatestDeparture(data);\n console.log(this.durationInMins);\n\n /**\n * ANIMATION LIFECYCLE STATE\n * Reset at the start of every animation\n */\n this.frameCount = 0;\n\n /**\n * MINUTE-BY-MINUTE STATE\n * Updated every minute for visitors within that minute\n */\n /* Array of objects that have x;N, y;N, and data:VisitorData fields,\n where VisitorData is {type:{r|c|w}, dir{up|down}, arrival:Minute, [departure:Minute]} */\n this.activeVisitors = [];\n // Shallow copy of data that can be mutated\n this.waitingVisitors = this.data.slice();\n /* Number of frames that elapse between each visitor in the current minute */\n this.framesPerVisitor;\n /* Array of VisitorData objects, the visitors that will be added\n to the animation during the current minute */\n this.visitorsInMin = [];\n\n /**\n * DRAWING (size + color) CONSTANTS\n * Known / given constants,\n * and dynamically calculated constants.\n */\n this.myWidth = width; // should be windowWidth when constructed\n this.myHeight = height; // should be 400 when constructed\n this.visitorDotSize = 10; // size of visitor dots in animatino\n // Calculate + set width-dependent drawing constants.\n this.initSizeConstants();\n // Init the color constants.\n this.initColorConstants();\n }", "function setAnimationPoints(){\n var a = vec4(0, 0, 0, 1);\n var b = vec4(-5, -25, 0, 1);\n var c = vec4(5, -25, 0, 1);\n var d = vec4(0, 0, 0, 1);\n var bezier = new Bezier([a, b, c, d]);\n animationPoints = bezier.vertices;\n}", "function animateCommute() {\r\n var transformation1;\r\n var transformation2;\r\n var transformationSelector1 = document.getElementById('TransformationSelector1').value;\r\n var transformationSelector2 = document.getElementById('TransformationSelector2').value;\r\n var frameSize = 20;\r\n var extra = axes.slice();\r\n extra.push(sphere);\r\n\r\n if (transformationSelector1===\"Rotation1\"){\r\n\r\n var rotateAxis = document.getElementById('TransformationRelative1').value\r\n var slider = document.getElementById(\"rotator1\").value;\r\n var start1 = 0;\r\n var end1 = slider * Math.PI;\r\n\r\n if (rotateAxis === \"X\") {\r\n transformation1 = rotationX;\r\n } else if (rotateAxis === \"Y\") {\r\n transformation1 = rotationY;\r\n } else if (rotateAxis === \"Z\") {\r\n transformation1 = rotationZ;\r\n }\r\n }else if (transformationSelector1 ===\"Reflection1\"){\r\n var plane = document.getElementById(\"TransformationRelative1\").value;\r\n var start1 = 1.0;\r\n var end1 = -1.0;\r\n\r\n\r\n if (plane === \"X\") {\r\n transformation1 = scaleX;\r\n extra.push({\r\n x: [0, 0],\r\n y: [-4, 4],\r\n z: [[-4, 4],\r\n [-4, 4]],\r\n colorscale: [[0.0, \"#608bbf\"], [1.0, \"#ffffff\"]],\r\n opacity: 0.5,\r\n showscale: false,\r\n type: \"surface\"\r\n })\r\n } else if (plane === \"Y\") {\r\n transformation1 = scaleY;\r\n extra.push({\r\n x: [-4, 4],\r\n y: [0, 0],\r\n z: [[-4, -4],\r\n [4, 4]],\r\n colorscale: [[0.0, \"#f7fcfb\"], [1.0, \"#f7fcfb\"]],\r\n opacity: 0.5,\r\n showscale: false,\r\n type: \"surface\"\r\n })\r\n } else if (plane === \"Z\") {\r\n transformation1 = scaleZ;\r\n extra.push({\r\n x: [-4, 4],\r\n y: [-4, 4],\r\n z: [[0, 0],\r\n [0, 0]],\r\n colorscale: [[0.0, \"#608bbf\"], [1.0, \"#ffffff\"]],\r\n opacity: 0.5,\r\n showscale: false,\r\n type: \"surface\"\r\n })\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if (transformationSelector2 ===\"Rotation2\"){\r\n\r\n var rotateAxis = document.getElementById('TransformationRelative2').value\r\n var slider = document.getElementById(\"rotator2\").value;\r\n var start2 = 0;\r\n var end2 = slider * Math.PI;\r\n\r\n if (rotateAxis === \"X\") {\r\n transformation2 = rotationX;\r\n } else if (rotateAxis === \"Y\") {\r\n transformation2 = rotationY;\r\n } else if (rotateAxis === \"Z\") {\r\n transformation2 = rotationZ;\r\n }\r\n }else if (transformationSelector2 ===\"Reflection2\"){\r\n var plane = document.getElementById('TransformationRelative2').value;\r\n var start2 = 1.0;\r\n var end2 = -1.0;\r\n\r\n\r\n if (plane === \"X\") {\r\n transformation2 = scaleX;\r\n extra.push({\r\n x: [0, 0],\r\n y: [-4, 4],\r\n z: [[-4, 4],\r\n [-4, 4]],\r\n colorscale: [[0.0, \"#608bbf\"], [1.0, \"#ffffff\"]],\r\n opacity: 0.5,\r\n showscale: false,\r\n type: \"surface\"\r\n })\r\n } else if (plane === \"Y\") {\r\n transformation2 = scaleY;\r\n extra.push({\r\n x: [-4, 4],\r\n y: [0, 0],\r\n z: [[-4, -4],\r\n [4, 4]],\r\n colorscale: [[0.0, \"#608bbf\"], [1.0, \"#ffffff\"]],\r\n opacity: 0.5,\r\n showscale: false,\r\n type: \"surface\"\r\n })\r\n } else if (plane === \"Z\") {\r\n transformation2 = scaleZ;\r\n extra.push({\r\n x: [-4, 4],\r\n y: [-4, 4],\r\n z: [[0, 0],\r\n [0, 0]],\r\n colorscale: [[0.0, \"#608bbf\"], [1.0, \"#ffffff\"]],\r\n opacity: 0.5,\r\n showscale: false,\r\n type: \"surface\"\r\n })\r\n }\r\n\r\n\r\n }\r\n var frames = computeCommute(transformation1, transformation2,start1, end1, start2, end2,frameSize)\r\n\r\n enableUndoReset();\r\n\r\n initAnimation(\"commuteAnimate\", frames, extra, layout);\r\n startAnimation();\r\n return frames;\r\n\r\n}", "function AnimationKeyframesSequenceMetadata() { }", "function AnimationKeyframesSequenceMetadata() { }", "getAnimationBoxes() {\n let sel = this.animation_display.selection;\n let ori = this.animation_display.sprite_origin;\n\n let f = {\n x: sel.x,\n y: sel.y,\n width: sel.w,\n height: sel.h,\n offset_x: ori.x,\n offset_y: ori.y\n };\n\n this.working_model.frames[this.current_frame] = f;\n }", "function Legato_Animation_Controller()\r\n{\r\n\r\n\t// Store the default values.\r\n\tthis.move = { to: new Legato_Structure_Point(),\r\n\t by: new Legato_Structure_Point(),\r\n\t\t\t\t\t\t\t ease: Legato_Animation.EASE_NONE };\r\n\r\n\tthis.width = { to: null,\r\n\t by: null,\r\n\t\t\t\t\t\t\t ease: Legato_Animation.EASE_NONE };\r\n\r\n\tthis.height = { to: null,\r\n\t by: null,\r\n\t\t\t\t\t\t\t ease: Legato_Animation.EASE_NONE };\r\n\r\n\tthis.opacity = { to: null,\r\n\t by: null,\r\n\t\t\t\t\t\t\t ease: Legato_Animation.EASE_NONE };\r\n\r\n\tthis.background_color = { to: new Legato_Structure_Color(),\r\n\t by: new Legato_Structure_Color() };\r\n\r\n\tthis.border_color = { to: new Legato_Structure_Color(),\r\n\t by: new Legato_Structure_Color() };\r\n\r\n\tthis.text_color = { to: new Legato_Structure_Color(),\r\n\t by: new Legato_Structure_Color() };\r\n\r\n\tthis.delay = 0;\r\n\r\n}", "set animatePhysics(value) {}", "function getAnimation2() {\n var element = $('.bulp2');\n //bezier magic provided by GSAP BezierPlugin (included with TweenMax)\n //https://api.greensock.com/js/com/greensock/plugins/BezierPlugin.html\n \n //create a semi-random tween \n var bezTween = new TweenMax(element, 6, {\n bezier:{\n type:\"soft\", \n //values:[{x:-200, y:300}, {x:300, y:30}, {x:500 + Math.random() *100, y:320*Math.random() + 50}, {x:650, y:320*Math.random() + 50}, {x:900, y:50}, {x:1100, y:50}, {x:1200, y:50}, {x:1400, y:50}, {x:1600, y:50}, {x:1900, y:50}],\n values:[{x:-430, y:0}, {x:0, y:50}, {x:100, y:70}, {x:500, y:70}, {x:650, y: 80}, {x:900, y:80}, {x:1100, y:90}, {x:1200, y:90}, {x:1400, y:90}, {x:1600, y:90}, {x:1900, y:90}],\n autoRotate:false\n },\n ease:Linear.easeNone});\n return bezTween;\n}", "function createFxNow() {\n window.setTimeout(function () {\n fxNow = undefined;\n });\n return fxNow = jQuery.now();\n } // Generate parameters to create a standard animation", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n w = 1600;\n dx = (TWO_PI / period) * xspacing;\n\n\n\n // var step = 0.4;\n}", "function drawDemo(t,duration) {\n push();\n translate(3*width/4,height/2);\n strokeWeight(1);\n let p = t/(duration);\n let g = (1-p)*100;\n stroke(40);\n // the first point of generation n and n-1\n let v1 = points3[0].copy();\n circle(v1.x,cy(v1.y),2)\n let v2 = points4[0].copy();\n circle(v2.x,cy(v2.y),2)\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // line gen n to gen n-1 for the first point\n drawarrow(v1,v2);\n // the first point of the moving line\n v1.mult(p).add(v2.mult(1-p));\n stroke(255);\n circle(v1.x,cy(v1.y),2) // first point of the moving line\n for (let i=1;i<points3.length;i++) {\n // the 2 generations\n stroke(40)\n let v11 = points3[i-1]; \n let v12 = points3[i];\n line(v11.x,cy(v11.y),v12.x,cy(v12.y)) // line generation n-1\n circle(v12.x,cy(v12.y),2)\n let v21 = points4[i-1]\n let v22 = points4[i]\n line(v21.x,cy(v21.y),v22.x,cy(v22.y)) // line generation n\n circle(v22.x,cy(v22.y),2)\n line(v12.x,cy(v12.y),v22.x,cy(v22.y)); // line gen n to gen n-1\n drawarrow(v12,v22);\n // the line in between\n v1 = p5.Vector.add(v11.copy().mult(p),v21.copy().mult(1-p));\n v2 = p5.Vector.add(v12.copy().mult(p),v22.copy().mult(1-p));\n stroke(255);\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // the moving line\n circle(v2.x,cy(v2.y),2)\n }\n pop();\n}", "function animate() { \n console.log('animate')\n \n gsap.registerEffect({\n name: \"fadeIn\",\n effect: (targets, config) => {\n var tlEffect = gsap.timeline();\n tlEffect.from(targets, {duration: config.duration, y:config.y, force3D:true, rotation: 0.01, stagger:config.stagger, ease:\"power2\"})\n .from(targets, {duration: config.duration, stagger:config.stagger, alpha:0, ease:\"none\"}, \"<\")\n return tlEffect;\n },\n defaults: {duration: 1.5, y:\"-=7\", stagger:4.5},\n extendTimeline: true,\n });\n \n gsap.to(plantWraps, {duration:25, rotation:\"+=20\", ease:\"none\"})\n gsap.to(flowerWraps, {duration:25, rotation:\"+=100\", ease:\"none\"})\n \n var imageDivs = selectAll('.imageDiv');\n // logoIntro = false;\n\n\t\t\ttl\n .to(bannerCover, {duration:0.7, alpha:0, ease:\"none\"})\n \n .from(plants, {duration:3, drawSVG:\"50% 50%\", ease:\"sine.inOut\"}, \"<\")\n .from(flowers, {duration:2, alpha:0, ease:\"none\"}, \"<\")\n \n if(logoIntro) {\n tl\n .from(letter_w, {duration:0.5, drawSVG: 0, ease:\"sine.in\"}, \"<\")\n .from(letter_y, {duration:0.3, drawSVG: 0, ease:\"sine.in\"}, \">\")\n .from(letter_nn, {duration:0.8, drawSVG: 0, ease:\"sine.inOut\"}, \">\")\n .from(lasvegas, {duration:0.7, y:\"-=10\", alpha: 0, ease:\"sine\"}, \">\")\n .from(sign_r, {duration:0.5, alpha: 0, ease:\"none\"}, \"<\")\n\n .to(logo, {duration:0.7, alpha:0, ease:\"none\"}, \">1\")\n .set(logo, {scale: 0.37, y:99, x:-60}, \">\")\n } else {\n tl\n .set(logo, {scale: 0.37, alpha:0,y:99, x:-60}, \"<\")\n }\n \n tl\n .from(imageDivs, {duration:1.3, stagger:4, alpha:0, blur:10, force3D:true, rotation: 0.01, ease:\"none\"}, \"<\")\n \n .fadeIn(text_head, \"<0.4\")\n .fadeIn(text_subHead,{y:\"0\", duration: 1,},\"<0.6\")\n .to(logo, {duration:1, alpha:1, ease:\"none\"}, \"<0.4\")\n .from(cta, {duration:0.8, alpha: 0, ease:\"none\"}, \"<\")\n .from(cta, {duration:1.6, rotateX:90, ease:\"power2\"}, \"<\") \n\t\t}", "function ChartAnimation(time) {\r\n\r\n //normikuvaajat\r\n for (var id in chartOptions) {\r\n if (chartOptions[id] != null) {;\r\n chartOptions[id].animation.duration = time;\r\n }\r\n\r\n }\r\n\r\n var tmpID;\r\n\r\n //googlen dashboardissa olevat kuvaajat\r\n for (var elo = 0; elo < 3; elo++) {\r\n for (var arranged = 0; arranged <= 1; arranged++) {\r\n for (var gameMode = 1; gameMode <= 4; gameMode++) {\r\n if (arranged == 1 && gameMode == 1) {\r\n continue;\r\n }\r\n tmpID = 'winRatioDaily' + 'M' + gameMode + 'E' + ELOdb[elo] + 'A' + arranged;\r\n chartChart[tmpID + \"_main\"].setOption('animation.duration', time);\r\n tmpID = 'gamesPlayedDaily' + 'M' + gameMode + 'E' + ELOdb[elo] + 'A' + arranged;\r\n chartChart[tmpID + \"_main\"].setOption('animation.duration', time);\r\n }\r\n }\r\n }\r\n\r\n for (var elo = 0; elo < 3; elo++) {\r\n for (var arranged = 0; arranged <= 1; arranged++) {\r\n tmpID = 'gamesPlayedDailyAll' + 'E' + ELOdb[elo] + 'A' + arranged;\r\n chartChart[tmpID + \"_main\"].setOption('animation.duration', time);\r\n }\r\n }\r\n\r\n\r\n}", "function Animator (args) {\n\t\targs = args || {};\n\n\t \tthis.easing = args.easing || function (t) { return t }; // default to linear easing\n\t \tthis.start_pos = args.start || 0;\n\t \tthis.end_pos = args.end || 1;\n\t \tthis.ratio = args.ratio || 0.25; // ratio to total animation --> normalize to 1\n\t \tthis.msec = args.msec || 1000; // default to 1000msec --> 1s\n\t \tthis.order = args.order || 0;\n\n\t \t// Called Flag\n\t \tthis.started = false;\n\n\t \t// Value to be returned\n\t \tthis.value = this.start_pos;\n\n\t \t// Global (local) reference to 'this'\n\t \tvar _this = this;\n\n\t\t// performance.now is guaranteed to increase and gives sub-millisecond resolution\n\t\t// Date.now is susceptible to system clock changes and gives some number of milliseconds resolution\n\t\t_this.start = window.performance.now(); \n\t\tvar delta = _this.end_pos - _this.start_pos; // displacement\n\n\t\tfunction frame() {\n\t\t\tvar now = window.performance.now();\n\t\t\tvar t = (now - _this.start) / _this.msec; // normalize to 0..1\n\n\t\t\tif (t >= 1) { // if animation complete or running over\n\t\t\t\t_this.value = _this.end_pos; // ensure the animation terminates in the specified state\n\t\t\t \treturn;\n\t\t\t}\n\n\t\t\tvar proportion = _this.easing(t); // Call upon the strange magic of your timing function\n\t\t\t\n\t\t\t// delta is our multiplier | this decides our current position relative to starting position\n\t\t\t// update your animation based on this value\n\t\t\t// trig functions are naturally really excited about this,\n\t\t\t// Can I make the whole thing less imperitive? --> Stateless?\n\n\t\t\t_this.value = _this.start_pos + proportion * delta; \t\n\t\t\trequestAnimationFrame(frame); // next frame!\n\t\t}\n\n\t\tthis.animate = function() {\n\t\t\t_this.started = true;\n\t\t\t_this.start = window.performance.now();\n\t\t\trequestAnimationFrame(frame); // you can use setInterval, but this will give a smoother animation --> Call it the first time and it loops forever until return\n\t\t}\n\t}", "function generateBottom480(){\r\n\tvar p1 = COLOR([0,0,0])(STRUCT([T([0,1,2])([-0.19,trainWidth+0.1,-trainHeight]),R([0,1])(-PI/2),\r\n\t\tCUBOID([trainWidth+0.15,trainLength+0.18])]));\r\n\tvar p2 = function(){\r\n\t\tvar adjust = 0.85;\r\n\t\tvar adjustBase = 0.25;\r\n\t\tvar c1 = BEZIER(S0)([[-adjustBase+0.2,trainHeight,-etr450adjust-0.3],[-adjustBase,trainHeight,-0.2],\r\n\t\t\t[trainWidth/2,trainHeight,1.8],[trainWidth+adjustBase,trainHeight,-0.2],\r\n\t\t\t[trainWidth+adjustBase-0.2,trainHeight,-etr450adjust-0.3]]);\r\n\r\n\t\tvar c2 = BEZIER(S0)([[-adjustBase+0.2,trainHeight,-etr450adjust-0.3-1],[-adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth/2,trainHeight+1,0.8],[trainWidth+adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth+adjustBase-0.2,trainHeight,-etr450adjust-0.3-1]]);\r\n\r\n\t\tvar c3 = BEZIER(S0)([[-adjustBase+0.2,trainHeight,-etr450adjust-0.3-1],[-adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth/2,trainHeight+1,2.5],[trainWidth+adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth+adjustBase-0.2,trainHeight,-etr450adjust-0.3-1]]);\r\n\r\n\t\tvar out = MAP(BEZIER(S1)([c1,c2,c3]))(dom2D);\r\n\r\n\t\treturn COLOR([0.5,0.5,0.5])(STRUCT([T([0,1,2])([-2.2,trainWidth,-trainHeight*2]),R([0,1])(-PI/2),R([1,2])(PI/2),out]));\r\n\r\n\t};\r\n\treturn STRUCT([p1,p2()]);\r\n}", "function constantGenerator (options) {\n var o = options || {};\n return function (i) {\n return {\n i : i,\n x : i / o.fps,\n y : options.value,\n length : o.length\n }\n }\n}", "constructor(x, color, translationRate) {\n // Position properties\n this.x = x;\n this.y = 0;\n // Display properties\n this.color = color;\n this.width = 500;\n this.height = 600;\n // Moving properties\n this.translationRate = translationRate;\n this.ninthFrameX = 4500; // offsetTargetX + timeFrameInterval * 9\n this.resetX = -500;\n }", "function keyframes(data, name, propertyValue,custom){\n \t // photo-click=>kf-namees-10p20p30p-bg-lg-blue-red---tf-r10deg--s2__40p50p80p-bgc-green atfeio ada aici adu1s\n//keyframe-name- already extracted\n//[from|to|20p]-classname--classname--classname__[to|20p]-classname--classname__[to|100p]\nlet statement=\"@keyframes \"+ name +\"{\\n\";\n let splits=data.split('__');\n splits.forEach(each=>{\n \tlet result=at(each,propertyValue,custom);\n \tif(result!==false) statement+='\\t'+result;\n });\n\n return statement+\"}\";\n}" ]
[ "0.6477499", "0.6449747", "0.6239411", "0.62102515", "0.62051743", "0.6019592", "0.599829", "0.594838", "0.5940393", "0.5940393", "0.5912163", "0.5873654", "0.5832134", "0.5828958", "0.58236474", "0.5820797", "0.5813001", "0.579854", "0.57910967", "0.57835335", "0.5780475", "0.5744776", "0.5744776", "0.5743037", "0.5725314", "0.57187176", "0.56824344", "0.5681388", "0.5681388", "0.5678651", "0.56618774", "0.5647999", "0.56424373", "0.56417084", "0.56417084", "0.5630118", "0.5630118", "0.5620743", "0.5609721", "0.56021315", "0.56021315", "0.56001645", "0.5594966", "0.55772984", "0.55669963", "0.55653876", "0.55635995", "0.55631703", "0.5558751", "0.5555574", "0.5549875", "0.5546244", "0.55430067", "0.5541023", "0.5540799", "0.55329746", "0.55329746", "0.5527512", "0.5519762", "0.55152524", "0.5485498", "0.54539764", "0.54531014", "0.5447024", "0.5445377", "0.54426", "0.54318804", "0.54289997", "0.5421807", "0.54158115", "0.54125386", "0.5410965", "0.5410965", "0.5398738", "0.5396087", "0.5393311", "0.53917104", "0.53820693", "0.53762", "0.5373947", "0.53671485", "0.53658193", "0.53646094", "0.53609955", "0.5353784", "0.53529763", "0.53529763", "0.5352467", "0.53397745", "0.53333664", "0.5332917", "0.53294826", "0.5324581", "0.53198284", "0.53193164", "0.53152305", "0.5314615", "0.53096515", "0.5307977", "0.53036606", "0.5299143" ]
0.0
-1
utillang.js The minimal language enhancement
function isType(type) { return function(obj) { return Object.prototype.toString.call(obj) === "[object " + type + "]" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TI18n() {}", "function TI18n() {}", "function TI18n() {}", "function TI18n() { }", "function TI18n() { }", "function LangMap() {}", "function LangMap() {}", "function addLanguages() {}", "function TI18n(){}", "function Lang() { \n}", "function BrowserLanguage() {\n}", "function GenLanguageDef(){}", "function testLty() {\n console.log(\"en\");\n console.log(\"ch\");\n}", "function initializeLangVars() {\nswitch (Xlang) {\n// --------------------------------------------------------------------------------------------------------------------------------------------------------------------\n// - The 03/02/2010 ------------- by Ptitfred06\n// Modification : small word to have good view in tasklist\n// - Small modification on word (translation).\n// - comment what can be personnalise / and what can't \n// -----------------------------------------------------------------------\n\tcase \"fr\": // thanks Tuga\n// Texte détécté dans les page Travian (NE PAS CHANGER / No CHANGE !!!)\n\t\taLangAllBuildWithId = [\"Bûcheron\", \"Carrière de terre\", \"Mine de fer\", \"Ferme\", \"\", \"Scierie\", \"Usine de poteries\", \"Fonderie\", \"Moulin\", \"Boulangerie\", \"Dépôt de ressources\", \"Silo de céréales\", \"Armurerie\", \"Usine d'armures\", \"Place du tournoi\", \"Bâtiment principal\", \"Place de rassemblement\", \"Place du Marché\", \"Ambassade\", \"Caserne\", \"Écurie\", \"Atelier\", \"Académie\", \"Cachette\", \"Hôtel de ville\", \"Résidence\", \"Palais\", \"Chambre aux trésors\", \"Comptoir de commerce\", \"Grande Caserne\", \"Grande Écurie\", \"Mur d'enceinte\", \"Mur de terre\", \"Palissade\", \"Tailleur de Pierres\", \"Brasserie\", \"Fabricant de pièges\",\"Manoir du héros\", \"Grand dépôt de ressources\", \"Grand silo de céréales\", \"Merveille du monde\", \"Abreuvoir\"];\n\t\taLangAllBuildAltWithId = [/*\"Bûcheron\"*/, \"Carrière de Terre\", /*\"Mine de fer\"*/, \"Ferme de céréales\", \"\", /*\"Scierie\"*/, \"Usine de Poteries\", /*\"Fonderie\", \"Moulin\"*/,/* \"Boulangerie\"*/, /*\"Dépôt de ressources\"*/, /*\"Silo de céréales\"*/, /*\"Armurerie\"*/, /*\"Usine d'armures\"*/, /*\"Place du tournoi\"*/, \"Bâtiment Principal\", /*\"Place de rassemblement\"*/, \"Place du marché\", /*\"Ambassade\"*/, /*\"Caserne\"*/, /*\"Écurie\"*/, /*\"Atelier\"*/, /*\"Académie\"*/, /*\"Cachette\"*/, \"Hôtel de Ville\", /*\"Résidence\"*/, /*\"Palais\"*/, /*\"Chambre aux trésors\"*/, \"Comptoir de commerce\", \"Grande Caserne\", \"Grande Écurie\", \"Mur d'enceinte\", \"Mur de terre\", \"Palissade\", \"Tailleur de Pierres\", \"Brasserie\", \"Fabricant de pièges\",\"Manoir du Héros\", \"Grand dépôt de ressources\", \"Grand silo de céréales\", \"Merveille du monde\", \"Abreuvoir\"];\n\n// <-- Peu être modifié / can be personnalize\n\t\taLangAddTaskText = [\"Ajouter tache\", \"Type\", \"Village actif\", \"Cible\", \"Vers\", \"Mode\", \"Aide Const.\", \"Quantité de ress.\", \"Bouger vers le haut\", \"Bouger vers le bas\", \"Effacer\", \"&#160;&#160;&#160;Taches\", \"Bouger \", \"Eliminer toutes les tâches\"];\n\t\taLangTaskKind = [\"Évol \", \"N Cons \", \"Att \", \"Rech \", \"Entrai \", \"Trans \", \"NPC\", \"Dém \", \"Fête\"];\n// -->\n\n// <-- Peu être modifié / can be personnalize\n\t\taLangGameText = [\"Niv\", \"Marchands\", \"Id\", \"Capitale\", \"Temps début\", \"this timeseting is unuseful now.\", \"Vers\", \"Village\", \"Transport\", \"de\", \"Transport vers\", \"Transport de\", \"Retour de\", \"Ressources\", \"Bâtiment\", \"Construire un nouveau bâtiment\", \"Vide\", \"Niveau\"];\n// original \taLangGameText = [\"Niveau\", \"Marchands\", \"Identification\", \"Capitale\", \"Inicio\", \"this timeseting is unuseful now.\", \"Vers\", \"Village\", \"Transport\", \"de\", \"Transport vers\", \"Transport de\", \"Retour de\", \"Ressources\", \"Bâtiment\", \"Construire un nouveau bâtiment\", \"Vazio\", \"Niveau\"];\n// -->\tfin\t\n\n\t\taLangRaceName = [\"Romains\", \"Germains\",\"Gaulois\"];\n// <-- Peu être modifié\n\t\taLangTaskOfText = [\"Planifier evolution\", \"Planifier nouvelle construction\", \"RessUpD\", \"OFF\", \"Comencer\", \"ON\", \"Arreter\", \"La distribution des champs de ce village est \", \"AutoT\", \"Auto transport n est pas ouvert\", \"Ouvert\", \"Transport avec succès\", \"Taches\", \"Limit\", \"Defaut\", \"Modifier\", \"Bois/Terre/Fer\", \"Céréales\", \"Planification de demolition\", \"Planif.Attaque\", \"Type d´attaque\", \"Temps de voyage\", \"Repeter numero de fois\", \"Temps de intervales\",\"00:30:00\",\"Cible catapulte\",\"Aléatoire\", \"Inconnu\", \" Fois\", \"/\", \" \", \"Troupes envoyées\", \"Planification d´entrainement\",\"Train ubication\",\"Planification d´entrainement fini\",\"TransP\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default sont 20 minutes, Insérer nouveau temps:\\n\\n\",\"Remain\",\"Planifier fête\",\"petite fête\",\"grande fête\",\"Set Interval of Ressources concentration\",\"minutes\",\".\",\".\",\"START\",\"STOP\",\"Planifier entrainement\",\"Augmenter Attaque\",\"Augmenter Defense\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n// -->> fin\n// < ne pas change / no change !!! Detected for the feedback error.\n\t\taLangErrorText = [\"Pas assez de ressources\", \"Les ouvriers sont déjà au travail\", \"Construction complète\", \"Début de la construction\", \"Dans développement\", \"Son Dépôt de ressources est petit. Évolue son Dépôt de ressources pour continuer sa construction\", \"Son silo de céréales est petit. Évolue son Silo de céréales pour continuer sa construction\", \"Ressources suffisantes\",\"Une fête est déjà organisée\"];\n// -->> fin\n\t\taLangOtherText = [\"Il remarque important\", \"Seulement les champs de ressources du capitale <br/>peuvent être élevés à niveau 20. Son capital <br/> n'est pas décelable. S'il vous plaît il visite son profil.\", \"Raccourci ici ^_^\", \"Installation conclue\", \"Annulé\", \"Initier les tâches\", \"Upgrade avec succès\", \"Exécuter avec succès\", \"Sa race est inconnue, et son type de troupe aussi. <br/>Il visite son profil pour déterminer la race.<br/>\", \"S'il vous plaît il visite sa Manoir du héros pour déterminer<br/>la vitesse et le type de héros.\"];\n\t\taLangResources=[\"Bois\",\"Terre\",\"Fer\",\"Céréales\"];\n\t\taLangTroops[0] = [\"Légionnaire\", \"Prétorien\", \"Impérian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Bélier\", \"Catapulte de feu\", \"Sénateur\", \"Colon\", \"Héros\"];\n\t\taLangTroops[1] = [\"Combattant au gourdin\", \"Combattant à la lance\", \"Combattant à la hache\", \"Eclaireur\", \"Paladin\", \"Cavalier Teuton\", \"Bélier\", \"Catapulte\", \"Chef de tribu\", \"Colon\", \"Héros\"];\n\n// <-- NE PAS modifier // Utilisé dans plannification d'attaque, dans recherche de niveau suppèrieur / NO CHANGE !!\n\t\taLangTroops[2] = [\"Phalange\", \"Combattant à l'épée\", \"Eclaireur\", \"Eclair de Toutatis\", \"Cavalier druide\", \"Hédouin\", \"Bélier\", \"Catapulte de Guerre\", \"Chef\", \"Colon\", \"Héros\"];\n// original\taLangTroops[2] = [\"Phalange\", \"Combattant à l'épée\", \"Eclaireur\", \"Eclair de Toutatis\", \"Cavalier druide\", \"Hédouin\", \"Bélier\", \"Catapulte de Guerre\", \"Chef\", \"Colon\", \"Héros\"];\n\n// <-- Peu être modifié // Label des taches / CAN BE CHANGE\n// original\taLangAttackType = [\"Assistance\", \"Attaque\", \"Pillage\"];\n\t\taLangAttackType = [\"Ass.\", \"Att.\", \"Pill.\"];\n// -->\t\t\n\t\tbreak;\n// -------------------------------------------------------------------------------------------------------------------------------\n\n\tcase \"cc\": // 2011.02.13 -- yesren\n\tcase \"cn\": // 感谢K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木场\", \"黏土矿\", \"铁矿场\", \"农场\", \"\", \"木材厂\", \"砖块厂\", \"铸造厂\", \"磨坊\", \"面包房\", \"仓库\", \"粮仓\", \"铁匠铺\", \"军械库\", \"竞技场\", \"中心大楼\", \"集结点\", \"市场\", \"大使馆\", \"兵营\", \"马厩\", \"工场\", \"研发所\", \"山洞\", \"市政厅\", \"行宫\", \"皇宫\", \n\t\t\t\"宝库\", \"交易所\", \"大兵营\", \"大马厩\", \"罗马城墙\", \"日尔曼城墙\", \"高卢城墙\", \"石匠铺\", \"酿酒厂\", \"陷阱机\", \"英雄园\", \"大仓库\", \"大粮仓\", \"世界奇观\", \"饮马槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木场\", \"黏土矿\", \"铁矿场\", \"农场\", \"\", \"木材厂\", \"砖块厂\", \"铸造厂\", \"磨坊\", \"面包房\", \"仓库\", \"粮仓\", \"铁匠铺\", \"军械库\", \"竞技场\", \"中心大楼\", \"集结点\", \"市场\", \"大使馆\", \"兵营\", \"马厩\", \"工场\", \"研发所\", \"山洞\", \"市政厅\", \"行宫\", \"皇宫\", \n\t\t\t\"宝库\", \"交易所\", \"大兵营\", \"大马厩\", \"罗马城墙\", \"日尔曼城墙\", \"高卢城墙\", \"石匠铺\", \"酿酒厂\", \"陷阱机\", \"英雄园\", \"大仓库\", \"大粮仓\", \"世界奇观\", \"饮马槽\"];\n\t\taLangAddTaskText = [\"添加任务\", \"任务类型\", \"所在村\", \"任务对象\", \"目标\", \"模式\", \"支援建设\", \"资源集中\", \"上移\", \"下移\", \"删除\", \"任务内容\", \"移动\", \"清除所有任务\"];\n\t\taLangTaskKind = [\"升级\", \"新建\", \"攻击\", \"研发\", \"训练\", \"运输\", \"活动\", \"拆除\", \"定制运输\"];\n\t\taLangGameText = [\"等级\", \"商人\", \"坑号\", \"主村\", \"执行时间\", \"此时间设置目前无效\", \"到\", \"村庄\", \"运送\", \"回来\", \"向\", \"来自于\", \"从\", \"资源\", \"建筑\", \"建造新的建筑\", \"空\", \"等级\"];\n\t\taLangRaceName = [\"罗马人\", \"日尔曼人\", \"高卢人\"];\n\t\taLangTaskOfText = [\"预定升级\", \"预定新建\", \"资源自动升级\", \"尚未开启\", \"马上开启\", \"已经开启\", \"点击关闭\", \"该村资源田分布\", \"自动运输\", \"自动运输尚未设定\", \"已设定\", \"运送成功\", \"任务列表\", \"资源输入限额\", \"默认\", \"更改\", \"木/泥/铁\", \"粮食\", \"预定拆除\",\n\t\t\t\"预定发兵\", \"攻击类型\", \"到达所需时间\", \"重复次数\", \"间隔时间\", \"00:30:00\", \"投石目标\", \"随机\", \"未知\", \"次\", \"月\", \"日\", \"部队已发出\",\"预定训练\",\"训练设施\",\"训练任务已执行\",\"定制运输\",\"设定页面刷新间隔\",\n\t\t\t\"页面刷新的间隔时间,是指隔多久执行一次页面的自动载入。\\n此时间过短,会增加被系统侦测到的危险,过长则影响任务执行的效率。\\n默认为20分钟,请输入新的时间间隔:\\n\\n\",\"资源输出保留\",\"预定活动\",\"小型活动\",\"大型活动\",\"资源集中模式的运输间隔\",\n\t\t\t\"分钟\",\"暂停中\",\"开启中\",\"开启\",\"暂停\",\"预定改良\",\"改良攻击\",\"改良防御\", \"资源过剩检查\", \"已经开启\", \"已经关闭\", \"粮田自动升级\", \"切换\"];\n\t\taLangErrorText = [\"资源不足\", \"已经有建筑在建造中\", \"建造完成\", \"将马上开始全部建造\", \"在开发中\", \"建造所需资源超过仓库容量上限,请先升级你的仓库\", \"建造所需资源超过粮仓容量上限,请先升级你的粮仓\", \"资源何时充足时间提示\",\"粮食产量不足: 需要先建造一个农场\",\"一个活动正在举行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的资源田可以升级到20,<br />目前主村尚未识别,点击个人资料<br />页面可以解决这一问题\", \"五星级传送门^_^\", \"已经设置完成\", \"已经取消\", \"开始执行任务\", \"升级成功\", \"已顺利执行\", \"种族尚未确认,兵种也就无法确定,<br />请点击个人资料页面,以便侦测种族\", \"然后,请顺便访问英雄园,以便确认<br />英雄的种类和速度。<br />\"];\n\t\taLangResources=[\"木材\",\"泥土\",\"铁块\",\"粮食\"];\n\t\taLangTroops[0] = [\"古罗马步兵\", \"禁卫兵\", \"帝国兵\", \"使节骑士\", \"帝国骑士\", \"将军骑士\", \"冲撞车\", \"火焰投石器\", \"参议员\", \"拓荒者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧头兵\", \"侦察兵\", \"圣骑士\", \"日耳曼骑兵\", \"冲撞车\", \"投石器\", \"执政官\", \"拓荒者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方阵兵\", \"剑士\", \"探路者\", \"雷法师\", \"德鲁伊骑兵\", \"海顿圣骑士\", \"冲撞车\", \"投石器\", \"首领\", \"拓荒者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻击\", \"抢夺\"];\n\t\tbreak;\n\t\t\n\tcase \"hk\": // 感谢sean3808、K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\",\"\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬棚\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬棚\", \"城牆\", \"土牆\", \"木牆\", \"石匠鋪\", \"釀酒廠\", \"陷阱\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\",\"\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬棚\", \"工場\", \"研究院\", \"山洞\", \"城鎮廳\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬棚\", \"城牆\", \"土牆\", \"木牆\", \"石匠鋪\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAddTaskText = [\"添加任務\", \"任務類型\", \"所在村\", \"任務對象\", \"目標\", \"模式\", \"支援建設\", \"資源集中\", \"上移\", \"下移\", \"刪除\", \"任務內容\", \"移動\", \"清除所有任務\"];\n\t\taLangTaskKind = [\"升級\", \"新建\", \"攻擊\", \"研發\", \"訓練\", \"運輸\", \"平倉\", \"拆除\", \"活動\"];\n\t\taLangGameText = [\"等級\", \"商人\", \"坑號\", \"主村\", \"執行時間\", \"該時間設置尚未啟用\", \"到\", \"村莊\", \"運送\", \"回來\", \"運輸到\", \"從\", \"由\", \"資源\", \"建築\", \"建造新的建築物\", \"empty\", \"等級\"];\n\t\taLangRaceName = [\"羅馬人\", \"條頓人\", \"高盧人\"];\n\t\taLangTaskOfText = [\"預定升級\", \"預定建築\", \"資源自動升級\", \"尚未開啟\", \"馬上開啟\", \"已經開啟\", \"點擊關閉\", \"該村資源分布\", \"自動運輸\", \"自動運輸尚未設定\", \"已設定\", \"運送成功\", \"任務列表\", \"資源輸入限額\", \"默認\", \"更改\", \"木/磚/鐵\", \"穀物\", \"預定拆除\",\n\t\t\t\"預定發兵\", \"攻擊類型\", \"到達所需時間\", \"重複次數\", \"間隔時間\", \"00:30:00\", \"投石目標\", \"隨機\", \"未知\", \"次\", \"月\", \"日\", \"部隊已發出\",\"預定訓練\",\"訓練設施\",\"訓練任務已執行\",\"定制運輸\",\"設定頁面刷新間隔\",\"頁面刷新的間隔時間,是指隔多久執行一次頁面的自動載入。\\n此時間過短,會增加被系統偵測到的危險,過長則影響任務執行的效率。\\n默認為20分鐘,請輸入新的時間間隔:\\n\\n\",\"資源輸出保留\",\"預定活動\",\"小型活動\",\"大型活動\",\"資源集中模式的間隔時間\",\n\t\t\t\"分鐘\",\"暫停中\",\"開啟中\",\"開啟\",\"暫停\",\"預定改良\",\"改良攻擊\",\"改良防御\", \"資源過剩檢查\", \"已經開啟\", \"已經關閉\", \"糧田自動升級\", \"切換\"];\n\t\taLangErrorText = [\"資源不足\", \"工作正在進行中\", \"完全地開發\", \"將馬上開始全部建造\", \"在開發中\", \"倉庫需要升級\", \"糧倉需要升級\", \"資源何時充足時間提示\",\"糧食產量不足: 需要先建造一個農場\",\"派對進行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的資源田可以升級到20,<br/>目前主村尚未識別,點擊個人資料<br/>頁面可以解決這一問題\", \"五星級傳送門^_ ^\", \"已經設置完成\", \"已經取消\", \"開始執行任務\", \"升級成功\", \"已順利執行\", \"種族尚未確認,兵種也就無法確定,<br/>請點擊個人資料頁面,以便偵測種族\", \"然後,請順便訪問英雄園,以便確認<br/>英雄的種類和速度。<br/>\"];\n\t\taLangResources=[\"木材\",\"磚塊\",\"鋼鐵\",\"穀物\"];\n\t\taLangTroops[0] = [\"古羅馬步兵\", \"禁衛兵\", \"帝國兵\", \"使者騎士\", \"帝國騎士\", \"將軍騎士\", \"衝撞車\", \"火焰投石機\", \"參議員\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧頭兵\", \"偵察兵\", \"遊俠\", \"條頓騎士\", \"衝撞車\", \"投石機\", \"司令官\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方陣兵\", \"劍士\", \"探路者\", \"雷法師\", \"德魯伊騎兵\", \"海頓聖騎\", \"衝撞車\", \"投石機\", \"族長\", \"開拓者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻擊\", \"搶奪\"];\n\t\tbreak;\n\n\tcase \"tw\": // 感谢adobe、魎皇鬼、ieyp、K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\", \"農田\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬廄\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬廄\", \"城牆\", \"土牆\", \"木牆\", \"石匠舖\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\", \"農田\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬廄\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬廄\", \"城牆\", \"土牆\", \"木牆\", \"石匠舖\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAddTaskText = [\"添加任務\", \"任務類型\", \"所在村\", \"任務對象\", \"目標\", \"模式\", \"支援建設\", \"資源集中\", \"上移\", \"下移\", \"刪除\", \"任務內容\", \"移動\", \"清除所有任務\"];\n\t\taLangTaskKind = [\"升級\", \"新建\", \"攻擊\", \"研發\", \"訓練\", \"運輸\", \"平倉\", \"拆除\", \"活動\"];\n\t\taLangGameText = [\"等級\", \"商人\", \"坑號\", \"主村\", \"執行時間\", \"該時間設置尚未啟用\", \"到\", \"村莊\", \"運送\", \"回來\", \"運送到\", \"從\", \"由\", \"資源\", \"建築\", \"建造新的建築物\", \"empty\", \"等級\"];\n\t\taLangRaceName = [\"羅馬人\", \"條頓人\", \"高盧人\"];\n\t\taLangTaskOfText = [\"預定升級\", \"預定建築\", \"資源自動升級\", \"尚未開啟\", \"馬上開啟\", \"已經開啟\", \"點擊關閉\", \"該村資源分布\", \"自動運輸\", \"自動運輸尚未設定\", \"已設定\", \"運送成功\", \"任務列表\", \"資源輸入限額\", \"默認\", \"更改\", \"木/磚/鐵\", \"穀物\", \"預定拆除\",\n\t\t\t\"預定發兵\", \"攻擊類型\", \"到達所需時間\", \"重複次數\", \"間隔時間\", \"00:30:00\", \"投石目標\", \"隨機\", \"未知\", \"次\", \"月\", \"日\", \"部隊已發出\",\"預定訓練\",\"訓練設施\",\"訓練任務已執行\",\"定制運輸\",\"設定頁面刷新間隔\",\"頁面刷新的間隔時間,是指隔多久執行一次頁面的自動載入。\\n此時間過短,會增加被系統偵測到的危險,過長則影響任務執行的效率。\\n默認為20分鐘,請輸入新的時間間隔:\\n\\n\",\"資源輸出保留\",\"預定活動\",\"小型活動\",\"大型活動\",\"資源集中模式的間隔時間\",\n\t\t\t\"分鐘\",\"暫停中\",\"開啟中\",\"開啟\",\"暫停\",\"預定改良\",\"改良攻擊\",\"改良防御\", \"資源過剩檢查\", \"已經開啟\", \"已經關閉\", \"糧田自動升級\", \"切換\"];\n\t\taLangErrorText = [\"資源不足\", \"已經有建築在建造中\", \"建造完成\", \"將馬上開始全部建造\", \"在開發中\", \"建造所需資源超過倉庫容量上限,請先升級你的倉庫\", \"建造所需資源超過糧倉容量上限,請先升級你的糧倉\", \"資源何時充足時間提示\",\"糧食產量不足: 需要先建造一個農場\",\"派對進行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的資源田可以升級到20,<br/>目前主村尚未識別,點擊個人資料<br/>頁面可以解決這一問題\", \"五星級傳送門^_ ^\", \"已經設置完成\", \"已經取消\", \"開始執行任務\", \"升級成功\", \"已順利執行\", \"種族尚未確認,兵種也就無法確定,<br/>請點擊個人資料頁面,以便偵測種族\", \"然後,請順便訪問英雄園,以便確認<br/>英雄的種類和速度。<br/>\"];\n\t\taLangResources=[\"木材\",\"磚塊\",\"鋼鐵\",\"穀物\"];\n\t\taLangTroops[0] = [\"古羅馬步兵\", \"禁衛兵\", \"帝國兵\", \"使者騎士\", \"帝國騎士\", \"將軍騎士\", \"衝撞車\", \"火焰投石機\", \"參議員\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧頭兵\", \"偵察兵\", \"遊俠\", \"條頓騎士\", \"衝撞車\", \"投石機\", \"司令官\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方陣兵\", \"劍士\", \"探路者\", \"雷法師\", \"德魯伊騎兵\", \"海頓聖騎\", \"衝撞車\", \"投石機\", \"族長\", \"開拓者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻擊\", \"搶奪\"];\n\t\tbreak;\n\n\tcase \"fi\": // thanks Christer82\n\t\taLangAllBuildWithId = [\"Puunhakkaaja\", \"Savimonttu\", \"Rautakaivos\", \"Viljapelto\", \"\", \"Saha\", \"Tiilitehdas\", \"Rautavalimo\", \"Mylly\", \"Leipomo\", \"Varasto\", \"Viljasiilo\", \"Aseseppä\", \"Haarniskapaja\", \"Turnausareena\", \"Päärakennus\", \"Kokoontumispiste\", \"Tori\", \"Lähetystö\", \"Kasarmi\", \"Talli\", \"Työpaja\", \"Akatemia\", \"Kätkö\", \"Kaupungintalo\", \"Virka-asunto\", \"Palatsi\", \"Aarrekammio\", \"Kauppavirasto\", \"Suuri kasarmi\", \"Suuri talli\", \"Kaupungin muuri\", \"Maamuuri\", \"Paaluaita\", \"Kivenhakkaaja\", \"Panimo\", \"Ansoittaja\",\"Sankarin kartano\", \"Suuri varasto\", \"Suuri viljasiilo\", \"Maailmanihme\", \"Hevostenjuottoallas\"];\n\t\taLangAllBuildAltWithId = [\"Puunhakkaaja\", \"Savimonttu\", \"Rautakaivos\", \"Viljapelto\", \"\", \"Saha\", \"Tiilitehdas\", \"Rautavalimo\", \"Mylly\", \"Leipomo\", \"Varasto\", \"Viljasiilo\", \"Aseseppä\", \"Haarniskapaja\", \"Turnausareena\", \"Päärakennus\", \"Kokoontumispiste\", \"Tori\", \"Lähetystö\", \"Kasarmi\", \"Talli\", \"Työpaja\", \"Akatemia\", \"Kätkö\", \"Kaupungintalo\", \"Virka-asunto\", \"Palatsi\", \"Aarrekammio\", \"Kauppavirasto\", \"Suuri kasarmi\", \"Suuri talli\", \"Kaupungin muuri\", \"Maamuuri\", \"Paaluaita\", \"Kivenhakkaaja\", \"Panimo\", \"Ansoittaja\",\"Sankarin kartano\", \"Suuri varasto\", \"Suuri viljasiilo\", \"Maailmanihme\", \"Hevostenjuottoallas\"];\n\t\taLangAddTaskText = [\"Lisää tehtävä\", \"Tyyli\", \"Kohdistettu kylä\", \"Tehtävän kohde\", \"Minne:\", \"Tyyppi\", \"Rakennustuki\", \"Resurssien keskittäminen\", \"Siirry ylös\", \"Siirry alas\", \"Poista\", \"&#160;&#160;&#160;Tehtävän sisältö\", \"Siirry \", \"Poista kaikki tehtävät\"];\n\t\taLangTaskKind = [\"Päivitä\", \"Uusi rakennus\", \"Hyökkäys\", \"Tutkimus\", \"Koulutus\", \"Kuljetus\", \"NPC\", \"Hajotus\", \"Juhla\"];\n\t\taLangGameText = [\"Taso\", \"Kauppiaat\", \"ID\", \"Pääkaupunki\", \"Aloitusaika\", \"Tätä aika-asetusta ei voi nyt käyttää.\", \"minne:\", \"Kylä\", \"kuljetus\", \"mistä\", \"Kuljeta kylään\", \"Kuljeta kylästä\", \"Palaa kylästä\", \"Resurssit\", \"rakennus\", \"Rakenna uusi rakennus\", \"tyhjä\", \"taso\"];\n\t\taLangRaceName = [\"Roomalaiset\", \"Teutonit\", \"Gallialaiset\"];\n\t\taLangTaskOfText = [\"Aseta kentän päivitys\", \"Aseta uusi rakennuskohde\", \"Automaattinen resurssipäivitys\", \"Ei toimintaa\", \"Aloita\", \"Aloitettu\", \"Keskeytä\", \"Tämän kylän resurssikenttien jakauma on \", \"Automaattikuljetus\", \"automaattikuljetusta ei ole avattu\", \"Avattu\", \"Kuljetus onnistui\", \"Tehtäväluettelo\", \"Trans_In_limit\", \"Perusasetus\", \"Muokkaa\", \"Puu/Savi/Rauta\", \"vilja\", \"Tehtävälistan poisto\",\n\t\t\t\"Schedule attack\", \"Hyökkäystyyppi\", \"Kuljetusaika\", \"toistokerrat\", \"Hyökkäysaikaväli\",\"00:30:00\",\"Katapultin kohde\",\"Satunnainen\", \"Tuntematon\", \"kertaa\", \"Kuukausi\", \"Päivä\", \"Joukot on lähetetty\",\"Aseta koulutustehtävä\",\"Koulutuskohde\",\"Koulutustehtävä suoritettu\",\"waitForTranslate\",\"setup Hyökkäysaikaväli of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minutes\",\"pausing\",\"running\",\"run\",\"pause\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Liian vähän resursseja\", \"Työntekijät ovat jo töissä.\", \"Rakennuskohde valmis\", \"Aloitetaan rakentaminen\", \"Työ kesken\", \"Varastosi on liian pieni. Suurenna varastoa aloittaaksesi rakentamisen\", \"Viljasiilosi on liian pieni. Suurenna viljasiiloa aloittaaksesi rakentamisen\", \"Riittävästi resursseja\"];\n\t\taLangOtherText = [\"Tärkeä huomautus\", \"Vain pääkaupungin resurssikenttiä voidaan <br/>päivittää tasolle 20. Nyt pääkaupunkia<br/> ei voida todentaa. Päivitä profiiliasi, kiitos.\", \"Pikalinkki tähän ^_^\", \"Asennus valmis\", \"Peruttu\", \"Aloita tehtävät\", \"Päivitys valmis\", \"Tehty onnistuneesti\", \"Heimosi on määrittämätön, siksi joukkojesi tyyppiä <br/>Päivitä profiiliasi heimon määrittämiseksi.<br/>\", \"Käy Sankarin kartanossa määrittääksesi<br/> sankarisi tyypin ja nopeuden.\"];\n\t\taLangResources=[\"waitTranslate\",\"waitTranslate\",\"waitTranslate\",\"waitTranslate\"];\n\t\taLangTroops[0] = [\"Legioonalainen\", \"Pretoriaani\", \"Imperiaani\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Muurinmurtaja\", \"Tulikatapultti\", \"Senaattori\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangTroops[1] = [\"Nuijamies\", \"Keihäsmies\", \"Kirvessoturi\", \"Tiedustelija\", \"Paladiini\", \"Teutoniritari\", \"Muurinmurtaja\", \"Katapultti\", \"Päällikkö\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangTroops[2] = [\"Falangi\", \"Miekkasoturi\", \"Tunnustelija\", \"Teutateksen salama\", \"Druidiratsastaja\", \"Haeduaani\", \"Muurinmurtaja\", \"Heittokone\", \"Päällikkö\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangAttackType = [\"Vahvistus\", \"Hyökkäys\", \"Ryöstö\"];\n\t\tbreak;\n\n\tcase \"us\": // by shadowx360\n\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armory\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"Town Hall\", \"Residence\", \"Palace\", \"Treasury\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason's Lodge\", \"Brewery\", \"Trapper\",\"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armory\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"Town Hall\", \"Residence\", \"Palace\", \"Treasury\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason's Lodge\", \"Brewery\", \"Trapper\",\"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is notuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Wheat\", \"Schedule demolition\",\n\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Too few resources.\", \"Your builders are already working\", \"completely upgraded\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\taLangResources=[\"lumber\",\"clay\",\"iron\",\"wheat\"];\n\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\tbreak;\n\n\tcase \"in\":\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armoury\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armoury\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\t\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\t\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Too few resources.\", \"Your workers are already building something.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\", \"Food shortage: Upgrade a wheat field first\", \"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources = [\"lumber\", \"clay\", \"iron\", \"crop\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"Place for new building\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Smithy\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Smithy\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\t\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\t\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Too few resources.\", \"Your workers are already building something.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\", \"Food shortage: Upgrade a wheat field first\", \"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources = [\"lumber\", \"clay\", \"iron\", \"crop\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'in\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\tcase \"sk\": // by Zapo [ 2011.04.07 ]\n\t\taLangAllBuildWithId = [\"Drevorubač\", \"Hlinená baňa\", \"Železná baňa\", \"Obilné pole\", \"\", \"Píla\", \"Tehelňa\", \"Zlievareň\", \"Mlyn\", \"Pekáreň\", \"Sklad surovín\", \"Sýpka\", \"Kováč\", \"Zbrojnica\", \"Turnajové ihrisko\", \"Hlavná budova\", \"Zhromaždisko\", \"Trhovisko\", \"Ambasáda\", \"Kasárne\", \"Stajne\", \"Dielňa\", \"Akadémia\", \"Úkryt\", \"Radnica\", \"Rezidencia\", \"Palác\", \"Pokladnica\", \"Obchodná kancelária\", \"Veľké kasárne\", \"Veľká stajňa\", \"Mestské hradby\", \"Zemná hrádza\", \"Palisáda\", \"Kamenár\", \"Pivovar\", \"Pasti\",\"Dvor hrdinov\", \"Veľké dielne\", \"Veľká sýpka\", \"Div sveta\", \"Žriedlo\"];\n\t\taLangAllBuildAltWithId = [\"Drevorubač\", \"Hlinená baňa\", \"Železná baňa\", \"Obilné pole\", \"\", \"Píla\", \"Tehelňa\", \"Zlievareň\", \"Mlyn\", \"Pekáreň\", \"Sklad surovín\", \"Sýpka\", \"Kováč\", \"Zbrojnica\", \"Turnajové ihrisko\", \"Hlavná budova\", \"Zhromaždisko\", \"Trhovisko\", \"Ambasáda\", \"Kasárne\", \"Stajne\", \"Dielňa\", \"Akadémia\", \"Úkryt\", \"Radnica\", \"Rezidencia\", \"Palác\", \"Pokladnica\", \"Obchodná kancelária\", \"Veľké kasárne\", \"Veľká stajňa\", \"Mestské hradby\", \"Zemná hrádza\", \"Palisáda\", \"Kamenár\", \"Pivovar\", \"Pasti\",\"Dvor hrdinov\", \"Veľké dielne\", \"Veľká sýpka\", \"Div sveta\", \"Žriedlo\"];\n\t\taLangAddTaskText = [\"Pridaj úlohu\", \"Štýl\", \"Aktívna dedina\", \"Plánovaný cieľ\", \"To\", \"Mód\", \"Construction support\", \"Resources concentration\", \"Presuň hore\", \"Presuň dole\", \"Zmaž\", \" Obsah úloh\", \"Posun \", \"Zmaž všetky úlohy\"];\n\t\taLangTaskKind = [\"Upgrade\", \"Nová stavba\", \"Útok\", \"Výskum\", \"Trénovať\", \"Transport\", \"NPC\", \"Búrať\", \"Oslavy\"];\n\t\taLangGameText = [\"Lvl\", \"Obchodníci\", \"ID\", \"Hlavná dedina\", \"Start time\", \"nastavenie času je nepoužiteľný teraz.\", \"do\", \"Dedina\", \"transport\", \"od\", \"Transport do\", \"Transport od\", \"Návrat z\", \"suroviny\", \"budova\", \"Postaviť novú budovu\", \"prázdne\", \"úroveň\"];\n\t\taLangRaceName = [\"Rimania\", \"Germáni\", \"Galovia\"];\n\t\taLangTaskOfText = [\"Naplánovať Upgrade\", \"Naplánovať novú budovu\", \"Auto ResUpD\", \"Nebeží\", \"Štart\", \"Beží\", \"Suspend\", \"Surovinová distribúcia tejto dediny je \", \"Autotransport\", \"Autotransport nie je otvorený\", \"Otvorený\", \"Transport úspešný\", \"Zoznam úloh\", \"Trans In limit\", \"Default\", \"Zmeň\", \"Drevo/Hlina/Železo\", \"Obilie\", \"Naplánuj demolíciu\",\n\t\t\t\"Naplánuj útok\", \"Typ útoku\", \"Čas cesty\", \"opakovať\", \"časový interval\",\"00:30:00\",\"Cieľ Katapultu\",\"Náhodne\", \"Neznámy\", \"krát\", \"Mesiac\", \"Deň\", \"Poslať jednotky\",\n\t\t\t\"Naplánovať výcvik\",\"Výcvikové miesto\",\"Výcviková úloha hotová\",\"customTransport\",\"nastav časový interval obnovenia\",\"toto je interval obnovenia stránky ,\\n default je 20 minút, prosím vlož nový čas:\\n\\n\",\"Trans Out Rmn\",\"NaplánujOslavu\",\"malá slava\",\"veľká oslava\",\"nastavInterval surovinovej koncentrácie\",\n\t\t\t\"minút\",\"pozastavené\",\"spustené\",\"spusť\",\"pauza\",\"Naplánuj vylepšenie\",\"Vylepšiť Útok\",\"Vylepšiť Obranu\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Príliš málo surovín.\", \"Stavitelia majú momentálne veľa práce\", \"Stavanie kompletné\", \"Začína stavanie\", \"Vo vývoji\", \"Tvoj sklad je príliš malý. Prosím zvýš tvoj Sklad na pokračovanie stavania\", \"Tvoja Sýpka je príliš malá. Prosím zvýš tvoju Sýpku na pokračovanie stavania\", \"Dostatok surovín\",\"Nedostatok potravín: rozšír obilné polia najskôr!\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Dôležité poznámky\", \"Surovinové polia môžu byť len v hlavnej zvyšované na úroveň 20. Teraz nieje určená tvoja hlavná. Navštív tvoj Profil prosím.\", \"Skratka tu ^_^\", \"Nastavenie kompletné\", \"Zrušené\", \"Spusť úlohy\", \"Upgrade úspešný\", \"Spustenie úspešné\", \"Tvoj národ je neznámy, therefore your troop type. Navštív tvoj Profil na určenie tvojho národa.\", \"Prosím navštív tiež tvoj Dvor hrdinov na určenie rýchlosti a typu tvojho hrdinu.\"];\n\t\taLangResources = [\"drevo\",\"hlina\",\"železo\",\"obilie\"];\n\t\taLangTroops[0] = [\"Legionár\", \"Pretorián\", \"Imperián\", \"Equites Legáti\", \"Equites Imperátoris\", \"Equites Caesaris\", \"Rímske Baranidlo\", \"Ohnivý Katapult\", \"Senátor\", \"Osadník\", \"Hrdina\"];\n\t\taLangTroops[1] = [\"Pálkar\", \"Oštepár\", \"Bojovník so sekerou\", \"Špeh\", \"Rytier\", \"Teuton jazdec\", \"Germánske baranidlo\", \"Katapult\", \"Kmeňový vodca\", \"Osadník\", \"Hrdina\"];\n\t\taLangTroops[2] = [\"Falanx\", \"Šermiar\", \"Sliedič\", \"Theutates Blesk\", \"Druid jazdec\", \"Haeduan\", \"Drevené Baranidlo\", \"Vojnový Katapult\", \"Náčelník\", \"Osadník\", \"Hrdina\"];\n\t\taLangAttackType = [\"Podpora\", \"Útok\", \"Lúpež\"];\n\t\tbreak;\n\n\tcase \"id\":\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Penebangan Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Penggergajian\", \"Pabrik Bata\", \"Peleburan Besi\", \"Penggilingan Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Penggergajian\", \"Pabrik Bata\", \"Peleburan Besi\", \"Penggilingan Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAddTaskText = [\"Tambah Pengerjaan\", \"Jenis\", \"Desa Aktif\", \"Target Pengerjaan\", \"ke\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Menaikkan\", \"Dirikan\", \"Serang\", \"riset\", \"latih\", \"Kirim\", \"NPC\", \"Bongkar\", \"Perayaan\"];\n\t\t\t\taLangGameText = [\"Tk\", \"Pedagang\", \"ID\", \"Ibukota\", \"Waktu mulai\", \"jangan gunakan waktu di atas\", \"ke\", \"Desa\", \"kirim\", \"dari\", \"Kirim ke\", \"Kiriman dari\", \"Kembali dari\", \"sumberdaya\", \"bangunan\", \"Mendirikan Bangunan\", \"kosong\", \"tingkat\"];\n\t\t\t\taLangRaceName = [\"Romawi\", \"Teuton\", \"Galia\"];\n\t\t\t\taLangTaskOfText = [\"Jadwal Menaikkan\", \"Jadwal Dirikan\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Otomatis kirim\", \"Autotransport is not opened\", \"Opened\", \"Pengiriman Berhasil\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Kayu/Liat/Besi\", \"Gandum\", \"Jadwal Pembongkaran\",\n\t\t\t\t\t\"Jadwal Serangan\", \"Tipe serangan\", \"Waktu tiba\", \"diulang\", \"rentang waktu\", \"00:30:00\", \"Target catapult\", \"Acak\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Pasukan terkirim\",\n\t\t\t\t\t\"Jadwal Pelatihan\", \"Tempat latih\", \"Pelatihan selesai\", \"Atur kirim\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"Jadwal Perayaan\",\"Perayaan kecil\",\"Perayaan besar\",\"setInterval of Resources concentration\",\n\t\t\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Jadwal Pengembangan\",\"Pengembangan serangan\",\"Pengembangan pertahanan\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"sumberdaya cukup pada\", \"Pekerja sedang bekerja\", \"sepenuhnya telah dikembangkan\", \"Dirikan bangunan\", \"Sedang Membangun\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"sumberdaya cukup pada\",\"Kurang makanan: kembangkan ladang terlebih dahulu\",\"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources=[\"Kayu\",\"Liat\",\"Besi\",\"Gandum\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangAttackType = [\"Bantuan\", \"Serang\", \"Rampok\"];\n\t\t\t\tbreak; \n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Pemotong Kayu\", \"Pabrik Bata\", \"Pelebur Besi\", \"Penggiling Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Pemotong Kayu\", \"Pabrik Bata\", \"Pelebur Besi\", \"Penggiling Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAddTaskText = [\"Tambah Pengerjaan\", \"Jenis\", \"Desa Aktif\", \"Target Pengerjaan\", \"ke\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Menaikkan\", \"Dirikan\", \"Serang\", \"riset\", \"latih\", \"Kirim\", \"NPC\", \"Bongkar\", \"Perayaan\"];\n\t\t\t\taLangGameText = [\"Tk\", \"Pedagang\", \"ID\", \"Ibukota\", \"Waktu mulai\", \"jangan gunakan waktu di atas\", \"ke\", \"Desa\", \"kirim\", \"dari\", \"Kirim ke\", \"Kiriman dari\", \"Kembali dari\", \"sumberdaya\", \"bangunan\", \"Mendirikan Bangunan\", \"kosong\", \"tingkat\"];\n\t\t\t\taLangRaceName = [\"Romawi\", \"Teuton\", \"Galia\"];\n\t\t\t\taLangTaskOfText = [\"Jadwal Menaikkan\", \"Jadwal Dirikan\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Otomatis kirim\", \"Autotransport is not opened\", \"Opened\", \"Pengiriman Berhasil\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Kayu/Liat/Besi\", \"Gandum\", \"Jadwal Pembongkaran\",\n\t\t\t\t\t\"Jadwal Serangan\", \"Tipe serangan\", \"Waktu tiba\", \"diulang\", \"rentang waktu\", \"00:30:00\", \"Target catapult\", \"Acak\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Pasukan terkirim\",\n\t\t\t\t\t\"Jadwal Pelatihan\", \"Tempat latih\", \"Pelatihan selesai\", \"Atur kirim\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"Jadwal Perayaan\",\"Perayaan kecil\",\"Perayaan besar\",\"setInterval of Resources concentration\",\n\t\t\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Jadwal Pengembangan\",\"Pengembangan serangan\",\"Pengembangan pertahanan\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"sumberdaya cukup pada\", \"Pekerja sedang bekerja\", \"sepenuhnya telah dikembangkan\", \"Dirikan bangunan\", \"Sedang Membangun\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"sumberdaya akan cukup pada\",\"Gandum anda dalam kondisi minus maka tidak akan pernah sampai pada jumlah sumber daya yang dibutuhkan.\",\"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources=[\"Kayu\",\"Liat\",\"Besi\",\"Gandum\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangAttackType = [\"Bantuan\", \"Serang\", \"Rampok\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'id\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\n\tcase \"au\":\t\n\tcase \"uk\":\t\n\tcase \"com\": // thanks ieyp\n\tdefault:\n\t\t// used for logic, translation required\n\t\taLangAllBuildWithId = aLangAllBuildWithIdComDef.slice(0);\n\t\t// used for logic, translation required\n\t\taLangAllBuildAltWithId = aLangAllBuildAltWithIdComDef.slice(0);\n\t\t// used for display only\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t// used for display only\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t// used for logic and display, translation required\n\t\taLangGameText = aLangGameTextComDef.slice(0);\n\t\t// used for getMainVillageid(), translation required\n\t\taLangRaceName = aLangRaceNameComDef.slice(0);\n\t\t// used for display only\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t// used for logic & display, translation required\n\t\taLangErrorText = aLangErrorTextComDef.slice(0);\n\t\t// used for display\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t// used for display only, however translation can be done\n\t\taLangResources = aLangResourcesComDef.slice(0);\n\t\t// used for logic & display, translation required\n\t\taLangTroops[0] = aLangTroopsComDef[0].slice(0);\n\t\taLangTroops[1] = aLangTroopsComDef[1].slice(0);\n\t\taLangTroops[2] = aLangTroopsComDef[2].slice(0);\n\t\t// used for display only, however translation can be done\n\t\taLangAttackType = aLangAttackTypeComDef.slice(0);\n\t\tbreak;\n\n\tcase \"pl\": // partial translation by deFox\n\t\t// 2011.02.13 -- partial translation by Blaker\n\t\taLangAllBuildWithId = [\"Las\", \"Kopalnia gliny\", \"Kopalnia żelaza\", \"Pole zboża\", \"\", \"Tartak\", \"Cegielnia\", \"Huta stali\", \"Młyn\", \"Piekarnia\", \"Magazyn surowców\", \"Spichlerz\", \"Zbrojownia\", \"Kuźnia\", \"Plac turniejowy\", \"Główny budynek\", \"Miejsce zbiórki\", \"Rynek\", \"Ambasada\", \"Koszary\", \"Stajnia\", \"Warsztat\", \"Akademia\", \"Kryjówka\", \"Ratusz\", \"Rezydencja\", \"Pałac\", \"Skarbiec\", \"Targ\", \"Duże koszary\", \"Duża stajnia\", \"Mur obronny\", \"Wał ziemny\", \"Palisada\", \"Kamieniarz\", \"Browar\", \"Traper\",\"Dwór bohatera\", \"Duży magazyn surowców\", \"Duży spichlerz\", \"Cud świata\", \"Wodopój\"];\n\t\taLangAllBuildAltWithId = [\"Las\", \"Kopalnia gliny\", \"Kopalnia żelaza\", \"Pole zboża\", \"\", \"Tartak\", \"Cegielnia\", \"Huta stali\", \"Młyn\", \"Piekarnia\", \"Magazyn surowców\", \"Spichlerz\", \"Zbrojownia\", \"Kuźnia\", \"Plac turniejowy\", \"Główny budynek\", \"Miejsce zbiórki\", \"Rynek\", \"Ambasada\", \"Koszary\", \"Stajnia\", \"Warsztat\", \"Akademia\", \"Kryjówka\", \"Ratusz\", \"Rezydencja\", \"Pałac\", \"Skarbiec\", \"Targ\", \"Duże koszary\", \"Duża stajnia\", \"Mur obronny\", \"Wał ziemny\", \"Palisada\", \"Kamieniarz\", \"Browar\", \"Traper\",\"Dwór bohatera\", \"Duży magazyn surowców\", \"Duży spichlerz\", \"Cud świata\", \"Wodopój\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct new building\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Rzymianie\", \"Germanie\", \"Galowie\"];\n\t\taLangTaskOfText = [\"Zaplanuj Upgrade\", \"Zaplanuj Budowę\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Lista zadań\", \"Trans In limit\", \"Domyśl.\", \"Zmień\", \"Drewno/Glina/Żelazo\", \"Zboże\", \"Schedule demolition\",\n\t\t\t\"Zaplanuj atak\", \"Typ Ataku\", \"Czas podróży\", \"repeat times\", \"odstęp czasu\", \"00:30:00\",\"Cel dla katapult\", \"Losowy\", \"Nieznany\", \"times\", \"Mies.\", \"Dzień\", \"Troops sent\",\n\t\t\t\"Zaplanuj szkolenie\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\",\"this is the interval of page reload,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minut\", \".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Zbyt mało surowców.\", \"The workers are already at work.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Ważna wiadomość\", \"Tylko w stolicy można rozbudować teren do poz. 20.<br/>Aktywna wioska nie została rozpoznana jako stolica.<br/>Wejdź w Ustawienia by wywołać aktualizację.\", \"Szybki link ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"Upgrade successfully\", \"Run successfully\", \"Nie udało się określić twojej rasy, stąd typy jednostek<br/>nie są znane. Wejdź w Ustawienia by skrypt wykrył twoją rasę.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\"];\n\t\taLangResources = [\"drewno\", \"glina\", \"żelazo\", \"zboże\"];\n\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Miecznik\", \"Tropiciel\", \"Grom Teutatesa\", \"Jeździec druidzki\", \"Haeduan\", \"Taran\", \"Trebusz\", \"Herszt\", \"Osadnicy\", \"Bohater\"];\n\t\taLangAttackType = [\"Posiłki\", \"Atak normalny\", \"Grabież\"];\n\t\tbreak;\n\n\tcase \"ua\":\n\t\taLangAllBuildWithId = [\"Лісоповал\", \"Глиняний кар'єр\", \"Залізна копальня\", \"Ферма\", \"\", \"Деревообробний завод\", \"Цегляний завод\", \"Чавуноливарний завод\", \"Млин\", \"Пекарня\", \"Склад\", \"Зернова комора\", \"Кузня зброї\", \"Кузня обладунків\", \"Арена\", \"Головна будівля\", \"Пункт збору\", \"Ринок\", \"Посольство\", \"Казарма\", \"Стайня\", \"Майстерня\", \"Академія\", \"Схованка\", \"Ратуша\", \"Резиденція\", \"Палац\", \"Скарбниця\", \"Торгова палата\", \"Велика казарма\", \"Велика стайня\", \"Міська стіна\", \"Земляний вал\", \" Огорожа\", \"Каменяр\", \"Пивна\", \"Капканщик\",\"Таверна\", \"Великий склад\", \"Велика Зернова комора\", \"Чудо світу\", \"Водопій\"];\n\t\taLangAllBuildAltWithId = [\"Лісоповал\", \"Глиняний кар'єр\", \"Залізна копальня\", \"Ферма\", \"\", \"Деревообробний завод\", \"Цегляний завод\", \"Чавуноливарний завод\", \"Млин\", \"Пекарня\", \"Склад\", \"Зернова комора\", \"Кузня зброї\", \"Кузня обладунків\", \"Арена\", \"Головна будівля\", \"Пункт збору\", \"Ринок\", \"Посольство\", \"Казарма\", \"Стайня\", \"Майстерня\", \"Академія\", \"Схованка\", \"Ратуша\", \"Резиденція\", \"Палац\", \"Скарбниця\", \"Торгова палата\", \"Велика казарма\", \"Велика стайня\", \"Міська стіна\", \"Земляний вал\", \" Огорожа\", \"Каменяр\", \"Пивна\", \"Капканщик\",\"Таверна\", \"Великий склад\", \"Велика Зернова комора\", \"Чудо світу\", \"Водопій\"];\n\t\taLangAddTaskText = [\"Додати завдання\", \"Спосіб\", \"Активне поселення\", \"Ціль завдання\", \"| Ціль\", \"Тип\", \"Підтримка будівництва\", \"Концентрація ресурсів\", \"Вверх\", \"Вниз\", \"\", \"\", \"\", \"Видалити усі завдання\"];\n\t\taLangTaskKind = [\"Покращити:\", \"Нове завдання:\", \"Атакувати:\", \"Розвідати:\", \" наняти:\", \"Відправити ресурси:\", \"NPC:\", \"Зруйнувати:\", \"Урочистість:\"];\n\t\taLangGameText = [\" Рівень \", \"Торговці\", \"ID\", \"Столиця\", \"Час початку\", \"(тимчасово не працює)\", \"в\", \"Поселення\", \"Транспортування\", \"з\", \"Транспортування в\", \"Транспортування из\", \"Повернення з\", \"ресурси\", \"будівля\", \"Побудувати нову будівлю\", \"пусто\", \"рівень\"];\n\t\taLangRaceName = [\"Римляни\", \"Тевтонці\", \"Галли\"];\n\t\taLangTaskOfText = [\"Запланувати удосконалення\", \"Запланувати нове завдання\", \"Качати реурси\", \"Викл\", \"Старт\", \"Вкл\", \"стоп\", \"Розполілення полів в поселенні: \", \"Автовідправлення\", \"Автовідправлення викл.\", \"Вкл.\", \"Успішно відправленно\", \"* Задачі *\", \"Обмеження ввозу\", \"Ні\", \"Змінити \", \"Дерево/Глина/Залізо\", \"Зерно\", \"Запланувати зруйнування\",\n\t\t\t\"Запланувати атаку\", \"Тип атаки\", \"Час в дорозі\", \"повтори\", \"проміжок\",\"00:30:00\",\"Ціль катов\",\"Випадково\", \"Невідомо\", \" раз\", \"/\", \" :дата/час: \", \"Війска\",\n\t\t\t\"Запланувати найм\",\"Train site\",\"Навчання військ завершено\",\"цілеве відправлення\",\"Інтервал оновлення\",\"Це інтервал оновлення сторінки ,\\n по замовчуванню - 20 хвилин, Введіть новоий час:\\n\\n\",\"Обмеження вивозу\",\"Запланувати святкування\",\"Малий праздник\",\"Великий праздник\",\"Встановлення інтервала концентрації ресурсів\",\n\t\t\t\"хвилини\",\"зупинено\",\"працює\",\"старт\",\"пауза\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Недостатньо сировини\", \"Всі будівельники зараз зайняті\", \"Це завдання зупинено повністю\", \"Починаю будівництво\", \"Процес розвитку\", \"Недостатня місткість складу\", \"Недостатня місткість Зернової комори\", \"Достатньо ресурсів\",\"\",\"Проводится урочистість\"];\n\t\taLangOtherText = [\"Важливі замітки\", \"Тільки в столиці поля можуть бути до рівня 20. Столиця не визначена.Зайдіть в профіль будьласка\", \"Ссилка тут ^_^\", \"Настройка завершена\", \"Відмінено\", \"Почати завдання\", \"Удосконалення пройшло успішно\", \"Успішно\", \"Ваш народ невизначений.Будьласка зайдіть в профіль.\", \"Також будьласка зайдіть в таверну для визначення типу та скорості героя\"];\n\t\taLangResources=[\"Деревина\",\"Глина\",\"Залізо\",\"Зерно\"];\n\t\taLangTroops[0] = [\"Легіонер\", \"Преторіанець\", \"Імперіанець\", \"Кінний розвідник\", \"Кіннота імператора\", \"Кіннота Цезаря\", \"Таран\", \"Вогняна катапульта\", \"Сенатор\", \"Поселенець\", \"Герой\"];\n\t\taLangTroops[1] = [\"Дубинник\", \"Списник\", \"Сокирник\", \"Скаут\", \"Паладин\", \"Тевтонський вершник\", \"Стінобитне знаряддя\", \"Катапульта\", \"Ватажок\", \"Поселенець\", \"Герой\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мечник\", \"Слідопит\", \"Тевтацький грім\", \"Друїд-вершник\", \"Едуйська кіннота\", \"Таран\", \"Катапульта\", \"Лідер\", \"Поселенець\", \"Герой\"];\n\t\taLangAttackType = [\"Підкріплення\", \"Напад\", \"Набіг\"];\n\t\tbreak;\n\n\tcase \"tr\": // by karambol update the 27 Mar 2010 by SARLAK\n aLangAllBuildWithId = [\"Oduncu\", \"Tuğla Ocağı\", \"Demir Madeni\", \"Tarla\", \"\", \"Kereste Fabrikası\", \"Tuğla Fırını\", \"Demir Dökümhanesi\", \"Değirmen\", \"Ekmek Fırını\", \"Hammadde deposu\", \"Tahıl Ambarı\", \"Silah Dökümhanesi\", \"Zırh Dökümhanesi\", \"Turnuva Yeri\", \"Merkez Binası\", \"Askeri Üs\", \"Pazar Yeri\", \"Elçilik\", \"Kışla\", \"Ahır\", \"Tamirhane\", \"Akademi\", \"Sığınak\", \"Belediye\", \"Köşk\", \"Saray\", \"Hazine\", \"Ticari Merkez\", \"Büyük Kışla\", \"Büyük Ahır\", \"Sur\", \"Toprak Siper\", \"Çit\", \"Taşçı\", \"İçecek Fabrikası\", \"Tuzakçı\",\"Kahraman Kışlası\", \"Büyük Hammadde deposu\", \"Büyük Tahıl Ambarı\", \"Dünya Harikası\", \"Yalak\"];\n aLangAllBuildAltWithId = [\"Oduncu\", \"Tuğla Ocağı\", \"Demir Madeni\", \"Tarla\", \"\", \"Kereste Fabrikası\", \"Tuğla Fırını\", \"Demir Dökümhanesi\", \"Değirmen\", \"Ekmek Fırını\", \"Hammadde deposu\", \"Tahıl Ambarı\", \"Silah Dökümhanesi\", \"Zırh Dökümhanesi\", \"Turnuva Yeri\", \"Merkez Binası\", \"Askeri Üs\", \"Pazar Yeri\", \"Elçilik\", \"Kışla\", \"Ahır\", \"Tamirhane\", \"Akademi\", \"Sığınak\", \"Belediye\", \"Köşk\", \"Saray\", \"Hazine\", \"Ticari Merkez\", \"Büyük Kışla\", \"Büyük Ahır\", \"Sur\", \"Toprak Siper\", \"Çit\", \"Taşçı\", \"İçecek Fabrikası\", \"Tuzakçı\",\"Kahraman Kışlası\", \"Büyük Hammadde deposu\", \"Büyük Tahıl Ambarı\", \"Dünya Harikası\", \"Yalak\"];\n aLangAddTaskText = [\"Görev Ekle\", \"Stil\", \"Aktif Köy\", \"Görev Hedefi\", \"Hedef\", \"Türü\", \"İnşaat Desteği\", \"Hammadde karışımı\", \"Yukarı Taşı\", \"Aşağı Taşı\", \"Sil\", \"Görev İçeriği\", \"Sırala\", \"Tüm görevleri sil\"]; \n aLangTaskKind = [\"Geliştirilen Bina :\", \"Yeni Bina :\", \"Hücum\", \"Araştır\", \"Yetiştir\", \"Gönder\", \"NPC\", \"Yıkılan Bina :\", \"Festival\"]; \n aLangGameText = [\"Seviye \", \"Tüccar\", \"ID\", \"Başkent\", \"Başlangıç zamanı\", \"Değiştirilemez.\", \"buraya\", \"Aktif Köy\", \"gönder\", \"buradan\", \"Gönderiliyor\", \"Gönderildi\", \"Dönüş\", \"hammadde\", \"bina\", \"Yeni bina kur\", \"boş\", \"Seviye \"]; \n aLangRaceName = [\"Romalılar\", \"Cermenler\", \"Galyalılar\"]; \n aLangTaskOfText = [\"Geliştirme Zamanla\", \"Yeni Bina Kurulumu\", \"Otomatik hammadde güncelle\", \"Çalışmıyor\", \"Başlat\", \"Çalışıyor\", \"Durdur\", \"Bu köyün kaynak alanları dağılımıdır \", \"Otomatik Gönderme\", \"Otomatik gönderme açılmadı\", \"Açıldı\", \"Gönderme Tamamladı\", \"\", \"Gönderme limiti\", \"Varsayılan\", \"Değiştir\", \"Odun/Tuğla/Demir\", \"Tahıl\", \"Yıkımı zamanla\", \n \"Hücum zamanla\", \"Hücum Şekli\", \"Varış zamanı\", \"Tekrar Sayısı\", \"Tekrar Aralığı\",\"00:30:00\",\"Mancınık hedef\",\"Rastgele\", \"Bilinmeyen\", \"kere\", \"Ay\", \"Gün\", \"Asker gönder\", \"Asker Yetiştir\",\"Yetiştirilme Noktası\",\"Eğitim görevi tamamlandı\",\"Hammadde Gönderimi Zamanla\",\"Gerçekleşmeyen Kurulumu Tekrarlama Süresi\",\"Tekrar deneme süresini giriniz.\\n(Varsayılan Değer: 20 Dakika)\",\"Trans Out Rmn\",\"Festivalzamanla\",\"Küçük festival\",\"Büyük festival\",\"Hammadde Toplama Aralığı\", \n \"dakikalar\",\"Pasif\",\"Aktif\",\"Aktif Et\",\"Pasif Et\",\"Asker Gelişimi Zamanla\",\"Silah Gelişimi\",\"Zırh Gelişimi\",\"saati\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n aLangErrorText = [\"Çok az kaynak.\", \"Işçi zaten iş başında.\", \"İnşaat tamamlandı\", \"İnşaat başlatılıyor\", \"Araştırma yapılıyor\", \"İnşaata Hammadde deposunu geliştirip devam ediniz.\", \"İnşaata Tahıl ambarını geliştirip devam ediniz.\", \"Yeterli hammadde\",\"Kaynak eksikliği: önce Tarlanı geliştir\",\"Şu anda bir festival yapılıyor zaten\"]; \n aLangOtherText = [\"Önemli not\", \"Sadece başkent için hammadde üretebilirsiniz <br/>be Güncellendi seviye 20. Şimdi Başkentin<br/> tesbit edilemedi. Profilinizi ziyaret ediniz.\", \"Buraya kısa yol ^_^\", \"Kurulum tamamlandı\", \"Vazgeçildi\", \"Görevleri başlat\", \"Güncelleme tamamlandı\", \"Çalışma tamam\", \"Irkınız bilinmediğinden asker türünüz belilenemedi <br/>Profilinizi ziyaret edip ırkınızı belirleyin<br/>\", \"Ayrıca kahraman kışlasınıda ziyaret edin<br/> Kahramanınızın hızı ve tipi.\"]; \n aLangResources=[\"Odun\",\"Tuğla\",\"Demir\",\"Tahıl\"]; \n aLangTroops[0] = [\"Lejyoner\", \"Pretoryan\", \"Emperyan\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Koçbaşı\", \"Ateş Mancınığı\", \"Senatör\", \"Göçmen\", \"Kahraman\"]; \n aLangTroops[1] = [\"Tokmak Sallayan\", \"Mızrakçı\", \"Balta Sallayan\", \"Casus\", \"Paladin\", \"Toyton\", \"Koçbaşı\", \"Mancınık\", \"Reis\", \"Göçmen\", \"Kahraman\"]; \n aLangTroops[2] = [\"Phalanx\", \"Kılıçlı\", \"Casus\", \"Toytatın Şimşeği\", \"Druyid\", \"Heduan\", \"Koçbaşı\", \"Mancınık\", \"Kabile Reisi\", \"Göçmen\", \"Kahraman\"]; \n aLangAttackType = [\"Destek\", \"Saldırı: Normal\", \"Saldırı: Yağma\"]; \n break;\n\n\tcase \"br\":\n\t\taLangAllBuildWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serraria\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalaria\", \"Oficina\", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalaria\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAllBuildAltWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serraria\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalaria\", \"Oficina\", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalaria\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAddTaskText = [\"Adicionar tarefa\", \"Estilo\", \"Aldeia Activa\", \"Alvo\", \"Para\", \"Modo\", \"Ajuda na Construção\", \"Quantidade de recursos\", \"Mover para cima\", \"Mover para baixo\", \"Apagar\", \"&#160;&#160;&#160;Tarefas\", \"Mover \", \"Eliminar todas as tarefas\"];\n\t\taLangTaskKind = [\"Evolução\", \"Novo construção\", \"Ataque\", \"Pesquisa\", \"Treino\", \"Transporte\", \"NPC\", \"Demolição\", \"Celebração\"];\n\t\taLangGameText = [\"Lvl\", \"Mercadores\", \"Identificação\", \"Capital\", \"Inicio\", \"this timeseting is unuseful now.\", \"Para\", \"Aldeia\", \"Transporte\", \"de\", \"Transporte para\", \"Transporte de\", \"A regressar de\", \"Recursos\", \"Edificio\", \"Construir novo edifício\", \"Vazio\", \"Nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Teutões\", \"Gauleses\"];\n\t\taLangTaskOfText = [\"Agendar Evolução\", \"Agendar nova construção\", \"ResourcesUpD\", \"OFF\", \"Iniciar\", \"ON\", \"Parar\", \"A distribuição dos campos desta aldeia é \", \"Autotransporte\", \"Autotransporte não está aberto\", \"Aberto\", \"Transporte com sucesso\", \"Lista de agendamento\", \"Limit\", \"Default\", \"Alterar\", \"madeira/barro/ferro\", \"cereal\", \"Agendamento de demolição\",\n\t\t\t\"Agendamento de ataque\", \"Tipo de ataque\", \"Tempo de viagem\", \"Repetir número de vezes\", \"Tempo de intervalo\",\"00:30:00\",\"Alvo catapulta\",\"Aleatório\", \"Desconhecido\", \"Vezes\", \" Mês\", \" Dia\", \"Tropas enviadas\",\n\t\t\t\"Agendamento de treino\",\"localização de tropas\",\"Agendamento de treino feito\",\"Transporte personalizado\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default são 20 minutos, Insira novo tempo:\\n\\n\",\"Remain\",\"Agendar Celebração\",\"pequena celebração\",\"grande celebração\",\"Set Interval of Resources concentration\",\n\t\t\t\"minutos\",\"parado\",\"ligado\",\"ligar\",\"parar\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Poucos recursos.\", \"Os trabalhadores já estão a trabalhar.\", \"Construção completa\", \"Inicio da construção\", \"Em desenvolvimento\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Apenas os campos de recursos da capital <br/>podem ser elevados a nivel 20 . A sua capital <br/> nao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Instalação concluída\", \"Cancelado\", \"Iniciar as tarefas\", \"Upgrade com sucesso\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também. <br/>Visite o seu perfil para determinar as raça.<br/>\", \"Por favor visite a sua mansão do heroi para determinar<br/> a velocidade e o tipo de heroi.\"];\n\t\taLangResources=[\"Madeira\",\"Barro\",\"Ferro\",\"Cereais\"];\n\t\taLangTroops[0] = [\"Legionário\", \"Pretoriano\", \"Imperiano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Aríete\", \"Catapulta de Fogo\", \"Senador\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[1] = [\"Salteador\", \"Lanceiro\", \"Bárbaro\", \"Espião\", \"Paladino\", \"Cavaleiro Teutão\", \"Aríete\", \"Catapulta\", \"Chefe\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[2] = [\"Falange\", \"Espadachim\", \"Batedor\", \"Trovão Theutate\", \"Cavaleiro Druida\", \"Haeduano\", \"Aríete\", \"Trabuquete\", \"Chefe de Clã\", \"Colonizador\", \"Heroi\"];\n\t\taLangAttackType = [\"Reforço\", \"Ataque\", \"Assalto\"];\n\t\tbreak;\n\n\n case \"pt\": // thanks RASCO and Tuga\n\t\taLangAllBuildWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serração\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalariça\", \"Oficina \", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalariça\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAllBuildAltWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serração\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalariça\", \"Oficina \", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalariça\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAddTaskText = [\"Adicionar tarefa\", \"Estilo\", \"Aldeia Activa\", \"Alvo\", \"Para\", \"Modo\", \"Ajuda na Construção\", \"Quantidade de recursos\", \"Mover para cima\", \"Mover para baixo\", \"Apagar\", \"&#160;&#160;&#160;Tarefas\", \"Mover \", \"Eliminar todas as tarefas\"];\n\t\taLangTaskKind = [\"Evolução\", \"Novo construção\", \"Ataque\", \"Pesquisa\", \"Treino\", \"Transporte\", \"NPC\", \"Demolição\", \"Celebração\"];\n\t\taLangGameText = [\"Lvl\", \"Mercadores\", \"Identificação\", \"Capital\", \"Inicio\", \"this timeseting is unuseful now.\", \"Para\", \"Aldeia\", \"Transporte\", \"de\", \"Transporte para\", \"Transporte de\", \"A regressar de\", \"Recursos\", \"Edificio\", \"Construir novo edifício\", \"Vazio\", \"Nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Teutões\", \"Gauleses\"];\n\t\taLangTaskOfText = [\"Agendar Evolução\", \"Agendar nova construção\", \"ResourcesUpD\", \"OFF\", \"Iniciar\", \"ON\", \"Parar\", \"A distribuição dos campos desta aldeia é \", \"Autotransporte\", \"Autotransporte não está aberto\", \"Aberto\", \"Transporte com sucesso\", \"Lista de agendamento\", \"Limit\", \"Default\", \"Alterar\", \"madeira/barro/ferro\", \"cereal\", \"Agendamento de demolição\",\n\t\t\t\"Agendamento de ataque\", \"Tipo de ataque\", \"Tempo de viagem\", \"Repetir número de vezes\", \"Tempo de intervalo\",\"00:30:00\",\"Alvo catapulta\",\"Aleatório\", \"Desconhecido\", \"Vezes\", \" Mês\", \" Dia\", \"Tropas enviadas\", \"Agendamento de treino\",\"localização de tropas\",\"Agendamento de treino feito\",\"Transporte personalizado\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default são 20 minutos, Insira novo tempo:\\n\\n\",\"Remain\",\"Agendar Celebração\",\"pequena celebração\",\"grande celebração\",\"Set Interval of Resources concentration\",\"minutos\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Poucos recursos.\", \"Os trabalhadores já estão a trabalhar.\", \"Construção completa\", \"Inicio da construção\", \"Em desenvolvimento\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Apenas os campos de recursos da capital <br/>podem ser elevados a nivel 20 . A sua capital <br/> nao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Instalação concluída\", \"Cancelado\", \"Iniciar as tarefas\", \"Upgrade com sucesso\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também. <br/>Visite o seu perfil para determinar as raça.<br/>\", \"Por favor visite a sua mansão do heroi para determinar<br/> a velocidade e o tipo de heroi.\"];\n\t\taLangResources = [\"Madeira\",\"Barro\",\"Ferro\",\"Cereais\"];\n\t\taLangTroops[0] = [\"Legionário\", \"Pretoriano\", \"Imperiano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Aríete\", \"Catapulta de Fogo\", \"Senador\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[1] = [\"Salteador\", \"Lanceiro\", \"Bárbaro\", \"Espião\", \"Paladino\", \"Cavaleiro Teutão\", \"Aríete\", \"Catapulta\", \"Chefe\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[2] = [\"Falange\", \"Espadachim\", \"Batedor\", \"Trovão Theutate\", \"Cavaleiro Druida\", \"Haeduano\", \"Aríete\", \"Trabuquete\", \"Chefe de Clã\", \"Colonizador\", \"Heroi\"];\n\t\taLangAttackType = [\"Reforço\", \"Ataque\", \"Assalto\"];\n\t\tbreak;\n\n case \"my\":\n\t\taLangAllBuildWithId = [\"Kawasan Pembalakan\", \"Kuari Tanat Liat\", \"Lombong Bijih Besi\", \"Ladang\", \"\", \"Kilang Papan\", \"Kilang Bata\", \"Faundri Besi\", \"Pengisar Bijian\", \"Kilang Roti\", \"Gudang\", \"Jelapang\", \"Kedai Senjata\", \"Kedai Perisai\", \"Gelanggang Latihan\", \"Bangunan Utama\", \"Titik Perhimpunan\", \"Pasar\", \"Kedutaan\", \"Berek\", \"Kandang Kuda\", \"Bengkel\", \"Akademi\", \"Gua\", \"Dewan Perbandaran\", \"Residen\", \"Istana\", \"Perbendaharaan\", \"Pejabat Dagangan\", \"Berek Besar\", \"Kandang Kuda Besar\", \"Tembok Bandar\", \"Tembok Tanah\", \"Pagar Kubu\", \"Kedai Tukang Batu\", \"Kilang Bir\", \"Pemerangkap\",\"Rumah Agam Wira\", \"Gudang Besar\", \"Jelapang Besar\", \"Dunia Keajaiban\", \"Palung Kuda\"];\n\t\taLangAllBuildAltWithId = [\"Kawasan Pembalakan\", \"Kuari Tanat Liat\", \"Lombong Bijih Besi\", \"Ladang\", \"\", \"Kilang Papan\", \"Kilang Bata\", \"Faundri Besi\", \"Pengisar Bijian\", \"Kilang Roti\", \"Gudang\", \"Jelapang\", \"Kedai Senjata\", \"Kedai Perisai\", \"Gelanggang Latihan\", \"Bangunan Utama\", \"Titik Perhimpunan\", \"Pasar\", \"Kedutaan\", \"Berek\", \"Kandang Kuda\", \"Bengkel\", \"Akademi\", \"Gua\", \"Dewan Perbandaran\", \"Residen\", \"Istana\", \"Perbendaharaan\", \"Pejabat Dagangan\", \"Berek Besar\", \"Kandang Kuda Besar\", \"Tembok Bandar\", \"Tembok Tanah\", \"Pagar Kubu\", \"Kedai Tukang Batu\", \"Kilang Bir\", \"Pemerangkap\",\"Rumah Agam Wira\", \"Gudang Besar\", \"Jelapang Besar\", \"Dunia Keajaiban\", \"Palung Kuda\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Tingkatkan\", \"Bina bangunan\", \"Serang\", \"Selidik\", \"latih\", \"Angkut\", \"NPC\", \"musnah\", \"Perayaan\"];\n\t\taLangGameText = [\"Tahap\", \"Pedagang\", \"ID\", \"Ibu Kota\", \"Waktu mula\", \"this timeseting is unuseful now.\", \"ke\", \"Kampung\", \"angkut\", \"dari\", \"Angkut ke\", \"Angkut dari\", \"Balik dari\", \"sumber\", \"bangunan\", \"Bina bangunan\", \"Kosong\", \"tahap\"];\n\t\taLangRaceName = [\"Rom\", \"Teuton\", \"Gaul\"];\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"AutoResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans_In_limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\", \"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\", \"Schedule Train\",\"Train site\",\"TrainTask done\",\"customTransport\",\"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\"minutes\",\".\",\".\",\"START\",\"STOP\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Terlalu sedikit sumber\", \"Para pekerja sedang bekerja\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"Upgrade successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\"];\n\t\taLangResources=[\"kayu\",\"tanah liat\",\"besi\",\"tanaman\"];\n\t\taLangTroops[0] = [\"Askar Legion\", \"Pengawal Pertahanan\", \"Askar Empayar\", \"Kesatria Diplomatik\", \"Kesatria Empayar\", \"Kesatria Jeneral\", \"Kereta Pelantak\", \"Tarbil Api\", \"Senator\", \"Peneroka\", \"Wira\"];\n\t\taLangTroops[1] = [\"Askar Belantan\", \"Askar Lembing\", \"Askar Kapak\", \"Peninjau\", \"Kesatria Santo\",\"Kesatria Teutonik\", \"Kereta Pelantak\", \"Tarbil\", \"Penghulu\", \"Peneroka\", \"Wira\"];\n\t\taLangTroops[2] = [\"Falanks\", \"Askar Pedang\", \"Penjelajah\", \"Guruh Theutates\", \"Penunggang Druid\", \"Haeduan\", \"Kereta Pelantak\", \"Tarbil\", \"Pemimpin\", \"Peneroka\", \"Wira\"];\n\t\taLangAttackType = [\"Bantuan\", \"Serangan: Normal\", \"Serangan: Serbuan\"];\n\t\tbreak;\n\n\n case \"nl\":\n\t\taLangAllBuildWithId = [\"Houthakker\", \"Klei-afgraving\", \"IJzermijn\", \"Graanakker\", \"\", \"Zaagmolen\", \"Steenbakkerij\", \"Ijzersmederij\", \"Korenmolen\", \"Bakkerij\", \"Pakhuis\", \"Graansilo\", \"Wapensmid\", \"Uitrustingssmederij\", \"Toernooiveld\", \"Hoofdgebouw\", \"Verzamelenplaats\", \"Marktplaats\", \"Ambassade\", \"Barakken\", \"Stal\", \"Werkplaats\", \"Acedemie\", \"Schuilplaats\", \"Raadhuis\", \"Residentie\", \"Paleis\", \"Schatkamer\", \"Handelskantoor\", \"Grote Barakken\", \"Grote Stal\", \"Stadsmuur\", \"Muur van aarde\", \"Palissade\", \"Steenhouwerij\", \"Brouwerij\", \"Vallenzetter\",\"Heldenhof\", \"Groot Pakhuis\", \"Grote Graansilo\", \"Wereldwonder\", \"Drinkplaats\"];\n\t\taLangAllBuildAltWithId = [\"Houthakker\", \"Klei-afgraving\", \"IJzermijn\", \"Graanakker\", \"\", \"Zaagmolen\", \"Steenbakkerij\", \"Ijzersmederij\", \"Korenmolen\", \"Bakkerij\", \"Pakhuis\", \"Graansilo\", \"Wapensmid\", \"Uitrustingssmederij\", \"Toernooiveld\", \"Hoofdgebouw\", \"Verzamelenplaats\", \"Marktplaats\", \"Ambassade\", \"Barakken\", \"Stal\", \"Werkplaats\", \"Acedemie\", \"Schuilplaats\", \"Raadhuis\", \"Residentie\", \"Paleis\", \"Schatkamer\", \"Handelskantoor\", \"Grote Barakken\", \"Grote Stal\", \"Stadsmuur\", \"Muur van aarde\", \"Palissade\", \"Steenhouwerij\", \"Brouwerij\", \"Vallenzetter\",\"Heldenhof\", \"Groot Pakhuis\", \"Grote Graansilo\", \"Wereldwonder\", \"Drinkplaats\"];\n\t\taLangAddTaskText = [\"Taak toevoegen\", \"Type\", \"Gekozen dorp\", \"Taakdoel\", \"Naar\", \"Modus\", \"Bouwhulp\", \"Grondstofconcentratie\", \"Naar boven\", \"Naar benenden\", \"Del\", \"&#160;&#160;&#160;Doelen\", \"Bewegen \", \"Verwijder alle taken\"]; \n\t\taLangTaskKind = [\"Verbeteren\", \"Gebouw bouwen\", \"Aanvallen\", \"Onderzoeken\", \"Trainen\", \"Handel\", \"NPC\", \"Slopen\", \"Vieren\"]; \n\t\taLangGameText = [\"Niveau\", \"Handelaren\", \"ID\", \"Hoofddorp\", \"Start tijd\", \"Deze tijdsinstelling is onbruikbaar op dit moment.\", \"Naar\", \"Dorp\", \"transport\", \"Van\", \"Transporteren naar\", \"Transporteren van\", \"Terugkeren van\", \"Grondstoffen\", \"Gebouw\", \"Nieuw gebouw bouwen\", \"Leeg\", \"Niveau\"]; \n aLangRaceName = [\"Romeinen\", \"Germanen\", \"Galliërs\"]; \n\t\taLangTaskOfText = [\"Upgrade plannen\", \"Nieuwbouw plannen\", \"Auto ResUpD\", \"Inactief\", \"Start\", \"Bezig\", \"Stop\", \"De grondverdeling van dit dorp is \", \"Autotransport\", \"Autotransport is niet gestart\", \"Gestart\", \"Transport succesvol\", \"Takenlijst\", \"Trans In limit\", \"Standaard\", \"Aanpassen\", \"Hout/Klei/Ijzer\", \"Graan\", \"Slopen plannen\", \n \"Aanval plannen\", \"Aanvalssoort\", \"Tijdsduur\", \"Herhalen\", \"tussentijd\",\"00:30:00\",\"Katapult doel\",\"Random\", \"Onbekend\", \"keren\", \"Maand\", \"Dag\", \"Troepen verstuurd\", \n \"Training plannen\", \"Trainingkant\", \"Trainingstaak voltooid\", \"Handmatig Transport\", \"Stel de tussentijd in\",\"Dit is de tussentijd van de pagina herladen ,\\n standaard is 20 minuten, stel a.u.b. een nieuwe tijd in:\\n\\n\",\"Trans Out Rmn\",\"Feest plannen\",\"Klein Feest\",\"Groot Feest\",\"Stel tussentijd in voor grondstofconcentratie\", \n \"minuten\", \".\",\".\",\"START\",\"STOP\",\"Verbetering plannen\",\"Verbeter aanval\",\"Verbeter uitrusting\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n aLangErrorText = [\"Te weinig grondstoffen.\", \"Je bouwvakkers zijn al aan het werk.\", \"Bouwopdracht voltooid\", \"Bouwopdracht begint\", \"Bezig\", \"Je pakhuis is te klein. Verbeter je pakhuis om de bouwopdracht voort te zetten.\", \"Je graansilo is te klein. Verbeter je graansilo om de bouwopdracht voort te zetten\", \"Genoeg grondstoffen\",\"Te weinig graanproductie: Verbeter eerst een graanveld\",\"Er is al een feest gaande\"]; \n\t\taLangOtherText = [\"Belangrijk bericht\", \"Alleen de grondstofvelden van het hoofddorp kunnen <br/>verbeterd worden tot niveau 20. Nu is je hoofddorp<br/> niet vastgesteld. Bezoek je profiel a.u.b.\", \"Afkorting hier ^_^\", \"Instellingen succesvol\", \"Geannuleerd\", \"Start de taken\", \"Verbetering succesvol\", \"Start succesvol\", \"Je ras is onbekend, daardoor ook je troeptype. <br/>Bezoek je profiel om je ras vast te stellen<br/>\", \"Bezoek a.u.b. ook je heldenhof om <br/> de snelheid en type van je held vast te stellen.\"]; \n\t\taLangResources=[\"Hout\",\"Klein\",\"Ijzer\",\"Graan\"]; \n\t\taLangTroops[0] = [\"Legionair\", \"Praetoriaan\", \"Imperiaan\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Ram\", \"Vuurkatapult\", \"Senator\", \"Kolonist\", \"Held\"]; \n\t\taLangTroops[1] = [\"Knuppelvechter\", \"Speervechter\", \"Bijlvechter\", \"Verkenner\", \"Paladijn\", \"Germaanse Ridder\", \"Ram\", \"Katapult\", \"Leider\", \"Kolonist\", \"Held\"]; \n\t\taLangTroops[2] = [\"Phalanx\", \"Zwaardvechter\", \"Padvinder\", \"Toetatis donder\", \"Druideruiter\", \"Haeduaan\", \"Ram\", \"Trebuchet\", \"Onderleider\", \"Kolonist\", \"Held\"]; \n\t\taLangAttackType = [\"Versterking\", \"Aanval\", \"Overval\"]; \n\t\tbreak;\n\n\ncase \"hu\": //Harrerp\n\n\t\taLangAllBuildWithId = [\"Favágó\", \"Agyagbánya\", \"Vasércbánya\", \"Búzafarm\", \"\", \"Fűrészüzem\", \"Agyagégető\", \"Vasöntöde\", \"Malom\", \"Pékség\", \"Raktár\", \"Magtár\", \"Fegyverkovács\", \"Páncélkovács\", \"Gyakorlótér\", \"Főépület\", \"Gyülekezőtér\", \"Piac\", \"Követség\", \"Kaszárnya\", \"Istálló\", \"Műhely\", \"Akadémia\", \"Rejtekhely\", \"Tanácsháza\", \"Rezidencia\", \"Palota\", \"Kincstár\", \"Kereskedelmi központ\", \"Nagy Kaszárnya\", \"Nagy Istálló\", \"Kőfal\", \"Földfal\", \"Cölöpfal\", \"Kőfaragó\", \"Sörfőzde\", \"Csapdakészítő\", \"Hősök háza\", \"Nagy Raktár\", \"Nagy Magtár\", \"Világcsoda\",\"Lóitató\"];\n\t\taLangAllBuildAltWithId = [\"Favágó\", \"Agyagbánya\", \"Vasércbánya\", \"Búzafarm\", \"\", \"Fűrészüzem\", \"Agyagégető\", \"Vasöntöde\", \"Malom\", \"Pékség\", \"Raktár\", \"Magtár\", \"Fegyverkovács\", \"Páncélkovács\", \"Gyakorlótér\", \"Főépület\", \"Gyülekezőtér\", \"Piac\", \"Követség\", \"Kaszárnya\", \"Istálló\", \"Műhely\", \"Akadémia\", \"Rejtekhely\", \"Tanácsháza\", \"Rezidencia\", \"Palota\", \"Kincstár\", \"Kereskedelmi központ\", \"Nagy Kaszárnya\", \"Nagy Istálló\", \"Kőfal\", \"Földfal\", \"Cölöpfal\", \"Kőfaragó\", \"Sörfőzde\", \"Csapdakészítő\", \"Hősök háza\", \"Nagy Raktár\", \"Nagy Magtár\", \"Világcsoda\",\"Lóitató\"];\n\t\taLangAddTaskText = [\"Feladat hozzáadása\", \"Feladat\", \"Aktív falu\", \"Feladat célja\", \"Ide\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Fel\", \"Le\", \"Törlés\", \" Feladatok\", \"Sorrend\", \"Összes feladat törlése\"];\n\t\taLangTaskKind = [\"Kiépítés\", \"Új épület\", \"Támadás\", \"Fejlesztés\", \"Kiképzés\", \"Szállítás\", \"NPC\", \"Bontás\", \"Ünnep\"];\n\t\taLangGameText = [\"Szint\", \"Kereskedők\", \"ID\", \"Capital\", \"Indítási idő\", \"az időbeállítás nem szükséges.\", \"ide\", \"Falu\", \"szállítás\", \"innen\", \"Szállítás ide\", \"Szállítás innen\", \"Visszaérkezés\", \"nyersanyag\", \"épület\", \"Új épület építése\", \"empty\", \"szint\"];\n\t\taLangRaceName = [\"Római\", \"Germán\", \"Gall\"];\n\t\taLangTaskOfText = [\"Időzített kiépítés\", \"Időzített építés\", \"AutoResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Auto szállítás\", \"Autotransport is not opened\", \"Opened\", \"Szállítás kész\", \"Feladat lista\", \"Trans_In_limit\", \"Default\", \"Módosítás\", \"Fa/Agyag/Vasérc\", \"Búza\", \"Időzített bontás\",\n\t\t\t\"Időzítet támadás\", \"Támadás típus\", \"Utazási idő\", \"Ismétlés\", \"Idő intervallum\",\"00:30:00\",\"Katapult célpont\",\"Véletlen\", \"Ismeretlen\", \"ismétlés\", \"Hónap\", \"Nap\", \"Egységek küldése\",\n\t\t\t\"Időzített kiképzés\",\"Kiképzőhely\",\"Kiképzés befejezve\",\"Egyedi szállítás\",\"Frissítési időintervallum beállítás\",\"Ez az oldalfrissítési időintervallum,\\n az alap 20 perc, írd be az új időt:\\n\\n\",\"Trans_Out_Rmn\",\"Időzített ünnepség\",\"Kis ünnepség\",\"Nagy ünnepség\",\"setInterval of Resources concentration\",\n\t\t\t\"perc\",\"áll\",\"fut\",\"indulj\",\"állj\",\"Időzített fejlesztés\",\"Fegyver fejlesztés\",\"Páncél fejlesztés\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Too few resources.\", \"The workers are already at work.\", \"Építés kész\", \"Építés indul\", \"Fejlesztés folyamatban\", \"A raktárad túl kicsi. Építsd tovább a raktárt, hogy folytathasd az építést\", \"A magtárad túl kicsi. Építsd tovább a magtárt, hogy folytathasd az építést\", \"Elég nyersanyag\",\"Élelemhiány: Előtte egy búzafarmot kell építened \",\"Jelenleg is ünnepelnek\",\"There is already research going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Beállítás kész\", \"Cancelled\", \"Start the tasks\", \"Kiépítés kész\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\"];\n\t\taLangResources= [\"fa\",\"agyag\",\"vasérc\",\"búza\"];\n\t\taLangTroops[0] = [\"Légiós\", \"Testőr\", \"Birodalmi\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Faltörő kos\", \"Tűzkatapult\", \"Szenátor\", \"Telepes\", \"Hős\"]; //Római\n\t\taLangTroops[1] = [\"Buzogányos\", \"Lándzsás\", \"Csatabárdos\", \"Felderítő\", \"Paladin\", \"Teuton lovag\", \"Faltörő kos\", \"Katapult\", \"Törzsi vezető\", \"Telepes\", \"Hős\"]; //Germán\n\t\taLangTroops[2] = [\"Phalanx\", \"Kardos\", \"Felderítő\", \"Theutat villám\", \"Druida lovas\", \"Haeduan\", \"Falromboló\", \"Harci-katapult\", \"Főnök\", \"Telepes\", \"Hős\"]; //Gall\n\t\taLangAttackType = [\"Támogatás\", \"Támadás\", \"Rablás\"];\n\t\tbreak;\t\t\n\n\ncase \"lv\": //by sultāns updated the 16/04/2010\n\t\taLangAllBuildWithId = [\"Cirsma\", \"Māla Karjers\", \"Dzelzs Raktuves\", \"Labības Lauks\", \"\", \"Kokzāģētava\", \"Ķieģelu Fabrika\", \"Dzelzs Lietuve\", \"Dzirnavas\", \"Maiznīca\", \"Noliktava\", \"Klēts\", \"Ieroču kaltuve\", \"Bruņu kaltuve\", \"Turnīru laukums\", \"Galvenā ēka\", \"Pulcēšanās Vieta\", \"Tirgus laukums\", \"Vēstniecība\", \"Kazarmas\", \"Stallis\", \"Darbnīca\", \"Akadēmija\", \"Paslēptuve\", \"Rātsnams\", \"Rezidence\", \"Pils\", \"Dārgumu glabātuve\", \"Tirdzniecības Birojs\", \"Lielās Kazarmas\", \"Lielais Stallis\", \"Pilsētas Mūris\", \"Zemes Mūris\", \" Palisāde\", \"Akmeņlauztuve\", \"Alus Darītava\", \"Mednieku māja\",\"Varoņu Savrupmāja\", \"Lielā Noliktava\", \"Liela Klēts\", \"Pasaules Brīnums\"];\n\t\taLangAllBuildAltWithId = [\"Cirsma\", \"Māla Karjers\", \"Dzelzs Raktuves\", \"Labības Lauks\", \"\", \"Kokzāģētava\", \"Ķieģelu Fabrika\", \"Dzelzs Lietuve\", \"Dzirnavas\", \"Maiznīca\", \"Noliktava\", \"Klēts\", \"Ieroču kaltuve\", \"Bruņu kaltuve\", \"Turnīru laukums\", \"Galvenā ēka\", \"Pulcēšanās Vieta\", \"Tirgus laukums\", \"Vēstniecība\", \"Kazarmas\", \"Stallis\", \"Darbnīca\", \"Akadēmija\", \"Paslēptuve\", \"Rātsnams\", \"Rezidence\", \"Pils\", \"Dārgumu glabātuve\", \"Tirdzniecības Birojs\", \"Lielās Kazarmas\", \"Lielais Stallis\", \"Pilsētas Mūris\", \"Zemes Mūris\", \" Palisāde\", \"Akmeņlauztuve\", \"Alus Darītava\", \"Mednieku māja\",\"Varoņu Savrupmāja\", \"Lielā Noliktava\", \"Liela Klēts\", \"Pasaules Brīnums\"];\n\t\taLangAddTaskText = [\"Izveidot uzdevumu\", \"Veids\", \"Aktīvais ciems\", \"Uzdevuma mērķis\", \"| Mērķis\", \"Tips\", \"Celtniecības atbalsts\", \"Resursu koncentrācija\", \"Uz augšu\", \"Uz leju\", \"Izdzēst\", \" Uzdevuma stāvoklis\", \"Pārvietot\", \"Dzēst visus uzdevumus\"];\n\t\taLangTaskKind = [\"Uzlabot\", \"Jauna ēka\", \"Uzbrukt\", \"Izpētīt\", \"Apmācīt\", \"Nosūtīt resursus\", \"NPC\", \"Nojaukt\", \"Svinības\"];\n\t\taLangGameText = [\"Līmenis\", \"Tirgotāji\", \"ID\", \"Galvaspilsēta\", \"Sākuma laiks\", \"Īslaicīgi nestrādā\", \"uz\", \"Ciems\", \"Transportēt\", \"no\", \"Transportēt uz\", \"Transportēt no\", \"Atgriezties no\", \"resursi\", \"ēka\", \"Būvēt jaunu ēku\", \"tukšs\", \"līmenis\"];\n\t\taLangRaceName = [\"Romieši\", \"Ģermāņi\", \"Galli\"];\n\t\taLangTaskOfText = [\"Ieplānot uzlabojumus\", \"Ieplānot jaunas ēkas celtniecību\", \"Uzlabot resursu laukus\", \"Izslēgt\", \"Uzsākt\", \"Ieslēgts\", \"Stop\", \"Resursu lauku izvietojums šajā ciemā\", \"Automātiska nosūtīšana\", \"Automātiska nosutīšana atslēgta\", \"Ieslēgts\", \"Veiksmīgi nosūtīts\", \"* Uzdevumi *\", \"Ienākošais limits\", \"Default\", \"Izmainīt\", \"Koks/Māls/Dzelzis\", \"Labība\", \"Ieplānot nojaukšanu\",\n\t\t\t\"Ieplānot uzbrukumu\", \"Uzbrukuma veids\", \"Laiks ceļā\", \"Atkartošanas laiks\", \"laika intervāls\",\"00:30:00\",\"Ar katapultām massēt\",\"Pofig pa ko\", \"Nezināms\", \"laiki\", \"Mēnesis\", \"Diena\", \"Kareivji nosūtīti\",\n\t\t\t\"Ieplānot apmācību\",\"Train site\",\"Kareivju apmācība pabeigta\",\"optimizēt transportēšanu\",\"Ievadīt laiku pēc kura atkārtot iekraušanu\",\"Šis ir intervāls lapas parlādēšanai ,\\n pēc noklusējuma - 20 min., Lūdzu ievadiet jaunu laiku:\\n\\n\",\"Izejošais limits\",\"Ieplānot svinības\",\"mazās svinības\",\"lielās svinības\",\"Uzstādīt laika intervālu resursu sūtīšanai\",\n\t\t\t\"minūtes\", \".\",\".\",\"Start\", \"Stop\", \"Ieplānot uzdevumus\",\"Ieplānot uzbrukumus\",\"Ieplanot aizsardzību\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Nepietiek resursu\", \"Strādnieki jau strādā\", \"Būvniecība pabeigta\", \"Ir uzsākta būvniecība\", \"Attīstības stadija\", \"Nepietiek vietas noliktavā, lūdzu paplašiniet to\", \"Nepietiek vietas klētī, ludzu paplašinoiet to\", \"Pietiekoši resursu\",\"\",\"Svinības jau notiek\"];\n\t\taLangOtherText = [\"Svarīgi\", \"Tikai galvaspilsētā resursu laukus var uzlabot uz 20Lvl. Galvaspilsāta nav noteikta. Ieejiet lūdzu savā profilā\", \"Shortcut here ^_^\", \"Iestatījumi pabeigti\", \"Atcelts\", \"Sākt uzdevumus\", \"Uzlabots veiksmīgi\", \"Viss notiek\", \"Jūsu rase ir unknown. Lūdzu ieejiet profilā.\", \"Kā arī, lūdzu ieejiet varoņu majā, lai noteiktu varoņa veidu un ātrumu\"];\n\t\taLangResources=[\"Koks\",\"Māls\",\"Dzelzs\",\"Labība\"];\n\t\taLangTroops[0] = [\"Leģionārs\", \"Pretorietis\", \"Iekarotājs\", \"Ziņnesis\", \"Romas Jātnieks\", \"Romas Bruņinieks\", \"Mūra Brucinātājs\", \"Uguns Katapulta\", \"Senators\", \"Kolonists\", \"Varonis\"];\n\t\taLangTroops[1] = [\"Rungas Vēzētājs\", \"Šķēpnesis\", \"Karacirvja Vēzētājs\", \"Izlūks\", \"Bruņinieks\", \"Ģermāņu Bruņinieks\", \"Postītājs\", \"Katapultas\", \"Virsaitis\", \"Kolonists\", \"Varonis\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Zobenbrālis\", \"Pēddzinis\", \"Zibens Jātnieks\", \"Priesteris - Jātnieks\", \"Edujs\", \"Tarāns\", \"Trebušets\", \"Barvedis\", \"Kolonists\", \"Varonis\"];\n\t\taLangAttackType = [\"Papildspēki\", \"Uzbrukums\", \"Iebrukums\"];\n\t\tbreak;\n\tcase \"cl\":\n\tcase \"mx\":\n\tcase \"net\": // thanks Renzo\n\t\taLangAllBuildWithId = [\"Leñador\", \"Barrera\", \"Mina\", \"Granja\", \"\", \"Serrería\", \"Ladrillar\", \"Fundición de Hierro\", \"Molino\", \"Panadería\", \"Almacén\", \"Granero\", \"Herrería\", \"Armería\", \"Plaza de torneos\", \"Edif. principal\", \"Plaza reuniones\", \"Mercado\", \"Embajada\", \"Cuartel\", \"Establo\", \"Taller\", \"Academia\", \"Escondite\", \"Ayuntamiento\", \"Residencia\", \"Palacio\", \"Tesoro\", \"Oficina de Comercio\", \"Cuartel Grande\", \"Establo Grande\", \"Muralla\", \"Terraplén\", \"Empalizada\", \"Cantero\", \"Cervecería\", \"Trampero\",\"Hogar del héroe\", \"Almacén Grande\", \"Granero Grande\", \"Maravilla\", \"Abrevadero\"];\n\t\taLangAllBuildAltWithId = [\"Leñador\", \"Barrera\", \"Mina\", \"Granja\", \"\", \"Serrería\", \"Ladrillar\", \"Fundición de Hierro\", \"Molino\", \"Panadería\", \"Almacén\", \"Granero\", \"Herrería\", \"Armería\", \"Plaza de torneos\", \"Edif. principal\", \"Plaza reuniones\", \"Mercado\", \"Embajada\", \"Cuartel\", \"Establo\", \"Taller\", \"Academia\", \"Escondite\", \"Ayuntamiento\", \"Residencia\", \"Palacio\", \"Tesoro\", \"Oficina de Comercio\", \"Cuartel Grande\", \"Establo Grande\", \"Muralla\", \"Terraplén\", \"Empalizada\", \"Cantero\", \"Cervecería\", \"Trampero\",\"Hogar del héroe\", \"Almacén Grande\", \"Granero Grande\", \"Maravilla\", \"Abrevadero\"];\n\t\taLangAddTaskText = [\"Añadir tarea\", \"Estilo\", \"Aldea activa\", \"Objetivo de Tarea\", \"Para\", \"Modo\", \"Soporte de Construcción\", \"Concentración de Recursos\", \"Ir arriba\", \"Ir abajo\", \"Borrar\", \" Contenido de tarea\", \"Mover \", \"Borrar todas las tareas\"];\n\t\taLangTaskKind = [\"Subir\", \"Construir edificio nuevo\", \"Atacar\", \"Mejorar\", \"Entrenar\", \"Transportar\", \"NPC\", \"Demoler\", \"Fiesta\"];\n\t\taLangGameText = [\"Nivel\", \"Comerciantes\", \"ID\", \"Capital\", \"Tiempo de Inicio\", \"esta prueba de tiempo no es útil.\", \"para\", \"Aldea\", \"transportar\", \"de\", \"Transportar a\", \"Transporte de\", \"Regreso de\", \"recursos\", \"edificio\", \"Construir nuevo edificio\", \"vacío\", \"nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Germanos\", \"Galos\"];\n\t\taLangTaskOfText = [\"Programar subida\", \"Programar nueva Construcción\", \"AutoResUpD\", \"OFF\", \"Empezar\", \"ON\", \"Suspender\", \"La distribución de campos de recursos de esta aldea es \", \"Autotransporte\", \"Autotransporte no está abierto\", \"Abierto\", \"Transporte exitoso\", \"Lista de Tareas\", \"Trans_In_limit\", \"Por Defecto\", \"Modificar\", \"Madera/Barro/Hierro\", \"Cereal\", \"Programar demolición\",\"Programar ataque\", \"Tipo de Ataque\", \"Tiempo de Viaje\", \"Número de Repeticiones\", \"Tiempo de intervalo\",\"00:30:00\",\"Objetivo de Catapulta\",\"Al Azar\", \"Desconocido\", \"Veces\", \"Mes\", \"Día\", \"Tropas enviadas\", \"Programar Cadena\",\"Sitio de Cadena\",\"Tarea de Cadena completada\",\"Transporte Custom\",\"Establecer tiempo de intervalo de la recarga\",\"este es el tiempo de intervalo entre cada recarga de la página,\\n Por defecto es 20 minutos, por favor introduza el nuevo tiempo:\\n\\n\",\"Trans_Out_Rmn\",\"Programar Fiesta\",\"fiesta pequeña\",\"fiesta grande\",\"Establecer intervalo de concentración de recursos\",\"minutos\",\".\",\".\",\"START\",\"STOP\", \"Programar Mejora\", \"Mejorar Ataque\", \"Mejorar Defensa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Muy pocos recursos.\", \"Los aldeanos ya están trabajando.\", \"Construcción completa\", \"Empezando construcción\", \"En desarrollo\", \"Su almacén es muy pequeño. Por favor amplíe su almacén para continuar su construcción\", \"Su almacén es muy pequeño. Por favor amplíe su almacén para continuar su construcción\", \"Suficientes Recursos\",\"Falta de Alimento: Amplíe una granja primero\",\"Ya hay una fiesta en progreso\",\"Ya hay una exploración en progreso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Solo los campos de recurso de la capital pueden ser ampliados a nivel 20. Su capital no ha sido detectada. Por favor visite su perfil.\", \"Atajo aquí ^_^\", \"Configuración completada\", \"Cancelado\", \"Empezar tareas\", \"Mejora Exitosa\", \"Ejecución exitosa\", \"Su raza es desconocida, asimismo su tipo de tropas. Visite su Perfil para determinar su raza.\", \"Por favor visite su Hogar del Heroe para determinar la velocidad y tipo de su heroe.\"];\n\t\taLangResources = [\"madera\", \"barro\", \"hierro\", \"cereal\"];\n\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Carnero\", \"Catapulta de Fuego\", \"Senador\", \"Colono\", \"Héroe\"];\n\t\taLangTroops[1] = [\"Luchador de Porra\", \"Lancero\", \"Luchador de Hacha\", \"Emisario\", \"Paladín\", \"Jinete Teutón\", \"Ariete\", \"Catapulta\", \"Cabecilla\", \"Colono\", \"Héroe\"];\n\t\taLangTroops[2] = [\"Falange\", \"Luchador de Espada\", \"Batidor\", \"Rayo de Teutates\", \"Jinete Druida\", \"Jinete Eduo\", \"Ariete\", \"Catapulta de Guerra\", \"Cacique\", \"Colono\", \"Héroe\"];\n\t\taLangAttackType = [\"Refuerzo\", \"Ataque\", \"Atraco\"];\n\t\tbreak;\n\n\tcase \"se\": // thanks to Arias\n\t\taLangAllBuildWithId = [\"Skogshuggare\", \"Lergrop\", \"Järngruva\", \"Vetefält\", \"\", \"Sågverk\", \"Murbruk\", \"Järngjuteri\", \"Vetekvarn\", \"Bageri\", \"Magasin\", \"Silo\", \"Smedja\", \"Vapenkammare\", \"Tornerplats\", \"Huvudbyggnad\", \"Samlingsplats\", \"Marknadsplats\", \"Ambassad\", \"Baracker\", \"Stall\", \"Verkstad\", \"Akademi\", \"Grotta\", \"Stadshus\", \"Residens\", \"Palats\", \"Skattkammare\", \"Handelskontor\", \"Stor barack\", \"Stort stall\", \"Stadsmur\", \"Jordvall\", \"Palisad\", \"Stenmurare\", \"Bryggeri\", \"Fälla\", \"Hjältens egendom\", \"Stort magasin\", \"Stor silo\", \"Världsunder\", \"Vattenbrunn\"];\n\t\taLangAllBuildAltWithId = [\"Skogshuggare\", \"Lergrop\", \"Järngruva\", \"Vetefält\", \"\", \"Sågverk\", \"Murbruk\", \"Järngjuteri\", \"Vetekvarn\", \"Bageri\", \"Magasin\", \"Silo\", \"Smedja\", \"Vapenkammare\", \"Tornerplats\", \"Huvudbyggnad\", \"Samlingsplats\", \"Marknadsplats\", \"Ambassad\", \"Baracker\", \"Stall\", \"Verkstad\", \"Akademi\", \"Grotta\", \"Stadshus\", \"Residens\", \"Palats\", \"Skattkammare\", \"Handelskontor\", \"Stor barack\", \"Stort stall\", \"Stadsmur\", \"Jordvall\", \"Palisad\", \"Stenmurare\", \"Bryggeri\", \"Fälla\", \"Hjältens egendom\", \"Stort magasin\", \"Stor silo\", \"Världsunder\", \"Vattenbrunn\"];\n\t\taLangAddTaskText = [\"Lägg till uppgift\", \"Stil\", \"Aktiv by\", \"Task target\", \"Till\", \"Läge\", \"Kontruktions stöd\", \"Råvaro koncentration\", \"Flytta upp\", \"Flytta ner\", \"Radera\", \"Uppgifter\", \"Flytta \", \"Radera alla uppgifterna\"];\n\t\taLangTaskKind = [\"Uppgradering:\", \"Ny byggnad:\", \"Attack:\", \"Forskning:\", \"Träning:\", \"Transport:\", \"NPC:\", \"Demolish:\", \"Celebration:\"];\n\t\taLangGameText = [\"Nivå \", \"Handel\", \"ID\", \"Capital\", \"Start time\", \"this timesetting is unuseful now.\", \"till\", \"By\", \"Transport\", \"från\", \"Transport till\", \"Transport från\", \"Återvänder från\", \"Råvaror\", \"Byggnad\", \"Konstruera en ny byggnad\", \"Tom\", \"Nivå\"];\n\t\taLangRaceName = [\"Romare\", \"Germaner\", \"Galler\"];\n\t\taLangTaskOfText = [\"Schemalägg uppgradering\", \"Schemalägg ny byggnad\", \"Uppgradera fält\", \"Ej Aktiv\", \"Starta\", \"Startad\", \"Avbryt\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport lyckades\", \"Uppgifter\", \"Trans_In_limit\", \"Standard\", \"Ändra \", \"Trä/Lera/Järn\", \"Vete\", \"Schemalägg demolition\",\n\t\t\t\"Schemalägg attack\", \"Attack type\", \"Res tid\", \"antal upprepningar\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Okänd\", \"times\", \"Månad\", \"Dag\", \"Trupper skickade\", \"Schemalägg Träning\",\"Tränings plats\",\"Träningen klar\",\"Anpassad transport\",\"Sätt intervallen för omladdning av sidan\",\"Detta är intevallen för omladdning av sida,\\n standard är 20 minuter, vänligen ange ny intervall:\\n\\n\",\"Trans_Out_Rmn\",\"Schemalägg fest\",\"Liten fest\",\"Stor fest\",\"Sätt intervall av råvarukoncentration\",\n\t\t\t\"minuter\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"För få råvaror\", \"Dina arbetare är redan ute på jobb\", \"Byggnad klar\", \"Påbörjar byggnad\", \"Under utveckling\", \"Ditt magasin är för litet. Vänligen uppgradera ditt magasin för att fortsätta ditt byggnadsarbete.\", \"Din silo är för liten. Vänligen uppgradera din silo för att fortsätta ditt byggnadsarbete.\", \"Tillräckligt med resurser\", \"Brist på mat: utöka vetefälten först\", \"En fest pågår redan.\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup klar\", \"Avbruten\", \"Starta uppgifterna\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\taLangResources=[\"Trä\",\"Lera\",\"Järn\",\"Vete\"];\n\t\taLangTroops[0] = [\"Legionär\", \"Praetorian\", \"Imperiesoldat\", \"Spårare\", \"Imperieriddare\", \"Ceasarriddare\", \"Murbräcka\", \"Eld Katapult\", \"Senator\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangTroops[1] = [\"Klubbman\", \"Spjutman\", \"Yxman\", \"Scout\", \"Paladin\", \"Germansk Knekt\", \"Murbräcka\", \"Katapult\", \"Stamledare\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangTroops[2] = [\"Falanx\", \"Svärdskämpe\", \"Spårare\", \"Theutates Blixt\", \"Druidryttare\", \"Haeduan\", \"Murbräcka\", \"Krigskatapult\", \"Hövding\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangAttackType = [\"Förstärkning\", \"Normal\", \"Plundring\"];\n\t\tbreak;\n\n\tcase \"it\": // thanks Hamkrik, corrections by baldo 2011.04.08\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\t// 2011.02.16 -- provided by Psea\n\t\t\t\taLangAllBuildWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di Mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fabbro\", \"Armeria\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura Cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fabbro\", \"Armeria\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAddTaskText = [\"Aggiungere Compito\", \"Tipo\", \"Villaggio Attivo\", \"Obiettivo del Compito\", \"Coordinate\", \"Modalita'\", \"Supporto ampliamento risorse\", \"Concentrazione risorse\", \"SU\", \"GIU\", \"Cancella\", \" Contenuto del Compito\", \"Muovere\", \"Cancella tutti i Compiti\"]; \n\t\t\t\taLangTaskKind = [\"Amplia\", \"Nuovo Edificio\", \"Attacco\", \"Ricerca\", \"Addestra\", \"Trasporto\", \"NPC\", \"Demolire\", \"Festa\"]; \n\t\t\t\taLangGameText = [\"Livello\", \"Mercanti\", \"ID\", \"Capitale\", \"Tempo di Inizio\", \"questa impostazione di tempo non si usa.\", \"Coordinate\", \"Villaggio\", \"trasporto\", \"dalla\", \"Trasporto alla\", \"Trasporto dalla\", \"Ritorno dalla\", \"risorse\", \"edifici\", \"Costruisci nuovo edificio\", \"vuoto\", \"livello\"]; \n\t\t\t\taLangRaceName = [\"Romani\", \"Teutoni\", \"Galli\"]; \n\t\t\t\taLangTaskOfText = [\"Programma Ampliamento\", \"Programma Nuovo Edificio\", \"AutoResUpD\", \"Non_attivo\", \"Start\", \"Iniziato\", \"Sospeso\", \"La distribuzione delle risorse di questo villaggio e' \", \"Autotrasporto\", \"Autotrasporto non e aperto\", \"Aperto\", \"Trasportato con successo\", \"Lista Compiti\", \"Trans_In_limit\", \"Default\", \"Modificare\", \"Legno/Argilla/Ferro\", \"Grano\", \"Demolire\",\n\t\t\t\t\t\"Programma Attacco\", \"Tipo Attacco\", \"Tempo Percorso\", \"ripeti\", \"intervallo di tempo\", \"00:30:00\", \"Obiettivo Catapulta\", \"Random\", \"Sconosciuto\", \"volte\", \"Mese\", \"Giorno\", \"Truppe Inviate\", \"Programma Addestramento\", \"Edificio di addestramento\", \"Addestramento Finito\", \"Transporto Diverso\", \"ripeti numero volte\", \"questo é l'intervallo di ricarica pagina,\\n default é 20 minuti, per favore inserire nuovo tempo:\\n\\n\", \"Trans_Out_Rmn\", \"Programma la Festa\", \"festa piccola\", \"Festa grande\", \"Imposta l'Intervallo di Concentrazione delle Risorse\",\n\t\t\t\t\t\"minuti\", \"in attesa\", \"corrente\", \"fare\", \"pausa\", \"Schedula Miglioria\", \"Migliora l'attacco\", \"Migliora la difesa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n\t\t\t\taLangErrorText = [\"Mancano le risorse.\", \"I Lavoratori Sono Pronti per Lavorare\", \"Edificio Completo\", \"Inizia Edificio\", \"Nella Ricerca\", \"Il tuo Magazzino é piccolo. Per favore amplia il magazzino per continuare la costruzione\", \"Il tuo Granaio e piccolo. Per favore amplia il granaio per continuare la costruzione\", \"Risorse sufficienti\", \"Mancanza di Cibo: Amplia i Campi di grano\", \"Pronta la Festa\"]; \n\t\t\t\taLangOtherText = [\"Nota Importante \", \"Solo i Campi della Capitale possono essere ampliati al livello 20. La tua capitale non é determinata. Visita il tuo Profilo per favore.\", \"Shortcut here ^_^\", \"Setup compiuto\", \"Cancellato\", \"Inizia i Compiti\", \"Ampliato con successo\", \"Iniziato con successo\", \"La tua razza e' sconosciuta, anche il tipo di truppe. Visita il tuo Profilo per determinare la razza.\", \"Per favore visita Circolo degli eroi per determinare la velocita e il tipo di eroe.\"];\n\t\t\t\taLangResources = [\"legno\", \"argilla\", \"ferro\", \"grano\"]; \n\t\t\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperiano\", \"Emissario a cavallo\", \"Cavaliere del Generale\", \"Cavaliere di Cesare\", \"Ariete\", \"Onagro\", \"Senatore\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[1] = [\"Combattente\", \"Alabardiere\", \"Combattente con ascia\", \"Esploratore\", \"Paladino\", \"Cavaliere Teutonico\", \"Ariete\", \"Catapulta\", \"Comandante\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[2] = [\"Falange\", \"Combattente con spada\", \"Ricognitore\", \"Fulmine di Teutates\", \"Cavaliere druido\", \"Paladino di Haeduan\", \"Ariete\", \"Trabucco\", \"Capo tribù\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangAttackType = [\"Rinforzi\", \"Attacco\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\t// 2011.03.28 -- provided by Psea\n\t\t\t\taLangAllBuildWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di Mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fucina\", \"Fucina\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande caserma\", \"Grande Scuderia\", \"Mura Cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio Civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fucina\", \"Fucina\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio Civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAddTaskText = [\"Aggiungere Compito\", \"Tipo\", \"Villaggio Attivo\", \"Obiettivo del Compito\", \"Coordinate\", \"Modo\", \"Supporto di Costruzione\", \"Concentrazione risorse\", \"SU\", \"GIU\", \"Cancella\", \" Contenuto del Compito\", \"Muovere\", \"Cancella tutti i Compiti\"]; \n\t\t\t\taLangTaskKind = [\"Amplia\", \"Nuovo Edificio\", \"Attacco\", \"Ricerca\", \"Addestra\", \"Trasporto\", \"NPC\", \"Demolire\", \"Festa\"]; \n\t\t\t\taLangGameText = [\"Livello\", \"Mercanti\", \"ID\", \"Capitale\", \"Tempo di Inizio\", \"Questa impostazione di tempo non si usa.\", \"Coordinate\", \"Villaggio\", \"Trasporto\", \"dalla\", \"Trasporto a\", \"Trasporto da\", \"In ritorno da\", \"Risorse\", \"Edifici\", \"Costruisci nuovo edificio\", \"vuoto\", \"livello\"]; \n\t\t\t\taLangRaceName = [\"Romani\", \"Teutoni\", \"Galli\"]; \n\t\t\t\taLangTaskOfText = [\"Programma Ampliamento\", \"Programma Nuovo Edificio\", \"AutoResUpD\", \"Non_attivo\", \"Start\", \"Iniziato\", \"Sospeso\", \"La distribuzione delle risorse di questo villaggio e' \", \"Autotrasporto\", \"Autotrasporto non aperto\", \"Aperto\", \"Trasportato con successo\", \"Lista Compiti\", \"Trans_In_limit\", \"Default\", \"Modificare\", \"Legno/Argilla/Ferro\", \"Grano\", \"Demolire\",\n\t\t\t\t\t\"Programma Attacco\", \"Tipo Attacco\", \"Tempo Percorso\", \"ripeti\", \"intervallo di tempo\", \"00:30:00\", \"Obiettivo Catapulta\", \"Random\", \"Sconosciuto\", \"volte\", \"Mese\", \"Giorno\", \"Truppe Inviate\", \"Programma Addestramento\", \"Edificio addestramento\", \"Addestramento Finito\", \"Transporto Diverso\", \"Ripeti numero volte\", \"Questo é l'intervallo di ricarica pagina,\\n default é 20 minuti, per favore inserisci il nuovo tempo:\\n\\n\", \"Trans_Out_Rmn\", \"Programma la Festa\", \"Festa piccola\", \"Festa grande\", \"Imposta l'Intervallo di Concentrazione delle Risorse\",\n\t\t\t\t\t\"minuti\", \"in attesa\", \"corrente\", \"fare\", \"pausa\", \"Schedula miglioria\", \"Migliora attacco\", \"Migliora difesa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n\t\t\t\taLangErrorText = [\"Mancano le risorse.\", \"I tuoi costruttori sono già occupati nella costruzione di un altro edificio\", \"Livello massimo raggiunto\", \"Inizia Edificio\", \"Nella Ricerca\", \"Il tuo Magazzino \", \"Il tuo Granaio \", \"Risorse disponibili\", \"Mancanza di cibo\", \"Pronta la Festa\"]; \n\t\t\t\taLangOtherText = [\"Nota Importante \", \"Solo i Campi della Capitale possono essere ampliati al livello 20. La tua capitale non é determinata. Visita il tuo Profilo per favore.\", \"Shortcut here ^_^\", \"Setup compiuto\", \"Cancellato\", \"Inizia i Compiti\", \"Ampliato con successo\", \"Iniziato con successo\", \"La tua razza e' sconosciuta, anche il tipo di truppe. Visita il tuo Profilo per determinare la razza.\", \"Per favore visita il Circolo degli eroi per determinare la velocita e tipo di eroe.\"];\n\t\t\t\taLangResources = [\"legno\", \"argilla\", \"ferro\", \"grano\"]; \n\t\t\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperiano\", \"Emissario a cavallo\", \"Cavaliere del Generale\", \"Cavaliere di Cesare\", \"Ariete\", \"Onagro\", \"Senatore\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[1] = [\"Combattente\", \"Alabardiere\", \"Combattente con ascia\", \"Esploratore\", \"Paladino\", \"Cavaliere Teutonico\", \"Ariete\", \"Catapulta\", \"Comandante\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[2] = [\"Falange\", \"Combattente con spada\", \"Ricognitore\", \"Fulmine di Teutates\", \"Cavaliere druido\", \"Paladino di Haeduan\", \"Ariete\", \"Trabucco\", \"Capo tribù\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangAttackType = [\"Rinforzi\", \"Attacco\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'it\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\n\tcase \"si\": // thanks Bananana and Tuga\n\t\taLangAllBuildWithId = [\"Gozdar\", \"Glinokop\", \"Rudnik železa\", \"Žitno polje\", \"\", \"Žaga\", \"Opekarna\", \"Talilnica železa\", \"Mlin\", \"Pekarna\", \"Skladišče\", \"Žitnica\", \"Izdelovalec orožja\", \"Izdelovalec oklepov\", \"Vadbišče\", \"Gradbeni ceh\", \"Zbirališče\", \"Tržnica\", \"Ambasada\", \"Barake\", \"Konjušnica\", \"Izdelovalec oblegovalnih naprav\", \"Akademija\", \"Špranja\", \"Mestna hiša\", \"Rezidenca\", \"Palača\", \"Zakladnica\", \"Trgovski center\", \"Velike barake\", \"Velika konjušnica\", \"Mestno obzidje\", \"Zemljen zid\", \"Palisada\", \"Kamnosek\", \"Pivnica\", \"Postavljalec pasti\", \"Herojeva rezidenca\", \"Veliko skladišče\", \"Velika žitnica\", \"Čudež sveta\"];\n\t\taLangAllBuildAltWithId = [\"Gozdar\", \"Glinokop\", \"Rudnik železa\", \"Žitno polje\", \"\", \"Žaga\", \"Opekarna\", \"Talilnica železa\", \"Mlin\", \"Pekarna\", \"Skladišče\", \"Žitnica\", \"Izdelovalec orožja\", \"Izdelovalec oklepov\", \"Vadbišče\", \"Gradbeni ceh\", \"Zbirališče\", \"Tržnica\", \"Ambasada\", \"Barake\", \"Konjušnica\", \"Izdelovalec oblegovalnih naprav\", \"Akademija\", \"Špranja\", \"Mestna hiša\", \"Rezidenca\", \"Palača\", \"Zakladnica\", \"Trgovski center\", \"Velike barake\", \"Velika konjušnica\", \"Mestno obzidje\", \"Zemljen zid\", \"Palisada\", \"Kamnosek\", \"Pivnica\", \"Postavljalec pasti\", \"Herojeva rezidenca\", \"Veliko skladišče\", \"Velika žitnica\", \"Čudež sveta\"];\n\t\taLangAddTaskText = [\"Dodaj nalogo\", \"Style\", \"Aktivna vas\", \"Nadgradi\", \"Na\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Prestavi gor\", \"Prestavi dol\", \"Izbriši\", \" Naloge\", \"Premakni \", \"Izbriši vse naloge\"];\n\t\taLangTaskKind = [\"Nadgradi\", \"Zazidljiva parcela\", \"Napad\", \"Razišči\", \"Uri\", \"Transport\", \"NPC\", \"Demolish\", \"Festival\"];\n\t\taLangGameText = [\"Stopnja\", \"Merchants\", \"ID\", \"Prestolnica\", \"Začetek ob\", \"Nastavitev časa ni pomembna.\", \"to\", \"Vas\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Postavi nov objekt\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Rimljani\", \"Tevtoni\", \"Galci\"];\n\t\taLangTaskOfText = [\"Nadgradi kasneje\", \"Postavi nov objekt\", \"Surovine gor\", \"Pauza\", \"Začetek\", \"Začeto\", \"Prekliči\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Naloge\", \"Trans_In_limit\", \"Osnovno\", \"Spremeni\", \"Les/Glina/Železo\", \"Crop\", \"Podri kasneje\",\n\t\t\t\"Napadi kasneje\", \"Tip napada\", \"Do napada\", \"Ponovi\", \"Vrnitev čez\",\"00:30:00\",\"Tarča katapultov\",\"Naključno\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Enote poslane\", \"Uri kasneje\",\"Mesto urjenja\",\"Urjenje končano\",\"customTransport\",\"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"mali festival\",\"veliki festival\",\"setInterval of Resources concentration\",\n\t\t\t\"minute\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Primankljaj surovin.\", \"Delavci so že na delu.\", \"Zgrajeno\", \"Začnem z gradnjo\", \"V razvoju\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Pomembno!\", \"Samo polja v prestolnicigredo do stopnje 20 . A sua capitalnao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Naloga uspešno dodana\", \"Preklicano\", \"Začni z nalogo\", \"Uspešno nadgrajeno\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também.Visite o seu perfil para determinar as raça.\", \"Por favor visite a sua mansão do heroi para determinara velocidade e o tipo de heroi.\"];\n\t\taLangResources=[\"Les\",\"Glina\",\"Železo\",\"Žito\"]; \n\t\taLangTroops[0] = [\"Legionar\", \"Praetorijan\", \"Imperijan\", \"Izvidnik\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Oblegovalni oven\", \"Ognjeni katapult\", \"Senator\", \"Kolonist\", \"Heroj\"];\n\t\taLangTroops[1] = [\"Gorjačar\", \"Suličar\", \"Metalec sekir\", \"Skavt\", \"Paladin\", \"Tevtonski vitez\", \"Oblegovalni oven\", \"Mangonel\", \"Vodja\", \"Kolonist\", \"Heroj\" ];\n\t\taLangTroops[2] = [\"Falanga\", \"Mečevalec\", \"Stezosledec\", \"Theutatesova Strela\", \"Druid\", \"Haeduan\", \"Oblegovalni oven\", \"Trebušet\", \"Poglavar\", \"Kolonist\", \"Heroj\"];\n\t\taLangAttackType = [\"Okrepitev\", \"Napad\", \"Ropanje\"];\n\t\tbreak;\n\n\tcase \"vn\": // thanks Tuga\n\t\taLangAllBuildWithId = [\"Tiều Phu\", \"Mỏ Đất Sét\", \"Mỏ sắt\", \"Ruộng lúa\", \"\", \"Xưởng Gỗ\", \"Lò Gạch\", \"Lò Rèn\", \"Nhà Xay Lúa\", \"Lò Bánh\", \"Nhà Kho\", \"Kho Lúa\", \"Thợ Rèn\", \"Lò Luyện Giáp\", \"Võ Đài\", \"Nhà Chính\", \"Binh Trường\", \"Chợ\", \"Đại Sứ Quán\", \"Trại Lính\", \"Chuồng Ngựa\", \"Xưởng\", \"Học Viện\", \"Hầm Ngầm\", \"Tòa Thị Chính\", \"Lâu Đài\", \"Cung Điện\", \"Kho Bạc\", \"Phòng Thương Mại\", \"Doanh Trại Lớn\", \"Trại Ngựa\", \"Tường Thành\", \"Tường Đất\", \"Tường Rào\", \"Thợ Xây Đá\", \"Quán bia\", \"Hố Bẫy\",\"Lâu đài tướng\", \"Nhà Kho Lớn\", \"Kho Lúa Lớn\", \"Kỳ Quan\", \"Tàu ngựa\"];\n\t\taLangAllBuildAltWithId = [\"Tiều Phu\", \"Mỏ Đất Sét\", \"Mỏ sắt\", \"Ruộng lúa\", \"\", \"Xưởng Gỗ\", \"Lò Gạch\", \"Lò Rèn\", \"Nhà Xay Lúa\", \"Lò Bánh\", \"Nhà Kho\", \"Kho Lúa\", \"Thợ Rèn\", \"Lò Luyện Giáp\", \"Võ Đài\", \"Nhà Chính\", \"Binh Trường\", \"Chợ\", \"Đại Sứ Quán\", \"Trại Lính\", \"Chuồng Ngựa\", \"Xưởng\", \"Học Viện\", \"Hầm Ngầm\", \"Tòa Thị Chính\", \"Lâu Đài\", \"Cung Điện\", \"Kho Bạc\", \"Phòng Thương Mại\", \"Doanh Trại Lớn\", \"Trại Ngựa\", \"Tường Thành\", \"Tường Đất\", \"Tường Rào\", \"Thợ Xây Đá\", \"Quán bia\", \"Hố Bẫy\",\"Lâu đài tướng\", \"Nhà Kho Lớn\", \"Kho Lúa Lớn\", \"Kỳ Quan\", \"Tàu ngựa\"];\n\t\taLangAddTaskText = [\"Thêm nhiệm vụ\", \"Loại\", \"Tại làng\", \"Mục tiêu\", \"Tới\", \"Phương thức\", \"Tự động\", \"Tùy chỉnh\", \"Di chuyển lên\", \"Di chuyển xuống\", \"Xóa\", \"&#160;&#160;&#160;Nội dung công việc\", \"Di chuyển\", \"Xóa tất cả danh mục\"];\n\t\taLangTaskKind = [\"Nâng cấp\", \"Kiến Trúc Mới\", \"Tấn công\", \"Nghiên cứu\", \"Huấn luyện\", \"Vận chuyển\", \"NPC\", \"Phá hủy\", \"ăn mừng\"];\n\t\taLangGameText = [\"Cấp \", \"Lái Buôn\", \"Tại vị trí\", \"Thủ đô\", \"Bắt đầu tại\", \"Chưa dùng được chức năng này.\", \"đến\", \"Làng\", \"vận chuyển\", \"từ\", \"Vận chuyển đến\", \"Vận chuyển từ\", \"Trở về từ\", \"Tài nguyên\", \"Kiến trúc\", \"Xây Kiến Trúc Mới\", \"không có gì\", \"Cấp\"];\n\t\taLangRaceName = [\"Tộc Romans\", \"Tộc Teutons\", \"Tộc Gauls\"];\n\t\taLangTaskOfText = [\"Lên lịch nâng cấp kiến trúc này\", \"Lên lịch xây kiến trúc này\", \"Tự động nâng cấp các mỏ\", \"Chưa kích hoạt\", \"Kích hoạt\", \"Đã kích hoạt\", \"Hủy\", \"Đây là làng loại \", \"Tự động gửi tài nguyên\", \"Tự động gửi tài nguyên chưa được kích hoạt\", \"Đã được kích hoạt\", \"Gủi thành công\", \"Danh mục\", \"Tài nguyên bạn muốn nhận\", \"Mặc định\", \"Tùy chỉnh \", \"Gỗ/Đất sét/Sắt\", \"Lúa\", \"Lên lịch phá hủy công trình\",\n\t\t\t\"Lên lịch tấn công làng này\", \"Loại tấn công\", \"Thời gian để đến nơi\", \"Số lần lặp lại\", \"Khoảng cách giữa các lần lặp lại\",\"00:30:00\",\"Mục tiêu cata\",\"Ngẫu nhiên\", \"Chưa biết\", \"Giờ\", \"Tháng\", \"Ngày\", \"Đã gửi lính\", \"Lên lịch huấn luyện lính này\",\"Train ubication\",\"Lính đang được huấn luyện\",\"Tùy chỉnh gửi tài nguyên\",\"Thiết lập thời gian tải lại trang web\",\"Đây là khoảng thởi gian tải lại trang web ,\\n Mặc định là 20 phút, hãy điền vào số phút bạn muốn thay đổi:\\n\\n\",\"Tài nguyên bạn muốn chừa lại\",\"Lên lịch ăn mừng\",\"Ăn mừng nhỏ\",\"Ăn mừng lớn\",\"Thiết lập khoảng thời gian bạn muốn gửi tài nguyên\",\n\t\t\t\"Phút\",\"Đang tạm dừng\",\"Đang thi hanh\",\"Thi hành\",\"Tạm dừng\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Quá ít tài nguyên.\", \"Công nhân đang làm nhiệm vụ khác.\", \"Kiến trúc đã hoàn thiên\", \"Bắt đầu xây dựng\", \"Đang xây dựng\", \"Nhà kho quá nhỏ. Hãy nâng cấp nhà kho mới xây dựng được kiến trúc\", \"Kho lúa quá nhỏ. Hãy nâng cấp kho lúa mới xây được kiến trúc\", \"Quá ít tài nguyên\",\"\",\"Hiện đang có buổi lễ ăn mừng\"];\n\t\taLangOtherText = [\"Chú thích quan trọng\", \"Chỉ thủ đô mới có thể<br/>nâng cấp các mỏ lên level 20. THủ đô của bạn<br/> chưa thấy. hãy vào phần hồ sơ của bạn.\", \"Click vào đây\", \"Cài đặt hoàn tất\", \"Đã hủy\", \"Bắt đầu công việc\", \"Nâng cấp thành công\", \"Kích hoạt thành công\", \"CHưa biết bạn thuộc tộc nào. <br/>Vì vậy bạn nên vào hồ sơ để cập nhật thông tin.<br/>\", \"Bạn cũng nên vào Lâu Đài Tướng để cập nhật<br/> tốc đọ và loại tướng.\"];\n\t\taLangResources=[\"Gỗ\",\"Đất sét\",\"Sắt\",\"Lúa\"];\n\t\taLangTroops[0] = [\"Lính Lê Dương\", \"Thị Vệ\", \"Chiến Binh Tinh Nhuệ\", \"Kỵ Binh Do Thám\", \"Kỵ Binh\", \"Kỵ Binh Tinh Nhuệ\", \"Xe Công Thành\", \"Máy Phóng Lửa\", \"Nguyên Lão\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangTroops[1] = [\"Lính Chùy\", \"Lính Giáo\", \"Lính Rìu\", \"Do Thám\", \"Hiệp Sĩ Paladin\", \"Kỵ Sĩ Teutonic\", \"Đội Công Thành\", \"Máy Bắn Đá\", \"Thủ Lĩnh\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangTroops[2] = [\"Lính Pha Lăng\", \"Kiếm Sĩ\", \"Do Thám\", \"Kỵ Binh Sấm Sét\", \"Tu Sĩ\", \"Kỵ Binh\", \"Máy Nện\", \"Máy Bắn Đá\", \"Tù Trưởng\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangAttackType = [\"Tiếp viện\", \"Tấn công\", \"Cướp bóc\"];\n\t\tbreak;\n\n\tcase \"ru\": // by MMX\n\t\taLangAllBuildWithId = [\"Лесопилка\", \"Глиняный карьер\", \"Железный рудник\", \"Ферма\", \"\", \"Лесопильный завод\", \"Кирпичный завод\", \"Чугунолитейный завод\", \"Мукомольная мельница\", \"Пекарня\", \"Склад\", \"Амбар\", \"Кузница оружия\", \"Кузница доспехов\", \"Арена\", \"Главное здание\", \"Пункт сбора\", \"Рынок\", \"Посольство\", \"Казарма\", \"Конюшня\", \"Мастерская\", \"Академия\", \"Тайник\", \"Ратуша\", \"Резиденция\", \"Дворец\", \"Сокровищница\", \"Торговая палата\", \"Большая казарма\", \"Большая конюшня\", \"Стена\", \"Земляной вал\", \"Изгородь\", \"Каменотес\", \"Пивная\", \"Капканщик\",\"Таверна\", \"Большой склад\", \"Большой амбар\", \"Чудо света\", \"Водопой\"];\n\t\taLangAllBuildAltWithId = [\"Лесопилка\", \"Глиняный карьер\", \"Железный рудник\", \"Ферма\", \"\", \"Лесопильный завод\", \"Кирпичный завод\", \"Чугунолитейный завод\", \"Мукомольная мельница\", \"Пекарня\", \"Склад\", \"Амбар\", \"Кузница оружия\", \"Кузница доспехов\", \"Арена\", \"Главное здание\", \"Пункт сбора\", \"Рынок\", \"Посольство\", \"Казарма\", \"Конюшня\", \"Мастерская\", \"Академия\", \"Тайник\", \"Ратуша\", \"Резиденция\", \"Дворец\", \"Сокровищница\", \"Торговая палата\", \"Большая казарма\", \"Большая конюшня\", \"Стена\", \"Земляной вал\", \"Изгородь\", \"Каменотес\", \"Пивная\", \"Капканщик\",\"Таверна\", \"Большой склад\", \"Большой амбар\", \"Чудо света\", \"Водопой\"];\n\t\taLangAddTaskText = [\"Добавить задание\", \"Тип задания\", \"Активная деревня\", \"Цель задания\", \" Цель\", \"Тип\", \"Поддержка строительства\", \"Концентрация ресурсов\", \"Вверх\", \"Вниз\", \"\", \"\", \"\",\"Снять все задания\"];\n\t\taLangTaskKind = [\"Улучшить:\", \"Строим:\", \"Атаковать:\", \"Исследовать:\", \" нанять:\", \"Отправить ресурсы:\", \"NPC:\", \"Разрушить:\", \"Торжество:\"];\n\t\taLangGameText = [\" \", \"Торговцы\", \"ID\", \"Столица\", \"Время запуска\", \"временно не работает\", \"в\", \"Деревня\", \"Транспортировка\", \"из\", \"Транспортировка в\", \"Транспортировка из\", \"Отправка из\", \"ресурсы\", \"здание\", \"Построить новое здание\", \"пусто\", \"уровень\"];\n\t\taLangRaceName = [\"Римляне\", \"Германцы\", \"Галлы\"];\n\t\taLangTaskOfText = [\"Запланировать улучшение\", \"Запланировать новое здание\", \"Качать ресурсы\", \"Выкл\", \"(►)\", \"Вкл\", \"(■)\", \"Распределение полей в деревне: \", \"Автоотправка\", \"Автоотправка выкл.\", \"Вкл.\", \"Успешно отправлено\", \"/Задания/\", \"Лимит ввоза\", \"Нет\", \"Правка \", \"Дерево/Глина/Железо\", \"Зерно\", \"Запланировать разрушение\",\n\t\t\t\"Запланировать атаку\", \"Тип атаки\", \"Време в пути\", \"повторы\", \"через\", \"00:30:00\", \"Цель катов\", \"Случайно\", \"Неизвестно\", \" раз\", \"/\", \" :дата/время: \", \"Войска\",\n\t\t\t\"Запланировать найм\",\"Выбранное здание \", \"Обучение войск завершено\",\"Поставки\", \"Задать интревал обновления\", \"Это интервал обновления страницы ,\\n по умолчанию - 20 минут, Введите новое время:\\n\\n\", \"Лимит вывоза\", \"Запланировать празднование\", \"Малый праздник\", \"Большой праздник\", \"Установка интервала концентрации ресов\",\n\t\t\t\"минуты\", \"Выключен\", \"Включено\", \"(►)\", \"(■)\",\"Запланировать улучшение\",\"Улучшить атаку\",\"Улучшить защиту\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Недостаточно сырья\", \"Все строители сейчас заняты\", \"Это здание отстроено полностью\", \"Начинаю строительство\", \"Процесс развития\", \"Недостаточна вместимость склада\", \"Недостаточна вместимость амбара\", \"Достаточно ресурсов\", \"Недостаток продовольствия: развивайте фермы.\",\"Проводится торжество\"];\n\t\taLangOtherText = [\"Важные заметки\", \"Только в столице поля могут быть до уровня 20.<br/>Столица не определена.Зайдите в профиль\", \"Ссылка тут ^_^\", \"<br/>Настройка завершена\", \"Отменено\", \"Начать задачи\", \" Улучшение прошло успешно\", \"Успешно\", \"Ваш народ неопределен.Пожалуйста зайдите в профиль.\", \"Также пожалуйста зайдите в таверну<br/>для определения типа и скорости героя\"];\n\t\taLangResources = [\"Древесина\",\"Глина\",\"Железо\",\"Зерно\"];\n\t\taLangTroops[0] = [\"Легионер\", \"Преторианец\", \"Империанец\", \"Конный разведчик\", \"Конница императора\", \"Конница Цезаря\", \"Таран\", \"Огненная катапульта\", \"Сенатор\", \"Поселенец\", \"Герой\"];\n\t\taLangTroops[1] = [\"Дубинщик\", \"Копьеносец\", \"Топорщик\", \"Скаут\", \"Паладин\", \"Тевтонская конница\", \"Стенобитное орудие\", \"Катапульта\", \"Вождь\", \"Поселенец\", \"Герой\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мечник\", \"Следопыт\", \"Тевтатский гром\", \"Друид-всадник\", \"Эдуйская конница\", \"Таран\", \"Требушет\", \"Предводитель\", \"Поселенец\", \"Герой\"];\n\t\taLangAttackType = [\"Подкрепление\", \"Нападение\", \"Набег\"];\n\t\tbreak; \n\n\tcase \"rs\": // by rsinisa\n\t\taLangAllBuildWithId = [\"Дрвосеча\", \"Рудник глине\", \"Рудник гвожђа\", \"Њива\", \"\", \"Пилана\", \"Циглана\", \"Ливница гвожђа\", \"Млин\", \"Пекара\", \"Складиште\", \"Силос\", \"Ковачница оружја\", \"Ковачница оклопа\", \"Витешка арена\", \"Главна зграда\", \"Место окупљања\", \"Пијаца\", \"Амбасада\", \"Касарна\", \"Штала\", \"Радионица\", \"Академија\", \"Склониште\", \"Општина\", \"Резиденција\", \"Палата\", \"Ризница\", \"Трговачки центар\", \"Велика касарна\", \"Велика штала\", \"Градски зид\", \"Земљани зид\", \"Палисада\", \"Каменорезац\", \"Пивница\", \"Постављач замки\",\"Дворац хероја\", \"Велико складиште\", \"Велики силос\", \"Светско чудо\", \"Појилиште\"];\n\t\taLangAllBuildAltWithId = [\"Дрвосеча\", \"Рудник глине\", \"Рудник гвожђа\", \"Њива\", \"\", \"Пилана\", \"Циглана\", \"Ливница гвожђа\", \"Млин\", \"Пекара\", \"Складиште\", \"Силос\", \"Ковачница оружја\", \"Ковачница оклопа\", \"Витешка арена\", \"Главна зграда\", \"Место окупљања\", \"Пијаца\", \"Амбасада\", \"Касарна\", \"Штала\", \"Радионица\", \"Академија\", \"Склониште\", \"Општина\", \"Резиденција\", \"Палата\", \"Ризница\", \"Трговачки центар\", \"Велика касарна\", \"Велика штала\", \"Градски зид\", \"Земљани зид\", \"Палисада\", \"Каменорезац\", \"Пивница\", \"Постављач замки\",\"Дворац хероја\", \"Велико складиште\", \"Велики силос\", \"Светско чудо\", \"Појилиште\"];\n\t\taLangAddTaskText = [\"Додај задатак\", \"Начин\", \"Активна села\", \"Задата мета\", \"на\", \"Мод\", \"Подршка изградње\", \"Концентрација ресурса\", \"Помери горе\", \"Помери доле\", \"Бриши\", \" Списак задатака\", \"Помери \", \"Обриши све задатке\"];\n\t\taLangTaskKind = [\"Надогради\", \"Нова градња\", \"Напад\", \"Истраживање\", \"Обучи\", \"Транспорт\", \"НПЦ\", \"Рушити\", \"Забава\"];\n\t\taLangGameText = [\"ниво \", \"Трговци\", \"ID\", \"Главни град\", \"Време почетка\", \"ово временско подешавање је бескорисно\", \" према\", \"Село\", \"транспорт\", \"из\", \"Пребацивање према\", \"Пребацивање из\", \"повратак из\", \"ресурси\", \"изградња\", \"Направи нову зграду\", \"празно\", \"ниво\"];\n\t\taLangRaceName = [\"Римљани\", \"Тевтонци\", \"Гали\"];\n\t\taLangTaskOfText = [\"Распоред за надоградњу\", \"Направи нови распоред\", \"Ауто надоградња ресурса\", \"Неактивно\", \"Покрени\", \"Активно\", \"Заустави\", \"Дистрибуција ресурсних поља овог села је \", \"Аутотранспорт\", \"Аутотранспорт није отворен\", \"Отворен\", \"Транспорт успешан\", \"Листа задатака\", \"Транспорт са лимитом\", \"Подразумевано\", \"Измени\", \"Дрво/Гллина/Гвожђе\", \"Њива\", \"Листа рушења\", \"Листа напада\", \"Врста напада\", \"Време превоза\", \"број понављања\", \"Временски интервал\",\"00:30:00\",\"Мета катапулта\",\"Насумично\", \"Непознат\", \" пута\", \". месец, \", \". дан, у \", \"Слање трупа\", \"Листа обуке\",\"Место обуке\",\"Тренинг задатак урадити\",\"прилагођен транспорт\",\"подеси време поновног учитавања \",\" ово је интервал поновног учитавања стране, \\n подразумевана вредност је 20 минута, молимо Вас убаците ново време:\\n \\n\",\"Остатак одлазног транспорта\",\"Листа забава\",\"мала забава\",\"велика забава\",\" Подесите интервал концентрације ресурса \", \"минути\", \"заустављено\", \"активно\", \"покрени\", \"паузирај\",\"Распоред унапређења\",\"Унапреди напад\",\"Унапреди одбрану\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Премало ресурса.\", \"Радници су већ на послу.\", \"Изградња завршена\", \"Покретање изградње\", \"У изградњи\", \"Складиште је премало. Проширите складиште како би наставили са изградњом\", \"Силос је премали. Проширите силос како би наставили са изградњом\", \"Довољно ресурса\",\"Премало жита: прошири прво њиве\",\"Прослава је већ у току\"];\n\t\taLangOtherText = [\"Важна напомена\", \"Само у главном граду ресурсна поља могу бити проширена на ниво 20. Твој главни град није детектован, погледај свој профил.\", \"Пречица овде ^_^\", \"Подешавања готова\", \"Отказано\", \"Покрени задатке\", \"Надоградња успешна\", \"Покретање успешно\", \"Ваше племе је непознато, стога и врста трупа. Погледајте свој профил да видите који сте народ.\",\"Такође посетите дворац хероја да сазнате брзину и тип свог хероја \"];\n\t\taLangResources=[\"дрво\",\"глина\",\"гвожђе\",\"жито\"];\n\t\taLangTroops[0] = [\"Легионар\", \"Преторијанац\", \"Империјанац\", \"Извиђач\", \"Императорова коњица\", \"Цезарева коњица\", \"Ован\", \"Ватрени катапулт\", \"Сенатор\", \"Насељеник\", \"Херој\"];\n\t\taLangTroops[1] = [\"Батинар\", \"Копљаник\", \"Секираш\", \"Извиђач\", \"Паладин\", \"Тевтонски витез\", \"Ован\", \"Катапулт\", \"Поглавица\", \"Насељеник\", \"Херој\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мачевалац\", \"Извиђач\", \"Галски витез\", \"Друид\", \"Коњаник\", \"Ован\", \"Катапулт\", \"Старешина\", \"Насељеник\", \"Херој\"];\n\t\taLangAttackType = [\"Појачање\", \"Нормалан\", \"Пљачка\"];\n\t\tbreak;\n\n\tcase \"ba\": // thanks ieyp\n\t\taLangAllBuildWithId = [\"Drvosječa\", \"Rudnik gline\", \"Rudnik željeza\", \"Poljoprivredno imanje\", \"\", \"Pilana\", \"Ciglana\", \"Livnica\", \"Mlin\", \"Pekara\", \"Skladište\", \"Silos\", \"Oruzarnica\", \"Kovacnica oklopa\", \"Mejdan\", \"Glavna zgrada\", \"Mesto okupljanja\", \"Pijaca\", \"Ambasada\", \"Kasarna\", \"Stala\", \"Radionica\", \"Akademija\", \"Skloniste\", \"Opstina\", \"Rezidencija\", \"Palata\", \"Riznica\", \"Trgovacki centar\", \"Velika kasarna\", \"Velika stala\", \"Gradski zid\", \"Zemljani zid\", \"Taraba\", \"Kamenorezac\", \"Pivnica\", \"Zamkar\",\"Dvorac heroja\", \"Veliko skladiste\", \"Veliki silos\", \"WW\", \"Pojiliste\"];\n\t\taLangAllBuildAltWithId = [\"Drvosječa\", \"Rudnik gline\", \"Rudnik željeza\", \"Poljoprivredno imanje\", \"\", \"Pilana\", \"Ciglana\", \"Livnica\", \"Mlin\", \"Pekara\", \"Skladište\", \"Silos\", \"Oruzarnica\", \"Kovacnica oklopa\", \"Mejdan\", \"Glavna zgrada\", \"Mesto okupljanja\", \"Pijaca\", \"Ambasada\", \"Kasarna\", \"Stala\", \"Radionica\", \"Akademija\", \"Skloniste\", \"Opstina\", \"Rezidencija\", \"Palata\", \"Riznica\", \"Trgovacki centar\", \"Velika kasarna\", \"Velika stala\", \"Gradski zid\", \"Zemljani zid\", \"Taraba\", \"Kamenorezac\", \"Pivnica\", \"Zamkar\",\"Dvorac heroja\", \"Veliko skladiste\", \"Veliki silos\", \"WW\", \"Pojiliste\"];\n\t\taLangAddTaskText = [\"Dodaj zadatak\", \"Nacin\", \"Aktivna sela\", \"Zadata meta\", \"Prema\", \"Mod\", \"Podrska izgradnje\", \"Koncentracija resursa\", \"Pomeri gore\", \"Pomeri dole\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Pomeri \", \"Obrisi sve zadatke\"];\n\t\taLangTaskKind = [\"Unapredi\", \"Nova izgradnja\", \"Napad\", \"Istrazivanje\", \"Obuci\", \"Transport\", \"NPC\", \"Rusiti\", \"Zabava\"];\n\t\taLangGameText = [\"Lvl\", \"Trgovci\", \"ID\", \"Glavni grad\", \"Vreme pocetka\", \"ovo vremensko podesavanje je beskorisno\", \"prema\", \"Selo\", \"transport\", \"iz\", \"Prebacivanje prema\", \"Prebacivanje iz\", \"povratak iz\", \"resursi\", \"izgradnja\", \"Napravi novu zgradu\", \"prazno\", \"nivo\"];\n\t\taLangRaceName = [\"Rimljani\", \"Teutonci\", \"Gali\"];\n\t\taLangTaskOfText = [\"Raspored za nadogradnju\", \"Napravi novi raspored\", \"AutoResUpD\", \"Not_run\", \"Pokreni\", \"Pokrenuto\", \"Zaustavi\", \"Distribucija resursnih polja ovog sela je \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Transport sa limitom\", \"Podrazumevano\", \"Izmeni\", \"Drvo/Glina/Gvozdje\", \"Njiva\", \"Lista rusenja\",\n\t\t\t\"Lista napada\", \"Vrsta napada\", \"Vreme prevoza\", \"broj ponavljanja\", \"Vremenski interval\",\"00:30:00\",\"Meta katapulta\",\"Nasumicno\", \"Nepoznat\", \"times\", \"Mesec\", \"Dan\", \"Slanje trupa\", \"Lista obuke\",\"Mesto obuke\",\"TreningZadatak uraditi\",\"prilagodenTransport\",\"podesi vreme ponovnog ucitavanja \",\" ovo je interval ponovnog ucitavanja strane, \\n podrazumevan vrednost je 20 minuta, molimo vas ubacite novo vreme:\\n \\n\",\"Trans_Out_Rmn\",\"Lista zabava\",\"mala zabava\",\"velika zabava\",\" Podesite interval koncentracie resursa \",\n\t\t\t\"minuti\", \"zaustavljanje\", \"pokrece se\", \"pokreni\", \"pauza\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Premalo resursa. Buahaha :D\", \"Radnici su vec na poslu :P\", \"Izgradnja zavrsena\", \"Pokretanje izgradnje\", \"U izgradnji\", \"Skladiste je premalo. Prosirite skladiste kako bi nastavili sa izgradnjom\", \"Silos je malecak. Prosirite silos kako bi nastavili sa izgradnjom\", \"Dovoljno resursa\",\"Premalo zita, prvo prosiri njive\",\"Proslava je u toku\"];\n\t\taLangOtherText = [\"Vazna napomena\", \"Samo u glavnom gradu mozete <br/> prosiriti resursna polja preko nivoa 10. Tvoj glavni grad <br/> nije otkriven, poseti svoj profil.\", \"Precica ovde ^^\", \"Podesavanja gotova\", \"Otkazano\", \"Pokreni zadatke\", \"Nadogradnja uspesna\", \"Pokretanje uspesno\", \"Vase pleme je nepoznato, stoga I tip trupa. Posetite <br/> svoj profil da vidite pleme. <br/>\",\"Posetite dvorac heroja da saznate <br/> brzinu I tip svog heroja \"];\n\t\taLangResources=[\"drvo\",\"glina\",\"gvozdje\",\"zito\"];\n\t\taLangTroops[0] = [\"Legionar\", \"Pretorijanac\", \"Imperijanac\", \"Izvidjac\", \"Imperatorova konjica\", \"Cezareva konjica\", \"Ovan\", \"Vatreni katapult\", \"Senator\", \"Naseljenik\", \"Heroj\"];\n\t\taLangTroops[1] = [\"Batinar\", \"Kopljanik\", \"Sekiras\", \"Izvidjac\", \"Paladin\", \"Tetutonski vitez\", \" Ovan \", \"Katapult\", \"Poglavica\", \"Naseljenik\", \"Heroj\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Macevalac\", \"Izvidjac\", \"Teutateov grom\", \"Druid\", \"Heduan\", \" Ovan \", \"Katapult\", \"Staresina\", \"Naseljenik\", \"Heroj\"];\n\t\taLangAttackType = [\"Pojacanje\", \"Normalan\", \"Pljacka\"];\n\t\tbreak;\n\n\tcase \"org\":\n\tcase \"de\": // by LohoC et al.\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Rüstungsschmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Rüstungsschmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAddTaskText = [\"Aufgabe hinzufügen\",\"Style\",\"Aktives Dorf\",\"Aufgaben Ziel\",\"nach\",\"Modus\",\"Baubetreuung\",\"Ressourcenkonzentration\",\"Rauf\",\"Runter\",\"Entfernen\",\" Aufgaben Inhalte\",\"Bewegen \",\"alle Aufgaben Löschen\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\",\"Neues Gebäude\",\"Angriff\",\"Forschung\",\"ausbilden\",\"Transport\",\"NPC\",\"Zerstören\",\"Fest\"];\n\t\t\t\taLangGameText = [\"Lvl\",\"Händler\",\"ID\",\"Hauptdorf\",\"Startzeit\",\"diese Zeiteinstellung ist nicht sinnvoll.\",\"nach\",\"Dorf\",\"Transport\",\"von\",\"Transport nach\",\"Transport von\",\"Rückkehr aus\",\"Rohstoffe\",\"Gebäude\",\"Neues Gebäude errichten\",\"leer\",\"Stufe\"];\n\t\t\t\taLangRaceName = [\"Römer\",\"Germane\",\"Gallier\"];\n\t\t\t\taLangTaskOfText = [\"Zeitplan Upgrade\",\"Zeitplan Neu Bauen\",\"AutoResRauf\",\"Pausiert\",\"Start\",\"Laufend\",\"Unterbrechen\",\"Es wird Gebaut \",\"Autotransport\",\"Autotransport ist nicht An\",\"AN\",\"Transport Erfolgreich\",\"Aufgabenliste\",\"Transportlimit (-)\",\"Vorgabe\",\"Ändern \",\"Holz/Lehm/Eisen\",\"G3D\",\"Zeitplan Abriss\",\n\t\t\t\t\t\"Zeitplan Angriff\",\"Angriffsart\",\"Laufzeit\",\"Wiederholungen\",\"Intervalzeit\",\"00:30:00\",\"Katapultziel\",\"Zufall\",\"Unbekannt\",\"mal\",\"Monat\",\"Tag\",\"Truppen senden\",\"Zeitplan Ausbildung\",\"Ausbildungsseite\",\"Ausbildungsauftrag abgeschlossen\",\"Manueller Transport\",\"Setzte Intervalzeit für Reload\",\"Dies ist der Interval zum Seitenreload ,\\n Standard sind 20 Minuten, Bitte trage eine neue ein:\\n\\n\",\"Transportlimit (+)\",\"Partyplanung\",\"Kleine Party\",\"Große Party\",\"Setzte den Interval der Ressourcenkonzentration\",\n\t\t\t\t\t\"Minuten\",\".\",\".\",\"START\",\"STOP\",\"Zeitplan Verbessern\",\"Angriff verbessern\",\"Verteidigung verbessern\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Zu wenig Rohstoffe\",\"Es wird bereits gebaut\",\"vollständig ausgebaut\",\"Starte Konstruktion\",\"In Entwicklung\",\"Zuerst Rohstofflager ausbauen\",\"Zuerst Kornspeicher ausbauen\",\"Genug Rohstoffe\",\"Nahrungsmangel: Erst eine Getreidefarm ausbauen\",\"Es wird bereits gefeiert.\"];\n\t\t\t\taLangOtherText = [\"Wichtige Notiz\",\"Nur die Ressourcenfelder der Hauptstadt können<br/>bis Stufe 20 ausgebaut werden. Zur zeit ist deine Hauptstadt<br/>nicht identifiziert. Bitte besuche dein Profil.\",\"Shortcut here ^_^\",\"Setup fertiggestellt\",\"Abgebrochen\",\"Starte die Aufgaben\",\"Upgrade war erfolgreich\",\"Starten war erfolgreich\",\"Deine Rasse ist unbekannt.<br/>Bitte besuche dein Profil.<br/>\",\"Bitte besuche auch deinen Heldenhof um<br/>die Geschwindigkeit und die Art deines Helden zu bestimmen.\"];\n\t\t\t\taLangResources = [\"Holz\",\"Lehm\",\"Eisen\",\"Getreide\"];\n\t\t\t\taLangTroops[0] = [\"Legionär\",\"Prätorianer\",\"Imperianer\",\"Equites Legati\",\"Equites Imperatoris\",\"Equites Caesaris\",\"Rammbock\",\"Feuerkatapult\",\"Senator\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[1] = [\"Keulenschwinger\",\"Speerkämpfer\",\"Axtkämpfer\",\"Kundschafter\",\"Paladin\",\"Teutonen Reiter\",\"Ramme\",\"Katapult\",\"Stammesführer\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\",\"Schwertkämpfer\",\"Späher\",\"Theutates Blitz\",\"Druidenreiter\",\"Haeduaner\",\"Rammholz\",\"Kriegskatapult\",\"Häuptling\",\"Siedler\",\"Held\"];\n\t\t\t\taLangAttackType = [\"Unterstützung\",\"Angriff: Normal\",\"Angriff: Raubzug\"];\n\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Schmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Schmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAddTaskText = [\"Aufgabe hinzufügen\",\"Style\",\"Aktives Dorf\",\"Aufgaben Ziel\",\"nach\",\"Modus\",\"Baubetreuung\",\"Ressourcenkonzentration\",\"Rauf\",\"Runter\",\"Entfernen\",\" Aufgaben Inhalte\",\"Bewegen \",\"alle Aufgaben Löschen\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\",\"Neues Gebäude\",\"Angriff\",\"Forschung\",\"ausbilden\",\"Transport\",\"NPC\",\"Zerstören\",\"Fest\"];\n\t\t\t\taLangGameText = [\"Lvl\",\"Händler\",\"ID\",\"Hauptdorf\",\"Startzeit\",\"diese Zeiteinstellung ist nicht sinnvoll.\",\"nach\",\"Dorf\",\"Transport\",\"von\",\"Transport nach\",\"Transport von\",\"Rückkehr aus\",\"Rohstoffe\",\"Gebäude\",\"Neues Gebäude errichten\",\"leer\",\"Stufe\"];\n\t\t\t\taLangRaceName = [\"Römer\",\"Germane\",\"Gallier\"];\n\t\t\t\taLangTaskOfText = [\"Zeitplan Upgrade\",\"Zeitplan Neu Bauen\",\"AutoResRauf\",\"Pausiert\",\"Start\",\"Laufend\",\"Unterbrechen\",\"Es wird Gebaut \",\"Autotransport\",\"Autotransport ist nicht An\",\"AN\",\"Transport Erfolgreich\",\"Aufgabenliste\",\"Transportlimit (-)\",\"Vorgabe\",\"Ändern \",\"Holz/Lehm/Eisen\",\"G3D\",\"Zeitplan Abriss\",\n\t\t\t\t\t\"Zeitplan Angriff\",\"Angriffsart\",\"Laufzeit\",\"Wiederholungen\",\"Intervalzeit\",\"00:30:00\",\"Katapultziel\",\"Zufall\",\"Unbekannt\",\"mal\",\"Monat\",\"Tag\",\"Truppen senden\",\"Zeitplan Ausbildung\",\"Ausbildungsseite\",\"Ausbildungsauftrag abgeschlossen\",\"Manueller Transport\",\"Setzte Intervalzeit für Reload\",\"Dies ist der Interval zum Seitenreload ,\\n Standard sind 20 Minuten, Bitte trage eine neue ein:\\n\\n\",\"Transportlimit (+)\",\"Partyplanung\",\"Kleine Party\",\"Große Party\",\"Setzte den Interval der Ressourcenkonzentration\",\n\t\t\t\t\t\"Minuten\",\".\",\".\",\"START\",\"STOP\",\"Zeitplan Verbessern\",\"Angriff verbessern\",\"Verteidigung verbessern\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Zu wenig Rohstoffe\",\"Es wird bereits gebaut\",\"vollständig ausgebaut\",\"Starte Konstruktion\",\"In Entwicklung\",\"Zuerst Rohstofflager ausbauen\",\"Zuerst Kornspeicher ausbauen\",\"Genug Rohstoffe\",\"Nahrungsmangel: Erst eine Getreidefarm ausbauen\",\"Es wird bereits gefeiert.\"];\n\t\t\t\taLangOtherText = [\"Wichtige Notiz\",\"Nur die Ressourcenfelder der Hauptstadt können<br/>bis Stufe 20 ausgebaut werden. Zur zeit ist deine Hauptstadt<br/>nicht identifiziert. Bitte besuche dein Profil.\",\"Shortcut here ^_^\",\"Setup fertiggestellt\",\"Abgebrochen\",\"Starte die Aufgaben\",\"Upgrade war erfolgreich\",\"Starten war erfolgreich\",\"Deine Rasse ist unbekannt.<br/>Bitte besuche dein Profil.<br/>\",\"Bitte besuche auch deinen Heldenhof um<br/>die Geschwindigkeit und die Art deines Helden zu bestimmen.\"];\n\t\t\t\taLangResources = [\"Holz\",\"Lehm\",\"Eisen\",\"Getreide\"];\n\t\t\t\taLangTroops[0] = [\"Legionär\",\"Prätorianer\",\"Imperianer\",\"Equites Legati\",\"Equites Imperatoris\",\"Equites Caesaris\",\"Rammbock\",\"Feuerkatapult\",\"Senator\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[1] = [\"Keulenschwinger\",\"Speerkämpfer\",\"Axtkämpfer\",\"Kundschafter\",\"Paladin\",\"Teutonen Reiter\",\"Ramme\",\"Katapult\",\"Stammesführer\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\",\"Schwertkämpfer\",\"Späher\",\"Theutates Blitz\",\"Druidenreiter\",\"Haeduaner\",\"Rammholz\",\"Kriegskatapult\",\"Häuptling\",\"Siedler\",\"Held\"];\n\t\t\t\taLangAttackType = [\"Unterstützung\",\"Angriff: Normal\",\"Angriff: Raubzug\"];\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'de\\' or \\'org\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\tcase \"ir\": // mrreza\n\t\taLangAllBuildWithId = [\"هیزم شکن\", \"آجرسازی\", \"معدن آهن\", \"گندم زار\", \"محل احداث ساختمان\", \"چوب بری\", \"آجرپزی\", \"ذوب آهن\", \"آسیاب\", \"نانوایی\", \"انبار\", \"انبار غذا\", \"آهنگری\", \"زره سازی\", \"میدان تمرین\", \"ساختمان اصلی\", \"اردوگاه\", \"بازار\", \"سفارت\", \"سربازخانه\", \"اصطبل\", \"کارگاه\", \"دارالفنون\", \"مخفیگاه\", \"تالار\", \"اقامتگاه\", \"قصر\", \"خزانه\", \"تجارتخانه\", \"سربازخانه‌ی بزرگ\", \"اصطبل بزرگ\", \"دیوار شهر\", \"دیوار گلی\", \"پرچین\", \"سنگ تراشی\", \"قهوه خانه\", \"تله ساز\",\"عمارت قهرمان\", \"انبار بزرگ\", \"انبارغذای بزگ\", \"شگفتی جهان\", \"آبشخور اسب\"];\n\t\taLangAllBuildAltWithId = [\"هیزم شکن\", \"آجر سازی\", \"معدن آهن\", \"گندم زار\", \"محل\", \"چوب بری\", \"آجرپزی\", \"ذوب آهن\", \"آسیاب\", \"نانوایی\", \"انبار\", \"انبارغذا\", \"آهنگری\", \"زره سازی\", \"میدان تمرین\", \"ساختمان اصلی\", \"اردوگاه\", \"بازار\", \"سفارت\", \"سربازخانه\", \"اصطبل\", \"کارگاه\", \"دارالفنون\", \"مخفیگاه\", \"تالار\", \"اقامتگاه\", \"قصر\", \"خزانه\", \"تجارتخانه\", \"سربازخانه‌ی بزرگ\", \"اصطبل بزرگ\", \"دیوار شهر\", \"دیوار گلی\", \"پرچین\", \"سنگ تراشی\", \"قهوه خانه\", \"تله ساز\",\"عمارت قهرمان\", \"انبار بزرگ\", \"انبار غذای بزرگ\", \" شگفتی جهان\", \"آبشخور اسب\"];\n\t\taLangAddTaskText = [\"اضافه کردن وظیفه\", \"شیوه\", \"دهکده فعال\", \"هدف کاری\", \"به سوی\", \"روش\", \"پشتیبانی از سازه ها\", \"ارسال معمولی (تمرکز منابع)\", \"بالا بردن\", \"پایین آوردن\", \"حذف\", \"&#160;&#160;&#160;محتوای وظیفه\", \"حرکت کردن\", \"پاک کردن تمام وظایف\"];\n\t\taLangTaskKind = [\"ارتقاء دادن\", \"بنای جدید\", \"حمله\", \"تحقیق\", \"تربیت کردن\", \"ارسال منابع\", \"تعدیل منابع\", \"تخریب کردن\", \"برگزاری جشن\"];\n\t\taLangGameText = [\"سطح\", \"بازرگانان\", \"شماره\", \"رئیس\", \"زمان شروع\", \"این تنظیم زمان در حال حاضر بی فایده است.\", \"به سوی\", \"دهکده\", \"انتقال دادن\", \"از\", \"ارسال به\", \"دریافت از\", \"بازگشت از\", \"منابع\", \"ساخنمان\", \"احداث ساختمان جدید\", \"خالی کردن\", \"سطح\" , \"منابع ارسال شدند.\"];\n\t\taLangRaceName = [\"رومی‌ها\" ,\"توتن‌ها\" ,\"گول‌ها\"];\n\t\taLangTaskOfText = [\"برنامه ارتقاء\", \"برنامه ساختمان جدید\", \"ارتقا خودکار منابع\", \"در حال اجرا نمی باشد\", \"شروع\", \"شروع شده\", \"معلق کردن\", \"جدول توزیع منابع در این روستا هست \", \"ارسال خودکار منابع\", \"حمل و نقل خودکار باز نمی باشد\", \"باز شده\", \"حمل و نقل با موفقیت\", \"لیست وظایف\", \"سقف ورود منابع\", \"پیشفرض\", \"اصلاح کردن\", \"چوب/خشت/آهن\", \"گندم\", \"برنامه تخریب\",\n\t\t\t\"برنامه حمله\", \"نوع حمله\", \"زمان سفر\", \"زمان تکرار\", \"فاصله زمانی\",\"00:30:00\",\"هدف منجنیق\",\"تصادفی\", \"نامعلوم\", \"زمان\", \"ماه\", \"روز\", \"سربازان فرستاده شدند\", \"برنامه آموزش\",\"محل آموزش\",\"وظیفه آموزش انجام شد\",\"ارسال سفارشی منابع\",\" فاصله زمانی از زمان راه اندازی مجدد\",\" این فاصله زمانی از صفحه بارگذاری شده است,\\n پیشفرض 20 دقیقه می باشد, لطفا مقدار جدید را وارد کنید زمان:\\n\\n\",\"سقف نگه داشتن منابع\",\"برنامه جشن\",\"جشن کوچک\",\"جشن بزرگ\",\" تنظیم فاصله زمانی حمل معمولی در قسمت ارسال خودکار\",\n\t\t\t\"دقیقه\", \"در حال مکث\", \"در حرکت\", \"ادامه دادن\", \"مکث\",\"ارتقا قدرت نظامی\",\"ارتقا قدرت حمله\",\"ارتقا قدرت دفاع\", \"کنترل سرریز منابع\", \"فعال\", \"غیر فعال\", \"ارتقا خودکار گندمزار\", \"تغییر\"];\n\t\taLangErrorText = [\"کمبود منابع.\", \"کارگران مشغول کار هستند.\", \"به سطح آخر ممکن رسید.\", \"ساخت و ساز شروع شد\", \"در حال توسعه\", \"اول انبار را ارتقا دهید.\", \"اول انبارغذا را ارتقا دهید.\", \"پیش نیازها:\",\"کمبود غذا: اول گندم زار را ارتقا دهید!\",\"در حال حاضر یک جشن در حال برگذاری است\",\"یک جشن هم‌اکنون در حال برگزاری است.\",\"در حال رسیدن به سطح نهایی خود می‌باشد.\"];\n\t\taLangOtherText = [\"توجه داشته باشید\", \"فقط منابع در دهکده پایتخت می توانند <br/>تا سطح 20 ارتقاء یابند. اکنون پایتخت شما<br/> تشخیص داده نشده است. لطفا از پروفایل خود دیدن کنید.\", \"دسترسی آسان در اینجا ^_^\", \"تنظیمات کامل شد\", \"لغو شد\", \"وظیفه آغاز شد\", \"با موفقیت انجام شد\" , \"حرکت با موفقیت انجام شد\", \"نژاد شما معلوم نیست, بنابراین نوع لشکرتون مشخص نیست. <br/>برای مشخص شدن نژادتون از پروفایل خود دیدن کنید.<br/>\", \"همچنین لطفا دیدن کنید از عمارت قهرمان برای مشخص شدن <br/> سطح و نوع آن.\" , \"ارتقاء\"];\n\t\taLangResources=[\"چوب\",\"خشت\",\"آهن\",\"گندم\"];\n\t\taLangTroops[0] = [\"سرباز لژیون\", \"محافظ\", \"شمشیرزن\", \"خبرچین\", \"شوالیه\", \"شوالیه سزار\", \"دژکوب\", \"منجنیق آتشین\", \"سناتور\", \"مهاجر\", \"قهرمان\"];\n\t\taLangTroops[1] = [\"گرزدار\", \"نیزه دار\", \"تبرزن\", \"جاسوس\", \"دلاور\", \"شوالیه‌ی توتن\", \"دژکوب\", \"منجنیق\", \"رئیس\", \"مهاجر\", \"قهرمان\"];\n\t\taLangTroops[2] = [\"سرباز پیاده\", \"شمشیرزن\", \"ردیاب\", \"رعد\", \"کاهن سواره\", \"شوالیه گول\", \"دژکوب\", \"منجنیق\", \"رئیس قبیله\", \"مهاجر\", \"قهرمان\"];\n\t\taLangAttackType = [\"پشتیبانی\", \"حمله عادی\", \"حمله غارت\"];\n\t\tbreak;\n\n\tcase \"ae\": // By Dream1, SnTraL (2011.02.24)\n\t\taLangAllBuildWithId = [\"الحطاب\", \"حفرة الطين\", \"منجم حديد\", \"حقل القمح\", \"\", \"معمل النجاره\", \"مصنع البلوك\", \"مصنع الحديد\", \"المطاحن\", \"المخابز\", \"المخزن\", \"مخزن الحبوب\", \"الحداد\", \"مستودع الدروع\", \"ساحة البطولة\", \"المبنى الرئيسي\", \"نقطة التجمع\", \"السوق\", \"السفارة\", \"الثكنه\", \"الإسطبل\", \"المصانع الحربية\", \"الأكاديمية الحربية\", \"المخبأ\", \"البلدية\", \"السكن\", \"القصر\", \"الخزنة\", \"المكتب التجاري\", \"الثكنة الكبيرة\", \"الإسطبل الكبير\", \"حائط المدينة\", \"الحائط الأرضي\", \"الحاجز\", \"الحجّار\", \"المعصرة\", \"الصياد\", \"قصر الأبطال\", \"المخزن الكبير\", \"مخزن الحبوب الكبير\", \"معجزة العالم\", \"بِئْر سقي الخيول\"];\n\t\taLangAllBuildAltWithId = [\"الحطاب\", \"حفرة الطين\", \"منجم حديد\", \"حقل القمح\", \"\", \"معمل النجاره\", \"مصنع البلوك\", \"مصنع الحديد\", \"المطاحن\", \"المخابز\", \"المخزن\", \"مخزن الحبوب\", \"الحداد\", \"مستودع الدروع\", \"ساحة البطولة\", \"المبنى الرئيسي\", \"نقطة التجمع\", \"السوق\", \"السفارة\", \"الثكنه\", \"الإسطبل\", \"المصانع الحربية\", \"الأكاديمية الحربية\", \"المخبأ\", \"البلدية\", \"السكن\", \"القصر\", \"الخزنة\", \"المكتب التجاري\", \"الثكنة الكبيرة\", \"الإسطبل الكبير\", \"حائط المدينة\", \"الحائط الأرضي\", \"الحاجز\", \"الحجّار\", \"المعصرة\", \"الصياد\", \"قصر الأبطال\", \"المخزن الكبير\", \"مخزن الحبوب الكبير\", \"معجزة العالم\", \"بِئْر سقي الخيول\"];\n\t\taLangAddTaskText = [\"أضافة مهمة\", \"النمط\", \"القرية النشطة\", \"المهمة المستهدفة\", \"الى\", \"نمط\", \"دعم للبناء\", \"تكثيف الموارد\", \"تحريك للاعلى\", \"تحريك للاسفل\", \"حذف\", \"&#160;&#160;&#160;محتوى المهمه\", \"تحريك \", \"حذف جميع المهام\"];\n\t\taLangTaskKind = [\"تطوير\", \"تشييد مبنى\", \"هجوم\", \"بحث\", \"تدريب\", \"نقل\", \"تاجر المبادله\", \"هدم\", \"الاحتفال\"];\n\t\taLangGameText = [\"مستوى\", \"التجار\", \"المعرف\", \"العاصمة\", \"بداية الوقت\", \"هذا الاعداد في الوقت الحالي عديم الفائدة.\", \" إلى\", \"القرية\", \"نقل\", \"من\", \"نقل الى\", \"نقل من\", \"العودة من\", \"الموارد\", \"المباني\", \"تشييد\", \"فارغ\", \"المستوى\"];\n\t\taLangRaceName = [\"الرومان\", \"الجرمان\", \"الإغريق\"];\n\t\taLangTaskOfText = [\"الجدول الزمني للترقية\", \"الجدول الزمني لبناء جديد\", \"التطوير التلقائي\", \"لايعمل\", \"بدأ\", \"أبتداء\", \"توقف مؤقتا\", \"الحقول / المباني توزيع لقرية \", \"النقل التلقائي\", \"لم يتم فتح النقل التلقائي\", \"فتح\", \"تم النقل بنجاح\", \"قائمة المهام\", \"Trans_In_limit\", \"أفتراضي\", \"تعديل\", \"خشب/طين/حديد\", \"قمح\", \"الجدول الزمني للهدم\",\n\t\t\t\"الجدول الزمني للهجوم\", \"نوع الهجوم\", \"وقت الذهاب\", \"عدد مرات التكرار\", \"الفاصل الزمني\",\"00:30:00\",\"هدف المقاليع\",\"عشوائي\", \"غير معروف\", \"مرات\", \"شهر\", \"يوم\", \"القوات ارسلت\", \"الجدول الزمني للتدريب\",\"مكان تدريب\",\"مهمة التدريب تمت\",\"الجدول الزمني للنقل\",\"إعداد الفاصل الزمني للتحديث\",\"هذا هو الفاصل الزمني لتحديث الصفحة ,\\n الافتراضي هو 20 دقيقة,يرجى وضع فاصل زمني جديد:\\n\\n\",\"Trans_Out_Rmn\",\"الجدول الزمني للإحتفال\",\"إحتفال صغير\",\"إحتفال كبير\",\"تعيين الفاصل الزمني لتركيز الموارد\",\n\t\t\t\"دقائق\", \"متوقف\", \"يعمل\", \"تشغيل\", \"أيقاف\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"الموارد قليلة جداً.\", \"العمال مشغولون الآن.\", \"البناء منجز\", \"بدء البناء\", \"في التطوير\", \"يجب رفع مستوى المخزن أولاً \", \"يجب رفع مستوى مخزن الحبوب أولاً \", \"الموارد كافية\",\"\",\"يوجد احتفال جارية بالفعل\"];\n\t\taLangOtherText = [\"ملاحظات هامه\", \"فقط حقول الموارد في العاصمة <br/>يتم ترقيتهم الى مستوى 20 .<br/> لم يتم معرفة العاصمه. يرجاء زيارة بطاقة العضويه.\", \"الاختصار هنا ^_^\", \"أكتمال الإعدادات\", \"ألغي\", \"بدء المهام\", \"تم التطوير بنجاح\", \"تم التشغيل بنجاح\", \"القبيلة غير معروفه, لابد من معرفة نوع القوات. <br/>يرجاء زيارة بطاقة العضويه لتحديد نوع القبيله.<br/>\", \"يرجاء ايضاً زيارة قصر الابطال<br/> لتحديد سرعة ونوع بطلك.\"];\n\t\taLangResources=[\"الخشب\",\"الطين\",\"الحديد\",\"القمح\"];\n\t\taLangTroops[0] = [\"جندي أول\", \" حراس الإمبراطور\", \"جندي مهاجم\", \"فرقة تجسس\", \"سلاح الفرسان\", \"فرسان القيصر\", \"الكبش\", \"المقلاع الناري\", \"حكيم\", \"مستوطن\", \"البطل\"]; //الرومان\n\t\taLangTroops[1] = [\"مقاتل بهراوة\", \"مقاتل برمح\", \"مقاتل بفأس\", \"الكشاف\", \"مقاتل القيصر\", \"فرسان الجرمان\", \"محطمة الأبواب\", \"المقلاع\", \"الزعيم\", \"مستوطن\", \"البطل\"]; //الجرمان\n\t\taLangTroops[2] = [\"الكتيبة\", \"مبارز\", \"المستكشف\", \"رعد الجرمان\", \"فرسان السلت\", \"فرسان الهيدوانر\", \"محطمة الأبواب الخشبية\", \"المقلاع الحربي\", \"رئيس\", \"مستوطن\", \"البطل\"]; //الإغريق\n\t\taLangAttackType = [\"مساندة\", \"هجوم: كامل\", \"هجوم: للنهب\"];\n\t\tbreak;\n\n\tcase \"gr\": // by adonis_gr (2011.03.30)\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Οπλοποιείο\", \"Πανοπλοποιείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκεντρώσεως\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Οπλοποιείο\", \"Πανοπλοποιείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκέντρωσης\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAddTaskText = [\"Προσθηκη Εργασίας\", \"Style\", \"Ενεργό χωριό\", \"στοχος εργασίας\", \"Προς\", \"λειτουργία\", \"Construction support\", \"Resources concentration\", \"Μετακίνηση πάνω\", \"Μετακίνηση κάτω\", \"Διαγραφή\", \" Περιεχομενο εργασιών\", \"Move \", \"Διαγραφή όλων των εργασιών\"];\n\t\t\t\taLangTaskKind = [\"αναβάθμισης\", \"Κατασκευή κτηρίου\", \"Επίθεση\", \"Έρευνα\", \"εκπαίδευση\", \"αποστολή\", \"NPC\", \"κατεδάφιση\", \"γιορτή\"];\n\t\t\t\taLangGameText = [\"επίπεδο\", \"Έμποροι\", \"ID\", \"Πρωτεύουσα\", \"Start time\", \"this timeseting is unuseful now.\", \"προς\", \"χωριό\", \"αποστολή\", \"από\", \"αποστολή προς\", \"αποστολή απο\", \"Επιστροφή απο\", \"πρώτες ύλες\", \"κτήριο\", \"Κατασκευή νέου κτηρίου\", \"κενό\", \"επίπεδο\"];\n\t\t\t\taLangRaceName = [\"Ρωμαίοι\", \"Τεύτονες\", \"Γαλάτες\"];\n\t\t\t\taLangTaskOfText = [\"Πρόγραμμα αναβάθμισης\", \"Πρόγραμμα Κατασκευή νέου κτηρίου\", \"Αυτοματη Αναβ. Υλών\", \"Not_run\", \"Έναρξη\", \"Ξεκίνησε\", \"Αναστολή\", \"The resource fields distribution of this village is \", \"Αυτοματη αποστολή\", \"αύτοματη αποστολή είναι ανενεργή\", \"Ανοιχτό\", \"αποστολή επιτυχής\", \"Λίστα Εργασιών\", \"Trans In limit\", \"Προεπιλογή\", \"Τροποποίηση\", \"Ξύλο/Πηλός/Σιδήρος\", \"Σιτάρι\", \"Πρόγραμμα κατεδάφισης\",\n\t\t\t\t\t\t\"Προγραμματισμος επίθεσης\", \"Τυπος επίθεσης\", \"διάρκεια\", \"επανάληψεις\", \"Ενδιάμεσο χρονικό διάστημα\", \"00:30:00\", \"Στόχος καταπέλτη\", \"Τυχαίος\", \"Άγνωστο\", \"φορές\", \"Μήνας\", \"Ημέρα\", \"Στρατεύματα εστάλησαν\",\n\t\t\t\t\t\t\"Προγραμματησμος εκπαίδευσης\", \"Μέρος εκπαίδευσης\", \"εκπαίδευση Ολοκληρώθηκε\", \"προσαρμοσμένη αποστολή\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"Προγραμματισμος γιορτων\", \"Μικρή γιορτή\", \"Μεγάλη Γιορτή\", \"Set Interval of Resources concentration\",\n\t\t\t\t\t\t\"λεπτά\", \".\", \".\", \"Έναρξη\", \"Διακοπή\", \"Schedule Improve\", \"Βελτίωση Επίθεσης\", \"Βελτίωση άμυνας\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Πάρα πολύ λίγες πρώτες ύλες\", \"Ήδη εκτελούνται εργασίες\", \"Κατασκευή ολοκληρώθηκε\", \"Εναρξη Κατασκευής\", \"Σε εξέλιξη\", \"Η Αποθήκη πρώτων υλών σας ειναι πολύ μικρή. Παρακαλώ αναβάθμιστε την Αποθήκη πρώτων υλών για να συνεχιστεί η κατασκευή σας\", \"Η Σιταποθήκη σας ειναι πολύμικρή. Παρακαλώ αναβάθμιστε την σιταποθήκη για να συνεχιστεί η κατασκευή σας\", \"Αρκετες Πρώτες ύλες\", \"Έλλειψη τροφής: Αναβαθίστε πρώτα ενα Χωράφι σιταριού\", \"Πραγματοποιείται ήδη μία γιορτή\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Μονο οι ύλες της Πρωτεύουσας μπορούν να αναβάθμιστουν στο επίπεδο 20. Now your Πρωτεύουσα is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Ακυρωμένο\", \"Έναρξη των εργασιών\", \"Επιτυχής αναβάθμιση\", \"Εκτελέστηκε με επιτυχία\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Περιοχή ηρώων to determine the speed and the type of your hero.\"];\n\t\t\t\taLangResources = [\"Ξύλο\", \"Πηλός\", \"Σίδερο\", \"Σιτάρι\"];\n\t\t\t\taLangTroops[0] = [\"Λεγεωνάριοι\", \"Πραιτοριανός\", \"Ιμπεριανός\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Πολιορκητικός κριός\", \"Καταπέλτης φωτιάς\", \"Γερουσιαστής\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Μαχητές με ρόπαλα\", \"Μαχητής με Ακόντιο\", \"Μαχητής με Τσεκούρι\", \"Ανιχνευτής\", \"Παλατινός\", \"Τεύτονας ιππότης\", \"Πολιορκητικός κριός\", \"Καταπέλτης\", \"Φύλαρχος\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Φάλαγγες\", \"Μαχητής με Ξίφος\", \"Ανιχνευτής\", \"Αστραπή του Τουτατή\", \"Δρυίδης\", \"Ιδουανός\", \"Πολιορκητικός κριός\", \"Πολεμικός καταπέλτης\", \"Αρχηγός\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Ενίσχυση\", \"Επίθεση: Κανονική\", \"Επίθεση: Επιδρομή\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Σιδηρουργείο\", \"Σιδηρουργείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκεντρώσεως\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Σιδηρουργείο\", \"Σιδηρουργείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκέντρωσης\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAddTaskText = [\"Προσθηκη Εργασίας\", \"Style\", \"Ενεργό χωριό\", \"στοχος εργασίας\", \"Προς\", \"λειτουργία\", \"Construction support\", \"Resources concentration\", \"Μετακίνηση πάνω\", \"Μετακίνηση κάτω\", \"Διαγραφή\", \" Περιεχομενο εργασιών\", \"Move \", \"Διαγραφή όλων των εργασιών\"];\n\t\t\t\taLangTaskKind = [\"αναβάθμισης\", \"Κατασκευή κτηρίου\", \"Επίθεση\", \"Έρευνα\", \"εκπαίδευση\", \"αποστολή\", \"NPC\", \"κατεδάφιση\", \"γιορτή\"];\n\t\t\t\taLangGameText = [\"επίπεδο\", \"Έμποροι\", \"ID\", \"Πρωτεύουσα\", \"Start time\", \"this timeseting is unuseful now.\", \"προς\", \"χωριό\", \"αποστολή\", \"από\", \"αποστολή προς\", \"αποστολή απο\", \"Επιστροφή απο\", \"πρώτες ύλες\", \"κτήριο\", \"Κατασκευή νέου κτηρίου\", \"κενό\", \"επίπεδο\"];\n\t\t\t\taLangRaceName = [\"Ρωμαίοι\", \"Τεύτονες\", \"Γαλάτες\"];\n\t\t\t\taLangTaskOfText = [\"Πρόγραμμα αναβάθμισης\", \"Πρόγραμμα Κατασκευή νέου κτηρίου\", \"Αυτοματη Αναβ. Υλών\", \"Not_run\", \"Έναρξη\", \"Ξεκίνησε\", \"Αναστολή\", \"The resource fields distribution of this village is \", \"Αυτοματη αποστολή\", \"αύτοματη αποστολή είναι ανενεργή\", \"Ανοιχτό\", \"αποστολή επιτυχής\", \"Λίστα Εργασιών\", \"Trans In limit\", \"Προεπιλογή\", \"Τροποποίηση\", \"Ξύλο/Πηλός/Σιδήρος\", \"Σιτάρι\", \"Πρόγραμμα κατεδάφισης\",\n\t\t\t\t\t\t\"Προγραμματισμος επίθεσης\", \"Τυπος επίθεσης\", \"διάρκεια\", \"επανάληψεις\", \"Ενδιάμεσο χρονικό διάστημα\", \"00:30:00\", \"Στόχος καταπέλτη\", \"Τυχαίος\", \"Άγνωστο\", \"φορές\", \"Μήνας\", \"Ημέρα\", \"Στρατεύματα εστάλησαν\",\n\t\t\t\t\t\t\"Προγραμματησμος εκπαίδευσης\", \"Μέρος εκπαίδευσης\", \"εκπαίδευση Ολοκληρώθηκε\", \"προσαρμοσμένη αποστολή\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"Προγραμματισμος γιορτων\", \"Μικρή γιορτή\", \"Μεγάλη Γιορτή\", \"Set Interval of Resources concentration\",\n\t\t\t\t\t\t\"λεπτά\", \".\", \".\", \"Έναρξη\", \"Διακοπή\", \"Schedule Improve\", \"Βελτίωση Επίθεσης\", \"Βελτίωση άμυνας\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Πάρα πολύ λίγες πρώτες ύλες\", \"Ήδη εκτελούνται εργασίες\", \"Κατασκευή ολοκληρώθηκε\", \"Εναρξη Κατασκευής\", \"Σε εξέλιξη\", \"Η Αποθήκη πρώτων υλών σας ειναι πολύ μικρή. Παρακαλώ αναβάθμιστε την Αποθήκη πρώτων υλών για να συνεχιστεί η κατασκευή σας\", \"Η Σιταποθήκη σας ειναι πολύμικρή. Παρακαλώ αναβάθμιστε την σιταποθήκη για να συνεχιστεί η κατασκευή σας\", \"Αρκετές πρώτες\", \"Έλλειψη τροφής : Αναβαθμίστε πρώτα ένα χωράφι σιταριού\", \"Πραγματοποιείται ήδη μία γιορτή\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Μονο οι ύλες της Πρωτεύουσας μπορούν να αναβάθμιστουν στο επίπεδο 20. Now your Πρωτεύουσα is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Ακυρωμένο\", \"Έναρξη των εργασιών\", \"Επιτυχής αναβάθμιση\", \"Εκτελέστηκε με επιτυχία\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Περιοχή ηρώων to determine the speed and the type of your hero.\"];\n\t\t\t\taLangResources = [\"Ξύλο\", \"Πηλός\", \"Σίδερο\", \"Σιτάρι\"];\n\t\t\t\taLangTroops[0] = [\"Λεγεωνάριοι\", \"Πραιτοριανός\", \"Ιμπεριανός\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Πολιορκητικός κριός\", \"Καταπέλτης φωτιάς\", \"Γερουσιαστής\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Μαχητές με ρόπαλα\", \"Μαχητής με Ακόντιο\", \"Μαχητής με Τσεκούρι\", \"Ανιχνευτής\", \"Παλατινός\", \"Τεύτονας ιππότης\", \"Πολιορκητικός κριός\", \"Καταπέλτης\", \"Φύλαρχος\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Φάλαγγες\", \"Μαχητής με Ξίφος\", \"Ανιχνευτής\", \"Αστραπή του Τουτατή\", \"Δρυίδης\", \"Ιδουανός\", \"Πολιορκητικός κριός\", \"Πολεμικός καταπέλτης\", \"Αρχηγός\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Ενίσχυση\", \"Επίθεση: Κανονική\", \"Επίθεση: Επιδρομή\"];\n\t\t\t\tbreak;\n\t\t}\n}\n\nJOINEDaLangAllBuildWithId = aLangAllBuildWithId.slice(0) ;\nJOINEDaLangAllBuildWithId = cleanString(JOINEDaLangAllBuildWithId);\n\t\t\nJOINEDaLangAllBuildAltWithId = aLangAllBuildAltWithId.slice(0);\nJOINEDaLangAllBuildAltWithId = cleanString(JOINEDaLangAllBuildAltWithId);\ninitializeLangSpecificDependentVars();\n\n}", "function setLocaleWording() {\n _D(\"Set locale wording...\");\n\n pn = options[\"lang\"] || G_DEFAULT_LANG;\n \n if( pn=='' ) {\n // use by system default.\n \n } else if( pn in _locale) {\n loc_list = {\n \"#dlist a\" : \"dlist\",\n \"#general a\" : \"general\",\n \"#langs a\" : \"langs\",\n \"#lang_desc\" : \"lang_desc\",\n \"#save\" : \"save\",\n \"#default\" : \"default\",\n \"#en\" : \"en\",\n \"#zh-TW\" : \"zh-TW\",\n \"#ja-JP\" : \"ja-JP\",\n \"#download_dir\" : \"download_dir\",\n \"#file_format\" : \"file_format\",\n \"#comment_file_format\" : \"comment_file_format\",\n \"#download_dir_btn\" : \"download_dir_btn\",\n \"#clear_all\" : \"delete_all_btn\",\n \"#comment_lang_en_span\" : \"en\",\n \"#comment_lang_jp_span\" : \"ja-JP\",\n \"#comment_lang_tw_span\" : \"zh-TW\",\n \"#comment_lang\" : \"comment_lang\",\n \"#if_file_exist\" : \"if_file_exist\",\n \"#overwrite\" : \"overwrite\",\n \"#saveNew\" : \"save_new\",\n \"#download_quality_mode\": \"download_quality_mode\",\n \"#high_quality\" : \"high_quality\",\n \"#low_quality\" : \"low_quality\",\n };\n \n for(var k in loc_list) {\n $(k).html( _locale[pn][loc_list[k]]);\n }\n }\n}", "function translateLanTags(lang) {\n if (lang == \"Russian\") {\n return \"russo\";\n } else if(lang == \"Italian\") {\n return \"italiano\";\n } else if (lang == \"German\") {\n return \"tedesco\";\n } else {\n return lang;\n };\n}", "function localise(lang = 'en') {\n\n function run(cmd) {\n var sudo = magik.getPlugin().getServer().getConsoleSender();\n magik.getPlugin().getServer().dispatchCommand(sudo, cmd);\n }\n\n const strings = [\n {\n name: 'tutorial_welcome',\n strings:\n {\n no:\n [\n 'Velkommen til',\n '&6The Land of Kigam&r',\n 'i',\n '&3The World of &4&uMagikcraft'\n ],\n en: [\n 'Welcome to',\n '&6The Land of Kigam&r',\n 'in',\n '&3The World of&r &4&uMagikcraft'\n ],\n ja: [\n '&uMagikcraft&r no sekai no kigamu',\n 'no kuni e yokoso',\n '.',\n '.'\n ]\n }\n },\n {\n name: 'tutorial_magik',\n strings:\n {\n no: [\n '--- &4&uMagi&r ---',\n 'er en kraft som lar folk',\n 'gj[ø]re &6umulige ting&r',\n 'ved [å] si &6spesielle ord&r'\n ],\n en: [\n '--- &4&uMagik&r ---',\n 'Is a power that allows people',\n 'to do &6impossible things&r',\n 'by saying &6special words&r'\n ],\n ja: [\n '--- &4&uMagikku wa&r ---',\n 'tokubetsuna kotoba o itte',\n 'hitobito ga fukanona koto o suru',\n 'koto o kano ni suru chikaradesu'\n ]\n }\n },\n {\n name: 'tutorial_chap_01',\n strings: {\n no: [\n 'Hei, jeg heter M.',\n '&4&u!!!!Hjelp!!!!!!&r',\n '&dSuperMegaCorp&r',\n 'stjal all &4&magien&r',\n 'i Kigamriket.'\n ],\n en: [\n 'Hello, my name is &aM&r.',\n '&4&u!!!!Help!!!!!!&r',\n '&dSuperMegaCorp&r',\n 'stole all the &4&umagik',\n 'in the realm of Kigam.'\n ],\n ja: [\n \"Kon'nichiwa watashinonamaeha M desu\",\n '&4&u!!!!Tasukete!!!!&r',\n '&dSuperMegaCorp&r ga tochi no subete',\n 'no &4&umaho&r o nusunda'\n ]\n }\n },\n {\n name: 'tutorial_chap_02',\n strings: {\n no: [\n 'Modige mennesker ble med',\n 'og sammen slo vi',\n 'SuperMegaCorp.',\n 'Men &4&umagien&r ble tapt!!!'\n ],\n en: [\n 'Brave people joined me',\n 'and together we beat',\n '&dSuperMegaCorp&r.',\n 'But &4&umagik&r was lost!!!'\n ],\n ja: [\n \"Yukan'na hitobito ga watashi\",\n 'ni kuwawari, issho ni',\n '&dSuperMegaCorp&r o utta ga,',\n '&4&umaho&r wa ushinawareta'\n ]\n }\n },\n {\n name: 'tutorial_chap_03',\n strings: {\n no: [\n 'Nå ønsker &dSuperMegaCorp&r',\n 'å få tilbake magien.',\n 'Finn trylleformlene før de finner dem,',\n 'og ta dem med tilbake til',\n '&a&uAsgard Romstasjon&r!'\n ],\n en: [\n 'Now &dSuperMegaCorp&r',\n 'wants to get the &4&umagik&r back.',\n 'Find the magik words before they do',\n 'and bring them to',\n 'the &a&uAsgard Space Station&r!'\n ],\n ja: [\n 'Ima sugu &dSuperMegaCorp&r',\n 'wa &4&umajikku&r o torimodosou',\n 'to shite imasu. Karera ga suru mae',\n 'ni magik kotoba o mitsukete, sorera',\n 'o asugarudo uchu suteshon ni motte iki nasai!'\n ]\n }\n },\n {\n name: 'tutorial_chap_04',\n strings: {\n no: [\n '--- &dSuperMegaCorp&r ---',\n 'vær advart:',\n 'All &4&umagi&r tilhører',\n '&dSuperMegaCorp&r.',\n 'Inntrengere vil bli forfulgt.'\n ],\n en: [\n '--- &dSuperMegaCorp&r ---',\n 'Be Warned:',\n 'All &4&umagik&r is the property of',\n '&dSuperMegaCorp&r.',\n 'Trespassers will be persecuted.'\n ],\n ja: [\n '--- &dSuperMegaCorp&r ---',\n 'Keikoku',\n 'Subete no &4&umahō&r wa ',\n '&dSuperMegaCorp&r no shoyu-monodesu',\n \"Shin'nyu-sha ga kiso sa remasu!\"\n ]\n }\n },\n {\n name: 'tutorial_chap_05',\n strings: {\n no: [\n 'Du må bruke &4&umagi&r',\n 'for å komme ut herfra',\n '&f[|||] &4[|||] &f[|||]',\n 'Finn det magiske ordet.'\n ],\n en: [\n 'You need to use &4&umagik&r',\n 'to get out of here',\n '&f[|||] &4[|||] &f[|||]',\n 'Find the magik word'\n ],\n ja: [\n 'Koko kara deru ni wa mahowotsukau',\n 'hitsuyo ga arimasu',\n '&f[|||] &4[|||] &f[|||]',\n 'Mahō no kotoba o mitsukeru'\n ]\n }\n },\n {\n name: 'tutorialwarp',\n strings: {\n no: [\n '--- &aM&r ---',\n 'Takk for den du er, og hva du gjør',\n 'for folket i Kigam.',\n 'Skriv inn /warp Lounge',\n 'det vil ta deg til det neste området.',\n 'Fortsett med det, og så ses vi snart!'\n ],\n en: [\n '--- &aM&r ---',\n 'Thank you for who you are',\n 'and what you are doing',\n 'for the people of Kigam.',\n 'Type in &u/warp Lounge',\n 'it will take you to the next area.',\n 'Keep doing you, and see you soon!'\n ],\n ja: [\n '--- &aM&r ---',\n 'Anata ga yatte kurete arigato',\n 'Anata wa daredesuka, arigatogozaimasu',\n '',\n 'Tsugi no eria ni iku ni wa',\n '/warp Lounge o tsukau',\n 'Mata chikaiuchini o ai shimashou!'\n ]\n }\n },\n {\n name: 'congrats',\n strings: {\n no: [\n 'Gratulerer!!!'\n ],\n en: [\n '&4&uCongratulations!!!&r'\n ],\n ja: ['&4&uOmedeto!&r']\n }\n },\n {\n name: 'arthur',\n strings: {\n no: [\n\n ],\n en: [\n \"'''Any sufficiently advanced technology\",\n 'is indistinguishable from magic',\n '- Arthur C. Clarke'\n ]\n }\n },\n {\n name: 'jungle-instructions',\n strings: {\n no: [\n 'Finn ingrediensene for trylleformelen',\n 'Det finnes fem stykk...',\n 'Du trenger bare tre stykk til en trylleformel'\n ],\n en: [\n 'Find the ingredients to make spell with',\n '&aThere are five of them...&r',\n '&aYou only need three for a spell&r'\n ]\n }\n },\n {\n name: 'flight_cast',\n strings: {\n no: [\n 'Bluk \"remember\"-trylleformelen her'\n ],\n en: [\n 'Cast your remember spell here'\n ],\n ja: [\n 'Oboete iru jumon o koko ni kyasuto suru'\n ]\n }\n },\n {\n name: 'flight-goback',\n strings: {\n no: [\n 'Fant du det magiske ordet? Det er tilbake, bak deg...'\n ],\n en: [\n \"Did you find the magik word? It's back up, behind you...\"\n ]\n }\n },\n {\n name: 'flight-end-menu',\n strings: {\n no: [\n 'Fant du den hemmelige passasjen gjennom fossen?',\n 'Gå tilbake for å finne den: &4&u/warp lounge&r',\n 'Gå videre til neste eventyr: &4&u/warp flight2&r'\n ],\n en: [\n 'Did you find the secret passage through the waterfall?',\n 'To go back to find it: &4&u/warp lounge&r',\n 'To go on to the next adventure: &4&u/warp flight2&r'\n ]\n }\n },\n {\n name: 'flight2-instructions',\n strings: {\n no: [\n 'Fly hele veien i ett hopp!'\n ],\n en: [\n 'Fly all the way in one jump!'\n ]\n }\n },\n {\n name: 'flight2-end',\n strings: {\n no: [\n 'Gratulerer!',\n 'Prøv igjen: &4&u/warp flight2&r',\n 'Gå til neste eventyr: &4&u/warp jungle&r'\n ],\n en: [\n 'Congrats!',\n 'To try again: &4&u/warp flight2&r',\n 'To go to the next adventure: &4&u/warp jungle&r'\n ]\n }\n },\n {\n name: 'kigam-volcano-exit',\n strings: {\n no: [\n 'Denne veien tilbake til Kigam Town!',\n '/ \\\\ / \\\\'\n ],\n en: [\n 'Stairway'\n ]\n }\n },\n {\n name: 'initial_welcome',\n strings: {\n no: [\n 'Velkommen til &uMagikcraft',\n 'Bruk W, A, S, D til å bevege deg.',\n 'Beveg musen for å kunne se deg rundt.',\n 'Når du er klar, følg stien'\n ],\n en: [\n 'Welcome to &uMagikcraft',\n 'Use W,A,S,D to move. Move your mouse to look',\n 'Once you get that, follow the path'\n ],\n ja: [\n '&uMagikcraft&r e yokoso!!',\n '\"W, A, S, D\" o shiyo shite ido shimasu. Konpyuta no mausu o tsukatte miru',\n 'Ima sugu pasu ni shitagatte kudasai'\n ]\n }\n },\n {\n name: 'initial_jumping',\n strings: {\n no: [\n 'Trykk på mellomromstasten for å hoppe'\n ],\n en: [\n 'Use the Spacebar to jump'\n ],\n ja: [\n 'Supesuba o shiyo shite janpu suru'\n ]\n }\n },\n {\n name: 'initial_portal',\n strings: {\n no: [\n '&uMagkicraft&r is connected with &uPortals',\n 'Gå gjennom her for å gå til opplæringsnivået'\n ],\n en: [\n '&uMagkicraft&r is connected with &uPortals',\n 'Walk though, and it will take you to the tutorial level'\n ],\n ja: [\n 'Ryoko ni &upotaru&r o shiyo suru',\n 'Chūtoriaru no reberu ni susumu'\n ]\n }\n }\n /*,\n {\n name: '',\n strings: {\n no: [\n ''\n ],\n en: [\n ''\n ]\n }\n },\n {\n name: '',\n strings: {\n no: [\n ''\n ],\n en: [\n ''\n ]\n }\n },\n {\n name: '',\n strings: {\n no: [\n ''\n ],\n en: [\n ''\n ]\n }\n },\n {\n name: '',\n strings: {\n no: [\n ''\n ],\n en: [\n ''\n ]\n }\n },\n {\n name: '',\n strings: {\n no: [\n ''\n ],\n en: [\n ''\n ]\n }\n } */\n ];\n\n strings.forEach(hologram => {\n if (hologram.strings[lang]) {\n hologram.strings[lang].forEach((text, line) =>\n run(`hd setline ${hologram.name} ${line + 1} ${text}`)\n );\n }\n });\n}", "function translate(language) {\n if (language === \"es\") {\n return \"Hola, mundo!\";\n } else if (language === \"fr\") {\n return \"Bonjour le monde\";\n } else {\n return \"Hello, World\";\n }\n\n}", "function initLanguage() {\n months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n weekdays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];\n }", "function $l(key, text) {\r\n var string, l;\r\n if (lang[language][key]) { string = lang[language][key]; l = language; }\r\n else { string = lang['en'][key]; l = 'en' }\r\n if (text) { string = string.replace('%s', text); }\r\n return string;\r\n }", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Enable shortcuts';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'Let you use keyboard shortcuts in town to quickly access important places. The shortcuts are listed below : <br /><dl><dt>G + O</dt><dd>Overview</dd><dt>G + H</dt><dd>Home</dd><dt>G + W</dt><dd>Well</dd><dt>G + B</dt><dd>Bank</dd><dt>G + C</dt><dd>Citizens</dd><dt>G + D</dt><dd>Buildings</dd><dt>G + G</dt><dd>Gates</dd><dt>G + P</dt><dd>Town upgrades</dd><dt>G + T</dt><dd>Watchtower</dd><dt>G + M</dt><dd>Workshop</dd><dt>G + L</dt><dd>Night watch</dd></dl>';\n\n i18n[I18N.LANG.FR] = {};\n i18n[I18N.LANG.FR][MODULE_NAME + '_short_desc'] = 'Activer les raccourcis clavier';\n i18n[I18N.LANG.FR][MODULE_NAME + '_full_desc'] = 'Active des raccourcis claviers pour accéder rapidement aux places importantes en ville. Les raccourcis sont listés ci-dessous : <br /><dl><dt>G + O</dt><dd>Vue d\\'ensemble</dd><dt>G + H</dt><dd>Maison</dd><dt>G + W</dt><dd>Puits</dd><dt>G + B</dt><dd>Banque</dd><dt>G + C</dt><dd>Citoyens</dd><dt>G + D</dt><dd>Constructions</dd><dt>G + G</dt><dd>Portes</dd><dt>G + P</dt><dd>Évolutions</dd><dt>G + T</dt><dd>Tour de guet</dd><dt>G + M</dt><dd>Atelier</dd><dt>G + L</dt><dd>Veille</dd></dl>';\n\n I18N.set(i18n);\n }", "function translations(lang) {\n\t\t lang = lang || 'en';\n\t\t var text = {\n\t\t daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\t limit: 'Limit reached ({{limit}} items max).',\n\t\t loading: 'Loading...',\n\t\t minLength: 'Min. Length',\n\t\t months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t notSelected: 'Nothing Selected',\n\t\t required: 'Required',\n\t\t search: 'Search'\n\t\t };\n\t\t return window.VueStrapLang ? window.VueStrapLang(lang) : text;\n\t\t}", "transliterate(text) {\n\n return Sanscript.t(text, 'itrans', 'devanagari');\n }", "function setLanguage(newLang){\r\n\tswitch (newLang) {\r\n\t\t// German - DE - by Stevieoo\r\n\t\tcase \"de\": \taLang = [\"Aktivieren\", \"Angriffs-Email\", \"Angriffs-Alarm\", \"Spionage-Alarm\", \"Nachrichten-Alarm\", \"Auto-Login\", \"Du musst Deine eMail Adresse am Anfang des Codes einfügen, wenn Du eine eMail bekommen möchtest, wenn Du angegriffen wirst.\", \"Es muss eine funktionierende Email Adresse definiert werden, damit Du bei einem Angriff benachrichtigt wirst.\", \"Angriff in \", \"Unbekannte Angriffs-Zeit\", \"Du wirst angegriffen, aber die Flottendetails nicht nicht verfügbar.\", \"Ankunfts-Zeit\", \"Schiffe\", \"Von\", \"Nach\", \"Angriff\", \"OGame Angriff\", \"Autologin kann in Chrome nicht abgeschaltet werden. Bitte deaktiviere das Addon zum ausschalten des Autologin.\", \"[email protected]\", \"Das ist eine Testmail\", \"Das ist ein [email protected] Test\", \"OGame Alarm w/ Cheese\", \"Email für eingehene Alarme\", \"Test\", \"Ogame Alarm by programer\", \"Minimale Reload-Zeit\", \"Maximale Reload-Zeit\", \"Prüfe auf alarme alle\", \"Speichern & Schließen\",\"Reload Typ Auswahl\",\"Sekunden\",\"Sprache\",\"\",\"[OGAbp] Löschen aller cookies\",\"Bist Du sicher das Du alle OGAbp Cookies löschen möchtest? Hiermit werden deine Logindaten gelöscht und alle Einstellungen auf standard zurück gesetzt.\", \"Reset alles\", \"AutoLogin Konten\", \"Server\", \"Spieler\", \"Passwort\", \"AutoLogin\", \"Es gibts keine AutoLogin informationen. Bitte ausloggen und neu einloggen zum speichern der informationen.\", \"Ungültige Email! Beispiel: [email protected]\", \"Eine Test Email wurde versendet! Wenn Sie kein Firefox verwenden könnte es nicht funktionieren.\", \"Ungültige Einstellungen! Das minimum darf nicht kleiner als 30 Sekunden sein. Das Maximum darf nicht kleiner als 360 sein. Prüfen auf Angriffe darf nicht kleiner als 30 sein. Die Email Adresse muss ein @ und einen . und keine Leerzeichen enthalten.\", \"Übersicht\", \"Löschen\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 1;\r\n\t\t\t\t\tbreak;\r\n\t\t// Danish - DK - by Kin0x\r\n\t\tcase \"dk\": \taLang = [\"Aktiver\", \"Angrebs email\", \"Angrebs Alarm\", \"Spionage Alarm\", \"Besked Alarm\", \"Auto Login\", \"Mangler email!\", \"Du skal have en email indtastet i bunden for at kunne modtage beskeder omkring flåde angreb pr. mail.\", \"Indkommende angreb om \", \"Ukendt angrebs tid\", \"Du er under angreb, men der er ingen flåde detajler\", \"Ankommer kl.\", \"Skibe\", \"Fra\", \"Til\", \"Angreb\", \"OGame indkommende angreb\", \"AutoLogin kan ikke blive slået fra i Chrome!\", \"[email protected]\", \"Dette er en test email!\", \"En test email så du kan se dit script virker!\", \"OGame Alarm med Ost\", \"Email for at modtage mails med angreb\", \"Send en test\", \"OGame Alarm Indstillinger\", \"Minimum opdateringstid (sek)\", \"Maksimum opdateringstid (sek)\", \"Check for alarms every\", \"Gem Indstillinger\", \"Select Reload Type\", \"sekund\", \"Sprog\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: [email protected]\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 2;\r\n \t\t\t\t\tbreak;\r\n\t\t// Portuguese - PL - by GL_notmypresident\r\n\t\tcase \"pt\": \taLang = [\"Recarregar\", \"Email de ataque\", \"Alarme de ataque\", \"Alarme de espião\", \"Alarme mensagem\", \"Login automático\", \"Tens que preencher a variável EmailURL no topo do código. Para usar a opção de Email de ataque.\", \"Tens que inserir o teu email no fim da página do OGame para usar a opção de Email de ataque.\", \"Ataque em \", \"Tempo para o ataque desconhecido\", \"Estás a ser atacado, mas os detalhes da frota atacante são desconhecidos.\", \"Tempo de chegada\", \"Naves\", \"De\", \"Para\", \"Ataque\", \"Ataque no OGame\", \"Não é possível desactivar o Login Automático no Chrome. Tens que ir à página das extensões e desactivar o script para desactivar o Login automático.\", \"[email protected]\", \"Email de teste\", \"Um teste com queijo\", \"Alarme do OGame com queijo\", \"Email para receberes notificações de ataque\", \"Teste\", \"Ogame Alarm by programer\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Salvar e Saída\", \"Select Reload Type\", \"segundo\", \"Linguagem\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: [email protected]\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 3;\r\n \t\t\t\t\tbreak;\r\n\t\t// Russian - RU - by programer\r\n\t\tcase \"ru\":\taLang = [\"Активировать\", \"Emailer атак\", \"Сирена при атаке\", \"Сигнал при скане\", \"Сигнал о сообщении\", \"Авто Вход\", \"Вы должны ввести адрес почтового ящика в начале кода скрипта для использования Входящие сообщения при атаке.\", \"Вы должны установить корректный почтовый ящик в опции Сигнал при атаке\", \"Атака через \", \"Неизвестное время атаки\", \"Обнаружена атака, но состав флотов не определен\", \"Время прилета\", \"Корабли\", \"с\", \"на\", \"Атака\", \"Атака в OGame\", \"Невозможно отключить Авто Вход в Chrome. Вы должны открыть расширения и отключить скрипт, чтобы отключить Авто Вход.\", \"[email protected]\", \"Тестовое сообщение\", \"Тест\", \"OGame Alarm by programer\", \"Почтовый ящик для отправки сигнального сообщения\", \"Тест\", \"Ogame Alarm by programer\", \"Минимальное время обновления\", \"Максимальное время обновления\", \"Проверять атаку каждые\", \"Сохранить & Выйти\", \"Выберите тип обновления\", \"секунд\", \"Язык\", \"\", \"[OGAbp] Удалить куки\", \"Вы действительно хотите удалить все OGAbp куки?\\n\\nЭто удалит адрес почтового ящика (и информацию авто входа в GreaseMonkey), как сброс всех настроек и опций по умолчанию.\", \"Сбросить все\", \"Аккаунты Авто входа\", \"Сервер\", \"Игрок\", \"Пароль\", \"Авто вход\", \"Не найдена информации об аккаунтах Авто входа. Пожалуйста выйдите и войдите обратно для сохранения информации об аккаунте для Авто входа\", \"Некорректный Email. Пожалуйста, используйте форму: [email protected]\", \"Тестовое сообщение отправлено!\\n\\nЭто будет работать только в браузере FireFox.\", \"Некорректные настройки!\\n\\nМинимум не может быть менее 30 секунд.\\nМаксимум не может быть менее 360 секунд.\\nПроверка атак не может быть установлена менее 30.\\nАдрес почтового ящика должен содержать @ и . и не должен содержать пробелов.\\nПовторение сигнала должно быть чаще, чем проверка атак.\", \"Обзор\", \"Удалить\", \"Повторять последний сигнал\", \"После\", \"(Менее 10 = отключено)\"];\r\n\t\t\t\t\taLangIndex = 4;\r\n\t\t\t\t\tbreak;\r\n\t\t// English (Default) - ORG - by Pimp Trizkit\r\n\t\tcase \"org\": // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\r\n\t\tdefault:\taLang = [\"Activate\", \"Attack Emailer\", \"Attack Alarm\", \"Espionage Alarm\", \"Message Alarm\", \"Auto Login\", \"You need to set the EmailURL at the top of the code. To use the Incoming Attack Email Alarm.\", \"You need to set a proper email address in the options screen for the Incoming Attack alerts.\", \"Incoming Attack in \", \"Unknown Attack Time\", \"You have an Incoming attack, but the fleet details are not available\", \"Arrival Time\", \"Ships\", \"From\", \"To\", \"Attack\", \"OGame Incoming Attack\", \"Can not turn off AutoLogin in Chrome. You will have to goto your extensions and disable the script to disable AutoLogin.\", \"[email protected]\", \"This is a test email\", \"One Cheesy Test\", \"OGame Alarm w/ programer\", \"Email address to send Incoming Attack alerts\", \"Test\", \"Ogame Alarm by programer\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Save & Close\", \"Select Reload Type\", \"seconds\", \"Language\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email (and autologin information in GreaseMonkey) as well as reset all settings and options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: [email protected]\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\\nAlarm repeat must be less than Check for Alarms.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 0;\r\n\t\t\t\t\tbreak;\r\n\t}\r\n}", "function changeLang(lang = 'en'){\n\n\tconst translations = {\n\t\t'en' : {\n\t\t\thtmlTitle : 'A Javascript restoration of «Pn=n!» (2006) by Iván Marino :: Marcelo Terreni',\n\t\t\ttitle: 'A Javascript restoration of <cite class=\"pn-title\">P<sub>n</sub>=n!</cite>&nbsp;(2006) by <span lang=\"es\">Iván Marino</span> built with ES6, CSS, MSE & the HandBrake CLI',\n\t\t\tdescription: '<p>First exhibited in March 2006, <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> was a media art installation developed in Flash by the argentinian artist <span lang=\"es\">Iván Marino</span>. A sequence from the film <cite lang=\"fr\">“La Passion de Jeanne d\\'Arc”</cite> (1928) by Carl T. Dreyer was divided into its constituent shots and repurposed to address the idea of torture as an algorithm, a piece of software. For every new sequence in the project, an individual shot from the film was randomly selected and reedited into a new progression that would fatally mirror the three semantic cornerstones present in several torture procedures: victims, victimizers and torture instruments.</p>\\n<p>For this conservation project I rewrote the code from scratch with ES6, used the Media Source API to manage video playback and built a responsive CSS layout to meet the requirements of the modern web. Although the source video was reprocessed with the HandBrake CLI from a more recent transfer of the film, I took care to mimic the look and feel of the original *.flv files in After Effects. A detailed tutorial of this new media restoration work is coming up soon. Meanwhile, <a href=\"http://terreni.com.ar\">check any of the other works in my personal portfolio</a>.</p>',\n\t\t\tviewwork : 'View <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> restoration',\n\t\t\tloadings : ['Loading <br />Judges', 'Loading <br />Jeanne', 'Loading <br />Machines'],\n\t\t\tcredits : 'Restored with ES6, CSS & the HandBrake&nbsp;CLI by <a href=\"http://terreni.com.ar\">Marcelo Terreni</a>',\n\t\t\tviewsource : 'View source in <strong>GitHub</strong>'\n\t\t},\n\t\t'es' : {\n\t\t\thtmlTitle : 'Una versión en Javascript de «Pn=n!» (2006) de Iván Marino :: Marcelo Terreni',\n\t\t\ttitle: 'Un ejercicio de preservación sobre <cite class=\"pn-title\">P<sub>n</sub>=n!</cite>&nbsp;(2006) de Iván Marino con ES6, CSS, MSE & la CLI de HandBrake',\n\t\t\tdescription: '<p>Exhibida por primera vez en marzo de 2006, <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> es una instalación programada en Flash por el artista argentino Iván Marino. El autor dividió una secuencia del film <cite lang=\"fr\">“La Passion de Jeanne d\\'Arc”</cite> (1928) de Carl T. Dreyer en sus planos constituitivos para luego resignificarlos en una meditación sobre la tortura como algoritmo, como un proceso suceptible de ser transformado en software. En cada nueva secuencia del proyecto, una toma individual del film era seleccionada y remontada en una nueva progresión de planos que sigue el orden de los tres pilares semánticos presentes en varios procedimientos de tortura: víctimas, victimarios e instrumentos de tortura.</p>\\n<p>Para este proyecto de restauración reescribí el código con ES6, use la API <span lang=\"en\">Media Source</span> para manejar la reproducción de video y construí vía CSS un diseño mejor adaptado a los requerimientos de la web moderna. Aunque el material fue recomprimido con la CLI de HandBrake a partir de un transfer más reciente del film, me tomé el trabajo de imitar el aspecto de los archivos *.flv originales en After Effects para conseguir una reproducción lo más fiel posible. Prontó escribiré un tutorial detallado sobre las soluciones que encontré durante el trabajo de restauración. Mientras tanto, <a href=\"http://terreni.com.ar\">te invito a navegar alguno de los otros trabajos exhibidos en mi portfolio personal</a>.</p>',\n\t\t\tviewwork : 'Ver <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> restaurada',\n\t\t\tloadings : ['Cargando <br />Jueces', 'Cargando <br />Juana', 'Cargando <br />Instrumentos'],\n\t\t\tcredits : 'Restaurada con ES6, CSS & la CLI de HandBrake por <a href=\"http://terreni.com.ar\">Marcelo Terreni</a>',\n\t\t\tviewsource : 'Ver el código en <strong>GitHub</strong>'\n\t\t}\n\t};\n\n\tdocument.getElementsByTagName('html')[0].setAttribute('lang', lang);\n\tdocument.title = translations[lang].htmlTitle;\n\n\tconst pnIntroTitle = document.getElementsByClassName('intro-description-title')[0];\n\tconst pnIntroDescription = document.getElementsByClassName('intro-description-bio')[0];\n\tconst pnIntroCredits = document.getElementsByClassName('intro-description-credits')[0];\n\tconst pnIntroViewwork = document.querySelector('.intro-description-start-btn span');\n\tconst pnIntroLoadings = document.querySelectorAll('.intro-description-loading-list p');\n\tconst pnIntroViewsource = document.getElementsByClassName('intro-description-viewsource')[0];\n\n\t/* Text translation */\n\tpnIntroTitle.innerHTML = translations[lang].title;\n\tpnIntroDescription.innerHTML = translations[lang].description;\n\tpnIntroCredits.innerHTML = translations[lang].credits;\n\tpnIntroViewwork.innerHTML = translations[lang].viewwork;\n\tpnIntroViewsource.innerHTML = translations[lang].viewsource;\n\n\tfor(let i = 0; i < pnIntroLoadings.length; i++){\n\t\tpnIntroLoadings[i].innerHTML = translations[lang].loadings[i];\n\t}\n\n}", "function trans( string ){\n\tif( window.furasta.lang[ string ] ){\n\t\treturn window.furasta.lang[ string ];\n\t}\n\treturn string;\n}", "function ui(e,t,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "function helloWorld()\r\n{\r\n var language = document.project2.lang.value;\r\n var language = language.toLowerCase();\r\n//create logic that outputs \"hello world\" different depending on language selected\r\n if (language == 'ru') //case of russia\r\n {\r\n return \"Privet Mir\";\r\n }\r\n else if (language == 'pt')\r\n {\r\n return \"Olá mundo!\";\r\n }\r\n else if(language == 'en')\r\n {\r\n return \"Hello world!\";\r\n }\r\n else if(language == 'fr')\r\n {\r\n return \"Bonjour le monde!\";\r\n }\r\n else if (language == 'es')\r\n {\r\n return \"Hola mundo\";\r\n }\r\n else\r\n {\r\n return \"HELLO MURICA.\";\r\n }\r\n\r\n\r\n}", "function translate(word)\n{\n return Language[word]\n\n}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "function _localize(s) {\n\tvar strings = {\n\t\t\"Yes Ц run as JScript\\nNo Ц run as VBScript\": {\n\t\t\tru: \"ƒа Ц запустить как JScript\\nЌет Ц запустить как VBScript\"\n\t\t}\n\t};\n\tvar lng;\n\tswitch(AkelPad.GetLangId(1 /*LANGID_PRIMARY*/)) {\n\t\tcase 0x19: lng = \"ru\"; break;\n\t\tdefault: lng = \"en\";\n\t}\n\t_localize = function(s) {\n\t\treturn strings[s] && strings[s][lng] || s;\n\t};\n\treturn _localize(s);\n}", "function set_language(lang) {\r\n\r\n if (_lang_code in _lang.strings)\r\n _lang_code = lang;\r\n\r\n }", "function PlcGeral(){\r\n}", "function T(texto){\r\n\t\t// Intenta usar el array del idioma, y si no esta disponible utiliza el castellano por defecto\r\n//\t\ttry{\r\n//\t\t\teval('var language = lang_' + idioma);\r\n//\t\t}catch(e){\r\n//\t\t\teval('var language = lang_hk');\r\n//\t\t}\r\n//\r\n//\t\ttexto = texto.toUpperCase();\r\n//\r\n//\t\t// Si una cadena concreta no esta traducida en el idioma, utiliza por defecto el castellano\r\n//\t\tif (language[texto] == undefined) {\r\n//\t\t\treturn language[texto] == undefined ? '!'+texto+'!' : lang_hk[texto];\r\n//\t\t} else {\r\n//\t\t\treturn language[texto];\r\n//\t\t}\r\n\r\n\t\ttexto = texto.toUpperCase();\r\n\r\n\t\ttry{\r\n\t\t\treturn aLang[texto] == undefined ? '!'+texto+'!' : aLang[texto];\r\n\t\t}catch(e){\r\n\t\t\treturn '!'+texto+'!';\r\n\t\t}\r\n\r\n\t}", "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function en(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function setUserLanguage(value){\n __params['ul'] = value;\n}", "LanguageTagToLanguageStr(tag)\r\n {\r\n switch(tag)\r\n {\r\n case \"de\":\r\n return \"German\";\r\n break;\r\n case \"en\":\r\n return \"English\";\r\n break;\r\n case \"ja\":\r\n return \"Japanese\";\r\n break;\r\n case \"ar\":\r\n return \"Arabian\";\r\n break;\r\n case \"es\":\r\n return \"Spanish\";\r\n break;\r\n case \"fr\":\r\n return \"French\";\r\n break;\r\n case \"it\":\r\n return \"Italian\";\r\n break;\r\n case \"nl\":\r\n return \"Dutch\";\r\n break;\r\n case \"pl\":\r\n return \"Polish\";\r\n break;\r\n case \"pt\":\r\n return \"Portuguese\";\r\n break;\r\n case \"ru\":\r\n return \"Russian\";\r\n break;\r\n case \"zh\":\r\n return \"Chinese\";\r\n break;\r\n }\r\n }", "function Umlaut(options = {}) {\n\n\n const project = {\n version: '1.0.0',\n date: '2016-10-18',\n url: 'http://neven.ca',\n author: 'Knut Neven',\n email: '[email protected]'\n };\n\n\n\n\n /*\n MAIN OBJECT\n */\n\n\n const umlaut = {};\n\n\n\n\n /*\n PRIVATE VARS\n */\n\n\n const dictionaries = {\n // all: 1765\n all: { 'I': 'I`', 'İ': 'I', 'J': 'J', 'S': 'Z`', '«': '\"', '²': '2', '³': '3', '¹': '1', '»': '\"', 'ß': 'ss', 'ẞ': 'SS', 'À': 'A', 'à': 'a', 'Á': 'A', 'á': 'a', 'Â': 'A', 'â': 'a', 'Ã': 'A', 'ã': 'a', 'Ä': 'A', 'ä': 'a', 'ä': 'ae', 'Ä': 'Ae', 'Å': 'A', 'å': 'a', 'æ': 'ae', 'Æ': 'AE', 'Ç': 'C', 'ç': 'c', 'È': 'E', 'è': 'e', 'É': 'E', 'é': 'e', 'Ê': 'E', 'ê': 'e', 'Ë': 'E', 'ë': 'e', 'Ì': 'I', 'ì': 'i', 'Í': 'I', 'í': 'i', 'Î': 'I', 'î': 'i', 'Ï': 'I', 'ï': 'i', 'ð': 'd', 'Ð': 'D', 'Ñ': 'N', 'ñ': 'n', 'Ò': 'O', 'ò': 'o', 'Ó': 'O', 'ó': 'o', 'Ô': 'O', 'ô': 'o', 'Õ': 'O', 'õ': 'o', 'Ö': 'O', 'ö': 'o', 'Ö': 'Oe', 'ö': 'oe', 'Ø': 'O', 'ø': 'o', 'Ù': 'U', 'ù': 'u', 'Ú': 'U', 'ú': 'u', 'Û': 'U', 'û': 'u', 'Ü': 'U', 'ü': 'u', 'Ü': 'Ue', 'ü': 'ue', 'Ý': 'Y', 'ý': 'y', 'þ': 't', 'Þ': 'T', 'Þ': 'TH', 'þ': 'th', 'Ÿ': 'Y', 'ÿ': 'y', 'Ā': 'A', 'ā': 'a', 'Ă': 'A', 'ă': 'a', 'Ą': 'A', 'ą': 'a', 'Ć': 'C', 'ć': 'c', 'Ĉ': 'C', 'ĉ': 'c', 'Ċ': 'C', 'ċ': 'c', 'Č': 'C', 'č': 'c', 'Ď': 'D', 'ď': 'd', 'Đ': 'D', 'đ': 'd', 'Ē': 'E', 'ē': 'e', 'Ĕ': 'E', 'ĕ': 'e', 'Ė': 'E', 'ė': 'e', 'Ę': 'E', 'ę': 'e', 'Ě': 'E', 'ě': 'e', 'Ĝ': 'G', 'ĝ': 'g', 'Ğ': 'G', 'ğ': 'g', 'Ġ': 'G', 'ġ': 'g', 'Ģ': 'G', 'ģ': 'g', 'Ĥ': 'H', 'ĥ': 'h', 'Ħ': 'H', 'ħ': 'h', 'Ĩ': 'I', 'ĩ': 'i', 'Ī': 'I', 'ī': 'i', 'Ĭ': 'I', 'ĭ': 'i', 'Į': 'I', 'į': 'i', 'ı': 'i', 'IJ': 'IJ', 'ij': 'ij', 'Ĵ': 'J', 'ĵ': 'j', 'Ķ': 'K', 'ķ': 'k', 'ĸ': 'k', 'ĸ': 'q', 'Ĺ': 'K', 'ĺ': 'l', 'Ĺ': 'L', 'Ļ': 'K', 'ļ': 'l', 'Ļ': 'L', 'Ľ': 'K', 'ľ': 'l', 'Ľ': 'L', 'Ŀ': 'K', 'ŀ': 'l', 'Ŀ': 'L', 'Ł': 'L', 'ł': 'l', 'Ń': 'N', 'ń': 'n', 'Ņ': 'N', 'ņ': 'n', 'Ň': 'N', 'ň': 'n', 'ʼn': 'n', 'Ŋ': 'N', 'ŋ': 'n', 'Ō': 'O', 'ō': 'o', 'Ŏ': 'O', 'ŏ': 'o', 'Ő': 'O', 'ő': 'o', 'Œ': 'O', 'œ': 'oe', 'Œ': 'OE', 'Ŕ': 'R', 'ŕ': 'r', 'Ŗ': 'R', 'ŗ': 'r', 'Ř': 'R', 'ř': 'r', 'Ś': 'S', 'ś': 's', 'Ŝ': 'S', 'ŝ': 's', 'Ş': 'S', 'ş': 's', 'Š': 'S', 'š': 's', 'Ţ': 'T', 'ţ': 't', 'Ť': 'T', 'ť': 't', 'Ŧ': 'T', 'ŧ': 't', 'Ũ': 'U', 'ũ': 'u', 'Ū': 'U', 'ū': 'u', 'Ŭ': 'U', 'ŭ': 'u', 'Ů': 'U', 'ů': 'u', 'Ű': 'U', 'ű': 'u', 'Ų': 'U', 'ų': 'u', 'Ŵ': 'W', 'ŵ': 'w', 'Ŷ': 'Y', 'ŷ': 'y', 'Ź': 'Z', 'ź': 'z', 'Ż': 'Z', 'ż': 'z', 'Ž': 'Z', 'ž': 'z', 'ſ': 's', 'ſ': 'ss', 'Ƀ': 'B', 'ƀ': 'b', 'Ƃ': 'B', 'ƃ': 'b', 'Ƈ': 'C', 'ƈ': 'c', 'Ƌ': 'D', 'ƌ': 'd', 'ƒ': 'f', 'Ƒ': 'F', 'ƕ': 'hv', 'Ƕ': 'HV', 'Ƙ': 'K', 'ƙ': 'k', 'Ƚ': 'L', 'ƚ': 'l', 'Ƞ': 'N', 'ƞ': 'n', 'Ơ': 'O', 'ơ': 'o', 'Ƣ': 'OI', 'ƣ': 'oi', 'Ƥ': 'P', 'ƥ': 'p', 'ƫ': 't', 'Ƭ': 'T', 'ƭ': 't', 'Ư': 'U', 'ư': 'u', 'Ƴ': 'Y', 'ƴ': 'y', 'Ƶ': 'Z', 'ƶ': 'z', 'ƿ': 'w', 'Ƿ': 'W', 'Dž': 'D', 'DŽ': 'DZ', 'dž': 'dz', 'Dž': 'Dz', 'Lj': 'L', 'LJ': 'LJ', 'lj': 'lj', 'Lj': 'Lj', 'Nj': 'N', 'NJ': 'NJ', 'nj': 'nj', 'Nj': 'Nj', 'Ǎ': 'A', 'ǎ': 'a', 'Ǐ': 'I', 'ǐ': 'i', 'Ǒ': 'O', 'ǒ': 'o', 'Ǔ': 'U', 'ǔ': 'u', 'Ǖ': 'U', 'ǖ': 'u', 'Ǘ': 'U', 'ǘ': 'u', 'Ǚ': 'U', 'ǚ': 'u', 'Ǜ': 'U', 'ǜ': 'u', 'Ǝ': 'E', 'ǝ': 'e', 'Ǟ': 'A', 'ǟ': 'a', 'Ǡ': 'A', 'ǡ': 'a', 'Ǣ': 'AE', 'ǣ': 'ae', 'Ǥ': 'G', 'ǥ': 'g', 'ǥ': 'G', 'Ǧ': 'G', 'ǧ': 'g', 'ǧ': 'G', 'Ǩ': 'K', 'ǩ': 'k', 'Ǫ': 'O', 'ǫ': 'o', 'Ǭ': 'O', 'ǭ': 'o', 'ǰ': 'j', 'Dz': 'D', 'DZ': 'DZ', 'dz': 'dz', 'Dz': 'Dz', 'Ǵ': 'G', 'ǵ': 'g', 'Ǹ': 'N', 'ǹ': 'n', 'Ǻ': 'A', 'ǻ': 'a', 'Ǽ': 'AE', 'ǽ': 'ae', 'Ǿ': 'O', 'ǿ': 'o', 'Ȁ': 'A', 'ȁ': 'a', 'Ȃ': 'A', 'ȃ': 'a', 'Ȅ': 'E', 'ȅ': 'e', 'Ȇ': 'E', 'ȇ': 'e', 'Ȉ': 'I', 'ȉ': 'i', 'Ȋ': 'I', 'ȋ': 'i', 'Ȍ': 'O', 'ȍ': 'o', 'Ȏ': 'O', 'ȏ': 'o', 'Ȑ': 'R', 'ȑ': 'r', 'Ȓ': 'R', 'ȓ': 'r', 'Ȕ': 'U', 'ȕ': 'u', 'Ȗ': 'U', 'ȗ': 'u', 'Ș': 'S', 'ș': 's', 'Ț': 'T', 'ț': 't', 'Ȝ': 'Z', 'ȝ': 'z', 'Ȟ': 'H', 'ȟ': 'h', 'ȡ': 'd', 'Ȣ': 'OU', 'ȣ': 'ou', 'Ȥ': 'Z', 'ȥ': 'z', 'Ȧ': 'A', 'ȧ': 'a', 'Ȩ': 'E', 'ȩ': 'e', 'Ȫ': 'O', 'ȫ': 'o', 'Ȭ': 'O', 'ȭ': 'o', 'Ȯ': 'O', 'ȯ': 'o', 'Ȱ': 'O', 'ȱ': 'o', 'Ȳ': 'Y', 'ȳ': 'y', 'ȴ': 'l', 'ȵ': 'n', 'ȶ': 't', 'ȷ': 'j', 'ȸ': 'db', 'ȹ': 'qp', 'Ȼ': 'C', 'ȼ': 'c', 'ȿ': 's', 'ɀ': 'z', 'Ɇ': 'E', 'ɇ': 'e', 'Ɉ': 'J', 'ɉ': 'j', 'ɋ': 'q', 'Ɋ': 'Q', 'Ɍ': 'R', 'ɍ': 'r', 'Ɏ': 'Y', 'ɏ': 'y', 'Ɐ': 'A', 'ɐ': 'a', 'Ɐ': 'a', 'Ɓ': 'B', 'ɓ': 'b', 'Ɔ': 'O', 'ɔ': 'o', 'ɕ': 'c', 'ɖ': 'd', 'Ɖ': 'D', 'Ɗ': 'D', 'ɗ': 'd', 'ɘ': 'e', 'Ə': 'A', 'ə': 'a', 'ɚ': 'a', 'Ɛ': 'E', 'ɛ': 'e', 'ɜ': 'e', 'ɝ': 'e', 'ɞ': 'e', 'ɟ': 'j', 'Ɠ': 'G', 'ɠ': 'g', 'ɡ': 'g', 'ɢ': 'G', 'ɥ': 'h', 'ɦ': 'h', 'Ɨ': 'I', 'ɨ': 'i', 'Ɩ': 'I', 'ɪ': 'I', 'Ɫ': 'L', 'ɫ': 'l', 'ɬ': 'l', 'ɭ': 'l', 'Ɯ': 'M', 'ɯ': 'm', 'ɰ': 'm', 'Ɱ': 'M', 'ɱ': 'm', 'Ɲ': 'N', 'ɲ': 'n', 'ɳ': 'n', 'ɴ': 'N', 'Ɵ': 'O', 'ɵ': 'o', 'ɶ': 'OE', 'ɹ': 'r', 'ɺ': 'r', 'ɻ': 'r', 'ɼ': 'r', 'Ɽ': 'R', 'ɽ': 'r', 'ɾ': 'r', 'ɿ': 'r', 'ʀ': 'R', 'ʁ': 'R', 'ʂ': 's', 'ʄ': 'j', 'ʇ': 't', 'Ʈ': 'T', 'ʈ': 't', 'Ʉ': 'U', 'ʉ': 'u', 'Ʋ': 'V', 'ʋ': 'v', 'Ʌ': 'V', 'ʌ': 'v', 'ʍ': 'w', 'ʎ': 'y', 'ʏ': 'Y', 'ʐ': 'z', 'ʑ': 'z', 'ʗ': 'C', 'ʙ': 'B', 'ʚ': 'e', 'ʛ': 'G', 'ʜ': 'H', 'ʝ': 'j', 'ʞ': 'k', 'ʟ': 'L', 'ʠ': 'q', 'ʣ': 'dz', 'ʥ': 'dz', 'ʦ': 'ts', 'ʨ': 'tc', 'ʪ': 'ls', 'ʫ': 'lz', 'ʮ': 'h', 'ʯ': 'h', 'ΐ': 'i', 'Ά': 'A', 'ά': 'a', 'Έ': 'E', 'έ': 'e', 'Ή': 'I', 'ή': 'i', 'Ί': 'I', 'ί': 'i', 'ΰ': 'y', 'Α': 'A', 'α': 'a', 'Β': 'B', 'β': 'b', 'Γ': 'G', 'γ': 'g', 'Δ': 'D', 'δ': 'd', 'Ε': 'E', 'ε': 'e', 'Ζ': 'Z', 'ζ': 'z', 'Η': 'I', 'η': 'i', 'Θ': 'T', 'θ': 't', 'Ι': 'I', 'ι': 'i', 'Κ': 'K', 'κ': 'k', 'Λ': 'L', 'λ': 'l', 'Μ': 'M', 'μ': 'm', 'Ν': 'N', 'ν': 'n', 'Ξ': 'K', 'ξ': 'k', 'Ο': 'O', 'ο': 'o', 'Π': 'P', 'π': 'p', 'Ρ': 'R', 'ρ': 'r', 'ς': 's', 'Σ': 'S', 'σ': 's', 'Τ': 'T', 'τ': 't', 'Υ': 'Y', 'υ': 'y', 'Φ': 'F', 'φ': 'f', 'Χ': 'X', 'χ': 'x', 'Ψ': 'P', 'ψ': 'p', 'Ω': 'O', 'ω': 'o', 'Ϊ': 'I', 'ϊ': 'i', 'Ϋ': 'Y', 'ϋ': 'y', 'Ό': 'O', 'ό': 'o', 'Ύ': 'Y', 'ύ': 'y', 'Ώ': 'O', 'ώ': 'o', 'А': 'A', 'а': 'a', 'А': 'a', 'а': 'а', 'Б': 'B', 'б': 'b', 'В': 'V', 'в': 'v', 'Г': 'G', 'г': 'g', 'Д': 'D', 'д': 'd', 'дж': 'dzh', 'дз': 'dz', 'Е': 'E', 'е': 'e', 'Ж': 'Zh', 'ж': 'zh', 'Ж': 'ZH', 'З': 'Z', 'з': 'z', 'И': 'I', 'и': 'i', 'И': 'Y', 'и': 'y', 'ия': 'ia', 'Ия': 'Ia', 'иЯ': 'iA', 'ИЯ': 'IA', 'й': 'i', 'Й': 'I', 'Й': 'J', 'й': 'j', 'й': 'y', 'Й': 'Y', 'йо': 'yo', 'К': 'K', 'к': 'k', 'Л': 'L', 'л': 'l', 'М': 'M', 'м': 'm', 'Н': 'N', 'н': 'n', 'О': 'O', 'о': 'o', 'о': 'о', 'П': 'P', 'п': 'p', 'Р': 'R', 'р': 'r', 'С': 'S', 'с': 's', 'Т': 'T', 'т': 't', 'У': 'U', 'у': 'u', 'Ф': 'F', 'ф': 'f', 'х': 'h', 'Х': 'H', 'Х': 'Kh', 'х': 'kh', 'Х': 'X', 'х': 'x', 'Ц': 'Cz', 'ц': 'cz', 'ц': 'ts', 'Ц': 'Ts', 'Ц': 'TS', 'Ч': 'Ch', 'ч': 'ch', 'Ч': 'CH', 'Ш': 'Sh', 'ш': 'sh', 'Ш': 'SH', 'щ': 'sch', 'Щ': 'Sch', 'Щ': 'SCH', 'Щ': 'Shch', 'щ': 'shch', 'Щ': 'Shh', 'щ': 'shh', 'щ': 'sht', 'Щ': 'Sht', 'Ъ': '', 'ъ': '', 'Ъ': '\\'', 'ъ': '\\'', 'ъ': 'a', 'Ъ': 'A', 'Ъ': 'A`', 'ъ': 'a`', 'Ы': 'I', 'ы': 'i', 'ы': 'y', 'Ы': 'Y', 'Ы': 'Y`', 'ы': 'y`', 'Ь': '', 'ь': '', 'Ь': '\\'', 'ь': '\\'', 'Ь': '`', 'ь': '`', 'ь': 'y', 'Ь': 'Y', 'ьо': 'yo', 'э': 'e', 'Э': 'E', 'Э': 'E`', 'э': 'e`', 'ю': 'iu', 'Ю': 'Yu', 'ю': 'yu', 'Ю': 'YU', 'я': 'ia', 'Я': 'Ya', 'я': 'ya', 'я': 'уа', 'Ё': 'E', 'ё': 'e', 'Ё': 'Yo', 'ё': 'yo', 'Ё': 'YO', 'Ѓ': 'G`', 'ѓ': 'g`', 'є': 'ie', 'Є': 'Ye', 'є': 'ye', 'ѕ': 'z`', 'І': 'I', 'і': 'i', 'і': 'i`', 'ї': 'i', 'Ї': 'Yi', 'ї': 'yi', 'ј': 'j', 'Љ': 'L`', 'љ': 'l`', 'Њ': 'N`', 'њ': 'n`', 'Ќ': 'K`', 'ќ': 'k`', 'Ў': 'U`', 'ў': 'u`', 'Џ': 'Dh', 'џ': 'dh', 'Ѣ': 'Ye', 'ѣ': 'уе', 'Ѫ': 'O`', 'ѫ': 'о`', 'Ѳ': 'Fh', 'ѳ': 'fh', 'Ѵ': 'Yh', 'ѵ': 'yh', 'Ґ': 'G', 'ґ': 'g', 'Ґ': 'G`', 'ґ': 'g`', 'Ғ': 'Gh', 'ғ': 'gh', 'Қ': 'Q', 'қ': 'q', 'Ң': 'Nh', 'ң': 'nh', 'Ү': 'U\\'', 'ү': 'u\\'', 'Ұ': 'U', 'ұ': 'u', 'Һ': 'H\\'', 'һ': 'h\\'', 'Ә': 'A\\'', 'ә': 'a\\'', 'Ө': 'O\\'', 'ө': 'o\\'', 'ა': 'a', 'ბ': 'b', 'გ': 'g', 'დ': 'd', 'ე': 'e', 'ვ': 'v', 'ზ': 'z', 'თ': 't', 'ი': 'i', 'კ': 'k', 'ლ': 'l', 'მ': 'm', 'ნ': 'n', 'ო': 'o', 'პ': 'p', 'ჟ': 'z', 'რ': 'r', 'ს': 's', 'ტ': 't', 'უ': 'u', 'ფ': 'p', 'ქ': 'k', 'ღ': 'g', 'ყ': 'q', 'შ': 's', 'ჩ': 'c', 'ც': 't', 'ძ': 'd', 'წ': 't', 'ჭ': 'c', 'ხ': 'k', 'ჯ': 'j', 'ჰ': 'h', 'ᴀ': 'A', 'ᴁ': 'AE', 'ᴂ': 'ae', 'ᴃ': 'B', 'ᴄ': 'C', 'ᴅ': 'D', 'ᴆ': 'D', 'ᴇ': 'E', 'ᴈ': 'e', 'ᴉ': 'i', 'ᴊ': 'J', 'ᴋ': 'K', 'ᴌ': 'L', 'ᴍ': 'M', 'ᴎ': 'N', 'ᴏ': 'O', 'ᴐ': 'O', 'ᴑ': 'o', 'ᴓ': 'o', 'ᴔ': 'oe', 'ᴕ': 'OU', 'ᴖ': 'o', 'ᴗ': 'o', 'ᴘ': 'P', 'ᴙ': 'R', 'ᴚ': 'R', 'ᴛ': 'T', 'ᴜ': 'U', 'ᴝ': 'u', 'ᴠ': 'V', 'ᴡ': 'W', 'ᴢ': 'Z', 'ᵢ': 'i', 'ᵣ': 'r', 'ᵤ': 'u', 'ᵥ': 'v', 'ᵫ': 'ue', 'ᵬ': 'b', 'ᵭ': 'd', 'ᵮ': 'f', 'ᵯ': 'm', 'ᵰ': 'n', 'ᵱ': 'p', 'ᵲ': 'r', 'ᵳ': 'r', 'ᵴ': 's', 'ᵵ': 't', 'ᵶ': 'z', 'ᵷ': 'g', 'Ᵹ': 'G', 'ᵹ': 'g', 'ᵺ': 'th', 'ᵻ': 'I', 'ᵼ': 'i', 'Ᵽ': 'P', 'ᵽ': 'p', 'ᵾ': 'U', 'ᶀ': 'b', 'ᶁ': 'd', 'ᶂ': 'f', 'ᶃ': 'g', 'ᶄ': 'k', 'ᶅ': 'l', 'ᶆ': 'm', 'ᶇ': 'n', 'ᶈ': 'p', 'ᶉ': 'r', 'ᶊ': 's', 'ᶌ': 'v', 'ᶍ': 'x', 'ᶎ': 'z', 'ᶏ': 'a', 'ᶑ': 'd', 'ᶒ': 'e', 'ᶓ': 'e', 'ᶔ': 'e', 'ᶕ': 'a', 'ᶖ': 'i', 'ᶗ': 'o', 'ᶙ': 'u', 'Ḁ': 'A', 'ḁ': 'a', 'Ḃ': 'B', 'ḃ': 'b', 'Ḅ': 'B', 'ḅ': 'b', 'Ḇ': 'B', 'ḇ': 'b', 'Ḉ': 'C', 'ḉ': 'c', 'Ḋ': 'D', 'ḋ': 'd', 'Ḍ': 'D', 'ḍ': 'd', 'Ḏ': 'D', 'ḏ': 'd', 'Ḑ': 'D', 'ḑ': 'd', 'Ḓ': 'D', 'ḓ': 'd', 'Ḕ': 'E', 'ḕ': 'e', 'Ḗ': 'E', 'ḗ': 'e', 'Ḙ': 'E', 'ḙ': 'e', 'Ḛ': 'E', 'ḛ': 'e', 'Ḝ': 'E', 'ḝ': 'e', 'Ḟ': 'F', 'ḟ': 'f', 'Ḡ': 'G', 'ḡ': 'g', 'Ḣ': 'H', 'ḣ': 'h', 'Ḥ': 'H', 'ḥ': 'h', 'Ḧ': 'H', 'ḧ': 'h', 'Ḩ': 'H', 'ḩ': 'h', 'Ḫ': 'H', 'ḫ': 'h', 'Ḭ': 'I', 'ḭ': 'i', 'Ḯ': 'I', 'ḯ': 'i', 'Ḱ': 'K', 'ḱ': 'k', 'Ḳ': 'K', 'ḳ': 'k', 'Ḵ': 'K', 'ḵ': 'k', 'Ḷ': 'L', 'ḷ': 'l', 'Ḹ': 'L', 'ḹ': 'l', 'Ḻ': 'L', 'ḻ': 'l', 'Ḽ': 'L', 'ḽ': 'l', 'Ḿ': 'M', 'ḿ': 'm', 'Ṁ': 'M', 'ṁ': 'm', 'Ṃ': 'M', 'ṃ': 'm', 'Ṅ': 'N', 'ṅ': 'n', 'Ṇ': 'N', 'ṇ': 'n', 'Ṉ': 'N', 'ṉ': 'n', 'Ṋ': 'N', 'ṋ': 'n', 'Ṍ': 'O', 'ṍ': 'o', 'Ṏ': 'O', 'ṏ': 'o', 'Ṑ': 'O', 'ṑ': 'o', 'Ṓ': 'O', 'ṓ': 'o', 'Ṕ': 'P', 'ṕ': 'p', 'Ṗ': 'P', 'ṗ': 'p', 'Ṙ': 'R', 'ṙ': 'r', 'Ṛ': 'R', 'ṛ': 'r', 'Ṝ': 'R', 'ṝ': 'r', 'Ṟ': 'R', 'ṟ': 'r', 'Ṡ': 'S', 'ṡ': 's', 'Ṣ': 'S', 'ṣ': 's', 'Ṥ': 'S', 'ṥ': 's', 'Ṧ': 'S', 'ṧ': 's', 'Ṩ': 'S', 'ṩ': 's', 'Ṫ': 'T', 'ṫ': 't', 'Ṭ': 'T', 'ṭ': 't', 'Ṯ': 'T', 'ṯ': 't', 'Ṱ': 'T', 'ṱ': 't', 'Ṳ': 'U', 'ṳ': 'u', 'Ṵ': 'U', 'ṵ': 'u', 'Ṷ': 'U', 'ṷ': 'u', 'Ṹ': 'U', 'ṹ': 'u', 'Ṻ': 'U', 'ṻ': 'u', 'Ṽ': 'V', 'ṽ': 'v', 'Ṿ': 'V', 'ṿ': 'v', 'Ẁ': 'W', 'ẁ': 'w', 'Ẃ': 'W', 'ẃ': 'w', 'Ẅ': 'W', 'ẅ': 'w', 'Ẇ': 'W', 'ẇ': 'w', 'Ẉ': 'W', 'ẉ': 'w', 'Ẋ': 'X', 'ẋ': 'x', 'Ẍ': 'X', 'ẍ': 'x', 'Ẏ': 'Y', 'ẏ': 'y', 'Ẑ': 'Z', 'ẑ': 'z', 'Ẓ': 'Z', 'ẓ': 'z', 'Ẕ': 'Z', 'ẕ': 'z', 'ẖ': 'h', 'ẗ': 't', 'ẘ': 'w', 'ẙ': 'y', 'ẚ': 'a', 'ẛ': 'f', 'ẛ': 's', 'ẜ': 's', 'ẝ': 's', 'Ạ': 'A', 'ạ': 'a', 'Ả': 'A', 'ả': 'a', 'Ấ': 'A', 'ấ': 'a', 'Ầ': 'A', 'ầ': 'a', 'Ẩ': 'A', 'ẩ': 'a', 'Ẫ': 'A', 'ẫ': 'a', 'Ậ': 'A', 'ậ': 'a', 'Ắ': 'A', 'ắ': 'a', 'Ằ': 'A', 'ằ': 'a', 'Ẳ': 'A', 'ẳ': 'a', 'Ẵ': 'A', 'ẵ': 'a', 'Ặ': 'A', 'ặ': 'a', 'Ẹ': 'E', 'ẹ': 'e', 'Ẻ': 'E', 'ẻ': 'e', 'Ẽ': 'E', 'ẽ': 'e', 'Ế': 'E', 'ế': 'e', 'Ề': 'E', 'ề': 'e', 'Ể': 'E', 'ể': 'e', 'Ễ': 'E', 'ễ': 'e', 'Ệ': 'E', 'ệ': 'e', 'Ỉ': 'I', 'ỉ': 'i', 'Ị': 'I', 'ị': 'i', 'Ọ': 'O', 'ọ': 'o', 'Ỏ': 'O', 'ỏ': 'o', 'Ố': 'O', 'ố': 'o', 'Ồ': 'O', 'ồ': 'o', 'Ổ': 'O', 'ổ': 'o', 'Ỗ': 'O', 'ỗ': 'o', 'Ộ': 'O', 'ộ': 'o', 'Ớ': 'O', 'ớ': 'o', 'Ờ': 'O', 'ờ': 'o', 'Ở': 'O', 'ở': 'o', 'Ỡ': 'O', 'ỡ': 'o', 'Ợ': 'O', 'ợ': 'o', 'Ụ': 'U', 'ụ': 'u', 'Ủ': 'U', 'ủ': 'u', 'Ứ': 'U', 'ứ': 'u', 'Ừ': 'U', 'ừ': 'u', 'Ử': 'U', 'ử': 'u', 'Ữ': 'U', 'ữ': 'u', 'Ự': 'U', 'ự': 'u', 'Ỳ': 'Y', 'ỳ': 'y', 'Ỵ': 'Y', 'ỵ': 'y', 'Ỷ': 'Y', 'ỷ': 'y', 'Ỹ': 'Y', 'ỹ': 'y', 'Ỻ': 'LL', 'ỻ': 'll', 'Ỽ': 'V', 'Ỿ': 'Y', 'ỿ': 'y', 'Ἀ': 'A', 'ἀ': 'a', 'Ἁ': 'A', 'ἁ': 'a', 'Ἂ': 'A', 'ἂ': 'a', 'Ἃ': 'A', 'ἃ': 'a', 'Ἄ': 'A', 'ἄ': 'a', 'Ἅ': 'A', 'ἅ': 'a', 'Ἆ': 'A', 'ἆ': 'a', 'Ἇ': 'A', 'ἇ': 'a', 'Ἐ': 'E', 'ἐ': 'e', 'Ἑ': 'E', 'ἑ': 'e', 'Ἒ': 'E', 'ἒ': 'e', 'Ἓ': 'E', 'ἓ': 'e', 'Ἔ': 'E', 'ἔ': 'e', 'Ἕ': 'E', 'ἕ': 'e', 'Ἠ': 'I', 'ἠ': 'i', 'Ἡ': 'I', 'ἡ': 'i', 'Ἢ': 'I', 'ἢ': 'i', 'Ἣ': 'I', 'ἣ': 'i', 'Ἤ': 'I', 'ἤ': 'i', 'Ἥ': 'I', 'ἥ': 'i', 'Ἦ': 'I', 'ἦ': 'i', 'Ἧ': 'I', 'ἧ': 'i', 'Ἰ': 'I', 'ἰ': 'i', 'Ἱ': 'I', 'ἱ': 'i', 'Ἲ': 'I', 'ἲ': 'i', 'Ἳ': 'I', 'ἳ': 'i', 'Ἴ': 'I', 'ἴ': 'i', 'Ἵ': 'I', 'ἵ': 'i', 'Ἶ': 'I', 'ἶ': 'i', 'Ἷ': 'I', 'ἷ': 'i', 'Ὀ': 'O', 'ὀ': 'o', 'Ὁ': 'O', 'ὁ': 'o', 'Ὂ': 'O', 'ὂ': 'o', 'Ὃ': 'O', 'ὃ': 'o', 'Ὄ': 'O', 'ὄ': 'o', 'Ὅ': 'O', 'ὅ': 'o', 'ὐ': 'y', 'Ὑ': 'Y', 'ὑ': 'y', 'ὒ': 'y', 'Ὓ': 'Y', 'ὓ': 'y', 'ὔ': 'y', 'Ὕ': 'Y', 'ὕ': 'y', 'ὖ': 'y', 'Ὗ': 'Y', 'ὗ': 'y', 'Ὠ': 'O', 'ὠ': 'o', 'Ὡ': 'O', 'ὡ': 'o', 'Ὢ': 'O', 'ὢ': 'o', 'Ὣ': 'O', 'ὣ': 'o', 'Ὤ': 'O', 'ὤ': 'o', 'Ὥ': 'O', 'ὥ': 'o', 'Ὦ': 'O', 'ὦ': 'o', 'Ὧ': 'O', 'ὧ': 'o', 'Ὰ': 'A', 'ὰ': 'a', 'Ὲ': 'E', 'ὲ': 'e', 'Ὴ': 'I', 'ὴ': 'i', 'Ὶ': 'I', 'ὶ': 'i', 'Ὸ': 'O', 'ὸ': 'o', 'Ὺ': 'Y', 'ὺ': 'y', 'Ὼ': 'O', 'ὼ': 'o', 'ᾈ': 'A', 'ᾀ': 'a', 'ᾉ': 'A', 'ᾁ': 'a', 'ᾊ': 'A', 'ᾂ': 'a', 'ᾋ': 'A', 'ᾃ': 'a', 'ᾌ': 'A', 'ᾄ': 'a', 'ᾍ': 'A', 'ᾅ': 'a', 'ᾎ': 'A', 'ᾆ': 'a', 'ᾏ': 'A', 'ᾇ': 'a', 'ᾘ': 'I', 'ᾐ': 'i', 'ᾙ': 'I', 'ᾑ': 'i', 'ᾚ': 'I', 'ᾒ': 'i', 'ᾛ': 'I', 'ᾓ': 'i', 'ᾜ': 'I', 'ᾔ': 'i', 'ᾝ': 'I', 'ᾕ': 'i', 'ᾞ': 'I', 'ᾖ': 'i', 'ᾟ': 'I', 'ᾗ': 'i', 'ᾨ': 'O', 'ᾠ': 'o', 'ᾩ': 'O', 'ᾡ': 'o', 'ᾪ': 'O', 'ᾢ': 'o', 'ᾫ': 'O', 'ᾣ': 'o', 'ᾬ': 'O', 'ᾤ': 'o', 'ᾭ': 'O', 'ᾥ': 'o', 'ᾮ': 'O', 'ᾦ': 'o', 'ᾯ': 'O', 'ᾧ': 'o', 'Ᾰ': 'A', 'ᾰ': 'a', 'Ᾱ': 'A', 'ᾱ': 'a', 'ᾲ': 'a', 'ᾼ': 'A', 'ᾳ': 'a', 'ᾴ': 'a', 'ᾶ': 'a', 'ᾷ': 'a', 'ῂ': 'i', 'ῌ': 'I', 'ῃ': 'i', 'ῄ': 'i', 'ῆ': 'i', 'ῇ': 'i', 'Ῐ': 'I', 'ῐ': 'i', 'Ῑ': 'I', 'ῑ': 'i', 'ῒ': 'i', 'ῖ': 'i', 'ῗ': 'i', 'Ῠ': 'Y', 'ῠ': 'y', 'Ῡ': 'Y', 'ῡ': 'y', 'ῢ': 'y', 'ῤ': 'r', 'Ῥ': 'R', 'ῥ': 'r', 'ῦ': 'y', 'ῧ': 'y', 'ῲ': 'o', 'ῼ': 'O', 'ῳ': 'o', 'ῴ': 'o', 'ῶ': 'o', 'ῷ': 'o', '‐': '-', '‑': '-', '‒': '-', '–': '-', '—': '-', '‘': '\\'', '’': '\\'', '‚': '\\'', '‛': '\\'', '“': '\"', '”': '\"', '„': '\"', '′': '\\'', '″': '\"', '‵': '\\'', '‶': '\"', '‸': '^', '‹': '\\'', '›': '\\'', '‼': '!!', '⁄': '/', '⁅': '[', '⁆': ']', '⁇': '??', '⁈': '?!', '⁉': '!?', '⁎': '*', '⁏': ';', '⁒': '%', '⁓': '~', '⁰': '0', 'ⁱ': 'i', '⁴': '4', '⁵': '5', '⁶': '6', '⁷': '7', '⁸': '8', '⁹': '9', '⁺': '+', '⁻': '-', '⁼': '=', '⁽': '(', '⁾': ')', 'ⁿ': 'n', '₀': '0', '₁': '1', '₂': '2', '₃': '3', '₄': '4', '₅': '5', '₆': '6', '₇': '7', '₈': '8', '₉': '9', '₊': '+', '₋': '-', '₌': '=', '₍': '(', '₎': ')', 'ₐ': 'a', 'ₑ': 'e', 'ₒ': 'o', 'ₓ': 'x', 'ₔ': 'a', 'ↄ': 'c', '①': '1', '②': '2', '③': '3', '④': '4', '⑤': '5', '⑥': '6', '⑦': '7', '⑧': '8', '⑨': '9', '⑩': '10', '⑪': '11', '⑫': '12', '⑬': '13', '⑭': '14', '⑮': '15', '⑯': '16', '⑰': '17', '⑱': '18', '⑲': '19', '⑳': '20', '⑴': '(1)', '⑵': '(2)', '⑶': '(3)', '⑷': '(4)', '⑸': '(5)', '⑹': '(6)', '⑺': '(7)', '⑻': '(8)', '⑼': '(9)', '⑽': '(10)', '⑾': '(11)', '⑿': '(12)', '⒀': '(13)', '⒁': '(14)', '⒂': '(15)', '⒃': '(16)', '⒄': '(17)', '⒅': '(18)', '⒆': '(19)', '⒇': '(20)', '⒈': '1.', '⒉': '2.', '⒊': '3.', '⒋': '4.', '⒌': '5.', '⒍': '6.', '⒎': '7.', '⒏': '8.', '⒐': '9.', '⒑': '10.', '⒒': '11.', '⒓': '12.', '⒔': '13.', '⒕': '14.', '⒖': '15.', '⒗': '16.', '⒘': '17.', '⒙': '18.', '⒚': '19.', '⒛': '20.', '⒜': '(a)', '⒝': '(b)', '⒞': '(c)', '⒟': '(d)', '⒠': '(e)', '⒡': '(f)', '⒢': '(g)', '⒣': '(h)', '⒤': '(i)', '⒥': '(j)', '⒦': '(k)', '⒧': '(l)', '⒨': '(m)', '⒩': '(n)', '⒪': '(o)', '⒫': '(p)', '⒬': '(q)', '⒭': '(r)', '⒮': '(s)', '⒯': '(t)', '⒰': '(u)', '⒱': '(v)', '⒲': '(w)', '⒳': '(x)', '⒴': '(y)', '⒵': '(z)', 'Ⓐ': 'A', 'ⓐ': 'a', 'Ⓑ': 'B', 'ⓑ': 'b', 'Ⓒ': 'C', 'ⓒ': 'c', 'Ⓓ': 'D', 'ⓓ': 'd', 'Ⓔ': 'E', 'ⓔ': 'e', 'Ⓕ': 'F', 'ⓕ': 'f', 'Ⓖ': 'G', 'ⓖ': 'g', 'Ⓗ': 'H', 'ⓗ': 'h', 'Ⓘ': 'I', 'ⓘ': 'i', 'Ⓙ': 'J', 'ⓙ': 'j', 'Ⓚ': 'K', 'ⓚ': 'k', 'Ⓛ': 'L', 'ⓛ': 'l', 'Ⓜ': 'M', 'ⓜ': 'm', 'Ⓝ': 'N', 'ⓝ': 'n', 'Ⓞ': 'O', 'ⓞ': 'o', 'Ⓟ': 'P', 'ⓟ': 'p', 'Ⓠ': 'Q', 'ⓠ': 'q', 'Ⓡ': 'R', 'ⓡ': 'r', 'Ⓢ': 'S', 'ⓢ': 's', 'Ⓣ': 'T', 'ⓣ': 't', 'Ⓤ': 'U', 'ⓤ': 'u', 'Ⓥ': 'V', 'ⓥ': 'v', 'Ⓦ': 'W', 'ⓦ': 'w', 'Ⓧ': 'X', 'ⓧ': 'x', 'Ⓨ': 'Y', 'ⓨ': 'y', 'Ⓩ': 'Z', 'ⓩ': 'z', '⓪': '0', '⓫': '11', '⓬': '12', '⓭': '13', '⓮': '14', '⓯': '15', '⓰': '16', '⓱': '17', '⓲': '18', '⓳': '19', '⓴': '20', '⓵': '1', '⓶': '2', '⓷': '3', '⓸': '4', '⓹': '5', '⓺': '6', '⓻': '7', '⓼': '8', '⓽': '9', '⓾': '10', '⓿': '0', '❛': '\\'', '❜': '\\'', '❝': '\"', '❞': '\"', '❨': '(', '❩': ')', '❪': '(', '❫': ')', '❬': '<', '❭': '>', '❮': '\"', '❯': '\"', '❰': '<', '❱': '>', '❲': '[', '❳': ']', '❴': '{', '❵': '}', '❶': '1', '❷': '2', '❸': '3', '❹': '4', '❺': '5', '❻': '6', '❼': '7', '❽': '8', '❾': '9', '❿': '10', '➀': '1', '➁': '2', '➂': '3', '➃': '4', '➄': '5', '➅': '6', '➆': '7', '➇': '8', '➈': '9', '➉': '10', '➊': '1', '➋': '2', '➌': '3', '➍': '4', '➎': '5', '➏': '6', '➐': '7', '➑': '8', '➒': '9', '➓': '10', 'Ⱡ': 'L', 'ⱡ': 'l', 'Ⱥ': 'A', 'ⱥ': 'a', 'Ⱦ': 'T', 'ⱦ': 't', 'Ⱨ': 'H', 'ⱨ': 'h', 'Ⱪ': 'K', 'ⱪ': 'k', 'Ⱬ': 'Z', 'ⱬ': 'z', 'ⱱ': 'v', 'Ⱳ': 'W', 'ⱳ': 'w', 'ⱴ': 'v', 'Ⱶ': 'H', 'ⱶ': 'h', 'ⱸ': 'e', 'ⱹ': 'r', 'ⱺ': 'o', 'ⱻ': 'E', 'ⱼ': 'j', '⸨': '((', '⸩': '))', 'Ꜩ': 'TZ', 'ꜩ': 'tz', 'ꜰ': 'F', 'ꜱ': 'S', 'Ꜳ': 'AA', 'ꜳ': 'aa', 'Ꜵ': 'AO', 'ꜵ': 'ao', 'Ꜷ': 'AU', 'ꜷ': 'au', 'Ꜹ': 'AV', 'ꜹ': 'av', 'Ꜻ': 'AV', 'ꜻ': 'av', 'Ꜽ': 'AY', 'ꜽ': 'ay', 'Ꜿ': 'C', 'ꜿ': 'c', 'Ꜿ': 'c', 'Ꝁ': 'K', 'ꝁ': 'k', 'Ꝃ': 'K', 'ꝃ': 'k', 'Ꝅ': 'K', 'ꝅ': 'k', 'Ꝇ': 'L', 'ꝇ': 'l', 'Ꝉ': 'L', 'ꝉ': 'l', 'Ꝋ': 'O', 'ꝋ': 'o', 'Ꝍ': 'O', 'ꝍ': 'o', 'Ꝏ': 'OO', 'ꝏ': 'oo', 'Ꝑ': 'P', 'ꝑ': 'p', 'Ꝓ': 'P', 'ꝓ': 'p', 'Ꝕ': 'P', 'ꝕ': 'p', 'Ꝗ': 'Q', 'ꝗ': 'q', 'Ꝙ': 'Q', 'ꝙ': 'q', 'Ꝛ': 'R', 'ꝛ': 'r', 'Ꝟ': 'V', 'ꝟ': 'v', 'Ꝡ': 'VY', 'ꝡ': 'vy', 'Ꝣ': 'Z', 'ꝣ': 'z', 'Ꝧ': 'TH', 'ꝧ': 'th', 'Ꝩ': 'V', 'Ꝫ': 'ET', 'ꝫ': 'et', 'Ꝭ': 'IS', 'ꝭ': 'is', 'ꝸ': 'um', 'Ꝺ': 'D', 'ꝺ': 'd', 'Ꝼ': 'F', 'ꝼ': 'f', 'Ꝿ': 'G', 'ꝿ': 'g', 'Ꞁ': 'L', 'ꞁ': 'l', 'Ꞃ': 'R', 'ꞃ': 'r', 'Ꞅ': 'S', 'ꞅ': 's', 'Ꞅ': 's', 'ꞅ': 'S', 'Ꞇ': 'T', 'ꞇ': 't', 'ꟻ': 'F', 'ꟼ': 'p', 'ꟽ': 'M', 'ꟾ': 'I', 'ꟿ': 'M', 'ff': 'ff', 'fi': 'fi', 'fl': 'fl', 'ffi': 'ffi', 'ffl': 'ffl', 'st': 'st', '!': '!', '"': '\"', '#': '#', '$': '$', '%': '%', '&': '&', ''': '\\'', '(': '(', ')': ')', '*': '*', '+': '+', ',': ',', '-': '-', '.': '.', '/': '/', '0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', ':': ':', ';': ';', '<': '<', '=': '=', '>': '>', '?': '?', '@': '@', '[': '[', '\': '\\\\', ']': ']', '^': '^', '_': '_', 'A': 'A', 'a': 'a', 'B': 'B', 'b': 'b', 'C': 'C', 'c': 'c', 'D': 'D', 'd': 'd', 'E': 'E', 'e': 'e', 'F': 'F', 'f': 'f', 'G': 'G', 'g': 'g', 'H': 'H', 'h': 'h', 'I': 'I', 'i': 'i', 'J': 'J', 'j': 'j', 'K': 'K', 'k': 'k', 'L': 'L', 'l': 'l', 'M': 'M', 'm': 'm', 'N': 'N', 'n': 'n', 'O': 'O', 'o': 'o', 'P': 'P', 'p': 'p', 'Q': 'Q', 'q': 'q', 'R': 'R', 'r': 'r', 'S': 'S', 's': 's', 'T': 'T', 't': 't', 'U': 'U', 'u': 'u', 'V': 'V', 'v': 'v', 'W': 'W', 'w': 'w', 'X': 'X', 'x': 'x', 'Y': 'Y', 'y': 'y', 'Z': 'Z', 'z': 'z', '{': '{', '}': '}', '~': '~' },\n // schlinkert: 1242\n schlinkert: { '«': '\"', '²': '2', '³': '3', '¹': '1', '»': '\"', 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y', 'Ā': 'A', 'ā': 'a', 'Ă': 'A', 'ă': 'a', 'Ą': 'A', 'ą': 'a', 'Ć': 'C', 'ć': 'c', 'Ĉ': 'C', 'ĉ': 'c', 'Ċ': 'C', 'ċ': 'c', 'Č': 'C', 'č': 'c', 'Ď': 'D', 'ď': 'd', 'Đ': 'D', 'đ': 'd', 'Ē': 'E', 'ē': 'e', 'Ĕ': 'E', 'ĕ': 'e', 'Ė': 'E', 'ė': 'e', 'Ę': 'E', 'ę': 'e', 'Ě': 'E', 'ě': 'e', 'Ĝ': 'G', 'ĝ': 'g', 'Ğ': 'G', 'ğ': 'g', 'Ġ': 'G', 'ġ': 'g', 'Ģ': 'G', 'ģ': 'g', 'Ĥ': 'H', 'ĥ': 'h', 'Ħ': 'H', 'ħ': 'h', 'Ĩ': 'I', 'ĩ': 'i', 'Ī': 'I', 'ī': 'i', 'Ĭ': 'I', 'ĭ': 'i', 'Į': 'I', 'į': 'i', 'İ': 'I', 'ı': 'i', 'IJ': 'IJ', 'ij': 'ij', 'Ĵ': 'J', 'ĵ': 'j', 'Ķ': 'K', 'ķ': 'k', 'ĸ': 'q', 'Ĺ': 'L', 'ĺ': 'l', 'Ļ': 'L', 'ļ': 'l', 'Ľ': 'L', 'ľ': 'l', 'Ŀ': 'L', 'ŀ': 'l', 'Ł': 'L', 'ł': 'l', 'Ń': 'N', 'ń': 'n', 'Ņ': 'N', 'ņ': 'n', 'Ň': 'N', 'ň': 'n', 'ʼn': 'n', 'Ŋ': 'N', 'ŋ': 'n', 'Ō': 'O', 'ō': 'o', 'Ŏ': 'O', 'ŏ': 'o', 'Ő': 'O', 'ő': 'o', 'Œ': 'OE', 'œ': 'oe', 'Ŕ': 'R', 'ŕ': 'r', 'Ŗ': 'R', 'ŗ': 'r', 'Ř': 'R', 'ř': 'r', 'Ś': 'S', 'ś': 's', 'Ŝ': 'S', 'ŝ': 's', 'Ş': 'S', 'ş': 's', 'Š': 'S', 'š': 's', 'Ţ': 'T', 'ţ': 't', 'Ť': 'T', 'ť': 't', 'Ŧ': 'T', 'ŧ': 't', 'Ũ': 'U', 'ũ': 'u', 'Ū': 'U', 'ū': 'u', 'Ŭ': 'U', 'ŭ': 'u', 'Ů': 'U', 'ů': 'u', 'Ű': 'U', 'ű': 'u', 'Ų': 'U', 'ų': 'u', 'Ŵ': 'W', 'ŵ': 'w', 'Ŷ': 'Y', 'ŷ': 'y', 'Ÿ': 'Y', 'Ź': 'Z', 'ź': 'z', 'Ż': 'Z', 'ż': 'z', 'Ž': 'Z', 'ž': 'z', 'ſ': 's', 'ƀ': 'b', 'Ɓ': 'B', 'Ƃ': 'B', 'ƃ': 'b', 'Ɔ': 'O', 'Ƈ': 'C', 'ƈ': 'c', 'Ɖ': 'D', 'Ɗ': 'D', 'Ƌ': 'D', 'ƌ': 'd', 'Ǝ': 'E', 'Ə': 'A', 'Ɛ': 'E', 'Ƒ': 'F', 'ƒ': 'f', 'Ɠ': 'G', 'ƕ': 'hv', 'Ɩ': 'I', 'Ɨ': 'I', 'Ƙ': 'K', 'ƙ': 'k', 'ƚ': 'l', 'Ɯ': 'M', 'Ɲ': 'N', 'ƞ': 'n', 'Ɵ': 'O', 'Ơ': 'O', 'ơ': 'o', 'Ƥ': 'P', 'ƥ': 'p', 'ƫ': 't', 'Ƭ': 'T', 'ƭ': 't', 'Ʈ': 'T', 'Ư': 'U', 'ư': 'u', 'Ʋ': 'V', 'Ƴ': 'Y', 'ƴ': 'y', 'Ƶ': 'Z', 'ƶ': 'z', 'ƿ': 'w', 'DŽ': 'DZ', 'Dž': 'Dz', 'dž': 'dz', 'LJ': 'LJ', 'Lj': 'Lj', 'lj': 'lj', 'NJ': 'NJ', 'Nj': 'Nj', 'nj': 'nj', 'Ǎ': 'A', 'ǎ': 'a', 'Ǐ': 'I', 'ǐ': 'i', 'Ǒ': 'O', 'ǒ': 'o', 'Ǔ': 'U', 'ǔ': 'u', 'Ǖ': 'U', 'ǖ': 'u', 'Ǘ': 'U', 'ǘ': 'u', 'Ǚ': 'U', 'ǚ': 'u', 'Ǜ': 'U', 'ǜ': 'u', 'ǝ': 'e', 'Ǟ': 'A', 'ǟ': 'a', 'Ǡ': 'A', 'ǡ': 'a', 'Ǣ': 'AE', 'ǣ': 'ae', 'Ǥ': 'G', 'ǥ': 'G', 'Ǧ': 'G', 'ǧ': 'G', 'Ǩ': 'K', 'ǩ': 'k', 'Ǫ': 'O', 'ǫ': 'o', 'Ǭ': 'O', 'ǭ': 'o', 'ǰ': 'j', 'DZ': 'DZ', 'Dz': 'Dz', 'dz': 'dz', 'Ǵ': 'G', 'ǵ': 'g', 'Ƕ': 'HV', 'Ƿ': 'W', 'Ǹ': 'N', 'ǹ': 'n', 'Ǻ': 'A', 'ǻ': 'a', 'Ǽ': 'AE', 'ǽ': 'ae', 'Ǿ': 'O', 'ǿ': 'o', 'Ȁ': 'A', 'ȁ': 'a', 'Ȃ': 'A', 'ȃ': 'a', 'Ȅ': 'E', 'ȅ': 'e', 'Ȇ': 'E', 'ȇ': 'e', 'Ȉ': 'I', 'ȉ': 'i', 'Ȋ': 'I', 'ȋ': 'i', 'Ȍ': 'O', 'ȍ': 'o', 'Ȏ': 'O', 'ȏ': 'o', 'Ȑ': 'R', 'ȑ': 'r', 'Ȓ': 'R', 'ȓ': 'r', 'Ȕ': 'U', 'ȕ': 'u', 'Ȗ': 'U', 'ȗ': 'u', 'Ș': 'S', 'ș': 's', 'Ț': 'T', 'ț': 't', 'Ȝ': 'Z', 'ȝ': 'z', 'Ȟ': 'H', 'ȟ': 'h', 'Ƞ': 'N', 'ȡ': 'd', 'Ȣ': 'OU', 'ȣ': 'ou', 'Ȥ': 'Z', 'ȥ': 'z', 'Ȧ': 'A', 'ȧ': 'a', 'Ȩ': 'E', 'ȩ': 'e', 'Ȫ': 'O', 'ȫ': 'o', 'Ȭ': 'O', 'ȭ': 'o', 'Ȯ': 'O', 'ȯ': 'o', 'Ȱ': 'O', 'ȱ': 'o', 'Ȳ': 'Y', 'ȳ': 'y', 'ȴ': 'l', 'ȵ': 'n', 'ȶ': 't', 'ȷ': 'j', 'ȸ': 'db', 'ȹ': 'qp', 'Ⱥ': 'A', 'Ȼ': 'C', 'ȼ': 'c', 'Ƚ': 'L', 'Ⱦ': 'T', 'ȿ': 's', 'ɀ': 'z', 'Ƀ': 'B', 'Ʉ': 'U', 'Ʌ': 'V', 'Ɇ': 'E', 'ɇ': 'e', 'Ɉ': 'J', 'ɉ': 'j', 'Ɋ': 'Q', 'ɋ': 'q', 'Ɍ': 'R', 'ɍ': 'r', 'Ɏ': 'Y', 'ɏ': 'y', 'ɐ': 'a', 'ɓ': 'b', 'ɔ': 'o', 'ɕ': 'c', 'ɖ': 'd', 'ɗ': 'd', 'ɘ': 'e', 'ə': 'a', 'ɚ': 'a', 'ɛ': 'e', 'ɜ': 'e', 'ɝ': 'e', 'ɞ': 'e', 'ɟ': 'j', 'ɠ': 'g', 'ɡ': 'g', 'ɢ': 'G', 'ɥ': 'h', 'ɦ': 'h', 'ɨ': 'i', 'ɪ': 'I', 'ɫ': 'l', 'ɬ': 'l', 'ɭ': 'l', 'ɯ': 'm', 'ɰ': 'm', 'ɱ': 'm', 'ɲ': 'n', 'ɳ': 'n', 'ɴ': 'N', 'ɵ': 'o', 'ɶ': 'OE', 'ɼ': 'r', 'ɽ': 'r', 'ɾ': 'r', 'ɿ': 'r', 'ʀ': 'R', 'ʁ': 'R', 'ʂ': 's', 'ʄ': 'j', 'ʇ': 't', 'ʈ': 't', 'ʉ': 'u', 'ʋ': 'v', 'ʌ': 'v', 'ʍ': 'w', 'ʎ': 'y', 'ʏ': 'Y', 'ʐ': 'z', 'ʑ': 'z', 'ʗ': 'C', 'ʙ': 'B', 'ʚ': 'e', 'ʛ': 'G', 'ʜ': 'H', 'ʝ': 'j', 'ʞ': 'k', 'ʟ': 'L', 'ʠ': 'q', 'ʣ': 'dz', 'ʥ': 'dz', 'ʦ': 'ts', 'ʨ': 'tc', 'ʪ': 'ls', 'ʫ': 'lz', 'ʮ': 'h', 'ʯ': 'h', 'ᴀ': 'A', 'ᴁ': 'AE', 'ᴂ': 'ae', 'ᴃ': 'B', 'ᴄ': 'C', 'ᴅ': 'D', 'ᴆ': 'D', 'ᴇ': 'E', 'ᴈ': 'e', 'ᴉ': 'i', 'ᴊ': 'J', 'ᴋ': 'K', 'ᴌ': 'L', 'ᴍ': 'M', 'ᴎ': 'N', 'ᴏ': 'O', 'ᴐ': 'O', 'ᴔ': 'oe', 'ᴕ': 'OU', 'ᴖ': 'o', 'ᴗ': 'o', 'ᴘ': 'P', 'ᴙ': 'R', 'ᴚ': 'R', 'ᴛ': 'T', 'ᴜ': 'U', 'ᴠ': 'V', 'ᴡ': 'W', 'ᴢ': 'Z', 'ᵢ': 'i', 'ᵣ': 'r', 'ᵤ': 'u', 'ᵥ': 'v', 'ᵫ': 'ue', 'ᵬ': 'b', 'ᵭ': 'd', 'ᵮ': 'f', 'ᵯ': 'm', 'ᵰ': 'n', 'ᵱ': 'p', 'ᵲ': 'r', 'ᵳ': 'r', 'ᵴ': 's', 'ᵵ': 't', 'ᵶ': 'z', 'ᵷ': 'g', 'ᵹ': 'g', 'ᵺ': 'th', 'ᵻ': 'I', 'ᵼ': 'i', 'ᵽ': 'p', 'ᵾ': 'U', 'ᶀ': 'b', 'ᶁ': 'd', 'ᶂ': 'f', 'ᶃ': 'g', 'ᶄ': 'k', 'ᶅ': 'l', 'ᶆ': 'm', 'ᶇ': 'n', 'ᶈ': 'p', 'ᶉ': 'r', 'ᶊ': 's', 'ᶌ': 'v', 'ᶍ': 'x', 'ᶎ': 'z', 'ᶏ': 'a', 'ᶑ': 'd', 'ᶒ': 'e', 'ᶓ': 'e', 'ᶔ': 'e', 'ᶕ': 'a', 'ᶖ': 'i', 'ᶗ': 'o', 'ᶙ': 'u', 'Ḁ': 'A', 'ḁ': 'a', 'Ḃ': 'B', 'ḃ': 'b', 'Ḅ': 'B', 'ḅ': 'b', 'Ḇ': 'B', 'ḇ': 'b', 'Ḉ': 'C', 'ḉ': 'c', 'Ḋ': 'D', 'ḋ': 'd', 'Ḍ': 'D', 'ḍ': 'd', 'Ḏ': 'D', 'ḏ': 'd', 'Ḑ': 'D', 'ḑ': 'd', 'Ḓ': 'D', 'ḓ': 'd', 'Ḕ': 'E', 'ḕ': 'e', 'Ḗ': 'E', 'ḗ': 'e', 'Ḙ': 'E', 'ḙ': 'e', 'Ḛ': 'E', 'ḛ': 'e', 'Ḝ': 'E', 'ḝ': 'e', 'Ḟ': 'F', 'ḟ': 'f', 'Ḡ': 'G', 'ḡ': 'g', 'Ḣ': 'H', 'ḣ': 'h', 'Ḥ': 'H', 'ḥ': 'h', 'Ḧ': 'H', 'ḧ': 'h', 'Ḩ': 'H', 'ḩ': 'h', 'Ḫ': 'H', 'ḫ': 'h', 'Ḭ': 'I', 'ḭ': 'i', 'Ḯ': 'I', 'ḯ': 'i', 'Ḱ': 'K', 'ḱ': 'k', 'Ḳ': 'K', 'ḳ': 'k', 'Ḵ': 'K', 'ḵ': 'k', 'Ḷ': 'L', 'ḷ': 'l', 'Ḹ': 'L', 'ḹ': 'l', 'Ḻ': 'L', 'ḻ': 'l', 'Ḽ': 'L', 'ḽ': 'l', 'Ḿ': 'M', 'ḿ': 'm', 'Ṁ': 'M', 'ṁ': 'm', 'Ṃ': 'M', 'ṃ': 'm', 'Ṅ': 'N', 'ṅ': 'n', 'Ṇ': 'N', 'ṇ': 'n', 'Ṉ': 'N', 'ṉ': 'n', 'Ṋ': 'N', 'ṋ': 'n', 'Ṍ': 'O', 'ṍ': 'o', 'Ṏ': 'O', 'ṏ': 'o', 'Ṑ': 'O', 'ṑ': 'o', 'Ṓ': 'O', 'ṓ': 'o', 'Ṕ': 'P', 'ṕ': 'p', 'Ṗ': 'P', 'ṗ': 'p', 'Ṙ': 'R', 'ṙ': 'r', 'Ṛ': 'R', 'ṛ': 'r', 'Ṝ': 'R', 'ṝ': 'r', 'Ṟ': 'R', 'ṟ': 'r', 'Ṡ': 'S', 'ṡ': 's', 'Ṣ': 'S', 'ṣ': 's', 'Ṥ': 'S', 'ṥ': 's', 'Ṧ': 'S', 'ṧ': 's', 'Ṩ': 'S', 'ṩ': 's', 'Ṫ': 'T', 'ṫ': 't', 'Ṭ': 'T', 'ṭ': 't', 'Ṯ': 'T', 'ṯ': 't', 'Ṱ': 'T', 'ṱ': 't', 'Ṳ': 'U', 'ṳ': 'u', 'Ṵ': 'U', 'ṵ': 'u', 'Ṷ': 'U', 'ṷ': 'u', 'Ṹ': 'U', 'ṹ': 'u', 'Ṻ': 'U', 'ṻ': 'u', 'Ṽ': 'V', 'ṽ': 'v', 'Ṿ': 'V', 'ṿ': 'v', 'Ẁ': 'W', 'ẁ': 'w', 'Ẃ': 'W', 'ẃ': 'w', 'Ẅ': 'W', 'ẅ': 'w', 'Ẇ': 'W', 'ẇ': 'w', 'Ẉ': 'W', 'ẉ': 'w', 'Ẋ': 'X', 'ẋ': 'x', 'Ẍ': 'X', 'ẍ': 'x', 'Ẏ': 'Y', 'ẏ': 'y', 'Ẑ': 'Z', 'ẑ': 'z', 'Ẓ': 'Z', 'ẓ': 'z', 'Ẕ': 'Z', 'ẕ': 'z', 'ẖ': 'h', 'ẗ': 't', 'ẘ': 'w', 'ẙ': 'y', 'ẚ': 'a', 'ẛ': 'f', 'ẜ': 's', 'ẝ': 's', 'ẞ': 'SS', 'Ạ': 'A', 'ạ': 'a', 'Ả': 'A', 'ả': 'a', 'Ấ': 'A', 'ấ': 'a', 'Ầ': 'A', 'ầ': 'a', 'Ẩ': 'A', 'ẩ': 'a', 'Ẫ': 'A', 'ẫ': 'a', 'Ậ': 'A', 'ậ': 'a', 'Ắ': 'A', 'ắ': 'a', 'Ằ': 'A', 'ằ': 'a', 'Ẳ': 'A', 'ẳ': 'a', 'Ẵ': 'A', 'ẵ': 'a', 'Ặ': 'A', 'ặ': 'a', 'Ẹ': 'E', 'ẹ': 'e', 'Ẻ': 'E', 'ẻ': 'e', 'Ẽ': 'E', 'ẽ': 'e', 'Ế': 'E', 'ế': 'e', 'Ề': 'E', 'ề': 'e', 'Ể': 'E', 'ể': 'e', 'Ễ': 'E', 'ễ': 'e', 'Ệ': 'E', 'ệ': 'e', 'Ỉ': 'I', 'ỉ': 'i', 'Ị': 'I', 'ị': 'i', 'Ọ': 'O', 'ọ': 'o', 'Ỏ': 'O', 'ỏ': 'o', 'Ố': 'O', 'ố': 'o', 'Ồ': 'O', 'ồ': 'o', 'Ổ': 'O', 'ổ': 'o', 'Ỗ': 'O', 'ỗ': 'o', 'Ộ': 'O', 'ộ': 'o', 'Ớ': 'O', 'ớ': 'o', 'Ờ': 'O', 'ờ': 'o', 'Ở': 'O', 'ở': 'o', 'Ỡ': 'O', 'ỡ': 'o', 'Ợ': 'O', 'ợ': 'o', 'Ụ': 'U', 'ụ': 'u', 'Ủ': 'U', 'ủ': 'u', 'Ứ': 'U', 'ứ': 'u', 'Ừ': 'U', 'ừ': 'u', 'Ử': 'U', 'ử': 'u', 'Ữ': 'U', 'ữ': 'u', 'Ự': 'U', 'ự': 'u', 'Ỳ': 'Y', 'ỳ': 'y', 'Ỵ': 'Y', 'ỵ': 'y', 'Ỷ': 'Y', 'ỷ': 'y', 'Ỹ': 'Y', 'ỹ': 'y', 'Ỻ': 'LL', 'ỻ': 'll', 'Ỽ': 'V', 'Ỿ': 'Y', 'ỿ': 'y', '‐': '-', '‑': '-', '‒': '-', '–': '-', '—': '-', '‘': '\\'', '’': '\\'', '‚': '\\'', '‛': '\\'', '“': '\"', '”': '\"', '„': '\"', '′': '\\'', '″': '\"', '‵': '\\'', '‶': '\"', '‸': '^', '‹': '\\'', '›': '\\'', '‼': '!!', '⁄': '/', '⁅': '[', '⁆': ']', '⁇': '??', '⁈': '?!', '⁉': '!?', '⁎': '*', '⁏': ';', '⁒': '%', '⁓': '~', '⁰': '0', 'ⁱ': 'i', '⁴': '4', '⁵': '5', '⁶': '6', '⁷': '7', '⁸': '8', '⁹': '9', '⁺': '+', '⁻': '-', '⁼': '=', '⁽': '(', '⁾': ')', 'ⁿ': 'n', '₀': '0', '₁': '1', '₂': '2', '₃': '3', '₄': '4', '₅': '5', '₆': '6', '₇': '7', '₈': '8', '₉': '9', '₊': '+', '₋': '-', '₌': '=', '₍': '(', '₎': ')', 'ₐ': 'a', 'ₑ': 'e', 'ₒ': 'o', 'ₓ': 'x', 'ₔ': 'a', 'ↄ': 'c', '①': '1', '②': '2', '③': '3', '④': '4', '⑤': '5', '⑥': '6', '⑦': '7', '⑧': '8', '⑨': '9', '⑩': '10', '⑪': '11', '⑫': '12', '⑬': '13', '⑭': '14', '⑮': '15', '⑯': '16', '⑰': '17', '⑱': '18', '⑲': '19', '⑳': '20', '⑴': '(1)', '⑵': '(2)', '⑶': '(3)', '⑷': '(4)', '⑸': '(5)', '⑹': '(6)', '⑺': '(7)', '⑻': '(8)', '⑼': '(9)', '⑽': '(10)', '⑾': '(11)', '⑿': '(12)', '⒀': '(13)', '⒁': '(14)', '⒂': '(15)', '⒃': '(16)', '⒄': '(17)', '⒅': '(18)', '⒆': '(19)', '⒇': '(20)', '⒈': '1.', '⒉': '2.', '⒊': '3.', '⒋': '4.', '⒌': '5.', '⒍': '6.', '⒎': '7.', '⒏': '8.', '⒐': '9.', '⒑': '10.', '⒒': '11.', '⒓': '12.', '⒔': '13.', '⒕': '14.', '⒖': '15.', '⒗': '16.', '⒘': '17.', '⒙': '18.', '⒚': '19.', '⒛': '20.', '⒜': '(a)', '⒝': '(b)', '⒞': '(c)', '⒟': '(d)', '⒠': '(e)', '⒡': '(f)', '⒢': '(g)', '⒣': '(h)', '⒤': '(i)', '⒥': '(j)', '⒦': '(k)', '⒧': '(l)', '⒨': '(m)', '⒩': '(n)', '⒪': '(o)', '⒫': '(p)', '⒬': '(q)', '⒭': '(r)', '⒮': '(s)', '⒯': '(t)', '⒰': '(u)', '⒱': '(v)', '⒲': '(w)', '⒳': '(x)', '⒴': '(y)', '⒵': '(z)', 'Ⓐ': 'A', 'Ⓑ': 'B', 'Ⓒ': 'C', 'Ⓓ': 'D', 'Ⓔ': 'E', 'Ⓕ': 'F', 'Ⓖ': 'G', 'Ⓗ': 'H', 'Ⓘ': 'I', 'Ⓙ': 'J', 'Ⓚ': 'K', 'Ⓛ': 'L', 'Ⓜ': 'M', 'Ⓝ': 'N', 'Ⓞ': 'O', 'Ⓟ': 'P', 'Ⓠ': 'Q', 'Ⓡ': 'R', 'Ⓢ': 'S', 'Ⓣ': 'T', 'Ⓤ': 'U', 'Ⓥ': 'V', 'Ⓦ': 'W', 'Ⓧ': 'X', 'Ⓨ': 'Y', 'Ⓩ': 'Z', 'ⓐ': 'a', 'ⓑ': 'b', 'ⓒ': 'c', 'ⓓ': 'd', 'ⓔ': 'e', 'ⓕ': 'f', 'ⓖ': 'g', 'ⓗ': 'h', 'ⓘ': 'i', 'ⓙ': 'j', 'ⓚ': 'k', 'ⓛ': 'l', 'ⓜ': 'm', 'ⓝ': 'n', 'ⓞ': 'o', 'ⓟ': 'p', 'ⓠ': 'q', 'ⓡ': 'r', 'ⓢ': 's', 'ⓣ': 't', 'ⓤ': 'u', 'ⓥ': 'v', 'ⓦ': 'w', 'ⓧ': 'x', 'ⓨ': 'y', 'ⓩ': 'z', '⓪': '0', '⓫': '11', '⓬': '12', '⓭': '13', '⓮': '14', '⓯': '15', '⓰': '16', '⓱': '17', '⓲': '18', '⓳': '19', '⓴': '20', '⓵': '1', '⓶': '2', '⓷': '3', '⓸': '4', '⓹': '5', '⓺': '6', '⓻': '7', '⓼': '8', '⓽': '9', '⓾': '10', '⓿': '0', '❛': '\\'', '❜': '\\'', '❝': '\"', '❞': '\"', '❨': '(', '❩': ')', '❪': '(', '❫': ')', '❬': '<', '❭': '>', '❮': '\"', '❯': '\"', '❰': '<', '❱': '>', '❲': '[', '❳': ']', '❴': '{', '❵': '}', '❶': '1', '❷': '2', '❸': '3', '❹': '4', '❺': '5', '❻': '6', '❼': '7', '❽': '8', '❾': '9', '❿': '10', '➀': '1', '➁': '2', '➂': '3', '➃': '4', '➄': '5', '➅': '6', '➆': '7', '➇': '8', '➈': '9', '➉': '10', '➊': '1', '➋': '2', '➌': '3', '➍': '4', '➎': '5', '➏': '6', '➐': '7', '➑': '8', '➒': '9', '➓': '10', 'Ⱡ': 'L', 'ⱡ': 'l', 'Ɫ': 'L', 'Ᵽ': 'P', 'Ɽ': 'R', 'ⱥ': 'a', 'ⱦ': 't', 'Ⱨ': 'H', 'ⱨ': 'h', 'Ⱪ': 'K', 'ⱪ': 'k', 'Ⱬ': 'Z', 'ⱬ': 'z', 'Ɱ': 'M', 'Ɐ': 'a', 'ⱱ': 'v', 'Ⱳ': 'W', 'ⱳ': 'w', 'ⱴ': 'v', 'Ⱶ': 'H', 'ⱶ': 'h', 'ⱸ': 'e', 'ⱺ': 'o', 'ⱻ': 'E', 'ⱼ': 'j', '⸨': '((', '⸩': '))', 'Ꜩ': 'TZ', 'ꜩ': 'tz', 'ꜰ': 'F', 'ꜱ': 'S', 'Ꜳ': 'AA', 'ꜳ': 'aa', 'Ꜵ': 'AO', 'ꜵ': 'ao', 'Ꜷ': 'AU', 'ꜷ': 'au', 'Ꜹ': 'AV', 'ꜹ': 'av', 'Ꜻ': 'AV', 'ꜻ': 'av', 'Ꜽ': 'AY', 'ꜽ': 'ay', 'Ꜿ': 'c', 'ꜿ': 'c', 'Ꝁ': 'K', 'ꝁ': 'k', 'Ꝃ': 'K', 'ꝃ': 'k', 'Ꝅ': 'K', 'ꝅ': 'k', 'Ꝇ': 'L', 'ꝇ': 'l', 'Ꝉ': 'L', 'ꝉ': 'l', 'Ꝋ': 'O', 'ꝋ': 'o', 'Ꝍ': 'O', 'ꝍ': 'o', 'Ꝏ': 'OO', 'ꝏ': 'oo', 'Ꝑ': 'P', 'ꝑ': 'p', 'Ꝓ': 'P', 'ꝓ': 'p', 'Ꝕ': 'P', 'ꝕ': 'p', 'Ꝗ': 'Q', 'ꝗ': 'q', 'Ꝙ': 'Q', 'ꝙ': 'q', 'Ꝛ': 'R', 'ꝛ': 'r', 'Ꝟ': 'V', 'ꝟ': 'v', 'Ꝡ': 'VY', 'ꝡ': 'vy', 'Ꝣ': 'Z', 'ꝣ': 'z', 'Ꝧ': 'TH', 'ꝧ': 'th', 'Ꝩ': 'V', 'Ꝺ': 'D', 'ꝺ': 'd', 'Ꝼ': 'F', 'ꝼ': 'f', 'Ᵹ': 'G', 'Ꝿ': 'G', 'ꝿ': 'g', 'Ꞁ': 'L', 'ꞁ': 'l', 'Ꞃ': 'R', 'ꞃ': 'r', 'Ꞅ': 's', 'ꞅ': 'S', 'Ꞇ': 'T', 'ꟻ': 'F', 'ꟼ': 'p', 'ꟽ': 'M', 'ꟾ': 'I', 'ꟿ': 'M', 'ff': 'ff', 'fi': 'fi', 'fl': 'fl', 'ffi': 'ffi', 'ffl': 'ffl', 'st': 'st', '!': '!', '"': '\"', '#': '#', '$': '$', '%': '%', '&': '&', ''': '\\'', '(': '(', ')': ')', '*': '*', '+': '+', ',': ',', '-': '-', '.': '.', '/': '/', '0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', ':': ':', ';': ';', '<': '<', '=': '=', '>': '>', '?': '?', '@': '@', 'A': 'A', 'B': 'B', 'C': 'C', 'D': 'D', 'E': 'E', 'F': 'F', 'G': 'G', 'H': 'H', 'I': 'I', 'J': 'J', 'K': 'K', 'L': 'L', 'M': 'M', 'N': 'N', 'O': 'O', 'P': 'P', 'Q': 'Q', 'R': 'R', 'S': 'S', 'T': 'T', 'U': 'U', 'V': 'V', 'W': 'W', 'X': 'X', 'Y': 'Y', 'Z': 'Z', '[': '[', '\': '\\\\', ']': ']', '^': '^', '_': '_', 'a': 'a', 'b': 'b', 'c': 'c', 'd': 'd', 'e': 'e', 'f': 'f', 'g': 'g', 'h': 'h', 'i': 'i', 'j': 'j', 'k': 'k', 'l': 'l', 'm': 'm', 'n': 'n', 'o': 'o', 'p': 'p', 'q': 'q', 'r': 'r', 's': 's', 't': 't', 'u': 'u', 'v': 'v', 'w': 'w', 'x': 'x', 'y': 'y', 'z': 'z', '{': '{', '}': '}', '~': '~' },\n // base: 892\n base: { 'Á': 'A', 'Ă': 'A', 'Ắ': 'A', 'Ặ': 'A', 'Ằ': 'A', 'Ẳ': 'A', 'Ẵ': 'A', 'Ǎ': 'A', 'Â': 'A', 'Ấ': 'A', 'Ậ': 'A', 'Ầ': 'A', 'Ẩ': 'A', 'Ẫ': 'A', 'Ä': 'A', 'Ǟ': 'A', 'Ȧ': 'A', 'Ǡ': 'A', 'Ạ': 'A', 'Ȁ': 'A', 'À': 'A', 'Ả': 'A', 'Ȃ': 'A', 'Ā': 'A', 'Ą': 'A', 'Å': 'A', 'Ǻ': 'A', 'Ḁ': 'A', 'Ⱥ': 'A', 'Ã': 'A', 'Ꜳ': 'AA', 'Æ': 'AE', 'Ǽ': 'AE', 'Ǣ': 'AE', 'Ꜵ': 'AO', 'Ꜷ': 'AU', 'Ꜹ': 'AV', 'Ꜻ': 'AV', 'Ꜽ': 'AY', 'Ḃ': 'B', 'Ḅ': 'B', 'Ɓ': 'B', 'Ḇ': 'B', 'Ƀ': 'B', 'Ƃ': 'B', 'Ć': 'C', 'Č': 'C', 'Ç': 'C', 'Ḉ': 'C', 'Ĉ': 'C', 'Ċ': 'C', 'Ƈ': 'C', 'Ȼ': 'C', 'Ď': 'D', 'Ḑ': 'D', 'Ḓ': 'D', 'Ḋ': 'D', 'Ḍ': 'D', 'Ɗ': 'D', 'Ḏ': 'D', 'Dz': 'D', 'Dž': 'D', 'Đ': 'D', 'Ƌ': 'D', 'DZ': 'DZ', 'DŽ': 'DZ', 'É': 'E', 'Ĕ': 'E', 'Ě': 'E', 'Ȩ': 'E', 'Ḝ': 'E', 'Ê': 'E', 'Ế': 'E', 'Ệ': 'E', 'Ề': 'E', 'Ể': 'E', 'Ễ': 'E', 'Ḙ': 'E', 'Ë': 'E', 'Ė': 'E', 'Ẹ': 'E', 'Ȅ': 'E', 'È': 'E', 'Ẻ': 'E', 'Ȇ': 'E', 'Ē': 'E', 'Ḗ': 'E', 'Ḕ': 'E', 'Ę': 'E', 'Ɇ': 'E', 'Ẽ': 'E', 'Ḛ': 'E', 'Ꝫ': 'ET', 'Ḟ': 'F', 'Ƒ': 'F', 'Ǵ': 'G', 'Ğ': 'G', 'Ǧ': 'G', 'Ģ': 'G', 'Ĝ': 'G', 'Ġ': 'G', 'Ɠ': 'G', 'Ḡ': 'G', 'Ǥ': 'G', 'Ḫ': 'H', 'Ȟ': 'H', 'Ḩ': 'H', 'Ĥ': 'H', 'Ⱨ': 'H', 'Ḧ': 'H', 'Ḣ': 'H', 'Ḥ': 'H', 'Ħ': 'H', 'Í': 'I', 'Ĭ': 'I', 'Ǐ': 'I', 'Î': 'I', 'Ï': 'I', 'Ḯ': 'I', 'İ': 'I', 'Ị': 'I', 'Ȉ': 'I', 'Ì': 'I', 'Ỉ': 'I', 'Ȋ': 'I', 'Ī': 'I', 'Į': 'I', 'Ɨ': 'I', 'Ĩ': 'I', 'Ḭ': 'I', 'Ꝺ': 'D', 'Ꝼ': 'F', 'Ᵹ': 'G', 'Ꞃ': 'R', 'Ꞅ': 'S', 'Ꞇ': 'T', 'Ꝭ': 'IS', 'Ĵ': 'J', 'Ɉ': 'J', 'Ḱ': 'K', 'Ǩ': 'K', 'Ķ': 'K', 'Ⱪ': 'K', 'Ꝃ': 'K', 'Ḳ': 'K', 'Ƙ': 'K', 'Ḵ': 'K', 'Ꝁ': 'K', 'Ꝅ': 'K', 'Ĺ': 'L', 'Ƚ': 'L', 'Ľ': 'L', 'Ļ': 'L', 'Ḽ': 'L', 'Ḷ': 'L', 'Ḹ': 'L', 'Ⱡ': 'L', 'Ꝉ': 'L', 'Ḻ': 'L', 'Ŀ': 'L', 'Ɫ': 'L', 'Lj': 'L', 'Ł': 'L', 'LJ': 'LJ', 'Ḿ': 'M', 'Ṁ': 'M', 'Ṃ': 'M', 'Ɱ': 'M', 'Ń': 'N', 'Ň': 'N', 'Ņ': 'N', 'Ṋ': 'N', 'Ṅ': 'N', 'Ṇ': 'N', 'Ǹ': 'N', 'Ɲ': 'N', 'Ṉ': 'N', 'Ƞ': 'N', 'Nj': 'N', 'Ñ': 'N', 'NJ': 'NJ', 'Ó': 'O', 'Ŏ': 'O', 'Ǒ': 'O', 'Ô': 'O', 'Ố': 'O', 'Ộ': 'O', 'Ồ': 'O', 'Ổ': 'O', 'Ỗ': 'O', 'Ö': 'O', 'Ȫ': 'O', 'Ȯ': 'O', 'Ȱ': 'O', 'Ọ': 'O', 'Ő': 'O', 'Ȍ': 'O', 'Ò': 'O', 'Ỏ': 'O', 'Ơ': 'O', 'Ớ': 'O', 'Ợ': 'O', 'Ờ': 'O', 'Ở': 'O', 'Ỡ': 'O', 'Ȏ': 'O', 'Ꝋ': 'O', 'Ꝍ': 'O', 'Ō': 'O', 'Ṓ': 'O', 'Ṑ': 'O', 'Ɵ': 'O', 'Ǫ': 'O', 'Ǭ': 'O', 'Ø': 'O', 'Ǿ': 'O', 'Õ': 'O', 'Ṍ': 'O', 'Ṏ': 'O', 'Ȭ': 'O', 'Ƣ': 'OI', 'Ꝏ': 'OO', 'Ɛ': 'E', 'Ɔ': 'O', 'Ȣ': 'OU', 'Ṕ': 'P', 'Ṗ': 'P', 'Ꝓ': 'P', 'Ƥ': 'P', 'Ꝕ': 'P', 'Ᵽ': 'P', 'Ꝑ': 'P', 'Ꝙ': 'Q', 'Ꝗ': 'Q', 'Ŕ': 'R', 'Ř': 'R', 'Ŗ': 'R', 'Ṙ': 'R', 'Ṛ': 'R', 'Ṝ': 'R', 'Ȑ': 'R', 'Ȓ': 'R', 'Ṟ': 'R', 'Ɍ': 'R', 'Ɽ': 'R', 'Ꜿ': 'C', 'Ǝ': 'E', 'Ś': 'S', 'Ṥ': 'S', 'Š': 'S', 'Ṧ': 'S', 'Ş': 'S', 'Ŝ': 'S', 'Ș': 'S', 'Ṡ': 'S', 'Ṣ': 'S', 'Ṩ': 'S', 'ẞ': 'SS', 'ß': 'ss', 'Ť': 'T', 'Ţ': 'T', 'Ṱ': 'T', 'Ț': 'T', 'Ⱦ': 'T', 'Ṫ': 'T', 'Ṭ': 'T', 'Ƭ': 'T', 'Ṯ': 'T', 'Ʈ': 'T', 'Ŧ': 'T', 'Ɐ': 'A', 'Ꞁ': 'L', 'Ɯ': 'M', 'Ʌ': 'V', 'Ꜩ': 'TZ', 'Ú': 'U', 'Ŭ': 'U', 'Ǔ': 'U', 'Û': 'U', 'Ṷ': 'U', 'Ü': 'U', 'Ǘ': 'U', 'Ǚ': 'U', 'Ǜ': 'U', 'Ǖ': 'U', 'Ṳ': 'U', 'Ụ': 'U', 'Ű': 'U', 'Ȕ': 'U', 'Ù': 'U', 'Ủ': 'U', 'Ư': 'U', 'Ứ': 'U', 'Ự': 'U', 'Ừ': 'U', 'Ử': 'U', 'Ữ': 'U', 'Ȗ': 'U', 'Ū': 'U', 'Ṻ': 'U', 'Ų': 'U', 'Ů': 'U', 'Ũ': 'U', 'Ṹ': 'U', 'Ṵ': 'U', 'Ꝟ': 'V', 'Ṿ': 'V', 'Ʋ': 'V', 'Ṽ': 'V', 'Ꝡ': 'VY', 'Ẃ': 'W', 'Ŵ': 'W', 'Ẅ': 'W', 'Ẇ': 'W', 'Ẉ': 'W', 'Ẁ': 'W', 'Ⱳ': 'W', 'Ẍ': 'X', 'Ẋ': 'X', 'Ý': 'Y', 'Ŷ': 'Y', 'Ÿ': 'Y', 'Ẏ': 'Y', 'Ỵ': 'Y', 'Ỳ': 'Y', 'Ƴ': 'Y', 'Ỷ': 'Y', 'Ỿ': 'Y', 'Ȳ': 'Y', 'Ɏ': 'Y', 'Ỹ': 'Y', 'Ź': 'Z', 'Ž': 'Z', 'Ẑ': 'Z', 'Ⱬ': 'Z', 'Ż': 'Z', 'Ẓ': 'Z', 'Ȥ': 'Z', 'Ẕ': 'Z', 'Ƶ': 'Z', 'IJ': 'IJ', 'Œ': 'OE', 'ᴀ': 'A', 'ᴁ': 'AE', 'ʙ': 'B', 'ᴃ': 'B', 'ᴄ': 'C', 'ᴅ': 'D', 'ᴇ': 'E', 'ꜰ': 'F', 'ɢ': 'G', 'ʛ': 'G', 'ʜ': 'H', 'ɪ': 'I', 'ʁ': 'R', 'ᴊ': 'J', 'ᴋ': 'K', 'ʟ': 'L', 'ᴌ': 'L', 'ᴍ': 'M', 'ɴ': 'N', 'ᴏ': 'O', 'ɶ': 'OE', 'ᴐ': 'O', 'ᴕ': 'OU', 'ᴘ': 'P', 'ʀ': 'R', 'ᴎ': 'N', 'ᴙ': 'R', 'ꜱ': 'S', 'ᴛ': 'T', 'ⱻ': 'E', 'ᴚ': 'R', 'ᴜ': 'U', 'ᴠ': 'V', 'ᴡ': 'W', 'ʏ': 'Y', 'ᴢ': 'Z', 'á': 'a', 'ă': 'a', 'ắ': 'a', 'ặ': 'a', 'ằ': 'a', 'ẳ': 'a', 'ẵ': 'a', 'ǎ': 'a', 'â': 'a', 'ấ': 'a', 'ậ': 'a', 'ầ': 'a', 'ẩ': 'a', 'ẫ': 'a', 'ä': 'a', 'ǟ': 'a', 'ȧ': 'a', 'ǡ': 'a', 'ạ': 'a', 'ȁ': 'a', 'à': 'a', 'ả': 'a', 'ȃ': 'a', 'ā': 'a', 'ą': 'a', 'ᶏ': 'a', 'ẚ': 'a', 'å': 'a', 'ǻ': 'a', 'ḁ': 'a', 'ⱥ': 'a', 'ã': 'a', 'ꜳ': 'aa', 'æ': 'ae', 'ǽ': 'ae', 'ǣ': 'ae', 'ꜵ': 'ao', 'ꜷ': 'au', 'ꜹ': 'av', 'ꜻ': 'av', 'ꜽ': 'ay', 'ḃ': 'b', 'ḅ': 'b', 'ɓ': 'b', 'ḇ': 'b', 'ᵬ': 'b', 'ᶀ': 'b', 'ƀ': 'b', 'ƃ': 'b', 'ɵ': 'o', 'ć': 'c', 'č': 'c', 'ç': 'c', 'ḉ': 'c', 'ĉ': 'c', 'ɕ': 'c', 'ċ': 'c', 'ƈ': 'c', 'ȼ': 'c', 'ď': 'd', 'ḑ': 'd', 'ḓ': 'd', 'ȡ': 'd', 'ḋ': 'd', 'ḍ': 'd', 'ɗ': 'd', 'ᶑ': 'd', 'ḏ': 'd', 'ᵭ': 'd', 'ᶁ': 'd', 'đ': 'd', 'ɖ': 'd', 'ƌ': 'd', 'ı': 'i', 'ȷ': 'j', 'ɟ': 'j', 'ʄ': 'j', 'dz': 'dz', 'dž': 'dz', 'é': 'e', 'ĕ': 'e', 'ě': 'e', 'ȩ': 'e', 'ḝ': 'e', 'ê': 'e', 'ế': 'e', 'ệ': 'e', 'ề': 'e', 'ể': 'e', 'ễ': 'e', 'ḙ': 'e', 'ë': 'e', 'ė': 'e', 'ẹ': 'e', 'ȅ': 'e', 'è': 'e', 'ẻ': 'e', 'ȇ': 'e', 'ē': 'e', 'ḗ': 'e', 'ḕ': 'e', 'ⱸ': 'e', 'ę': 'e', 'ᶒ': 'e', 'ɇ': 'e', 'ẽ': 'e', 'ḛ': 'e', 'ꝫ': 'et', 'ḟ': 'f', 'ƒ': 'f', 'ᵮ': 'f', 'ᶂ': 'f', 'ǵ': 'g', 'ğ': 'g', 'ǧ': 'g', 'ģ': 'g', 'ĝ': 'g', 'ġ': 'g', 'ɠ': 'g', 'ḡ': 'g', 'ᶃ': 'g', 'ǥ': 'g', 'ḫ': 'h', 'ȟ': 'h', 'ḩ': 'h', 'ĥ': 'h', 'ⱨ': 'h', 'ḧ': 'h', 'ḣ': 'h', 'ḥ': 'h', 'ɦ': 'h', 'ẖ': 'h', 'ħ': 'h', 'ƕ': 'hv', 'í': 'i', 'ĭ': 'i', 'ǐ': 'i', 'î': 'i', 'ï': 'i', 'ḯ': 'i', 'ị': 'i', 'ȉ': 'i', 'ì': 'i', 'ỉ': 'i', 'ȋ': 'i', 'ī': 'i', 'į': 'i', 'ᶖ': 'i', 'ɨ': 'i', 'ĩ': 'i', 'ḭ': 'i', 'ꝺ': 'd', 'ꝼ': 'f', 'ᵹ': 'g', 'ꞃ': 'r', 'ꞅ': 's', 'ꞇ': 't', 'ꝭ': 'is', 'ǰ': 'j', 'ĵ': 'j', 'ʝ': 'j', 'ɉ': 'j', 'ḱ': 'k', 'ǩ': 'k', 'ķ': 'k', 'ⱪ': 'k', 'ꝃ': 'k', 'ḳ': 'k', 'ƙ': 'k', 'ḵ': 'k', 'ᶄ': 'k', 'ꝁ': 'k', 'ꝅ': 'k', 'ĺ': 'l', 'ƚ': 'l', 'ɬ': 'l', 'ľ': 'l', 'ļ': 'l', 'ḽ': 'l', 'ȴ': 'l', 'ḷ': 'l', 'ḹ': 'l', 'ⱡ': 'l', 'ꝉ': 'l', 'ḻ': 'l', 'ŀ': 'l', 'ɫ': 'l', 'ᶅ': 'l', 'ɭ': 'l', 'ł': 'l', 'lj': 'lj', 'ſ': 's', 'ẜ': 's', 'ẛ': 's', 'ẝ': 's', 'ḿ': 'm', 'ṁ': 'm', 'ṃ': 'm', 'ɱ': 'm', 'ᵯ': 'm', 'ᶆ': 'm', 'ń': 'n', 'ň': 'n', 'ņ': 'n', 'ṋ': 'n', 'ȵ': 'n', 'ṅ': 'n', 'ṇ': 'n', 'ǹ': 'n', 'ɲ': 'n', 'ṉ': 'n', 'ƞ': 'n', 'ᵰ': 'n', 'ᶇ': 'n', 'ɳ': 'n', 'ñ': 'n', 'nj': 'nj', 'ó': 'o', 'ŏ': 'o', 'ǒ': 'o', 'ô': 'o', 'ố': 'o', 'ộ': 'o', 'ồ': 'o', 'ổ': 'o', 'ỗ': 'o', 'ö': 'o', 'ȫ': 'o', 'ȯ': 'o', 'ȱ': 'o', 'ọ': 'o', 'ő': 'o', 'ȍ': 'o', 'ò': 'o', 'ỏ': 'o', 'ơ': 'o', 'ớ': 'o', 'ợ': 'o', 'ờ': 'o', 'ở': 'o', 'ỡ': 'o', 'ȏ': 'o', 'ꝋ': 'o', 'ꝍ': 'o', 'ⱺ': 'o', 'ō': 'o', 'ṓ': 'o', 'ṑ': 'o', 'ǫ': 'o', 'ǭ': 'o', 'ø': 'o', 'ǿ': 'o', 'õ': 'o', 'ṍ': 'o', 'ṏ': 'o', 'ȭ': 'o', 'ƣ': 'oi', 'ꝏ': 'oo', 'ɛ': 'e', 'ᶓ': 'e', 'ɔ': 'o', 'ᶗ': 'o', 'ȣ': 'ou', 'ṕ': 'p', 'ṗ': 'p', 'ꝓ': 'p', 'ƥ': 'p', 'ᵱ': 'p', 'ᶈ': 'p', 'ꝕ': 'p', 'ᵽ': 'p', 'ꝑ': 'p', 'ꝙ': 'q', 'ʠ': 'q', 'ɋ': 'q', 'ꝗ': 'q', 'ŕ': 'r', 'ř': 'r', 'ŗ': 'r', 'ṙ': 'r', 'ṛ': 'r', 'ṝ': 'r', 'ȑ': 'r', 'ɾ': 'r', 'ᵳ': 'r', 'ȓ': 'r', 'ṟ': 'r', 'ɼ': 'r', 'ᵲ': 'r', 'ᶉ': 'r', 'ɍ': 'r', 'ɽ': 'r', 'ↄ': 'c', 'ꜿ': 'c', 'ɘ': 'e', 'ɿ': 'r', 'ś': 's', 'ṥ': 's', 'š': 's', 'ṧ': 's', 'ş': 's', 'ŝ': 's', 'ș': 's', 'ṡ': 's', 'ṣ': 's', 'ṩ': 's', 'ʂ': 's', 'ᵴ': 's', 'ᶊ': 's', 'ȿ': 's', 'ɡ': 'g', 'ᴑ': 'o', 'ᴓ': 'o', 'ᴝ': 'u', 'ť': 't', 'ţ': 't', 'ṱ': 't', 'ț': 't', 'ȶ': 't', 'ẗ': 't', 'ⱦ': 't', 'ṫ': 't', 'ṭ': 't', 'ƭ': 't', 'ṯ': 't', 'ᵵ': 't', 'ƫ': 't', 'ʈ': 't', 'ŧ': 't', 'ᵺ': 'th', 'ɐ': 'a', 'ᴂ': 'ae', 'ǝ': 'e', 'ᵷ': 'g', 'ɥ': 'h', 'ʮ': 'h', 'ʯ': 'h', 'ᴉ': 'i', 'ʞ': 'k', 'ꞁ': 'l', 'ɯ': 'm', 'ɰ': 'm', 'ᴔ': 'oe', 'ɹ': 'r', 'ɻ': 'r', 'ɺ': 'r', 'ⱹ': 'r', 'ʇ': 't', 'ʌ': 'v', 'ʍ': 'w', 'ʎ': 'y', 'ꜩ': 'tz', 'ú': 'u', 'ŭ': 'u', 'ǔ': 'u', 'û': 'u', 'ṷ': 'u', 'ü': 'u', 'ǘ': 'u', 'ǚ': 'u', 'ǜ': 'u', 'ǖ': 'u', 'ṳ': 'u', 'ụ': 'u', 'ű': 'u', 'ȕ': 'u', 'ù': 'u', 'ủ': 'u', 'ư': 'u', 'ứ': 'u', 'ự': 'u', 'ừ': 'u', 'ử': 'u', 'ữ': 'u', 'ȗ': 'u', 'ū': 'u', 'ṻ': 'u', 'ų': 'u', 'ᶙ': 'u', 'ů': 'u', 'ũ': 'u', 'ṹ': 'u', 'ṵ': 'u', 'ᵫ': 'ue', 'ꝸ': 'um', 'ⱴ': 'v', 'ꝟ': 'v', 'ṿ': 'v', 'ʋ': 'v', 'ᶌ': 'v', 'ⱱ': 'v', 'ṽ': 'v', 'ꝡ': 'vy', 'ẃ': 'w', 'ŵ': 'w', 'ẅ': 'w', 'ẇ': 'w', 'ẉ': 'w', 'ẁ': 'w', 'ⱳ': 'w', 'ẘ': 'w', 'ẍ': 'x', 'ẋ': 'x', 'ᶍ': 'x', 'ý': 'y', 'ŷ': 'y', 'ÿ': 'y', 'ẏ': 'y', 'ỵ': 'y', 'ỳ': 'y', 'ƴ': 'y', 'ỷ': 'y', 'ỿ': 'y', 'ȳ': 'y', 'ẙ': 'y', 'ɏ': 'y', 'ỹ': 'y', 'ź': 'z', 'ž': 'z', 'ẑ': 'z', 'ʑ': 'z', 'ⱬ': 'z', 'ż': 'z', 'ẓ': 'z', 'ȥ': 'z', 'ẕ': 'z', 'ᵶ': 'z', 'ᶎ': 'z', 'ʐ': 'z', 'ƶ': 'z', 'ɀ': 'z', 'ff': 'ff', 'ffi': 'ffi', 'ffl': 'ffl', 'fi': 'fi', 'fl': 'fl', 'ij': 'ij', 'œ': 'oe', 'st': 'st', 'ₐ': 'a', 'ₑ': 'e', 'ᵢ': 'i', 'ⱼ': 'j', 'ₒ': 'o', 'ᵣ': 'r', 'ᵤ': 'u', 'ᵥ': 'v', 'ₓ': 'x', 'Ё': 'YO', 'Й': 'I', 'Ц': 'TS', 'У': 'U', 'К': 'K', 'Е': 'E', 'Н': 'N', 'Г': 'G', 'Ш': 'SH', 'Щ': 'SCH', 'З': 'Z', 'Х': 'H', 'Ъ': '\\'', 'ё': 'yo', 'й': 'i', 'ц': 'ts', 'у': 'u', 'к': 'k', 'е': 'e', 'н': 'n', 'г': 'g', 'ш': 'sh', 'щ': 'sch', 'з': 'z', 'х': 'h', 'ъ': '\\'', 'Ф': 'F', 'Ы': 'I', 'В': 'V', 'А': 'a', 'П': 'P', 'Р': 'R', 'О': 'O', 'Л': 'L', 'Д': 'D', 'Ж': 'ZH', 'Э': 'E', 'ф': 'f', 'ы': 'i', 'в': 'v', 'а': 'a', 'п': 'p', 'р': 'r', 'о': 'o', 'л': 'l', 'д': 'd', 'ж': 'zh', 'э': 'e', 'Я': 'Ya', 'Ч': 'CH', 'С': 'S', 'М': 'M', 'И': 'I', 'Т': 'T', 'Ь': '\\'', 'Б': 'B', 'Ю': 'YU', 'я': 'ya', 'ч': 'ch', 'с': 's', 'м': 'm', 'и': 'i', 'т': 't', 'ь': '\\'', 'б': 'b', 'ю': 'yu' },\n // arm: 81\n arm: { 'Ա': 'A', 'ա': 'a', 'Բ': 'B', 'բ': 'b', 'Գ': 'G', 'գ': 'g', 'Դ': 'D', 'դ': 'd', 'Ե': 'E', 'ե': 'e', 'Զ': 'Z', 'զ': 'z', 'Է': 'E\\'', 'է': 'e\\'', 'Ը': 'Y\\'', 'ը': 'y\\'', 'Թ': 'T\\'', 'թ': 't\\'', 'Ժ': 'Zh', 'ժ': 'zh', 'Ի': 'I', 'ի': 'i', 'Լ': 'L', 'լ': 'l', 'Խ': 'Kh', 'խ': 'kh', 'Ծ': 'Ts\\'', 'ծ': 'ts\\'', 'Կ': 'K', 'կ': 'k', 'Հ': 'H', 'հ': 'h', 'Ձ': 'Dz', 'ձ': 'dz', 'Ղ': 'gh', 'ղ': 'gh', 'Ճ': 'Tch', 'ճ': 'tch', 'Մ': 'M', 'մ': 'm', 'Յ': 'Y', 'յ': 'y', 'Ն': 'N', 'ն': 'n', 'Շ': 'Sh', 'շ': 'sh', 'Ո': 'Vo', 'ո': 'o', 'Չ': 'Ch', 'չ': 'ch', 'Պ': 'P', 'պ': 'p', 'Ջ': 'J', 'ջ': 'j', 'Ռ': 'R', 'ռ': 'r', 'Ս': 'S', 'ս': 's', 'Վ': 'V', 'վ': 'v', 'Տ': 'T', 'տ': 't', 'Ր': 'R', 'ր': 'r', 'Ց': 'Ts', 'ց': 'ts', 'Ու': 'U', 'ՈՒ': 'U', 'ու': 'u', 'Փ': 'P', 'փ': 'p', 'Ք': 'Q', 'ք': 'q', 'Եւ': 'Ev', 'ԵՒ': 'Ev', 'եւ': 'ev', 'և': 'ev', 'Օ': 'O', 'օ': 'o', 'Ֆ': 'F', 'ֆ': 'f' },\n // bgr: 68\n bgr: { 'дж': 'dzh', 'дз': 'dz', 'ьо': 'yo', 'йо': 'yo', 'ия': 'ia', 'Ия': 'Ia', 'иЯ': 'iA', 'ИЯ': 'IA', 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ж': 'zh', 'з': 'z', 'и': 'i', 'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'h', 'ц': 'ts', 'ч': 'ch', 'ш': 'sh', 'щ': 'sht', 'ъ': 'a', 'ь': 'y', 'ю': 'yu', 'я': 'ya', 'А': 'A', 'Б': 'B', 'В': 'V', 'Г': 'G', 'Д': 'D', 'Е': 'E', 'Ж': 'Zh', 'З': 'Z', 'И': 'I', 'Й': 'Y', 'К': 'K', 'Л': 'L', 'М': 'M', 'Н': 'N', 'О': 'O', 'П': 'P', 'Р': 'R', 'С': 'S', 'Т': 'T', 'У': 'U', 'Ф': 'F', 'Х': 'H', 'Ц': 'Ts', 'Ч': 'Ch', 'Ш': 'SH', 'Щ': 'Sht', 'Ъ': 'A', 'Ь': 'Y', 'Ю': 'Yu', 'Я': 'Ya' },\n // kaz: 18\n kaz: { 'Ә': 'A\\'', 'ә': 'a\\'', 'Ғ': 'Gh', 'ғ': 'gh', 'Қ': 'Q', 'қ': 'q', 'Ң': 'Nh', 'ң': 'nh', 'Ө': 'O\\'', 'ө': 'o\\'', 'Ұ': 'U', 'ұ': 'u', 'Ү': 'U\\'', 'ү': 'u\\'', 'Һ': 'H\\'', 'һ': 'h\\'', 'І': 'I', 'і': 'i' },\n // deu: 8\n deu: { 'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue', 'ä': 'ae', 'ö': 'oe', 'ü': 'ue', 'ß': 'ss', 'ẞ': 'SS' },\n // cyrillic: 75\n cyrillic: { 'А': 'A', 'а': 'a', 'Б': 'B', 'б': 'b', 'В': 'V', 'в': 'v', 'Г': 'G', 'г': 'g', 'Ґ': 'G', 'ґ': 'g', 'Д': 'D', 'д': 'd', 'Е': 'E', 'е': 'e', 'Ё': 'E', 'ё': 'e', 'Є': 'Ye', 'є': 'ie', 'Ж': 'Zh', 'ж': 'zh', 'З': 'Z', 'з': 'z', 'И': 'Y', 'и': 'y', 'І': 'I', 'і': 'i', 'Ї': 'Yi', 'ї': 'i', 'Й': 'Y', 'й': 'i', 'К': 'K', 'к': 'k', 'Л': 'L', 'л': 'l', 'М': 'M', 'м': 'm', 'Н': 'N', 'н': 'n', 'О': 'O', 'о': 'o', 'П': 'P', 'п': 'p', 'Р': 'R', 'р': 'r', 'С': 'S', 'с': 's', 'Т': 'T', 'т': 't', 'У': 'U', 'у': 'u', 'Ф': 'F', 'ф': 'f', 'Х': 'Kh', 'х': 'kh', 'Ц': 'Ts', 'ц': 'ts', 'Ч': 'Ch', 'ч': 'ch', 'Ш': 'Sh', 'ш': 'sh', 'Щ': 'Shch', 'щ': 'shch', 'Ы': 'Y', 'ы': 'y', 'Э': 'E', 'э': 'e', 'Ю': 'Yu', 'ю': 'iu', 'Я': 'Ya', 'я': 'ia', 'Ь': '', 'ь': '', 'Ъ': '', 'ъ': '', '\\'': '' },\n // nonroman: 559\n nonroman: { 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'ж': 'zh', 'з': 'z', 'и': 'i', 'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'h', 'ц': 'ts', 'ч': 'ch', 'ш': 'sh', 'щ': 'sch', 'ъ': '\\'', 'ы': 'y', 'ь': '\\'', 'э': 'e', 'ю': 'yu', 'я': 'ya', 'А': 'A', 'Б': 'B', 'В': 'V', 'Г': 'G', 'Д': 'D', 'Е': 'E', 'Ё': 'Yo', 'Ж': 'Zh', 'З': 'Z', 'И': 'I', 'Й': 'Y', 'К': 'K', 'Л': 'L', 'М': 'M', 'Н': 'N', 'О': 'O', 'П': 'P', 'Р': 'R', 'С': 'S', 'Т': 'T', 'У': 'U', 'Ф': 'F', 'Х': 'H', 'Ц': 'Ts', 'Ч': 'Ch', 'Ш': 'Sh', 'Щ': 'Sch', 'Ъ': '\\'', 'Ы': 'Y', 'Ь': '\\'', 'Э': 'E', 'Ю': 'Yu', 'Я': 'Ya', 'IJ': 'IJ', 'Ö': 'O', 'Œ': 'O', 'Ü': 'U', 'ä': 'ae', 'æ': 'ae', 'ij': 'ij', 'ö': 'o', 'œ': 'oe', 'ü': 'u', 'ß': 'ss', 'ſ': 'ss', 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ā': 'A', 'Ą': 'A', 'Ă': 'A', 'Ç': 'C', 'Ć': 'C', 'Č': 'C', 'Ĉ': 'C', 'Ċ': 'C', 'Ď': 'D', 'Đ': 'D', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ē': 'E', 'Ę': 'E', 'Ě': 'E', 'Ĕ': 'E', 'Ė': 'E', 'Ĝ': 'G', 'Ğ': 'G', 'Ġ': 'G', 'Ģ': 'G', 'Ĥ': 'H', 'Ħ': 'H', 'Ì': 'I', 'Í': 'I', 'Î': 'I', 'Ï': 'I', 'Ī': 'I', 'Ĩ': 'I', 'Ĭ': 'I', 'Į': 'I', 'İ': 'I', 'Ĵ': 'J', 'Ķ': 'K', 'Ľ': 'K', 'Ĺ': 'K', 'Ļ': 'K', 'Ŀ': 'K', 'Ł': 'L', 'Ñ': 'N', 'Ń': 'N', 'Ň': 'N', 'Ņ': 'N', 'Ŋ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ø': 'O', 'Ō': 'O', 'Ő': 'O', 'Ŏ': 'O', 'Ŕ': 'R', 'Ř': 'R', 'Ŗ': 'R', 'Ś': 'S', 'Ş': 'S', 'Ŝ': 'S', 'Ș': 'S', 'Š': 'S', 'Ť': 'T', 'Ţ': 'T', 'Ŧ': 'T', 'Ț': 'T', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ū': 'U', 'Ů': 'U', 'Ű': 'U', 'Ŭ': 'U', 'Ũ': 'U', 'Ų': 'U', 'Ŵ': 'W', 'Ŷ': 'Y', 'Ÿ': 'Y', 'Ý': 'Y', 'Ź': 'Z', 'Ż': 'Z', 'Ž': 'Z', 'à': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ā': 'a', 'ą': 'a', 'ă': 'a', 'å': 'a', 'ç': 'c', 'ć': 'c', 'č': 'c', 'ĉ': 'c', 'ċ': 'c', 'ď': 'd', 'đ': 'd', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', 'ē': 'e', 'ę': 'e', 'ě': 'e', 'ĕ': 'e', 'ė': 'e', 'ƒ': 'f', 'ĝ': 'g', 'ğ': 'g', 'ġ': 'g', 'ģ': 'g', 'ĥ': 'h', 'ħ': 'h', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ī': 'i', 'ĩ': 'i', 'ĭ': 'i', 'į': 'i', 'ı': 'i', 'ĵ': 'j', 'ķ': 'k', 'ĸ': 'k', 'ł': 'l', 'ľ': 'l', 'ĺ': 'l', 'ļ': 'l', 'ŀ': 'l', 'ñ': 'n', 'ń': 'n', 'ň': 'n', 'ņ': 'n', 'ʼn': 'n', 'ŋ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ø': 'o', 'ō': 'o', 'ő': 'o', 'ŏ': 'o', 'ŕ': 'r', 'ř': 'r', 'ŗ': 'r', 'ś': 's', 'ş': 's', 'š': 's', 'ť': 't', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ū': 'u', 'ů': 'u', 'ű': 'u', 'ŭ': 'u', 'ũ': 'u', 'ų': 'u', 'ŵ': 'w', 'ÿ': 'y', 'ý': 'y', 'ŷ': 'y', 'ż': 'z', 'ź': 'z', 'ž': 'z', 'Α': 'A', 'Ά': 'A', 'Ἀ': 'A', 'Ἁ': 'A', 'Ἂ': 'A', 'Ἃ': 'A', 'Ἄ': 'A', 'Ἅ': 'A', 'Ἆ': 'A', 'Ἇ': 'A', 'ᾈ': 'A', 'ᾉ': 'A', 'ᾊ': 'A', 'ᾋ': 'A', 'ᾌ': 'A', 'ᾍ': 'A', 'ᾎ': 'A', 'ᾏ': 'A', 'Ᾰ': 'A', 'Ᾱ': 'A', 'Ὰ': 'A', 'ᾼ': 'A', 'Β': 'B', 'Γ': 'G', 'Δ': 'D', 'Ε': 'E', 'Έ': 'E', 'Ἐ': 'E', 'Ἑ': 'E', 'Ἒ': 'E', 'Ἓ': 'E', 'Ἔ': 'E', 'Ἕ': 'E', 'Ὲ': 'E', 'Ζ': 'Z', 'Η': 'I', 'Ή': 'I', 'Ἠ': 'I', 'Ἡ': 'I', 'Ἢ': 'I', 'Ἣ': 'I', 'Ἤ': 'I', 'Ἥ': 'I', 'Ἦ': 'I', 'Ἧ': 'I', 'ᾘ': 'I', 'ᾙ': 'I', 'ᾚ': 'I', 'ᾛ': 'I', 'ᾜ': 'I', 'ᾝ': 'I', 'ᾞ': 'I', 'ᾟ': 'I', 'Ὴ': 'I', 'ῌ': 'I', 'Θ': 'T', 'Ι': 'I', 'Ί': 'I', 'Ϊ': 'I', 'Ἰ': 'I', 'Ἱ': 'I', 'Ἲ': 'I', 'Ἳ': 'I', 'Ἴ': 'I', 'Ἵ': 'I', 'Ἶ': 'I', 'Ἷ': 'I', 'Ῐ': 'I', 'Ῑ': 'I', 'Ὶ': 'I', 'Κ': 'K', 'Λ': 'L', 'Μ': 'M', 'Ν': 'N', 'Ξ': 'K', 'Ο': 'O', 'Ό': 'O', 'Ὀ': 'O', 'Ὁ': 'O', 'Ὂ': 'O', 'Ὃ': 'O', 'Ὄ': 'O', 'Ὅ': 'O', 'Ὸ': 'O', 'Π': 'P', 'Ρ': 'R', 'Ῥ': 'R', 'Σ': 'S', 'Τ': 'T', 'Υ': 'Y', 'Ύ': 'Y', 'Ϋ': 'Y', 'Ὑ': 'Y', 'Ὓ': 'Y', 'Ὕ': 'Y', 'Ὗ': 'Y', 'Ῠ': 'Y', 'Ῡ': 'Y', 'Ὺ': 'Y', 'Φ': 'F', 'Χ': 'X', 'Ψ': 'P', 'Ω': 'O', 'Ώ': 'O', 'Ὠ': 'O', 'Ὡ': 'O', 'Ὢ': 'O', 'Ὣ': 'O', 'Ὤ': 'O', 'Ὥ': 'O', 'Ὦ': 'O', 'Ὧ': 'O', 'ᾨ': 'O', 'ᾩ': 'O', 'ᾪ': 'O', 'ᾫ': 'O', 'ᾬ': 'O', 'ᾭ': 'O', 'ᾮ': 'O', 'ᾯ': 'O', 'Ὼ': 'O', 'ῼ': 'O', 'α': 'a', 'ά': 'a', 'ἀ': 'a', 'ἁ': 'a', 'ἂ': 'a', 'ἃ': 'a', 'ἄ': 'a', 'ἅ': 'a', 'ἆ': 'a', 'ἇ': 'a', 'ᾀ': 'a', 'ᾁ': 'a', 'ᾂ': 'a', 'ᾃ': 'a', 'ᾄ': 'a', 'ᾅ': 'a', 'ᾆ': 'a', 'ᾇ': 'a', 'ὰ': 'a', 'ᾰ': 'a', 'ᾱ': 'a', 'ᾲ': 'a', 'ᾳ': 'a', 'ᾴ': 'a', 'ᾶ': 'a', 'ᾷ': 'a', 'β': 'b', 'γ': 'g', 'δ': 'd', 'ε': 'e', 'έ': 'e', 'ἐ': 'e', 'ἑ': 'e', 'ἒ': 'e', 'ἓ': 'e', 'ἔ': 'e', 'ἕ': 'e', 'ὲ': 'e', 'ζ': 'z', 'η': 'i', 'ή': 'i', 'ἠ': 'i', 'ἡ': 'i', 'ἢ': 'i', 'ἣ': 'i', 'ἤ': 'i', 'ἥ': 'i', 'ἦ': 'i', 'ἧ': 'i', 'ᾐ': 'i', 'ᾑ': 'i', 'ᾒ': 'i', 'ᾓ': 'i', 'ᾔ': 'i', 'ᾕ': 'i', 'ᾖ': 'i', 'ᾗ': 'i', 'ὴ': 'i', 'ῂ': 'i', 'ῃ': 'i', 'ῄ': 'i', 'ῆ': 'i', 'ῇ': 'i', 'θ': 't', 'ι': 'i', 'ί': 'i', 'ϊ': 'i', 'ΐ': 'i', 'ἰ': 'i', 'ἱ': 'i', 'ἲ': 'i', 'ἳ': 'i', 'ἴ': 'i', 'ἵ': 'i', 'ἶ': 'i', 'ἷ': 'i', 'ὶ': 'i', 'ῐ': 'i', 'ῑ': 'i', 'ῒ': 'i', 'ῖ': 'i', 'ῗ': 'i', 'κ': 'k', 'λ': 'l', 'μ': 'm', 'ν': 'n', 'ξ': 'k', 'ο': 'o', 'ό': 'o', 'ὀ': 'o', 'ὁ': 'o', 'ὂ': 'o', 'ὃ': 'o', 'ὄ': 'o', 'ὅ': 'o', 'ὸ': 'o', 'π': 'p', 'ρ': 'r', 'ῤ': 'r', 'ῥ': 'r', 'σ': 's', 'ς': 's', 'τ': 't', 'υ': 'y', 'ύ': 'y', 'ϋ': 'y', 'ΰ': 'y', 'ὐ': 'y', 'ὑ': 'y', 'ὒ': 'y', 'ὓ': 'y', 'ὔ': 'y', 'ὕ': 'y', 'ὖ': 'y', 'ὗ': 'y', 'ὺ': 'y', 'ῠ': 'y', 'ῡ': 'y', 'ῢ': 'y', 'ῦ': 'y', 'ῧ': 'y', 'φ': 'f', 'χ': 'x', 'ψ': 'p', 'ω': 'o', 'ώ': 'o', 'ὠ': 'o', 'ὡ': 'o', 'ὢ': 'o', 'ὣ': 'o', 'ὤ': 'o', 'ὥ': 'o', 'ὦ': 'o', 'ὧ': 'o', 'ᾠ': 'o', 'ᾡ': 'o', 'ᾢ': 'o', 'ᾣ': 'o', 'ᾤ': 'o', 'ᾥ': 'o', 'ᾦ': 'o', 'ᾧ': 'o', 'ὼ': 'o', 'ῲ': 'o', 'ῳ': 'o', 'ῴ': 'o', 'ῶ': 'o', 'ῷ': 'o', 'ð': 'd', 'Ð': 'D', 'þ': 't', 'Þ': 'T', 'ა': 'a', 'ბ': 'b', 'გ': 'g', 'დ': 'd', 'ე': 'e', 'ვ': 'v', 'ზ': 'z', 'თ': 't', 'ი': 'i', 'კ': 'k', 'ლ': 'l', 'მ': 'm', 'ნ': 'n', 'ო': 'o', 'პ': 'p', 'ჟ': 'z', 'რ': 'r', 'ს': 's', 'ტ': 't', 'უ': 'u', 'ფ': 'p', 'ქ': 'k', 'ღ': 'g', 'ყ': 'q', 'შ': 's', 'ჩ': 'c', 'ც': 't', 'ძ': 'd', 'წ': 't', 'ჭ': 'c', 'ხ': 'k', 'ჯ': 'j', 'ჰ': 'h' },\n // gostb: 99\n gostb: { 'А': 'A', 'а': 'а', 'Б': 'B', 'б': 'b', 'В': 'V', 'в': 'v', 'Г': 'G', 'г': 'g', 'Ѓ': 'G`', 'ѓ': 'g`', 'Ґ': 'G`', 'ґ': 'g`', 'Д': 'D', 'д': 'd', 'Е': 'E', 'е': 'e', 'Ё': 'Yo', 'ё': 'yo', 'Є': 'Ye', 'є': 'ye', 'Ж': 'Zh', 'ж': 'zh', 'З': 'Z', 'з': 'z', 'S': 'Z`', 'ѕ': 'z`', 'И': 'I', 'и': 'i', 'Й': 'J', 'й': 'j', 'J': 'J', 'ј': 'j', 'I': 'I`', 'і': 'i`', 'Ї': 'Yi', 'ї': 'yi', 'К': 'K', 'к': 'k', 'Ќ': 'K`', 'ќ': 'k`', 'Л': 'L', 'л': 'l', 'Љ': 'L`', 'љ': 'l`', 'М': 'M', 'м': 'm', 'Н': 'N', 'н': 'n', 'Њ': 'N`', 'њ': 'n`', 'О': 'O', 'о': 'о', 'П': 'P', 'п': 'p', 'Р': 'R', 'р': 'r', 'С': 'S', 'с': 's', 'Т': 'T', 'т': 't', 'У': 'U', 'у': 'u', 'Ў': 'U`', 'ў': 'u`', 'Ф': 'F', 'ф': 'f', 'Х': 'X', 'х': 'x', 'Ц': 'Cz', 'ц': 'cz', 'Ч': 'Ch', 'ч': 'ch', 'Џ': 'Dh', 'џ': 'dh', 'Ш': 'Sh', 'ш': 'sh', 'Щ': 'Shh', 'щ': 'shh', 'Ъ': 'A`', 'ъ': 'a`', 'Ы': 'Y`', 'ы': 'y`', 'Ь': '`', 'ь': '`', 'Э': 'E`', 'э': 'e`', 'Ю': 'Yu', 'ю': 'yu', 'Я': 'Ya', 'я': 'уа', '’': '\\'', 'Ѣ': 'Ye', 'ѣ': 'уе', 'Ѳ': 'Fh', 'ѳ': 'fh', 'Ѵ': 'Yh', 'ѵ': 'yh', 'Ѫ': 'O`', 'ѫ': 'о`' },\n reference: {},\n characters: {}\n };\n\n const reference = [\n { 'base': ' ', 'letters': '\\u00A0' },\n { 'base': 'A', 'letters': '\\u0041\\u24B6\\uFF21\\u00C0\\u00C1\\u00C2\\u1EA6\\u1EA4\\u1EAA\\u1EA8\\u00C3\\u0100\\u0102\\u1EB0\\u1EAE\\u1EB4\\u1EB2\\u0226\\u01E0\\u00C4\\u01DE\\u1EA2\\u00C5\\u01FA\\u01CD\\u0200\\u0202\\u1EA0\\u1EAC\\u1EB6\\u1E00\\u0104\\u023A\\u2C6F' },\n { 'base': 'a', 'letters': '\\u0061\\u24D0\\uFF41\\u1E9A\\u00E0\\u00E1\\u00E2\\u1EA7\\u1EA5\\u1EAB\\u1EA9\\u00E3\\u0101\\u0103\\u1EB1\\u1EAF\\u1EB5\\u1EB3\\u0227\\u01E1\\u00E4\\u01DF\\u1EA3\\u00E5\\u01FB\\u01CE\\u0201\\u0203\\u1EA1\\u1EAD\\u1EB7\\u1E01\\u0105\\u2C65\\u0250\\u0251' },\n { 'base': 'AA', 'letters': '\\uA732' },\n { 'base': 'aa', 'letters': '\\uA733' },\n { 'base': 'AE', 'letters': '\\u00C6\\u01FC\\u01E2' },\n { 'base': 'ae', 'letters': '\\u00E6\\u01FD\\u01E3' },\n { 'base': 'AO', 'letters': '\\uA734' },\n { 'base': 'ao', 'letters': '\\uA735' },\n { 'base': 'AU', 'letters': '\\uA736' },\n { 'base': 'au', 'letters': '\\uA737' },\n { 'base': 'AV', 'letters': '\\uA738\\uA73A' },\n { 'base': 'av', 'letters': '\\uA739\\uA73B' },\n { 'base': 'AY', 'letters': '\\uA73C' },\n { 'base': 'ay', 'letters': '\\uA73D' },\n { 'base': 'B', 'letters': '\\u0042\\u24B7\\uFF22\\u1E02\\u1E04\\u1E06\\u0243\\u0182\\u0181' },\n { 'base': 'b', 'letters': '\\u0062\\u24D1\\uFF42\\u1E03\\u1E05\\u1E07\\u0180\\u0183\\u0253' },\n { 'base': 'C', 'letters': '\\u0043\\u24B8\\uFF23\\u0106\\u0108\\u010A\\u010C\\u00C7\\u1E08\\u0187\\u023B\\uA73E' },\n { 'base': 'c', 'letters': '\\u0063\\u24D2\\uFF43\\u0107\\u0109\\u010B\\u010D\\u00E7\\u1E09\\u0188\\u023C\\uA73F\\u2184' },\n { 'base': 'D', 'letters': '\\u00D0\\u0044\\u24B9\\uFF24\\u1E0A\\u010E\\u1E0C\\u1E10\\u1E12\\u1E0E\\u0110\\u018B\\u018A\\u0189\\uA779' },\n { 'base': 'd', 'letters': '\\u00F0\\u0064\\u24D3\\uFF44\\u1E0B\\u010F\\u1E0D\\u1E11\\u1E13\\u1E0F\\u0111\\u018C\\u0256\\u0257\\uA77A' },\n { 'base': 'DZ', 'letters': '\\u01F1\\u01C4' },\n { 'base': 'Dz', 'letters': '\\u01F2\\u01C5' },\n { 'base': 'dz', 'letters': '\\u01F3\\u01C6' },\n { 'base': 'E', 'letters': '\\u0045\\u24BA\\uFF25\\u00C8\\u00C9\\u00CA\\u1EC0\\u1EBE\\u1EC4\\u1EC2\\u1EBC\\u0112\\u1E14\\u1E16\\u0114\\u0116\\u00CB\\u1EBA\\u011A\\u0204\\u0206\\u1EB8\\u1EC6\\u0228\\u1E1C\\u0118\\u1E18\\u1E1A\\u0190\\u018E' },\n { 'base': 'e', 'letters': '\\u0065\\u24D4\\uFF45\\u00E8\\u00E9\\u00EA\\u1EC1\\u1EBF\\u1EC5\\u1EC3\\u1EBD\\u0113\\u1E15\\u1E17\\u0115\\u0117\\u00EB\\u1EBB\\u011B\\u0205\\u0207\\u1EB9\\u1EC7\\u0229\\u1E1D\\u0119\\u1E19\\u1E1B\\u0247\\u025B\\u01DD' },\n { 'base': 'F', 'letters': '\\u0046\\u24BB\\uFF26\\u1E1E\\u0191\\uA77B' },\n { 'base': 'f', 'letters': '\\u0066\\u24D5\\uFF46\\u1E1F\\u0192\\uA77C' },\n { 'base': 'ff', 'letters': '\\uFB00' },\n { 'base': 'ffi', 'letters': '\\uFB03' },\n { 'base': 'ffl', 'letters': '\\uFB04' },\n { 'base': 'fi', 'letters': '\\uFB01' },\n { 'base': 'fl', 'letters': '\\uFB02' },\n { 'base': 'ft', 'letters': '\\uFB05' },\n { 'base': 'G', 'letters': '\\u0047\\u24BC\\uFF27\\u01F4\\u011C\\u1E20\\u011E\\u0120\\u01E6\\u0122\\u01E4\\u0193\\uA7A0\\uA77D\\uA77E' },\n { 'base': 'g', 'letters': '\\u0067\\u24D6\\uFF47\\u01F5\\u011D\\u1E21\\u011F\\u0121\\u01E7\\u0123\\u01E5\\u0260\\uA7A1\\u1D79\\uA77F' },\n { 'base': 'H', 'letters': '\\u0048\\u24BD\\uFF28\\u0124\\u1E22\\u1E26\\u021E\\u1E24\\u1E28\\u1E2A\\u0126\\u2C67\\u2C75\\uA78D' },\n { 'base': 'h', 'letters': '\\u0068\\u24D7\\uFF48\\u0125\\u1E23\\u1E27\\u021F\\u1E25\\u1E29\\u1E2B\\u1E96\\u0127\\u2C68\\u2C76\\u0265' },\n { 'base': 'hv', 'letters': '\\u0195' },\n { 'base': 'I', 'letters': '\\u0049\\u24BE\\uFF29\\u00CC\\u00CD\\u00CE\\u0128\\u012A\\u012C\\u0130\\u00CF\\u1E2E\\u1EC8\\u01CF\\u0208\\u020A\\u1ECA\\u012E\\u1E2C\\u0197' },\n { 'base': 'i', 'letters': '\\u0069\\u24D8\\uFF49\\u00EC\\u00ED\\u00EE\\u0129\\u012B\\u012D\\u00EF\\u1E2F\\u1EC9\\u01D0\\u0209\\u020B\\u1ECB\\u012F\\u1E2D\\u0268\\u0131' },\n { 'base': 'IJ', 'letters': '\\u0132' },\n { 'base': 'ij', 'letters': '\\u0133' },\n { 'base': 'J', 'letters': '\\u004A\\u24BF\\uFF2A\\u0134\\u0248' },\n { 'base': 'j', 'letters': '\\u006A\\u24D9\\uFF4A\\u0135\\u01F0\\u0249' },\n { 'base': 'K', 'letters': '\\u004B\\u24C0\\uFF2B\\u1E30\\u01E8\\u1E32\\u0136\\u1E34\\u0198\\u2C69\\uA740\\uA742\\uA744\\uA7A2' },\n { 'base': 'k', 'letters': '\\u006B\\u24DA\\uFF4B\\u1E31\\u01E9\\u1E33\\u0137\\u1E35\\u0199\\u2C6A\\uA741\\uA743\\uA745\\uA7A3' },\n { 'base': 'L', 'letters': '\\u004C\\u24C1\\uFF2C\\u013F\\u0139\\u013D\\u1E36\\u1E38\\u013B\\u1E3C\\u1E3A\\u0141\\u023D\\u2C62\\u2C60\\uA748\\uA746\\uA780' },\n { 'base': 'l', 'letters': '\\u006C\\u24DB\\uFF4C\\u0140\\u013A\\u013E\\u1E37\\u1E39\\u013C\\u1E3D\\u1E3B\\u017F\\u0142\\u019A\\u026B\\u2C61\\uA749\\uA781\\uA747' },\n { 'base': 'LJ', 'letters': '\\u01C7' },\n { 'base': 'Lj', 'letters': '\\u01C8' },\n { 'base': 'lj', 'letters': '\\u01C9' },\n { 'base': 'M', 'letters': '\\u004D\\u24C2\\uFF2D\\u1E3E\\u1E40\\u1E42\\u2C6E\\u019C' },\n { 'base': 'm', 'letters': '\\u006D\\u24DC\\uFF4D\\u1E3F\\u1E41\\u1E43\\u0271\\u026F' },\n { 'base': 'N', 'letters': '\\u004E\\u24C3\\uFF2E\\u01F8\\u0143\\u00D1\\u1E44\\u0147\\u1E46\\u0145\\u1E4A\\u1E48\\u0220\\u019D\\uA790\\uA7A4' },\n { 'base': 'n', 'letters': '\\x6E\\xF1\\u006E\\u24DD\\uFF4E\\u01F9\\u0144\\u00F1\\u1E45\\u0148\\u1E47\\u0146\\u1E4B\\u1E49\\u019E\\u0272\\u0149\\uA791\\uA7A5\\u043B\\u0509' },\n { 'base': 'NJ', 'letters': '\\u01CA' },\n { 'base': 'Nj', 'letters': '\\u01CB' },\n { 'base': 'nj', 'letters': '\\u01CC' },\n { 'base': 'O', 'letters': '\\u004F\\u24C4\\uFF2F\\u00D2\\u00D3\\u00D4\\u1ED2\\u1ED0\\u1ED6\\u1ED4\\u00D5\\u1E4C\\u022C\\u1E4E\\u014C\\u1E50\\u1E52\\u014E\\u022E\\u0230\\u00D6\\u022A\\u1ECE\\u0150\\u01D1\\u020C\\u020E\\u01A0\\u1EDC\\u1EDA\\u1EE0\\u1EDE\\u1EE2\\u1ECC\\u1ED8\\u01EA\\u01EC\\u00D8\\u01FE\\u0186\\u019F\\uA74A\\uA74C' },\n { 'base': 'o', 'letters': '\\u07C0\\u006F\\u24DE\\uFF4F\\u00F2\\u00F3\\u00F4\\u1ED3\\u1ED1\\u1ED7\\u1ED5\\u00F5\\u1E4D\\u022D\\u1E4F\\u014D\\u1E51\\u1E53\\u014F\\u022F\\u0231\\u00F6\\u022B\\u1ECF\\u0151\\u01D2\\u020D\\u020F\\u01A1\\u1EDD\\u1EDB\\u1EE1\\u1EDF\\u1EE3\\u1ECD\\u1ED9\\u01EB\\u01ED\\u00F8\\u01FF\\u0254\\uA74B\\uA74D\\u0275' },\n { 'base': 'OE', 'letters': '\\u008C\\u0152' },\n { 'base': 'oe', 'letters': '\\u009C\\u0152\\u0153' },\n { 'base': 'OI', 'letters': '\\u01A2' },\n { 'base': 'oi', 'letters': '\\u01A3' },\n { 'base': 'OO', 'letters': '\\uA74E' },\n { 'base': 'oo', 'letters': '\\uA74F' },\n { 'base': 'OU', 'letters': '\\u0222' },\n { 'base': 'ou', 'letters': '\\u0223' },\n { 'base': 'P', 'letters': '\\u0050\\u24C5\\uFF30\\u1E54\\u1E56\\u01A4\\u2C63\\uA750\\uA752\\uA754' },\n { 'base': 'p', 'letters': '\\u0070\\u24DF\\uFF50\\u1E55\\u1E57\\u01A5\\u1D7D\\uA751\\uA753\\uA755' },\n { 'base': 'Q', 'letters': '\\u0051\\u24C6\\uFF31\\uA756\\uA758\\u024A' },\n { 'base': 'q', 'letters': '\\u0071\\u24E0\\uFF51\\u024B\\uA757\\uA759' },\n { 'base': 'R', 'letters': '\\u0052\\u24C7\\uFF32\\u0154\\u1E58\\u0158\\u0210\\u0212\\u1E5A\\u1E5C\\u0156\\u1E5E\\u024C\\u2C64\\uA75A\\uA7A6\\uA782' },\n { 'base': 'r', 'letters': '\\u0072\\u24E1\\uFF52\\u0155\\u1E59\\u0159\\u0211\\u0213\\u1E5B\\u1E5D\\u0157\\u1E5F\\u024D\\u027D\\uA75B\\uA7A7\\uA783' },\n { 'base': 'S', 'letters': '\\u0053\\u24C8\\uFF33\\u015A\\u1E64\\u015C\\u1E60\\u0160\\u1E66\\u1E62\\u1E68\\u0218\\u015E\\u2C7E\\uA7A8\\uA784' },\n { 'base': 's', 'letters': '\\u0073\\u24E2\\uFF53\\u00DF\\u015B\\u1E65\\u015D\\u1E61\\u0161\\u1E67\\u1E63\\u1E69\\u0219\\u015F\\u023F\\uA7A9\\uA785\\u1E9B' },\n { 'base': 'SS', 'letters': '\\u1E9E' },\n { 'base': 'ss', 'letters': '\\xDF\\u00DF' },\n { 'base': 'st', 'letters': '\\uFB06' },\n { 'base': 'T', 'letters': '\\u0054\\u24C9\\uFF34\\u1E6A\\u0164\\u1E6C\\u021A\\u0162\\u1E70\\u1E6E\\u0166\\u01AC\\u01AE\\u023E\\uA786' },\n { 'base': 't', 'letters': '\\u0074\\u24E3\\uFF54\\u1E6B\\u1E97\\u0165\\u1E6D\\u021B\\u0163\\u1E71\\u1E6F\\u0167\\u01AD\\u0288\\u2C66\\uA787' },\n { 'base': 'Th', 'letters': '\\u00DE' },\n { 'base': 'TH', 'letters': '\\u00DE' },\n { 'base': 'th', 'letters': '\\u00FE' },\n { 'base': 'TZ', 'letters': '\\uA728' },\n { 'base': 'tz', 'letters': '\\uA729' },\n { 'base': 'U', 'letters': '\\u0055\\u24CA\\uFF35\\u00D9\\u00DA\\u00DB\\u0168\\u1E78\\u016A\\u1E7A\\u016C\\u00DC\\u01DB\\u01D7\\u01D5\\u01D9\\u1EE6\\u016E\\u0170\\u01D3\\u0214\\u0216\\u01AF\\u1EEA\\u1EE8\\u1EEE\\u1EEC\\u1EF0\\u1EE4\\u1E72\\u0172\\u1E76\\u1E74\\u0244' },\n { 'base': 'u', 'letters': '\\u0075\\u24E4\\uFF55\\u00F9\\u00FA\\u00FB\\u0169\\u1E79\\u016B\\u1E7B\\u016D\\u00FC\\u01DC\\u01D8\\u01D6\\u01DA\\u1EE7\\u016F\\u0171\\u01D4\\u0215\\u0217\\u01B0\\u1EEB\\u1EE9\\u1EEF\\u1EED\\u1EF1\\u1EE5\\u1E73\\u0173\\u1E77\\u1E75\\u0289' },\n { 'base': 'V', 'letters': '\\u0056\\u24CB\\uFF36\\u1E7C\\u1E7E\\u01B2\\uA75E\\u0245' },\n { 'base': 'v', 'letters': '\\u0076\\u24E5\\uFF56\\u1E7D\\u1E7F\\u028B\\uA75F\\u028C' },\n { 'base': 'VY', 'letters': '\\uA760' },\n { 'base': 'vy', 'letters': '\\uA761' },\n { 'base': 'W', 'letters': '\\u0057\\u24CC\\uFF37\\u1E80\\u1E82\\u0174\\u1E86\\u1E84\\u1E88\\u2C72' },\n { 'base': 'w', 'letters': '\\u0077\\u24E6\\uFF57\\u1E81\\u1E83\\u0175\\u1E87\\u1E85\\u1E98\\u1E89\\u2C73' },\n { 'base': 'X', 'letters': '\\u0058\\u24CD\\uFF38\\u1E8A\\u1E8C' },\n { 'base': 'x', 'letters': '\\u0078\\u24E7\\uFF58\\u1E8B\\u1E8D' },\n { 'base': 'Y', 'letters': '\\u0059\\u24CE\\uFF39\\u1EF2\\u00DD\\u0176\\u1EF8\\u0232\\u1E8E\\u0178\\u1EF6\\u1EF4\\u01B3\\u024E\\u1EFE' },\n { 'base': 'y', 'letters': '\\u0079\\u24E8\\uFF59\\u1EF3\\u00FD\\u0177\\u1EF9\\u0233\\u1E8F\\u00FF\\u1EF7\\u1E99\\u1EF5\\u01B4\\u024F\\u1EFF' },\n { 'base': 'Z', 'letters': '\\u005A\\u24CF\\uFF3A\\u0179\\u1E90\\u017B\\u017D\\u1E92\\u1E94\\u01B5\\u0224\\u2C7F\\u2C6B\\uA762' },\n { 'base': 'z', 'letters': '\\u007A\\u24E9\\uFF5A\\u017A\\u1E91\\u017C\\u017E\\u1E93\\u1E95\\u01B6\\u0225\\u0240\\u2C6C\\uA763' }\n ];\n\n\n\n\n /*\n PRIVATE FUNCTIONS\n */\n\n\n function _initReference() {\n\n for (let i = 0; i < reference.length; i++) {\n const letters = reference[i].letters;\n for (let j = 0; j < letters.length; j++) {\n dictionaries.reference[letters[j]] = reference[i].base;\n }\n }\n }\n\n\n function _initDictionaries() {\n\n if (options.dictionaries.length === 0) {\n dictionaries.characters = Object.assign(dictionaries.reference);\n }\n\n if (options.dictionaries.length > 0) {\n _addDictionaries(options.dictionaries);\n }\n }\n\n\n\n\n /*\n PUBLIC FUNCTIONS\n */\n\n\n // StringReplace\n umlaut.latinize = function (str) {\n\n return str.replace(/[^A-Za-z0-9]/g, (x) => {\n\n return dictionaries.characters[x] || x;\n });\n };\n\n\n // StringReplace\n umlaut.diacritics = function (str) {\n\n return str.replace(/[^\\u0000-\\u007E]/g, (x) => {\n\n return dictionaries.characters[x] || x;\n });\n };\n\n\n // StringBuilder\n umlaut.clean = function (str) {\n\n if (!str || !str.length || str.length < 1) {\n return '';\n }\n\n let string = '';\n const letters = str.split('');\n let letter;\n for (let i = 0, length = letters.length; i < length; i++) {\n letter = letters[i];\n string += letter in dictionaries.characters ? dictionaries.characters[letter] : letter;\n }\n\n return string;\n };\n\n\n // ObjectMap\n umlaut.objectmap = function (str) {\n\n return str.replace(/[À-ž]/g, (x) => {\n\n return dictionaries.characters[x.charCodeAt(0)] || x;\n });\n };\n\n\n umlaut.update = function (obj) {\n\n const key = Object.keys(obj)[0];\n const value = obj[Object.keys(obj)[0]];\n dictionaries.characters[key] = value;\n };\n\n\n\n\n /*\n HELPER FUNCTIONS\n */\n\n\n function _addDictionaries(dicts) {\n\n const args = [];\n for (let i = 0; i < dicts.length; i++) {\n args.push(dictionaries[dicts[i]]);\n }\n\n dictionaries.characters = Object.assign.apply(null, args);\n // dictionaries.characters = Object.assign(...tmp);\n }\n\n\n\n\n /*\n ENTRY POINT\n */\n\n\n umlaut.init = function (object) {\n\n Object.assign(options, object);\n _initReference();\n _initDictionaries();\n };\n\n\n\n\n /*\n RETURN PUBLIC POINTERS\n */\n\n\n return umlaut;\n\n\n } // . MODULE DEFINITION", "function T(texto){\n\t\t// Intenta usar el array del idioma, y si no esta disponible utiliza el castellano por defecto\n\t\ttry{\n\t\t\teval('var language = lang_' + idioma);\n\t\t}catch(e){\n\t\t\teval('var language = lang_es');\n\t\t}\n\t\t// Si una cadena concreta no esta traducida en el idioma, utiliza por defecto el castellano\n\t\tif (language[texto] == undefined) return lang_es[texto]; else return language[texto];\n\t}", "function local_to_international_style(local) {\n\treturn local.replace(new RegExp('[' + __WEBPACK_IMPORTED_MODULE_3__parse__[\"d\" /* VALID_PUNCTUATION */] + ']+', 'g'), ' ').trim();\n}", "function getLanguage() {\n return 'en-us';\n}", "translate(...args) {\n\t\tif (this._localizationEnabled) {\n\t\t\treturn this.__(...args)\n\t\t}\n\n\t\treturn args[0]\n\t}", "onTranslation() {\n }", "function e(a){var c=b.localeData||b.langData;return c.call(b,a)||c.call(b,\"en\")}", "@action(Action.INIT_LANGUAGE)\n @dispatches(Action.UI_LANGUAGE_READY)\n async initUiLanguage (store) {\n await $.getScript(`${basepath}/i18n/${this.getLanguage(store).code}.js`)\n\n t10.scan() // translate\n }", "function q(a){var c=g(a);if(c.id){\n// get the related l10n object\nvar d=n(c.id,c.args);if(!d)return void console.warn(\"#\"+c.id+\" is undefined.\");\n// translate element (TODO: security checks?)\nif(d[v]){// XXX\nif(0===r(a))a[v]=d[v];else{for(var e=a.childNodes,f=!1,h=0,i=e.length;i>h;h++)3===e[h].nodeType&&/\\S/.test(e[h].nodeValue)&&(f?e[h].nodeValue=\"\":(e[h].nodeValue=d[v],f=!0));\n// if no (non-empty) textNode is found, insert a textNode before the\n// first element child.\nif(!f){var j=b.createTextNode(d[v]);a.insertBefore(j,a.firstChild)}}delete d[v]}for(var k in d)a[k]=d[k]}}", "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Fold Twinoid bar';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'Fold the Twinoid black bar at the top of the screen. Put your mouse near the top of the screen to show it again.';\n\n i18n[I18N.LANG.FR] = {};\n i18n[I18N.LANG.FR][MODULE_NAME + '_short_desc'] = 'Replier la barre Twinoid';\n i18n[I18N.LANG.FR][MODULE_NAME + '_full_desc'] = 'Permet de gagner de la place en repliant la barre Twinoid. Rapprochez votre souris du bord supérieur de l\\'écran pour l\\'afficher de nouveau.';\n\n I18N.set(i18n);\n }", "function LanguageUnderstandingModel() {\n }", "function greetEnglish(firstname, lastname) {\n\tgreet(firstname, lastname); //didn't pass the language parameter. But by default it's \"en\"\n}", "function helloWorld(language){\n\n if (language == \"English\"){\n console.log(\"Hello World\");\n\n }else if (language == \"Arabic\"){\n console.log(\"مرحبا بالعالم\");\n\n }else if (language == \"French\"){\n console.log(\"Bonjour le monde\");\n } \n}", "function translateToEnglish() {\n var tstk;\n tstk = new TSTranslateKhmer(FormApp.getActiveForm()).translateText('km', 'en');\n FormApp.getUi().alert('Form text has been translated to English.');\n}", "function translating(language) {\n return regeneratorRuntime.wrap(function translating$(context$1$0) {\n while (1) switch (context$1$0.prev = context$1$0.next) {\n case 0:\n console.log('Winding up the gears...');\n context$1$0.next = 3;\n return null;\n\n case 3:\n console.log('Finding a copy of ' + language + ' dictionary');\n context$1$0.next = 6;\n return null;\n\n case 6:\n console.log('Writing out a response...');\n\n case 7:\n case 'end':\n return context$1$0.stop();\n }\n }, marked0$0[0], this);\n}", "changeLanguageStrings () {\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_modal_header_text\", this.labels.modal_header_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_ok_text\", this.labels.btn_ok_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_all_text\", this.labels.btn_all_text);\n\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesicon-label\", this.labels.modal_titlesicon_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesname_text\", this.labels.modal_titlesname_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlestotal_text\", this.labels.modal_titlestotal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesglobal_text\", this.labels.modal_titlesglobal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titleslocal_text\", this.labels.modal_titleslocal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlescopies_text\", this.labels.modal_titlescopies_text);\n\t}", "_loadWithCurrentLang() {\n i18n.changeLang(this.DOM.body, this.lang, this.DOM.domForTranslate, true);\n }", "load (language) {\n\t\tlet strings;\n\n\t\tif ((typeof language == \"string\") && (language != \"\")) {\n\t\t\ttry {\n\t\t\t\tstrings = require (Path.join (App.SOURCE_DIRECTORY, \"UiText\", `${language}.js`));\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tLog.warn (`Failed to load text strings; language=${language} err=${err}`);\n\t\t\t\tstrings = null;\n\t\t\t}\n\n\t\t\tif (strings != null) {\n\t\t\t\tLog.debug (`Loaded text strings; language=${language}`);\n\t\t\t\tthis.strings = strings;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlanguage = DefaultLanguage;\n\t\ttry {\n\t\t\tstrings = require (Path.join (App.SOURCE_DIRECTORY, \"UiText\", `${language}.js`));\n\t\t}\n\t\tcatch (err) {\n\t\t\tLog.warn (`Failed to load text strings; language=${language} err=${err}`);\n\t\t\tstrings = null;\n\t\t}\n\t\tif (strings != null) {\n\t\t\tLog.debug (`Loaded text strings; language=${language}`);\n\t\t\tthis.strings = strings;\n\t\t}\n\t}", "function gunGan() {\n <div class=\"ftembed\">\n <script src = \"http://funtranslations.com/extensions/embed/v1/funtranslations.embed.js\" >< /script>\n <script>FunTranslations.Embed.render({translator: 'gungan'});</script>\n </div>\n}", "function localize(s : string) {\n let str = l10n_js[s];\n\n return str===undefined ? '??' + s + '??' : str;\n}", "get lang () { return this._.recog.lang }", "function trs(what, atts) {\n var struct = that.messages[what];\n\n if (struct && struct[language])\n return translate(what, atts);\n return what;\n }", "languageStrToLanguageTag(language)\r\n {\r\n let lang = this.capitalizeFirstLetter(language);\r\n switch(lang)\r\n {\r\n case \"German\":\r\n return \"de\";\r\n break;\r\n case \"English\":\r\n return \"en\";\r\n break;\r\n case \"Japanese\":\r\n return \"ja\";\r\n break;\r\n case \"Arabian\":\r\n return \"ar\";\r\n break;\r\n case \"Spanish\":\r\n return \"es\";\r\n break;\r\n case \"French\":\r\n return \"fr\";\r\n break;\r\n case \"Italian\":\r\n return \"it\";\r\n break;\r\n case \"Dutch\":\r\n return \"nl\";\r\n break;\r\n case \"Polish\":\r\n return \"pl\";\r\n break;\r\n case \"Portuguese\":\r\n return \"pt\";\r\n break;\r\n case \"Russian\":\r\n return \"ru\";\r\n break;\r\n case \"Chinese\":\r\n return \"zh\";\r\n break;\r\n }\r\n }", "function helloWorld () {\r\n var language = document.projectTwo.inputOne.value; // captures data from input box\r\n language = language.toLowerCase();\r\n // here comes the logic statements\r\n if (language == 'kr')\r\n {\r\n return '안녕 세상';\r\n }\r\n else if (language == 'ru')\r\n {\r\n return 'Привет мир';\r\n }\r\n else if (language == 'de')\r\n {\r\n return 'Hallo Welt';\r\n }\r\n else if (language == 'hi')\r\n {\r\n return 'नमस्ते दुनिया';\r\n }\r\n else if (language == 'pl')\r\n {\r\n return 'Witaj świecie';\r\n }\r\n else if (language == 'en')\r\n {\r\n return 'Hello World!';\r\n }\r\n else\r\n {\r\n return 'Hello World!'; // default value\r\n }\r\n // PEBCAK = problem exists between chair and keyboard\r\n}", "function setLang() {\n\n // first update text fields based on selected mode\n var selId = $(\"#mode-select\").find(\":selected\").attr(\"id\");\n setText(\"text-timedomain\",\n \"Zeitbereich: \" + lang_de.text[selId],\n \"Time domain: \" + lang_en.text[selId]);\n setText(\"text-headline-left\",\n \"Federpendel: \" + lang_de.text[selId],\n \"Spring Pendulum: \" + lang_en.text[selId]);\n\n // then loop over all ids to replace the text\n for(var id in Spring.langObj.text) {\n $(\"#\"+id).text(Spring.langObj.text[id].toLocaleString());\n }\n // finally, set label of language button\n // $('#button-lang').text(Spring.langObj.otherLang);\n $('#button-lang').button(\"option\", \"label\", Spring.langObj.otherLang);\n }", "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n new KeyMap(\"\\u1CF2\", \"h\\u032C\", \"V\"), // upadhmaniya\n new KeyMap(\"\\u0905\", \"a\", \"a\"), // a\n new KeyMap(\"\\u0906\", \"\\u0101\", \"A\"), // long a\n new KeyMap(\"\\u093E\", null, \"A\", true), // long a attached\n new KeyMap(\"\\u0907\", \"i\", \"i\"), // i\n new KeyMap(\"\\u093F\", null, \"i\", true), // i attached\n new KeyMap(\"\\u0908\", \"\\u012B\", \"I\"), // long i\n new KeyMap(\"\\u0940\", null, \"I\", true), // long i attached\n new KeyMap(\"\\u0909\", \"u\", \"u\"), // u\n new KeyMap(\"\\u0941\", null, \"u\", true), // u attached\n new KeyMap(\"\\u090A\", \"\\u016B\", \"U\"), // long u\n new KeyMap(\"\\u0942\", null, \"U\", true), // long u attached\n new KeyMap(\"\\u090B\", \"\\u1E5B\", \"q\"), // vocalic r\n new KeyMap(\"\\u0943\", null, \"q\", true), // vocalic r attached\n new KeyMap(\"\\u0960\", \"\\u1E5D\", \"Q\"), // long vocalic r\n new KeyMap(\"\\u0944\", null, \"Q\", true), // long vocalic r attached\n new KeyMap(\"\\u090C\", \"\\u1E37\", \"L\"), // vocalic l\n new KeyMap(\"\\u0962\", null, \"L\", true), // vocalic l attached\n new KeyMap(\"\\u0961\", \"\\u1E39\", \"LY\"), // long vocalic l\n new KeyMap(\"\\u0963\", null, \"LY\", true), // long vocalic l attached\n new KeyMap(\"\\u090F\", \"e\", \"e\"), // e\n new KeyMap(\"\\u0947\", null, \"e\", true), // e attached\n new KeyMap(\"\\u0910\", \"ai\", \"E\"), // ai\n new KeyMap(\"\\u0948\", null, \"E\", true), // ai attached\n new KeyMap(\"\\u0913\", \"o\", \"o\"), // o\n new KeyMap(\"\\u094B\", null, \"o\", true), // o attached\n new KeyMap(\"\\u0914\", \"au\", \"O\"), // au\n new KeyMap(\"\\u094C\", null, \"O\", true), // au attached\n\n // velars\n new KeyMap(\"\\u0915\\u094D\", \"k\", \"k\"), // k\n new KeyMap(\"\\u0916\\u094D\", \"kh\", \"K\"), // kh\n new KeyMap(\"\\u0917\\u094D\", \"g\", \"g\"), // g\n new KeyMap(\"\\u0918\\u094D\", \"gh\", \"G\"), // gh\n new KeyMap(\"\\u0919\\u094D\", \"\\u1E45\", \"f\"), // velar n\n\n // palatals\n new KeyMap(\"\\u091A\\u094D\", \"c\", \"c\"), // c\n new KeyMap(\"\\u091B\\u094D\", \"ch\", \"C\"), // ch\n new KeyMap(\"\\u091C\\u094D\", \"j\", \"j\"), // j\n new KeyMap(\"\\u091D\\u094D\", \"jh\", \"J\"), // jh\n new KeyMap(\"\\u091E\\u094D\", \"\\u00F1\", \"F\"), // palatal n\n\n // retroflex\n new KeyMap(\"\\u091F\\u094D\", \"\\u1E6D\", \"t\"), // retroflex t\n new KeyMap(\"\\u0920\\u094D\", \"\\u1E6Dh\", \"T\"), // retroflex th\n new KeyMap(\"\\u0921\\u094D\", \"\\u1E0D\", \"d\"), // retroflex d\n new KeyMap(\"\\u0922\\u094D\", \"\\u1E0Dh\", \"D\"), // retroflex dh\n new KeyMap(\"\\u0923\\u094D\", \"\\u1E47\", \"N\"), // retroflex n\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"lY\"), // retroflex l\n new KeyMap(\"\\u0933\\u094D\\u0939\\u094D\", \"\\u1E37\", \"lYh\"), // retroflex lh\n\n // dental\n new KeyMap(\"\\u0924\\u094D\", \"t\", \"w\"), // dental t\n new KeyMap(\"\\u0925\\u094D\", \"th\", \"W\"), // dental th\n new KeyMap(\"\\u0926\\u094D\", \"d\", \"x\"), // dental d\n new KeyMap(\"\\u0927\\u094D\", \"dh\", \"X\"), // dental dh\n new KeyMap(\"\\u0928\\u094D\", \"n\", \"n\"), // dental n\n\n // labials\n new KeyMap(\"\\u092A\\u094D\", \"p\", \"p\"), // p\n new KeyMap(\"\\u092B\\u094D\", \"ph\", \"P\"), // ph\n new KeyMap(\"\\u092C\\u094D\", \"b\", \"b\"), // b\n new KeyMap(\"\\u092D\\u094D\", \"bh\", \"B\"), // bh\n new KeyMap(\"\\u092E\\u094D\", \"m\", \"m\"), // m\n\n // sibillants\n new KeyMap(\"\\u0936\\u094D\", \"\\u015B\", \"S\"), // palatal s\n new KeyMap(\"\\u0937\\u094D\", \"\\u1E63\", \"R\"), // retroflex s\n new KeyMap(\"\\u0938\\u094D\", \"s\", \"s\"), // dental s\n new KeyMap(\"\\u0939\\u094D\", \"h\", \"h\"), // h\n\n // semivowels\n new KeyMap(\"\\u092F\\u094D\", \"y\", \"y\"), // y\n new KeyMap(\"\\u0930\\u094D\", \"r\", \"r\"), // r\n new KeyMap(\"\\u0932\\u094D\", \"l\", \"l\"), // l\n new KeyMap(\"\\u0935\\u094D\", \"v\", \"v\"), // v\n\n\n // numerals\n new KeyMap(\"\\u0966\", \"0\", \"0\"), // 0\n new KeyMap(\"\\u0967\", \"1\", \"1\"), // 1\n new KeyMap(\"\\u0968\", \"2\", \"2\"), // 2\n new KeyMap(\"\\u0969\", \"3\", \"3\"), // 3\n new KeyMap(\"\\u096A\", \"4\", \"4\"), // 4\n new KeyMap(\"\\u096B\", \"5\", \"5\"), // 5\n new KeyMap(\"\\u096C\", \"6\", \"6\"), // 6\n new KeyMap(\"\\u096D\", \"7\", \"7\"), // 7\n new KeyMap(\"\\u096E\", \"8\", \"8\"), // 8\n new KeyMap(\"\\u096F\", \"9\", \"9\"), // 9\n\n // accents\n new KeyMap(\"\\u0951\", \"|\", \"|\"), // udatta\n new KeyMap(\"\\u0952\", \"_\", \"_\"), // anudatta\n new KeyMap(\"\\u0953\", null, \"//\"), // grave accent\n new KeyMap(\"\\u0954\", null, \"\\\\\"), // acute accent\n\n // miscellaneous\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"L\"), // retroflex l\n new KeyMap(\"\\u093D\", \"'\", \"'\"), // avagraha\n new KeyMap(\"\\u0950\", null, \"om\"), // om\n new KeyMap(\"\\u0964\", \".\", \".\") // single danda\n ];\n\n PhoneticMapper.call(this, map);\n}", "function getLanguage(selectedText){\r\n\r\n\t// Detect the language of the passed in text\r\n\tvar selectedTextLanguage;\r\n\tguessLanguage.detect(selectedText, function(language) {\r\n\t\tselectedTextLanguage = language;\t\t\r\n \t//console.log('Detected language of provided text is [' + language + ']');\r\n \t});\r\n\t\r\n\tvar language = {};\r\n\tlanguage.shortname = selectedTextLanguage;\r\n\tlanguage.isrighttoleft = false;\r\n\tlanguage.pattern = 'en-us';\r\n\t\r\n\tswitch(selectedTextLanguage)\r\n\t{\r\n\t\tcase 'en':\r\n\t \t\tlanguage.fullname = 'English';\r\n\t \t\tbreak;\r\n\t\tcase 'ab':\r\n\t \t\tlanguage.fullname = 'Abkhazian';\r\n\t \t\tbreak;\r\n\t\tcase 'af':\r\n\t \t\tlanguage.fullname = 'Afrikaans';\r\n\t \t\tbreak;\r\n\t\tcase 'ar':\r\n\t \t\tlanguage.fullname = 'Arabic';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'az':\r\n\t \t\tlanguage.fullname = 'Azeri';\r\n\t \t\tbreak;\r\n\t\tcase 'be':\r\n\t \t\tlanguage.fullname = 'Belarusian';\r\n\t\t\tlanguage.pattern = 'be';\r\n\t \t\tbreak;\r\n\t\tcase 'bg':\r\n\t \t\tlanguage.fullname = 'Bulgarian';\r\n\t \t\tbreak;\r\n\t\tcase 'bn':\r\n\t \t\tlanguage.fullname = 'Bengali';\r\n\t\t\tlanguage.pattern = 'bn';\r\n\t \t\tbreak;\r\n\t\tcase 'bo':\r\n\t \t\tlanguage.fullname = 'Tibetan';\r\n\t \t\tbreak;\r\n\t\tcase 'br':\r\n\t \t\tlanguage.fullname = 'Breton';\r\n\t \t\tbreak;\r\n\t\tcase 'ca':\r\n\t \t\tlanguage.fullname = 'Catalan';\r\n\t\t\tlanguage.pattern = 'ca';\r\n\t \t\tbreak;\r\n\t\tcase 'ceb':\r\n\t \t\tlanguage.fullname = 'Cebuano';\r\n\t \t\tbreak;\r\n\t\tcase 'cs':\r\n\t \t\tlanguage.fullname = 'Czech';\r\n\t\t\tlanguage.pattern = 'cz';\r\n\t \t\tbreak;\r\n\t\tcase 'cy':\r\n\t \t\tlanguage.fullname = 'Welsh';\r\n\t \t\tbreak;\r\n\t\tcase 'da':\r\n\t \t\tlanguage.fullname = 'Danish';\r\n\t\t\tlanguage.pattern = 'da';\r\n\t \t\tbreak;\r\n\t\tcase 'de':\r\n\t \t\tlanguage.fullname = 'German';\r\n\t\t\tlanguage.pattern = 'de';\r\n\t \t\tbreak;\r\n\t\tcase 'el':\r\n\t \t\tlanguage.fullname = 'Greek';\r\n\t \t\tbreak;\r\n\t\tcase 'eo':\r\n\t \t\tlanguage.fullname = 'Esperanto';\r\n\t \t\tbreak;\r\n\t\tcase 'es':\r\n\t \t\tlanguage.fullname = 'Spanish';\r\n\t\t\tlanguage.pattern = 'es';\r\n\t \t\tbreak;\r\n\t\tcase 'et':\r\n\t \t\tlanguage.fullname = 'Estonian';\r\n\t \t\tbreak;\r\n\t\tcase 'eu':\r\n\t \t\tlanguage.fullname = 'Basque';\r\n\t \t\tbreak;\r\n\t\tcase 'fa':\r\n\t \t\tlanguage.fullname = 'Farsi';\r\n\t \t\tbreak;\r\n\t\tcase 'fi':\r\n\t \t\tlanguage.fullname = 'Finnish';\r\n\t\t\tlanguage.pattern = 'fi';\r\n\t \t\tbreak;\r\n\t\tcase 'fo':\r\n\t \t\tlanguage.fullname = 'Faroese';\r\n\t \t\tbreak;\r\n\t\tcase 'fr':\r\n\t \t\tlanguage.fullname = 'French';\r\n\t\t\tlanguage.pattern = 'fr';\r\n\t \t\tbreak;\r\n\t\tcase 'fy':\r\n\t \t\tlanguage.fullname = 'Frisian';\r\n\t \t\tbreak;\r\n\t\tcase 'gd':\r\n\t \t\tlanguage.fullname = 'Scots Gaelic';\r\n\t \t\tbreak;\r\n\t\tcase 'gl':\r\n\t \t\tlanguage.fullname = 'Galician';\r\n\t \t\tbreak;\r\n\t\tcase 'gu':\r\n\t \t\tlanguage.fullname = 'Gujarati';\r\n\t\t\tlanguage.pattern = 'gu';\r\n\t \t\tbreak;\r\n\t\tcase 'ha':\r\n\t \t\tlanguage.fullname = 'Hausa';\r\n\t \t\tbreak;\r\n\t\tcase 'haw':\r\n\t \t\tlanguage.fullname = 'Hawaiian';\r\n\t \t\tbreak;\r\n\t\tcase 'he':\r\n\t \t\tlanguage.fullname = 'Hebrew';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'hi':\r\n\t \t\tlanguage.fullname = 'Hindi';\r\n\t\t\tlanguage.pattern = 'hi';\r\n\t \t\tbreak;\r\n\t\tcase 'hr':\r\n\t \t\tlanguage.fullname = 'Croatian';\r\n\t \t\tbreak;\r\n\t\tcase 'hu':\r\n\t \t\tlanguage.fullname = 'Hungarian';\r\n\t\t\tlanguage.pattern = 'hu';\r\n\t \t\tbreak;\r\n\t\tcase 'hy':\r\n\t \t\tlanguage.fullname = 'Armenian';\r\n\t\t\tlanguage.pattern = 'hy';\r\n\t \t\tbreak;\r\n\t\tcase 'id':\r\n\t \t\tlanguage.fullname = 'Indonesian';\r\n\t \t\tbreak;\r\n\t\tcase 'is':\r\n\t \t\tlanguage.fullname = 'Icelandic';\r\n\t \t\tbreak;\r\n\t\tcase 'it':\r\n\t \t\tlanguage.fullname = 'Italian';\r\n\t\t\tlanguage.pattern = 'it';\r\n\t \t\tbreak;\r\n\t\tcase 'ja':\r\n\t \t\tlanguage.fullname = 'Japanese';\r\n\t \t\tbreak;\r\n\t\tcase 'ka':\r\n\t \t\tlanguage.fullname = 'Georgian';\r\n\t \t\tbreak;\r\n\t\tcase 'kk':\r\n\t \t\tlanguage.fullname = 'Kazakh';\r\n\t \t\tbreak;\r\n\t\tcase 'km':\r\n\t \t\tlanguage.fullname = 'Cambodian';\r\n\t \t\tbreak;\r\n\t\tcase 'ko':\r\n\t \t\tlanguage.fullname = 'Korean';\r\n\t \t\tbreak;\r\n\t\tcase 'ku':\r\n\t \t\tlanguage.fullname = 'Kurdish';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'ky':\r\n\t \t\tlanguage.fullname = 'Kyrgyz';\r\n\t \t\tbreak;\r\n\t\tcase 'la':\r\n\t \t\tlanguage.fullname = 'Latin';\r\n\t\t\tlanguage.pattern = 'la';\r\n\t \t\tbreak;\r\n\t\tcase 'lt':\r\n\t \t\tlanguage.fullname = 'Lithuanian';\r\n\t\t\tlanguage.pattern = 'lt';\r\n\t \t\tbreak;\r\n\t\tcase 'lv':\r\n\t \t\tlanguage.fullname = 'Latvian';\r\n\t\t\tlanguage.pattern = 'lv';\r\n\t \t\tbreak;\r\n\t\tcase 'mg':\r\n\t \t\tlanguage.fullname = 'Malagasy';\r\n\t \t\tbreak;\r\n\t\tcase 'mk':\r\n\t \t\tlanguage.fullname = 'Macedonian';\r\n\t \t\tbreak;\r\n\t\tcase 'ml':\r\n\t \t\tlanguage.fullname = 'Malayalam';\r\n\t\t\tlanguage.pattern = 'ml';\r\n\t \t\tbreak;\r\n\t\tcase 'mn':\r\n\t \t\tlanguage.fullname = 'Mongolian';\r\n\t \t\tbreak;\r\n\t\tcase 'mr':\r\n\t \t\tlanguage.fullname = 'Marathi';\r\n\t \t\tbreak;\r\n\t\tcase 'ms':\r\n\t \t\tlanguage.fullname = 'Malay';\r\n\t \t\tbreak;\r\n\t\tcase 'nd':\r\n\t \t\tlanguage.fullname = 'Ndebele';\r\n\t \t\tbreak;\r\n\t\tcase 'ne':\r\n\t \t\tlanguage.fullname = 'Nepali';\r\n\t \t\tbreak;\r\n\t\tcase 'nl':\r\n\t \t\tlanguage.fullname = 'Dutch';\r\n\t\t\tlanguage.pattern = 'nl';\r\n\t \t\tbreak;\r\n\t\tcase 'nn':\r\n\t \t\tlanguage.fullname = 'Nynorsk';\r\n\t \t\tbreak;\r\n\t\tcase 'no':\r\n\t \t\tlanguage.fullname = 'Norwegian';\r\n\t\t\tlanguage.pattern = 'nb-no';\r\n\t \t\tbreak;\r\n\t\tcase 'nso':\r\n\t \t\tlanguage.fullname = 'Sepedi';\r\n\t \t\tbreak;\r\n\t\tcase 'pa':\r\n\t \t\tlanguage.fullname = 'Punjabi';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t\t\tlanguage.pattern = 'pa';\r\n\t \t\tbreak;\r\n\t\tcase 'pl':\r\n\t \t\tlanguage.fullname = 'Polish';\r\n\t\t\tlanguage.pattern = 'pl';\r\n\t \t\tbreak;\r\n\t\tcase 'ps':\r\n\t \t\tlanguage.fullname = 'Pashto';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'pt':\r\n\t \t\tlanguage.fullname = 'Portuguese';\r\n\t\t\tlanguage.pattern = 'pt';\r\n\t \t\tbreak;\r\n\t\tcase 'pt_PT':\r\n\t \t\tlanguage.fullname = 'Portuguese (Portugal)';\r\n\t\t\tlanguage.pattern = 'pt';\r\n\t \t\tbreak;\r\n\t\tcase 'pt_BR':\r\n\t \t\tlanguage.fullname = 'Portuguese (Brazil)';\r\n\t\t\tlanguage.pattern = 'pt';\r\n\t \t\tbreak;\r\n\t\tcase 'ro':\r\n\t \t\tlanguage.fullname = 'Romanian';\r\n\t \t\tbreak;\r\n\t\tcase 'ru':\r\n\t \t\tlanguage.fullname = 'Russian';\r\n\t\t\tlanguage.pattern = 'ru';\r\n\t \t\tbreak;\r\n\t\tcase 'sa':\r\n\t \t\tlanguage.fullname = 'Sanskrit';\r\n\t \t\tbreak;\r\n\t\tcase 'sh':\r\n\t \t\tlanguage.fullname = 'Serbo-Croatian';\r\n\t \t\tbreak;\r\n\t\tcase 'sk':\r\n\t \t\tlanguage.fullname = 'Slovak';\r\n\t\t\tlanguage.pattern = 'sk';\r\n\t\t\tlanguage.isrighttoleft = false;\r\n\t \t\tbreak;\r\n\t\tcase 'sl':\r\n\t \t\tlanguage.fullname = 'Slovene';\r\n\t\t\tlanguage.pattern = 'sl';\r\n\t \t\tbreak;\r\n\t\tcase 'so':\r\n\t \t\tlanguage.fullname = 'Somali';\r\n\t \t\tbreak;\r\n\t\tcase 'sq':\r\n\t \t\tlanguage.fullname = 'Albanian';\r\n\t \t\tbreak;\r\n\t\tcase 'sr':\r\n\t \t\tlanguage.fullname = 'Serbian';\r\n\t \t\tbreak;\r\n\t\tcase 'sv':\r\n\t \t\tlanguage.fullname = 'Swedish';\r\n\t\t\tlanguage.pattern = 'sv';\r\n\t \t\tbreak;\r\n\t\tcase 'sw':\r\n\t \t\tlanguage.fullname = 'Swahili';\r\n\t \t\tbreak;\r\n\t\tcase 'ta':\r\n\t \t\tlanguage.fullname = 'Tamil';\r\n\t\t\tlanguage.pattern = 'ta';\r\n\t \t\tbreak;\r\n\t\tcase 'te':\r\n\t \t\tlanguage.fullname = 'Telugu';\r\n\t\t\tlanguage.pattern = 'te';\r\n\t \t\tbreak;\r\n\t\tcase 'th':\r\n\t \t\tlanguage.fullname = 'Thai';\r\n\t \t\tbreak;\r\n\t\tcase 'tl':\r\n\t \t\tlanguage.fullname = 'Tagalog';\r\n\t \t\tbreak;\r\n\t\tcase 'tlh':\r\n\t \t\tlanguage.fullname = 'Klingon';\r\n\t \t\tbreak;\r\n\t\tcase 'tn':\r\n\t \t\tlanguage.fullname = 'Setswana';\r\n\t \t\tbreak;\r\n\t\tcase 'tr':\r\n\t \t\tlanguage.fullname = 'Turkish';\r\n\t\t\tlanguage.pattern = 'tr';\r\n\t \t\tbreak;\r\n\t\tcase 'ts':\r\n\t \t\tlanguage.fullname = 'Tsonga';\r\n\t \t\tbreak;\r\n\t\tcase 'tw':\r\n\t \t\tlanguage.fullname = 'Tiwi';\r\n\t \t\tbreak;\r\n\t\tcase 'uk':\r\n\t \t\tlanguage.fullname = 'Ukrainian';\r\n\t\t\tlanguage.pattern = 'uk';\r\n\t \t\tbreak;\r\n\t\tcase 'ur':\r\n\t \t\tlanguage.fullname = 'Urdu';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'uz':\r\n\t \t\tlanguage.fullname = 'Uzbek';\r\n\t \t\tbreak;\r\n\t\tcase 've':\r\n\t \t\tlanguage.fullname = 'Venda';\r\n\t \t\tbreak;\r\n\t\tcase 'vi':\r\n\t \t\tlanguage.fullname = 'Vietnamese';\r\n\t \t\tbreak;\r\n\t\tcase 'xh':\r\n\t \t\tlanguage.fullname = 'Xhosa';\r\n\t \t\tbreak;\r\n\t\tcase 'zh':\r\n\t \t\tlanguage.fullname = 'Chinese';\r\n\t \t\tbreak;\r\n\t\tcase 'zh_TW':\r\n\t \t\tlanguage.fullname = 'Traditional Chinese (Taiwan)';\r\n\t \t\tbreak;\r\n\t\tdefault:\r\n\t \t\tlanguage.fullname = \"\";\r\n\t}\r\n\t\r\n\t// load the pattern script\r\n\tvar patternJS = '../lib/guess_language/language_patterns/' + language.pattern + '.js'\r\n\t$.ajax({\r\n\t\tasync: false,\r\n\t \turl: patternJS,\r\n\t \tdataType: \"script\"\r\n\t});\r\n\r\n\treturn language;\r\n}", "function initLanguage() {\n if(getLanguage()) return;\n setItem('language', 'sv');\n}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n\t\t\t\thelpArray=[_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"),_(\"Next\"),_(\"Close\"),_(\"help8\"),_(\"help9\")];\n scope.heading=_(\"Emission spectra\");\n\t\t\t\tscope.variables=_(\"Variables\"); \n\t\t\t\tscope.result=_(\"Result\"); \n\t\t\t\tscope.copyright=_(\"copyright\"); \n\t\t\t\tscope.calibrate_txt = _(\"Reset\");\n scope.calibrate_slider_txt = _(\"Calibrate Telescope :\");\n scope.select_lamp_txt = _(\"Select Lamp :\");\n light_on_txt = _(\"Switch On Light\");\n light_off_txt = _(\"Switch Off Light\");\n place_grating_txt = _(\"Place grating\");\n remove_grating_txt = _(\"Remove grating\");\n scope.telescope_angle_txt = _(\"Angle of Telescope :\");\n scope.vernier_table_angle_txt = _(\"Angle of Vernier Table :\");\n scope.fine_angle_txt = _(\"Fine Angle of Telescope :\");\n scope.start_txt = _(\"Start\");\n\t\t\t\tscope.reset_txt = _(\"Reset\");\n scope.lamp_array = [{\n lamp:_(\"Mercury\"),\n index:0\n },{\n lamp:_(\"Hydrogen\"),\n index:1\n },{\n lamp:_(\"Neon\"),\n index:2\n }];\n scope.$apply();\t\t\t\t\n\t\t\t}", "function updateLanguage() {\n\n var code = \"package org.usfirst.frcEasyJ.team5122;\\n\";\n // code.push(\"\");\n\n \n\n var content = document.getElementById('languagePre');\n code += Blockly.Java.workspaceToCode(rootBlock);\n content.textContent = code;\n if (typeof prettyPrintOne == 'function') {\n code = content.innerHTML;\n code = prettyPrintOne(code, 'java');\n content.innerHTML = code;\n }\n\n}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function view_parse_localization(content, language) {\n\n\tvar is = false;\n\n\tcontent = content.replace(REG_NOTRANSLATE, function() {\n\t\tis = true;\n\t\treturn '';\n\t}).trim();\n\n\tif (is)\n\t\treturn content;\n\n\tvar command = view_find_localization(content, 0);\n\tvar output = '';\n\tvar end = 0;\n\n\tif (!command)\n\t\treturn content;\n\n\twhile (command) {\n\n\t\tif (command)\n\t\t\toutput += content.substring(end ? end + 1 : 0, command.beg) + (command.command ? localize(language, command) : '');\n\n\t\tend = command.end;\n\t\tcommand = view_find_localization(content, command.end);\n\t}\n\n\toutput += content.substring(end + 1);\n\treturn output;\n}", "function ch_site_lang(lng='en') {\n $.getJSON( \"lng/\"+lng+\".json\", function( data ) {\n\n var $lang_tags = $('[data=lng-txt]');\n\n $('[data=lng-txt]').each(function() {\n var lang_content = $.trim($(this).text().toLowerCase());\n $(this).text(data[lng][lang_content]);\n });\n\n $('[data=lng-place]').each(function() {\n var lang_content = $.trim($(this).attr(\"placeholder\").toLowerCase());\n $(this).attr(\"placeholder\", data[lng][lang_content]);\n });\n\n });\n}", "function get_language(langue){\r\n\t// Langue par défaut : Anglais\r\n\tadd_log(3, \"get_language() > Début.\");\r\n\tswitch(langue_serveur) { \r\n\t\tcase \"fr\": // French\r\n\t\t\t// Les batiments :\r\n\t\t\tlangue_batiments['1'] = \"Bûcheron\";\r\n\t\t\tlangue_batiments['2'] = \"Carrière d'argile\";\r\n\t\t\tlangue_batiments['3'] = \"Mine de fer\";\r\n\t\t\tlangue_batiments['4'] = \"Ferme\";\r\n\t\t\tlangue_batiments['5'] = \"Scierie\";\r\n\t\t\tlangue_batiments['6'] = \"Usine de poteries\";\r\n\t\t\tlangue_batiments['7'] = \"Fonderie\";\r\n\t\t\tlangue_batiments['8'] = \"Moulin\";\r\n\t\t\tlangue_batiments['9'] = \"Boulangerie\";\r\n\t\t\tlangue_batiments['10'] = \"Dépôt de ressources\";\r\n\t\t\tlangue_batiments['11'] = \"Silo de céréales\";\r\n\t\t\tlangue_batiments['12'] = \"Armurerie\";\r\n\t\t\tlangue_batiments['13'] = \"Forge\";\r\n\t\t\tlangue_batiments['14'] = \"Place du tournoi\";\r\n\t\t\tlangue_batiments['15'] = \"Bâtiment principal\";\r\n\t\t\tlangue_batiments['16'] = \"Place de rassemblement\";\r\n\t\t\tlangue_batiments['17'] = \"Place du Marché\";\r\n\t\t\tlangue_batiments['18'] = \"Ambassade\";\r\n\t\t\tlangue_batiments['19'] = \"Caserne\";\r\n\t\t\tlangue_batiments['20'] = \"Écurie\";\r\n\t\t\tlangue_batiments['21'] = \"Atelier\";\r\n\t\t\tlangue_batiments['22'] = \"Académie\";\r\n\t\t\tlangue_batiments['23'] = \"Cachette\";\r\n\t\t\tlangue_batiments['24'] = \"Hôtel de ville\";\r\n\t\t\tlangue_batiments['25'] = \"Résidence\";\r\n\t\t\tlangue_batiments['26'] = \"Palais\";\r\n\t\t\tlangue_batiments['27'] = \"Chambre aux trésors\";\r\n\t\t\tlangue_batiments['28'] = \"Comptoir de commerce\";\r\n\t\t\tlangue_batiments['29'] = \"Grande caserne\";\r\n\t\t\tlangue_batiments['30'] = \"Grande écurie\";\r\n\t\t\tlangue_batiments['31'] = \"Mur d'enceinte\";\r\n\t\t\tlangue_batiments['32'] = \"Mur de terre\";\r\n\t\t\tlangue_batiments['33'] = \"Palissade\";\r\n\t\t\tlangue_batiments['34'] = \"Tailleur de pierre\";\r\n\t\t\tlangue_batiments['35'] = \"Brasserie\";\r\n\t\t\tlangue_batiments['36'] = \"Fabricant de pièges\";\r\n\t\t\tlangue_batiments['37'] = \"Manoir du héros\";\r\n\t\t\tlangue_batiments['38'] = \"Grand dépôt\";\r\n\t\t\tlangue_batiments['39'] = \"Grand silo\";\r\n\t\t\tlangue_batiments['40'] = \"Merveille du monde\";\r\n\t\t\tlangue_batiments['41'] = \"Abreuvoir\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"Bois\";\r\n\t\t\tlangue_ressources['clay'] = \"Argile\";\r\n\t\t\tlangue_ressources['iron'] = \"Fer\";\r\n\t\t\tlangue_ressources['crop'] = \"Céréales\";\r\n\t\t\t// Taches\r\n\t\t\tlangue_textes['build'] = \"Construire le bâtiment\";\r\n\t\t\tlangue_textes['upgrade'] = \"Augmenter\";\r\n\t\t\tlangue_textes['attack'] = \"Attaque\";\r\n\t\t\tlangue_textes['research'] = \"Rechercher\";\r\n\t\t\tlangue_textes['train'] = \"Entrainer\";\r\n\t\t\tlangue_textes['party'] = \"Fête\";\r\n\t\t\tlangue_textes['demolish'] = \"Démolir\";\r\n\t\t\tlangue_textes['send_merchants'] = \"Envoyer ressources\";\r\n\t\t\tlangue_textes['send_assistance'] = \"Envoyer une assistance\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"Ressources\";\r\n\t\t\tlangue_textes['villages'] = \"Villages\";\r\n\t\t\tlangue_textes['my_hero'] = \"Mon héro\";\r\n\t\t\tlangue_textes['task_list'] = \"Liste des tâches\";\r\n\t\t\tlangue_textes['options'] = \"Options Multi-Tools\";\r\n\t\t\tlangue_textes['options_right_side'] = \"Colonne de droite\";\r\n\t\t\tlangue_textes['replace_hero'] = \"Remplacer le cadre du héro ?\";\r\n\t\t\tlangue_textes['replace_player'] = \"Remplacer le cadre du joueur ?\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"Remplacer le cadre de l'alliance ?\";\r\n\t\t\tlangue_textes['replace_village'] = \"Remplacer le cadre des villages ?\";\r\n\t\t\tlangue_textes['defense_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajouter le raccourci \\\"envoyer défense\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajouter le raccourci \\\"envoyer marchand\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"Ajouter le cadre des barres de ressource ?\";\r\n\t\t\tlangue_textes['position_resource'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Avant ou après les villages ?\";\r\n\t\t\tlangue_textes['no'] = \"Non\";\r\n\t\t\tlangue_textes['yes'] = \"Oui\";\r\n\t\t\tlangue_textes['before_village'] = \"Avant les villages\";\r\n\t\t\tlangue_textes['after_village'] = \"Après les villages\";\r\n\t\t\tlangue_textes['options_various'] = \"Options diverses\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"Remplacer le nom de la page ?\";\r\n\t\t\tlangue_textes['save'] = \"Sauvegarder et fermer\";\r\n\t\t\tlangue_textes['replace_logo'] = \"Remplacer le logo original ?\";\r\n\t\t\tlangue_textes['ready'] = \"Prêt\";\r\n\t\t\tlangue_textes['never'] = \"Jamais\";\r\n\t\t\tlangue_textes['required_resources'] = \"Ressources nécessaires pour améliorer\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"Afficher les ressources manquantes dans les pages de construction ?\";\r\n\t\t\tlangue_textes['infinity'] = \"Infini\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"Vous devez améliorer le dépot de ressources.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"Vous devez améliorer le dépot de céréales.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Utiliser le planificateur ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Niveau de log ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Ajouter à la liste des constructions -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Ajouter une tâche (heure du serveur)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Planifier à :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(aaaa/mm/jj hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\tcase \"ir\": // Persian by Mr_572\r\n\t\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"هیزم شکن\";\r\n\t\t\tlangue_batiments['2'] = \"آجر سازی\";\r\n\t\t\tlangue_batiments['3'] = \"معدن آهن\";\r\n\t\t\tlangue_batiments['4'] = \"گندم زار\";\r\n\t\t\tlangue_batiments['5'] = \"چوب بری\";\r\n\t\t\tlangue_batiments['6'] = \"آجرپزی\";\r\n\t\t\tlangue_batiments['7'] = \"ذوب آهن\";\r\n\t\t\tlangue_batiments['8'] = \"آسیاب\";\r\n\t\t\tlangue_batiments['9'] = \"نانوایی\";\r\n\t\t\tlangue_batiments['10'] = \"آنبار\";\r\n\t\t\tlangue_batiments['11'] = \"آنبار غذا\";\r\n\t\t\tlangue_batiments['12'] = \"اسلحه سازی\";\r\n\t\t\tlangue_batiments['13'] = \"زره سازی\";\r\n\t\t\tlangue_batiments['14'] = \"میدان تمرین\";\r\n\t\t\tlangue_batiments['15'] = \"ساختمان اصلی\";\r\n\t\t\tlangue_batiments['16'] = \"اردوگاه\";\r\n\t\t\tlangue_batiments['17'] = \"بازار\";\r\n\t\t\tlangue_batiments['18'] = \"سفارت\";\r\n\t\t\tlangue_batiments['19'] = \"سربازخانه\";\r\n\t\t\tlangue_batiments['20'] = \"اصطبل\";\r\n\t\t\tlangue_batiments['21'] = \"کارگاه\";\r\n\t\t\tlangue_batiments['22'] = \"دارالفنون\";\r\n\t\t\tlangue_batiments['23'] = \"مخفیگاه\";\r\n\t\t\tlangue_batiments['24'] = \"تالار شهر\";\r\n\t\t\tlangue_batiments['25'] = \"اقامتگاه\";\r\n\t\t\tlangue_batiments['26'] = \"قصر\";\r\n\t\t\tlangue_batiments['27'] = \"خزانه\";\r\n\t\t\tlangue_batiments['28'] = \"تجارتخانه\";\r\n\t\t\tlangue_batiments['29'] = \"سربازخانه بزرگ\";\r\n\t\t\tlangue_batiments['30'] = \"اصطبل بزرگ\";\r\n\t\t\tlangue_batiments['31'] = \"دیوارشهر\";\r\n\t\t\tlangue_batiments['32'] = \"دیوار گلی\";\r\n\t\t\tlangue_batiments['33'] = \"پرچین\";\r\n\t\t\tlangue_batiments['34'] = \"سنگ تراشی\";\r\n\t\t\tlangue_batiments['35'] = \"قهوه خانه\";\r\n\t\t\tlangue_batiments['36'] = \"تله ساز\";\r\n\t\t\tlangue_batiments['37'] = \"عمارت قهرمان\";\r\n\t\t\tlangue_batiments['38'] = \"انبار بزرگ\";\r\n\t\t\tlangue_batiments['39'] = \"انبار غذای بزرگ\";\r\n\t\t\tlangue_batiments['40'] = \"شگفتی جهان\";\r\n\t\t\tlangue_batiments['41'] = \"آبشخور اسب\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"چوب\";\r\n\t\t\tlangue_ressources['clay'] = \"خشت\";\r\n\t\t\tlangue_ressources['iron'] = \"آهن\";\r\n\t\t\tlangue_ressources['crop'] = \"گندم\";\r\n\t\t\t// Tasks\r\n\t\t\tlangue_textes['build'] = \"ساختن\";\r\n\t\t\tlangue_textes['upgrade'] = \"ارتقاع\";\r\n\t\t\tlangue_textes['attack'] = \"حمله\";\r\n\t\t\tlangue_textes['research'] = \"تحقیق\";\r\n\t\t\tlangue_textes['train'] = \"تربیت\";\r\n\t\t\tlangue_textes['party'] = \"جشن\";\r\n\t\t\tlangue_textes['demolish'] = \"تخریب\";\r\n\t\t\tlangue_textes['send_merchants'] = \"ارسال تاجر\";\r\n\t\t\tlangue_textes['send_assistance'] = \"ارسال نیروی کمکی\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"منابع\";\r\n\t\t\tlangue_textes['villages'] = \"دهکده ها\";\r\n\t\t\tlangue_textes['my_hero'] = \"قهرمان\";\r\n\t\t\tlangue_textes['task_list'] = \"لیست وظایف\";\r\n\t\t\tlangue_textes['options'] = \"گزینه ها\";\r\n\t\t\tlangue_textes['options_right_side'] = \"ستون سمت چپ\";\r\n\t\t\tlangue_textes['replace_hero'] = \"بخش مربوط به قهرمان تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_player'] = \"بخش مربوط به نام بازیکن تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"بخش مربوط به اتحاد تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_village'] = \"بخش مربوط به اسامی دهکده ها تغییر کند؟\";\r\n\t\t\tlangue_textes['defense_village'] = \"Add shortcut\\\"ارسال نیروی کمکی\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"Add shortcut \\\"ارسال منابع\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"قسمت نوار منابع نمایش داده شود؟\";\r\n\t\t\tlangue_textes['position_resource'] = \"قبل یا بعد از بخش مربوط به اسامی دهکده ها\";\r\n\t\t\tlangue_textes['no'] = \"خیر\";\r\n\t\t\tlangue_textes['yes'] = \"بله\";\r\n\t\t\tlangue_textes['before_village'] = \"بعد از لیست دهکده ها\";\r\n\t\t\tlangue_textes['after_village'] = \"قبل از لیست دهکده ها\";\r\n\t\t\tlangue_textes['options_various'] = \"گزینه های مختلف\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"نام صفحه تغییر پیدا کند؟\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"آرم تراوین تغییر کند؟\";\r\n\t\t\tlangue_textes['ready'] = \"آماده\";\r\n\t\t\tlangue_textes['never'] = \"هرگز\";\r\n\t\t\tlangue_textes['required_resources'] = \"منابع مورد نیاز برای ارتقاع\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"نمایش منابع مورد نیاز در صفحه ساختمان؟\";\r\n\t\t\tlangue_textes['infinity'] = \"ارتقاع\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"شما دارید برای ارتقاع انبار.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \" شما دارید برای ارتقاع انبار غذا.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\tcase \"sa\": // Arabic by Dream1\r\n\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"الحطاب\";\r\n\t\t\tlangue_batiments['2'] = \"حفرة الطين\";\r\n\t\t\tlangue_batiments['3'] = \"منجم الحديد\";\r\n\t\t\tlangue_batiments['4'] = \"حقل القمح\";\r\n\t\t\tlangue_batiments['5'] = \"معمل النشار\";\r\n\t\t\tlangue_batiments['6'] = \"معمل البلوك\";\r\n\t\t\tlangue_batiments['7'] = \"مسبك الحديد\";\r\n\t\t\tlangue_batiments['8'] = \"المطاحن\";\r\n\t\t\tlangue_batiments['9'] = \"مخبز\";\r\n\t\t\tlangue_batiments['10'] = \"المخزن\";\r\n\t\t\tlangue_batiments['11'] = \"مخزن الحبوب\";\r\n\t\t\tlangue_batiments['12'] = \"الحداد\";\r\n\t\t\tlangue_batiments['13'] = \"مستودع الدروع\";\r\n\t\t\tlangue_batiments['14'] = \"ساحة البطولة\";\r\n\t\t\tlangue_batiments['15'] = \"المبنى الرئيسي\";\r\n\t\t\tlangue_batiments['16'] = \"نقطة التجمع\";\r\n\t\t\tlangue_batiments['17'] = \"السوق\";\r\n\t\t\tlangue_batiments['18'] = \"السفارة\";\r\n\t\t\tlangue_batiments['19'] = \"الثكنة\";\r\n\t\t\tlangue_batiments['20'] = \"إسطبل\";\r\n\t\t\tlangue_batiments['21'] = \"المصانع الحربية\";\r\n\t\t\tlangue_batiments['22'] = \"الأكادمية الحربية\";\r\n\t\t\tlangue_batiments['23'] = \"المخبأ\";\r\n\t\t\tlangue_batiments['24'] = \"البلدية\";\r\n\t\t\tlangue_batiments['25'] = \"السكن\";\r\n\t\t\tlangue_batiments['26'] = \"القصر\";\r\n\t\t\tlangue_batiments['27'] = \"الخزنة\";\r\n\t\t\tlangue_batiments['28'] = \"المكتب التجاري\";\r\n\t\t\tlangue_batiments['29'] = \"الثكنة الكبيرة\";\r\n\t\t\tlangue_batiments['30'] = \"الأسطبل الكبير\";\r\n\t\t\tlangue_batiments['31'] = \"حائط المدينة\";\r\n\t\t\tlangue_batiments['32'] = \"الحائط الأرضي\";\r\n\t\t\tlangue_batiments['33'] = \"الحاجز\";\r\n\t\t\tlangue_batiments['34'] = \"الحجار\";\r\n\t\t\tlangue_batiments['35'] = \"المقهى\";\r\n\t\t\tlangue_batiments['36'] = \"الصياد\";\r\n\t\t\tlangue_batiments['37'] = \"قصر الأبطال\";\r\n\t\t\tlangue_batiments['38'] = \"المخزن الكبير\";\r\n\t\t\tlangue_batiments['39'] = \"مخزن الحبوب الكبير\";\r\n\t\t\tlangue_batiments['40'] = \"أعجوبة العالم أو المعجزة\";\r\n\t\t\tlangue_batiments['41'] = \"ساقية الخيول\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_textes['build'] = \"بناء\";\r\n\t\t\tlangue_textes['upgrade'] = \"تطوير\";\r\n\t\t\tlangue_textes['attack'] = \"هجوم\";\r\n\t\t\tlangue_textes['research'] = \"بحث\";\r\n\t\t\tlangue_textes['train'] = \"قطار\";\r\n\t\t\tlangue_textes['party'] = \"حفله\";\r\n\t\t\tlangue_textes['demolish'] = \"هدم\";\r\n\t\t\tlangue_textes['send_merchants'] = \"أرسال التجار\";\r\n\t\t\tlangue_textes['send_assistance'] = \"دعم البريد الإلكتروني\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"الموارد\";\r\n\t\t\tlangue_textes['villages'] = \"القرى\";\r\n\t\t\tlangue_textes['my_hero'] = \"بطلي\";\r\n\t\t\tlangue_textes['task_list'] = \"قائمة المهام\";\r\n\t\t\tlangue_textes['options'] = \"خيارات\";\r\n\t\t\tlangue_textes['options_right_side'] = \"الخانة في الجانب الأيمن\";\r\n\t\t\tlangue_textes['replace_hero'] = \"أستبدال شكل قائمة البطل؟\";\r\n\t\t\tlangue_textes['replace_player'] = \"أستبدال شكل قائمة الاعب؟\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"أستبدال شكل قائمة التحالف؟\";\r\n\t\t\tlangue_textes['replace_village'] = \"أستبدال شكل قائمة القرى؟\";\r\n\t\t\tlangue_textes['defense_village'] = \"أضافة أختصار \\\"أرسال القوات\\\"؟\";\r\n\t\t\tlangue_textes['merchant_village'] = \"أضافة أختصار \\\"أرسال التجار أو الموارد\\\"؟\";\r\n\t\t\tlangue_textes['add_resource'] = \"أضافة قائمة الموارد؟\";\r\n\t\t\tlangue_textes['position_resource'] = \"قائمة القرى قبل أو بعد؟\";\r\n\t\t\tlangue_textes['no'] = \"لا\";\r\n\t\t\tlangue_textes['yes'] = \"نعم\";\r\n\t\t\tlangue_textes['before_village'] = \"بعد قائمة القرى\";\r\n\t\t\tlangue_textes['after_village'] = \"قبل قائمة القرى\";\r\n\t\t\tlangue_textes['options_various'] = \"خيارات أخرى\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"أستبدال أسم الصفحة؟\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"أستبدال الشعار الأصلي؟\";\r\n\t\t\tlangue_textes['ready'] = \"Ready\";\r\n\t\t\tlangue_textes['never'] = \"أبداَ\";\r\n\t\t\tlangue_textes['required_resources'] = \"الموارد المطلوبة للإرتقاء الى المستوى التالي\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"أظهار كم تحتاج من الموارد للبناء؟\";\r\n\t\t\tlangue_textes['infinity'] = \"غير محدود\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"You have to upgrade wharehouse.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"You have to upgrade granary.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\tbreak;\r\n\t\tcase \"uk\": // English\r\n\t\tdefault:\r\n\t\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"Woodcutter\";\r\n\t\t\tlangue_batiments['2'] = \"Clay Pit\";\r\n\t\t\tlangue_batiments['3'] = \"Iron Mine\";\r\n\t\t\tlangue_batiments['4'] = \"Cropland\";\r\n\t\t\tlangue_batiments['5'] = \"Sawmill\";\r\n\t\t\tlangue_batiments['6'] = \"Brickyard\";\r\n\t\t\tlangue_batiments['7'] = \"Iron Foundry\";\r\n\t\t\tlangue_batiments['8'] = \"Flour Mill\";\r\n\t\t\tlangue_batiments['9'] = \"Bakery\";\r\n\t\t\tlangue_batiments['10'] = \"Warehouse\";\r\n\t\t\tlangue_batiments['11'] = \"Granary\";\r\n\t\t\tlangue_batiments['12'] = \"Blacksmith\";\r\n\t\t\tlangue_batiments['13'] = \"Armory\";\r\n\t\t\tlangue_batiments['14'] = \"Tournament Square\";\r\n\t\t\tlangue_batiments['15'] = \"Main Building\";\r\n\t\t\tlangue_batiments['16'] = \"Rally Point\";\r\n\t\t\tlangue_batiments['17'] = \"Marketplace\";\r\n\t\t\tlangue_batiments['18'] = \"Embassy\";\r\n\t\t\tlangue_batiments['19'] = \"Barracks\";\r\n\t\t\tlangue_batiments['20'] = \"Stable\";\r\n\t\t\tlangue_batiments['21'] = \"Siege Workshop\";\r\n\t\t\tlangue_batiments['22'] = \"Academy\";\r\n\t\t\tlangue_batiments['23'] = \"Cranny\";\r\n\t\t\tlangue_batiments['24'] = \"City Hall\";\r\n\t\t\tlangue_batiments['25'] = \"Residence\";\r\n\t\t\tlangue_batiments['26'] = \"Palace\";\r\n\t\t\tlangue_batiments['27'] = \"Treasury\";\r\n\t\t\tlangue_batiments['28'] = \"Trade Office\";\r\n\t\t\tlangue_batiments['29'] = \"Great Barracks\";\r\n\t\t\tlangue_batiments['30'] = \"Great Stable\";\r\n\t\t\tlangue_batiments['31'] = \"City Wall\";\r\n\t\t\tlangue_batiments['32'] = \"Earth Wall\";\r\n\t\t\tlangue_batiments['33'] = \"Palisade\";\r\n\t\t\tlangue_batiments['34'] = \"Stonemason\";\r\n\t\t\tlangue_batiments['35'] = \"Brewery\";\r\n\t\t\tlangue_batiments['36'] = \"Trapper\";\r\n\t\t\tlangue_batiments['37'] = \"Hero's Mansion\";\r\n\t\t\tlangue_batiments['38'] = \"Great Warehouse\";\r\n\t\t\tlangue_batiments['39'] = \"Great Granary\";\r\n\t\t\tlangue_batiments['40'] = \"Wonder\";\r\n\t\t\tlangue_batiments['41'] = \"Horse Drinking Trough\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"Lumber\";\r\n\t\t\tlangue_ressources['clay'] = \"Clay\";\r\n\t\t\tlangue_ressources['iron'] = \"Iron\";\r\n\t\t\tlangue_ressources['crop'] = \"Crop\";\r\n\t\t\t// Tasks\r\n\t\t\tlangue_textes['build'] = \"Build\";\r\n\t\t\tlangue_textes['upgrade'] = \"Upgrade\";\r\n\t\t\tlangue_textes['attack'] = \"Attack\";\r\n\t\t\tlangue_textes['research'] = \"Research\";\r\n\t\t\tlangue_textes['train'] = \"Train\";\r\n\t\t\tlangue_textes['party'] = \"Party\";\r\n\t\t\tlangue_textes['demolish'] = \"Demolish\";\r\n\t\t\tlangue_textes['send_merchants'] = \"Send Merchants\";\r\n\t\t\tlangue_textes['send_assistance'] = \"Send assistance\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"Ressources\";\r\n\t\t\tlangue_textes['villages'] = \"Villages\";\r\n\t\t\tlangue_textes['my_hero'] = \"My hero\";\r\n\t\t\tlangue_textes['task_list'] = \"Task list\";\r\n\t\t\tlangue_textes['options'] = \"Multi-Tools options\";\r\n\t\t\tlangue_textes['options_right_side'] = \"Right side column\";\r\n\t\t\tlangue_textes['replace_hero'] = \"Replace hero's framework ?\";\r\n\t\t\tlangue_textes['replace_player'] = \"Replace player's framework ?\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"Replace alliance's framework ?\";\r\n\t\t\tlangue_textes['replace_village'] = \"Replace village's framework ?\";\r\n\t\t\tlangue_textes['defense_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add shortcut \\\"send defense\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add shortcut \\\"send merchant\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"Add resource bars framework ?\";\r\n\t\t\tlangue_textes['position_resource'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Before or after village's framework ?\";\r\n\t\t\tlangue_textes['no'] = \"No\";\r\n\t\t\tlangue_textes['yes'] = \"Yes\";\r\n\t\t\tlangue_textes['before_village'] = \"Before village\";\r\n\t\t\tlangue_textes['after_village'] = \"After village\";\r\n\t\t\tlangue_textes['options_various'] = \"Various options\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"Replace name's page ?\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"Replace original logo ?\";\r\n\t\t\tlangue_textes['ready'] = \"Ready\";\r\n\t\t\tlangue_textes['never'] = \"Never\";\r\n\t\t\tlangue_textes['required_resources'] = \"Required resources to upgrade\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"Show ressourses needed in building's pages ?\";\r\n\t\t\tlangue_textes['infinity'] = \"Infinity\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"You have to upgrade wharehouse.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"You have to upgrade granary.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\tadd_log(3, \"get_language() > Fin.\");\r\n\t}", "function reloadLanguage() {\n document.querySelectorAll(\"*\").forEach(function (node) {\n let translate = node.getAttribute(\"data-translate\");\n let translateTitle = node.getAttribute(\"data-translate-title\");\n let translatePlaceholder = node.getAttribute(\"data-translate-placeholder\");\n let languageList = node.getAttribute(\"data-languages-list\");\n let custom = node.getAttribute(\"data-languages-custom\");\n\n let languagePath = loadedTranslationData[currentLang];\n let fallbackPath = loadedTranslationData[defaultLang];\n\n if (translate)\n node.innerHTML = languagePath[translate]\n ? languagePath[translate]\n : fallbackPath[translate]\n ? fallbackPath[translate]\n : translate;\n if (translateTitle)\n node.title = languagePath[translateTitle]\n ? languagePath[translateTitle]\n : fallbackPath[translateTitle]\n ? fallbackPath[translateTitle]\n : translateTitle;\n if (translatePlaceholder)\n node.placeholder = languagePath[translatePlaceholder]\n ? languagePath[translatePlaceholder]\n : fallbackPath[translatePlaceholder]\n ? fallbackPath[translatePlaceholder]\n : translatePlaceholder;\n if (languageList) {\n node.innerHTML = \"\";\n for (const locale of availableLanguages) {\n const langCode = locale.baseName;\n const languageNames = new Intl.DisplayNames([langCode], {type: 'language'});\n const dispName = languageNames.of(langCode);\n const replace = languageList\n .replace(/%langCode%/g, langCode)\n .replace(/%langDispName%/g, dispName)\n .replace(/%langCodeQ%/g, '\"' + langCode + '\"')\n .replace(/%langDispName%/g, '\"' + dispName + '\"');\n node.innerHTML += replace;\n }\n }\n if (custom) {\n const pairs = custom.split(\";\");\n for (const p in pairs)\n if (pairs.hasOwnProperty(p)) {\n const pair = pairs[p].split(\":\");\n const attr = pair[0];\n const valueKey = pair[1];\n const value = languagePath[valueKey]\n ? languagePath[valueKey]\n : fallbackPath[valueKey]\n ? fallbackPath[valueKey]\n : valueKey;\n node.setAttribute(attr, value);\n }\n }\n });\n}", "function initTranslations() {\n\ti18n.init( {\n\t\tresGetPath: '/TrixLoc/resources/locales/__lng__/__ns__.json',\n\t\tresPostPath: '/TrixLoc/resources/locales/add/__lng__/__ns__'\n\t}, function(t) {\n\t\t_t = t;\n\t\ttranslateAll(t);\n\t});\n}", "function localize(l10n, array)\n{\n for(var i = 0 ; i < array.length ; i++)\n {\n try\n {\n var node = document.querySelector('[data-l10n-id=' + array[i] + ']');\n if(node != null)\n {\n node.textContent = l10n.entities[array[i]].value;\n }\n }\n catch(e)\n {\n console.log(\"ERROR: cannot translate string \" + array[i]);\n }\n }\n}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n\t\t\t\thelpArray = [_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\"),_(\"help6\"),_(\"help7\"),_(\"help8\"),_(\"help9\"),_(\"help10\")];\n scope.heading = _(\"Young's Modulus-Uniform Bending\");\n\t\t\t\tscope.variables = _(\"Variables\"); \n\t\t\t\tscope.result = _(\"Result\"); \n\t\t\t\tscope.copyright = _(\"copyright\"); \n\t\t\t\tscope.environment_lbl = _(\"Select Environment\");\n\t\t\t\tscope.material_lbl = _(\"Select Material\");\n\t\t\t\tscope.mass_lbl = _(\"Mass of weight hanger : \");\n\t\t\t\tscope.material_lbl = _(\"Select Material\");\n\t\t\t\tscope.unit_gram = _(\"g\");\n\t\t\t\tscope.unit_cm = _(\"cm\");\n\t\t\t\tscope.breadth_lbl = _(\"Breadth of bar(b) : \");\n scope.thickness_lbl = _(\"Thickness of bar(d) : \");\n scope.blade_distance_lbl = _(\"Knife edge distance : \");\n scope.weight_hangers_distance_lbl = _(\"Weight hangers distance : \");\n scope.reset = _(\"Reset\");\n\t\t\t\tscope.result_txt = _(\"Young's Modulus of \");\n\t\t\t\tscope.environment_array = [{\n environment: _('Earth, g=9.8m/s'),\n value: 9.8\n }, {\n environment: _('Moon, g=1.63m/s'),\n value: 1.63\n }, {\n environment: _('Uranus, g=10.67m/s'),\n value: 10.67\n }, {\n environment: _('Saturn, g=11.08m/s'),\n value: 11.08\n }];\n scope.material_array = [{\n material: _('Wood'),\n value: 1.1\n }, {\n material: _('Aluminium'),\n value: 6.9\n }, {\n material: _('Copper'),\n value: 11.7\n }, {\n material: _('Steel'),\n value: 20\n }];\n\n scope.$apply();\t\t\t\t\n\t\t\t}", "function parseLanguage(str,i){var match=simpleLanguageRegExp.exec(str);if(!match)return null;var prefix=match[1],suffix=match[2],full=prefix;if(suffix)full+=\"-\"+suffix;var q=1;if(match[3]){var params=match[3].split(';');for(var i=0;i<params.length;i++){var p=params[i].split('=');if(p[0]==='q')q=parseFloat(p[1]);}}return{prefix:prefix,suffix:suffix,q:q,i:i,full:full};}", "constructor(locale) {\n const result = localeRe.exec(locale.replace(/_/g, \"-\"));\n if (!result) {\n this.isWellFormed = false;\n return;\n }\n\n let [, language, script, region, variant] = result;\n\n if (language) {\n this.language = language.toLowerCase();\n }\n if (script) {\n this.script = script[0].toUpperCase() + script.slice(1);\n }\n if (region) {\n this.region = region.toUpperCase();\n }\n this.variant = variant;\n this.isWellFormed = true;\n }", "function _localize(s) {\n\tvar strings = {\n\t\t\"&Arguments\": {\n\t\t\tru: \"&Аргументы\"\n\t\t},\n\t\t\"OK\": {\n\t\t\tru: \"ОК\"\n\t\t},\n\t\t\"Exec\": {\n\t\t\tru: \"Запустить\"\n\t\t},\n\t\t\"Edit\": {\n\t\t\tru: \"Изменить\"\n\t\t},\n\t\t\"Cancel\": {\n\t\t\tru: \"Отмена\"\n\t\t}\n\t};\n\tvar lng;\n\tswitch(AkelPad.GetLangId(1 /*LANGID_PRIMARY*/)) {\n\t\tcase 0x19: lng = \"ru\"; break;\n\t\tdefault: lng = \"en\";\n\t}\n\t_localize = function(s) {\n\t\treturn strings[s] && strings[s][lng] || s;\n\t};\n\treturn _localize(s);\n}", "changeLanguage (language) {\n COMPONENT.innerHTML = DATA.lang[language];\n }", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n helpArray=[_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\")];\n scope.heading=_(\"Moment of Inertia of Flywheel\");\n scope.variables=_(\"Variables\"); \n scope.result=_(\"Result\"); \n scope.copyright=_(\"copyright\"); \n scope.choose_enviornment = _(\"Choose Environment:\");\n cm = _(\" cm\");\n scope.kg = _(\"kg\");\n scope.cm = cm;\n scope.gm = _(\"gm\");\n scope.earth = _(\"Earth, g=9.8m/s\");\n scope.mass_of_fly_wheel_lbl = _(\"Mass of fly wheel:\");\n scope.dia_of_fly_wheel_lbl = _(\"Diameter of fly wheel:\");\n scope.mass_of_rings_lbl = _(\"Mass of rings:\");\n scope.axle_diameter_lbl = _(\"Diameter of axle:\");\n scope.no_of_wound_lbl = _(\"No. of wound of chord:\");\n scope.mInertia_lbl = _(\"First start experiment..!\");\n scope.mInertia_val = \"\";\n btn_lbls = [_(\"Release fly wheel\"),_(\"Hold fly wheel\")];\n scope.release_hold_txt = btn_lbls[0];\n scope.reset = _(\"Reset\");\n scope.enviornment_array = [{\n enviornment: _('Earth, g=9.8m/s'),\n type: 9.8\n }, {\n enviornment: _('Moon, g=1.63m/s'),\n type: 1.63\n }, {\n enviornment: _('Uranus, g=10.5m/s'),\n type: 10.5\n }, {\n enviornment: _('Saturn, g=11.08m/s'),\n type: 11.08\n }, {\n enviornment: _('Jupiter, g=25.95m/s'),\n type: 25.95\n }];\n scope.$apply(); \n }", "function setLanguage() {\n services.tts.then(function(tts) {\n\tif (game.german) tts.setLanguage('German');\n\telse tts.setLanguage('English');\n });\n}", "_transformIfLanguageDeterminated(baseText, map, extendedMap) {\n if ((! this._isEnglish) && (! this._isRussian)) {\n return baseText;\n }\n let text = this._current + baseText;\n\n this._current = this._getNextChunkData(text, extendedMap);\n if (this._current.length > 0) {\n text = text.substr(0, text.length - this._current.length);\n }\n\n for (let item in extendedMap) {\n let regex = new RegExp(item, 'g');\n text = text.replace(regex, extendedMap[item]);\n }\n\n for (let item in map) {\n let regex = new RegExp(item, 'g');\n text = text.replace(regex, map[item]);\n }\n\n return text;\n }", "_determineTargetLanguage(text) {\n if ((! this._isRussian) && (! this._isEnglish)) {\n this._isRussian = /[а-яА-Я]/.test(text);\n // only one of the flags will be set\n if (! this._isRussian) {\n this._isEnglish = /[a-zA-Z]/.test(text);\n }\n }\n }", "function greet(lang) {\n switch (lang) {\n case 'en':\n console.log('hello!');\n break;\n case 'es':\n console.log('hola');\n break;\n case 'fr':\n console.log('bonjour!');\n }\n}", "function switchLanguage()\r\n{\r\n\t$('[data-translation]').each(function ()\r\n\t{\r\n\t\tvar text = $(this).attr('data-translation');\r\n\t\tvar oldText = $(this).text();\r\n\t\t$(this).attr('data-translation', oldText);\r\n\t\t$(this).text(text);\r\n\t});\r\n}", "get language() { return 'all'; }", "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Directly enable the good escort options';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'When the escort mode is enabled, you can directly be taken further away and your rucksack objects can be manipulated.';\n\n i18n[I18N.LANG.FR] = {};\n i18n[I18N.LANG.FR][MODULE_NAME + '_short_desc'] = 'Activer les bonnes options d\\'escorte automatiquement';\n i18n[I18N.LANG.FR][MODULE_NAME + '_full_desc'] = 'Quand le mode escorte est activé, vous pouvez automatiquement être éloigné de la ville et les objets de votre sac peuvent être manipulés.';\n\n I18N.set(i18n);\n }", "function loadLangs() \n{\n\tif (jsonObject.phraseArray.length)\n\t{\n\t\tchrome.storage.sync.get({\n\t\t\tfrom: 'en',\n\t\t\tto: 'es',\n\t\t}, function(items) {\n\t\t\tjsonObject.fromLang = items.from;\n\t\t\tjsonObject.toLang = items.to;\n\t\t\tgetTranslation();\n\t\t});\n\t}\n}", "function learnJS(lang, callback) {\n console.log(\"I learn \" + lang);\n callback();\n}", "function addGoogTrans() {\r\n\treturn ''; // NOT USING YET\r\n}", "function languageChecks(name) {\n if (language === '1') {\n prompt(jsonMessages['English'][name]);\n } else if (language === '2') {\n prompt(jsonMessages['Spanish'][name]);\n }\n}", "function t(e,t,a){var i,s;return\"m\"===a?t?\"хвіліна\":\"хвіліну\":\"h\"===a?t?\"гадзіна\":\"гадзіну\":e+\" \"+(i=+e,s={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[a].split(\"_\"),i%10==1&&i%100!=11?s[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?s[1]:s[2])}", "function controlLanguage(langString) {\n localStorage.setItem(\"language\", langString);\n renderTranslation(eval(\"json\"+langString));\n }", "function storageLang(index) {\r\n\tvar type = {\r\n\t\t'ko': 0,\r\n\t\t'ko-KR': 0,\r\n\t\t'en-US': 1,\r\n \t'ja': 2,\r\n \t'ja-JP': 2,\r\n \t'cn': 3,\r\n \t'zh-cn': 3\r\n\t}\r\n\r\n\tvar text = [\r\n\t\t[\r\n\t\t\t\"하드디스크\", // 0\r\n\t \"이동디스크\",\r\n\t \"보안토큰\",\r\n\t \"저장토큰\",\r\n\t \"안전디스크\",\r\n\r\n\t \"구동에 실패하였습니다.\\n\\n IE인터넷 옵션 -> 보안 \\n 인터넷 보호모드 check, 신뢰사이트 보호모드 check \\n\", // 5\r\n\t \"지원되지 않습니다.\",\r\n\t \r\n\t \"인증서의 유출가능성이 있어 안전하지 않습니다.<br><br>PC를 공용으로 상용하는 경우는 더 위험하오니,<br>USB메모리, 보안토큰, IC카드 등을 이용하십시오.\", // 7\r\n\t \"USB 메모리의 경우,<br>하드디스크와 동일하게 인식되어 이용이 매우 편리합니다.<br>\",\r\n\t \" - 보안기능이 탑재된 가장 우수한 장치입니다.<br> - 국내 표준 인증을 받은 제품 이외에는<br>&nbsp;&nbsp;해당매체를 지원하지 못합니다<br> - 인증서 발급시 몇 분이 소요될 수 있습니다.\",\r\n\t \" - 접근속도가 저장매체중 비교적 낮습니다<br> - 저장매체의 안전성(보안성)이 우수합니다.\",\r\n\r\n\t \t// html 언어\r\n\t\t\t\"인증서 저장매체 선택\",\t// 11\r\n\t\t\t\"저장매체 선택\",\r\n\t\t\t\"[설명]\",\r\n\t\t\t\"확인\",\r\n\t\t\t\"취소\",\r\n\t\t\t\"이동식매체 선택\",\t// 16\r\n\r\n\t\t\t\"저장매체를 선택하세요.\",\t// 17\r\n\r\n\t\t\t// 언어 세팅이 일본어일때 저장매체 영어로\r\n\t\t\t\"HardDisk\", // 18\r\n\t \"Removable\",\r\n\t \"CryptoToken\",\r\n\t \"SaveToken\",\r\n\t \"SecureDisk\",\r\n\r\n\t // 안전디스크 설명문\r\n\t\t\t \"하드디스크의 특정영역을 암호화하고, <br>별도의 인증절차를 통해서만 접근할 수 있도록 만든 <br>안전한 디스크 영역으로 공인인증서를 안전디스크에 저장함으로써 <br>위험요소를 최소화 하였습니다.\",\t// 23\r\n\t\t\t \"공통저장소\"\r\n\t\t],\r\n\t\t[\r\n\t\t\t\"HardDisk\", // 0\r\n\t \"Removable\",\r\n\t \"CryptoToken\",\r\n\t \"SaveToken\",\r\n\t \"SecureDisk\",\r\n\r\n\t \"Failedtoinitialize, IE internet Option -> security-> internet protected mode check, -> trusted site protecet mode check \", // 5\r\n\t \"Not Supported.\",\r\n\r\n\t \"This storage isn't safe, there is the possibility of certificate leakage.<br><br>It could be very unsafe, if you are using public PC.<br>It is stongly recommended using Removable Disk, Crypto Token, IC Card.\",\r\n\t \"The removable disk is very easy to use, because it is recognized in the same manner as a hard disk.<br>\",\r\n\t \" - This is the best storage device that is equipped with security functions.<br> - Except for products received national certification standards <br>&nbsp;&nbsp;do not support the device.<br> - It may take a few minutes during certificate issuance.\",\r\n\t \" - This storage is relatively low access speed of the storage media.<br> - This storage has excellent the safety and security.\",\r\n\r\n\t // html 언어\r\n\t\t\t\"Select certificate storage\",\t// 11\r\n\t\t\t\"Select storage\",\r\n\t\t\t\"[description]\",\r\n\t\t\t\"OK\",\r\n\t\t\t\"Cancel\",\r\n\t\t\t\"Select Removable Disk\",\t// 16\r\n\r\n\t\t\t// 새로 추가됨\r\n\t\t\t\"Select storage.\",\t// 17\r\n\r\n\t\t\t// 언어 세팅이 일본어일때 저장매체 영어로\r\n\t\t\t\"HardDisk\", // 18\r\n\t \"Removable\",\r\n\t \"CryptoToken\",\r\n\t \"SaveToken\",\r\n\t \"SecureDisk\",\r\n\r\n\t // 안전디스크 설명문\r\n\t \"하드디스크의 특정영역을 암호화하고, <br>별도의 인증절차를 통해서만 접근할 수 있도록 만든 <br>안전한 디스크 영역으로 공인인증서를 안전디스크에 저장함으로써 <br>위험요소를 최소화 하였습니다.\",\t// 23\r\n\t\t\t \"공통저장소\"\r\n\t\t],\r\n\t\t[\r\n\t\t\t\"ハードディスク\", // 0\r\n\t \"リムーバブルディスク\",\r\n\t \"セキュリティトークン\",\r\n\t \"ICトークン\",\r\n\t \"安全ディスク\",\r\n\r\n\t \"起動に失敗しました。\\n\\nIEインターネットオプション -> セキュリティ\\nインターネット保護モードcheck、信頼済みサイト保護モードcheck \\n\", // 5\r\n\t \"サポートされていません。\",\r\n\t \r\n\t \"認証書はハッキングの可能性があって危険です。<br><br>共用PCを使用する場合はより危険なので、<br>USBメモリ、セキュリティトークン、ICカードなどを利用してください。\", // 7\r\n\t \"USBメモリの場合、<br>ハードディスクと同一に認識されて利用が非常に便利です。<br>\",\r\n\t \" -セキュリティ機能がある最も優れた装置です。<br>- 国内標準認証を受けた製品以外には<br>&nbsp;&nbsp;その媒体をサポートすることができません。<br>- 認証書の発給時には数分時間がかかる場合があります。\",\r\n\t \" -アクセル速度が保存媒体の中で比較的低いです。<br>-保存媒体の安全(セキュリティ)性が優れます。\",\r\n\r\n\t // html 언어\r\n\t\t\t\"認証書保存媒体の選択\",\t// 11\r\n\t\t\t\"保存媒体の選択\",\r\n\t\t\t\"[説明]\",\r\n\t\t\t\"確認\",\r\n\t\t\t\"取消\",\r\n\t\t\t\"USB媒体の選択\",\t// 16\r\n\r\n\t\t\t// 새로 추가됨\r\n\t\t\t\"保存媒体のを選択してください。\",\t// 17\r\n\r\n\t\t\t// 언어 세팅이 일본어일때 저장매체 영어로\r\n\t\t\t\"HardDisk\", // 18\r\n\t \"Removable\",\r\n\t \"CryptoToken\",\r\n\t \"SaveToken\",\r\n\t \"SecureDisk\",\r\n\r\n\t // 안전디스크 설명문\r\n\t \"하드디스크의 특정영역을 암호화하고, <br>별도의 인증절차를 통해서만 접근할 수 있도록 만든 <br>안전한 디스크 영역으로 공인인증서를 안전디스크에 저장함으로써 <br>위험요소를 최소화 하였습니다.\",\t// 23\r\n\t\t\t \"공통저장소\"\r\n\t\t],\r\n\t\t[\r\n\t\t\t\"硬盘\", // 0\r\n\t \"移动硬盘\",\r\n\t \"安全令牌\",\r\n\t\t\t\"储存令牌\",\r\n\t\t\t\"安全磁盘\",\r\n\r\n\t \"驱动失败.\\n\\n IE互联网选项 -> 安全 \\n 互联网保护模式 check, 可信任网址保护模式 check \\n\", // 5\r\n\t \"不受支持.\",\r\n\t \r\n\t \"认证书有泄漏的危险.<br><br>使用公用电脑的话更加危险,<br>请使用USB, 安全令牌, IC卡等.\", // 7\r\n\t \"USB,<br>将被识别为移动硬盘,使用起来非常便捷.<br>\",\r\n\t \" - 搭载安保功能的最优秀的设备.<br> - 国内获得标准认证的产品以外<br>&nbsp;&nbsp;不支持相关媒体<br> - 证书签发需要几分钟.\",\r\n\t \" - 接触速度相对于其他储存媒体较低<br> - 储存媒体的安全性(保安性)良好.\",\r\n\r\n\t \t// html 언어\r\n\t\t\t\"认证书储存媒体选择\",\r\n\t\t\t\"储存媒体选择\",\r\n\t\t\t\"[说明]\",\r\n\t\t\t\"确认\",\r\n\t\t\t\"取消\",\r\n\t\t\t\"移动媒体选择\",\r\n\r\n\t\t\t\"请选择储存媒体.\",\t\t// 17\r\n\r\n\t\t\t// 언어 세팅이 일본어일때 저장매체 영어로\r\n\t\t\t\"HardDisk\", // 18\r\n\t \"Removable\",\r\n\t \"CryptoToken\",\r\n\t \"SaveToken\",\r\n\t \"SecureDisk\",\r\n\r\n\t // 안전디스크 설명문\r\n\t \"硬盘特定领域加密, <br>通过额外的认证程序才可以靠近 <br>以此创建安全的磁盘区 <br>使存放在安全磁盘的公认认证书的安全风险降到最低.\",\t// 23\r\n\t\t\t \"공통저장소\"\r\n\t\t]\r\n\t];\r\n\r\n\tvar brwoserLang = (function () {\r\n\t\tif (typeof (window.navigator.browserLanguage) === 'undefined')\r\n\t\t\treturn window.navigator.language;\r\n\t\treturn window.navigator.browserLanguage;\r\n\t})();\r\n\r\n\tvar _config = VestSign.getConfig();\r\n\tif(_config.langIndex === undefined)\r\n\t\treturn text[type[brwoserLang]][index];\r\n\r\n\treturn text[_config.langIndex][index];\r\n}", "function sayHello(name, language)\n{\n if (language === \"de\")\n {\n console.log(\"Hallo Welt \" + name + \"!\")\n }\n else if (language === \"en\")\n {\n console.log((\"Hi \" + name + \"!\"))\n }\n \n}", "function i18n(tag) {\n return '<%= __(\"' + tag + '\") %>';\n}" ]
[ "0.7186397", "0.7186397", "0.7186397", "0.71283567", "0.71283567", "0.7121588", "0.7121588", "0.7110207", "0.6952862", "0.6790221", "0.6766629", "0.6725471", "0.6504188", "0.6451519", "0.63734365", "0.63401806", "0.63004434", "0.6299742", "0.6285467", "0.62538856", "0.6246662", "0.6246662", "0.6246662", "0.61069787", "0.6097102", "0.6070202", "0.6060222", "0.6048868", "0.6035088", "0.60222995", "0.6013007", "0.6012724", "0.5979652", "0.5979652", "0.5974719", "0.597282", "0.5962295", "0.5958374", "0.5939204", "0.5909798", "0.5909607", "0.58927095", "0.5881844", "0.58802193", "0.5866691", "0.5865267", "0.58489203", "0.58401483", "0.5839903", "0.58284384", "0.5826572", "0.5816448", "0.5807555", "0.5802613", "0.57909054", "0.57777286", "0.57614094", "0.57594645", "0.57591426", "0.5757456", "0.573127", "0.57286495", "0.572105", "0.57201684", "0.57201385", "0.57189333", "0.57164496", "0.57134926", "0.5706208", "0.57048094", "0.5703356", "0.5701247", "0.5699619", "0.56990093", "0.56953", "0.56938016", "0.5691652", "0.56881785", "0.56858987", "0.567735", "0.5669808", "0.56630445", "0.5656868", "0.565093", "0.56500316", "0.5648196", "0.56473464", "0.56444615", "0.5637999", "0.5635809", "0.5629508", "0.56230456", "0.56206816", "0.5612647", "0.5610802", "0.560842", "0.55987734", "0.5597764", "0.5596946", "0.55941814", "0.5587533" ]
0.0
-1
Extract the directory portion of a path dirname("a/b/c.js?t=123xx/zz") ==> "a/b/" ref:
function dirname(path) { return path.match(DIRNAME_RE)[0] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dirname(url) {\n const slashIndex = url && url.lastIndexOf('/');\n return slashIndex >= 0 ? url.substr(0, slashIndex) : '';\n}", "function dirname(url) {\n const slashIndex = url && url.lastIndexOf('/');\n return slashIndex >= 0 ? url.substr(0, slashIndex) : '';\n}", "function sc_dirname(p) {\n var i = p.lastIndexOf('/');\n\n if(i >= 0)\n return p.substring(0, i);\n else\n return '';\n}", "function dirname( path ){\n\treturn path.match( DIRNAME_RE )[ 0 ]\n}", "function dirname(path) {\n return path.replace(/\\\\/g, '/').replace(/\\/[^\\/]*$/, '');;\n}", "function dirname(path) {\n return path.replace(/\\\\/g, '/').replace(/\\/[^\\/]*$/, '');;\n}", "function dirname(path) {\r\n return path.replace(/\\\\/g,'/').replace(/\\/[^\\/]*$/, '');;\r\n}", "function urldir(pathname) {\n var path = pathname.slice(1);\n if (path.slice(-1) === '/') {\n path = path.slice(0, -1);\n }\n if (path.indexOf('/') > 0) {\n var parts = path.split('/');\n } else {\n return path;\n }\n var filedir = parts[(parts.length - 1)];\n if (filedir.indexOf('.') > 0) {\n return parts[(parts.length - 2)];\n } else {\n return filedir;\n }\n}", "function dirname(path) {\n var s = ('./' + path).replace(/(.*)?\\/.*/, '$1').substring(2);\n return (s ? s : '.') + '/';\n }", "function dirname(dir) {\n if ( dir ) {\n var tmp = dir.split(\"/\");\n if ( tmp.length > 1 ) {\n tmp.pop();\n }\n return tmp.join(\"/\") || \"/\";\n }\n\n return val;\n}", "function directoryOf(/*string*/ href) {\n return href.substring(0, href.lastIndexOf('/'));\n }", "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n }", "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n}", "function getDirFromUrl(url) {\n var regex = new RegExp(\"[\\\\?&]dir=([^&#]*)\");\n results = regex.exec(url);\n return results[1] ? decodeURIComponent(results[1]).replace(/\\+/g, ' ') : '/';\n}", "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "function dirname(path) {\n var dir = path.replace(/\\\\/g, '/').replace(/\\/[^\\/]*$/, '');\n if (dir == '') {\n return '/';\n } else {\n return dir;\n }\n}", "function dirname(path) {\r\n\t\treturn path.match(DIRNAME_RE)[0]\r\n\t}", "function dirname(path) {\n\treturn path.match(DIRNAME_RE)[0];\n}", "function getParsedPath(url) {\n return _path.default.parse(_url.default.parse(url).pathname || ``);\n}", "function dirname(path) {\n return path.match(DIRNAME_RE)[0];\n }", "function dirname(file, n) {\n let i;\n if (n <= 1) {\n i = file.lastIndexOf('/');\n if (i < 0) {\n return '';\n }\n }\n else {\n i = file.length;\n while (--n >= 0) {\n i = i ? file.lastIndexOf('/', i - 1) : -1;\n if (i < 0) {\n return n || file[0] == '/' ? null : '';\n }\n }\n }\n return i ? file.slice(0, i) : '/';\n}", "pathFromUrl(url) {\n return url.substring(0, url.lastIndexOf(\"/\") + 1);\n }", "pathFromUrl(url) {\n return url.substring(0, url.lastIndexOf(\"/\") + 1);\n }", "function getDir(str) {\n return str.match(/^(?:.*[\\/\\\\])?/)[0];\n }", "function dirname(path) {\r\n return path.split(\"/\").slice(0, -1).join(\"/\") + \"/\";\r\n }", "function GetPathFromURL(url) {\n if (!url.length) return url; // empty string\n\n var lastCh = url.charAt(url.length - 1);\n if (lastCh === \"/\" || lastCh === \"\\\\\") return url; // already a path terminated by slash\n\n var last_slash = url.lastIndexOf(\"/\");\n if (last_slash === -1) last_slash = url.lastIndexOf(\"\\\\\");\n if (last_slash === -1) return \"\"; // neither slash found, assume no path (e.g. \"file.ext\" returns \"\" as path)\n\n return url.substr(0, last_slash + 1);\n }", "function dirname(path) {\n const output = normalize(path).split('/');\n return output.splice(0, output.length - 1).join('/');\n }", "function dirname(dir) {\r\n dir = path.resolve(dir || '');\r\n try {\r\n var stat = fs.statSync(dir);\r\n if (stat.isFile()) {\r\n dir = path.dirname(dir);\r\n }\r\n return path.basename(dir);\r\n } catch (err) {}\r\n return null;\r\n}", "dirname(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return (entry.parent || entry).fullpath();\n }", "function dirname(path) {\n return path.split(\"/\").slice(0, -1).join(\"/\") + \"/\";\n }", "parsePath(url) {\n\t\tvar ret = \"\";\n\n\t\t// In case the url has a protocol, remove it.\n\t\tvar protocolSplit = url.split(\"://\");\n\t\tvar withoutProtocol;\n\t\tif (protocolSplit.length > 1) {\n\t\t\twithoutProtocol = protocolSplit[1];\n\t\t} else {\n\t\t\twithoutProtocol = protocolSplit[0];\n\t\t}\n\n\t\tvar host = withoutProtocol.split(\"?\")[0];\n\t\tvar pathIndex = host.indexOf(\"/\");\n\t\tif (pathIndex !== -1) {\n\t\t\tret = host.substring(pathIndex, host.length);\n\t\t} else {\n\t\t\tret = \"/\";\n\t\t}\n\n\t\treturn ret;\n\t}", "function recuperaPath(url)\n{\n\ttry {\n\t\tvar result = url.match(/[-_\\w]+[.][\\w]+$/i)[0];\n\t}\n\tcatch(err) {\n\t\t//console.log(err);\n\t\tvar result = \" \";\n\t}\n\treturn result;\n}", "function r(r){let e,t;return r.replace(/^(.*\\/)?([^/]*)$/,((r,a,i)=>(e=a||\"\",t=i||\"\",\"\"))),{dirPart:e,filePart:t}}", "function RemoveLastDirectoryPartOf(the_url) {\n var the_arr = the_url.split('/');\n the_arr.pop();\n return (the_arr.join('/'));\n }", "function r$1(r){let e,t;return r.replace(/^(.*\\/)?([^/]*)$/,((r,a,i)=>(e=a||\"\",t=i||\"\",\"\"))),{dirPart:e,filePart:t}}", "function getURLPath(url) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getPath();\n}", "function getURLPath(url) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getPath();\n}", "static getDirAndFilenameFromURI(uri) {\n let directory = \"\";\n let filename = \"\";\n // const regexMatch = this.uri.match(/(.*\\/)([^\\/]*)$/);\n const regexMatch = uri.match(/(.*\\/)?([^\\/]*)$/);\n if (regexMatch !== null) {\n // files on root directoy will lead to first match to be undefined\n directory = regexMatch[1] || \"\";\n filename = regexMatch[2];\n }\n return [directory, filename];\n }", "function sc_basename(p) {\n var i = p.lastIndexOf('/');\n\n if(i >= 0)\n return p.substring(i + 1, p.length);\n else\n return p;\n}", "get dirname() {\n return typeof this.path === 'string' ? path$1.dirname(this.path) : undefined\n }", "function getFilename(url) {\n var lastSlashPos = url.lastIndexOf('/', url.length - 2);\n return url.substr(lastSlashPos + 1);\n}", "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n return url.substring(0,indexOfTS)+\"//\"+fp.split(\"/\")[0];\n }\n\n }", "function getPath(requrl){\n requrl = url.parse(requrl).pathname.split('/');\n return requrl[requrl.length-1];\n}", "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n return url.substring(0,indexOfTS)+\"//\"+fp.split(\"/\")[0];\n }\n\n }", "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n return url.substring(0,indexOfTS)+\"//\"+fp.split(\"/\")[0];\n }\n\n }", "function l(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");\n// XXX: It is possible to remove this block, and the tests still pass!\nvar n=o(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function GetURLPath(url) {\n var path = url.split('/');\n\n var urlPath = '';\n for (var index = 0; index < (path.length-1); index++)\n {\n urlPath = urlPath + path[index] + '/';\n }\n\n return urlPath;\n}", "static dir(path) {\n const n = path.lastIndexOf(\"/\");\n return path.substring(0, n + 1);\n }", "_getPathFromUrl () {\n return window.location.toString().split(/[?#]/)[0]\n }", "function getDirName(path) {\n if (path == null) {\n return null;\n }\n var index = path.lastIndexOf(\"/\");\n return index == -1 ? null : path.substring(0, index);\n}", "function extractUrlCode(str) {\n\t\tstr = str.split('/');\n\t\tstr = str[str.length - 1];\n\t\treturn str;\n\t}", "function basename(dir) {\n if ( dir && dir.split ) {\n var expl = dir.split(\"/\");\n return expl.length ? (expl[expl.length - 1]) : null;\n }\n\n return dir;\n}", "function GetPath(url) {\n var loc = location.href;\n if (loc.charAt(loc.length - 1) != '/')\n loc += '/';\n return loc + url;\n}", "get dirname() {\n return typeof this.path === 'string' ? path.dirname(this.path) : undefined\n }", "function getFilenameFromUrl(url) {\n var anchor = url.indexOf('#');\n var query = url.indexOf('?');\n var end = Math.min(anchor > 0 ? anchor : url.length, query > 0 ? query : url.length);\n return url.substring(url.lastIndexOf('/', end) + 1, end);\n }", "function getFilename(url) {\n return url.split('/').pop();\n }", "function extractCurrentPath(path){\r\n\tvar result = \"\";\r\n\tvar parts = path.split(\"/\");\r\n\tif(path.charAt(path.length - 1) == \"/\"){\r\n\t\tfor (var i = 0; i < parts.length-2; i++) {\r\n\t\t\tresult += parts[i] + \"/\";\r\n\t\t}\r\n\t}else{\r\n\t\tfor (var i = 0; i < parts.length-1; i++) {\r\n\t\t\tresult += parts[i] + \"/\";\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "function dirname(path) {\n let dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }", "function getUrlFilename(url) {\n if (typeof url === 'string') {\n //remove query strings\n return url.split(/[?#]/)[0].split(\"/\").pop();\n }\n return undefined;\n }", "function dirname(path) {\n var dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }", "function removePath(url) {\r\n var arr = url.split('?');\r\n arr.pop();\r\n return( arr.join('/') );\r\n}", "function GetFilename(url){\n if (url){\n var m = url.toString().match(/.*\\/(.+?)\\./);\n if (m && m.length > 1){\n return m[1];\n }\n }\n return \"\";\n}", "function pathname(url) {\n return urlWithoutProtocol(url).replace(hostReg, '');\n }", "static getDirectory(path) {\n let index = Math.max(path.lastIndexOf(\"/\"), path.lastIndexOf(\"\\\\\"));\n return path.substring(0, (index >= 0 ? index : path.length));\n }", "function parseName(_url) {\n return url.parse(_url).pathname;\n}", "function parsePath(p) {\n var extname = path.extname(p);\n return {\n dirname: path.dirname(p),\n basename: path.basename(p, extname),\n extname: extname\n };\n}", "function basename(url) {\n\treturn url.replace(/\\\\/g,'/').replace( /.*\\//, '' );\n}", "function basename(s) {\n var r = s.split('/');\n var last_one = r[r.length-1];\n var matchbox = last_one.match(/^(\\w+).*$/);\n if(matchbox === null)\n {\n return false;\n }else{\n return matchbox[1]\n }\n}", "get dirname() {\n return typeof this.path === 'string' ? path__default[\"default\"].dirname(this.path) : undefined\n }", "function normalizePath(url, type) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}", "function getFileName(url) {\r\n var tmp,last;\r\n last = url.lastIndexOf('\\\\');\r\n tmp = url.substring(last + 1, url.length);\r\n return tmp;\r\n}", "function s(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");// XXX: It is possible to remove this block, and the tests still pass!\nvar n=r(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function getFilePath(url, commitType, baseBranch) {\n let fpath = url.split(commitType)[1];\n fpath = fpath.replace(`/${baseBranch}`, '');\n return fpath;\n}", "function urlToPath(str) {\n var pathArray = str.split(\"/\");\n var url = pathArray[0] + \"//\" + pathArray[2];\n\n return str.replace(url, \"\");\n}", "function basenameFromUrl(url) {\n return q.unescape(path.basename(url));\n}", "function lastPart(url) {\n return removeTrailingSlash(url).split('/').pop();\n}", "function getURLStringForCwd() {\n try {\n return getURLFromFilePath(`${process.cwd()}/`).href;\n } catch (e) {\n e.stack;\n // If the current working directory no longer exists.\n if (e.code === 'ENOENT') {\n return undefined;\n }\n throw e;\n }\n}", "function normalizePath(url, type) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n }", "static getLocalPath(url) {\n if (!/^[\\w-]+:\\/\\//.test(url)) {\n return url;\n }\n if (url.toLocaleLowerCase().startsWith('file://')) {\n return url.replace(/^file:\\/\\//i, '');\n }\n return undefined;\n }", "function getPathname(url){\n var $anchor = $('<a></a>');\n $anchor.attr('href', url);\n return $anchor.prop('pathname');\n }", "GetCurrentRelativePath() {\n return decodeURI(window.location.pathname.substr(1));\n }", "function getRelativePath(dir) {\n var standardizedDir = dir.replace(SEP_PATT, \"/\");\n //remove the workspace path\n return standardizedDir.replace(\n workspacePath.replace(SEP_PATT, \"/\")\n , \"\"\n )\n //remove the source directory\n .replace(\n defaults.sourceDirectory\n , \"\"\n )\n //remove the left over path separaters from the begining\n .replace(\n LEADING_SEP_PATT\n , \"\"\n );\n }", "function here(d) {\n\tif (!d){ return __dirname; }\n\treturn path.resolve(__dirname, d);\n}", "function basename(path) { return path.replace( /.*\\//, \"\" ); }", "function getNonRootPath (url) {\n if (url) {\n const { pathname } = new URL(url)\n return pathname === '/' ? null : pathname\n }\n}", "function getLastOfUrl(url) {\n url = url.split('/');\n url.pop();\n url = url.pop();\n return url;\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}", "function getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}" ]
[ "0.7684736", "0.7684736", "0.7474577", "0.7028416", "0.6948202", "0.6948202", "0.6931474", "0.67882746", "0.67527723", "0.6701431", "0.6695406", "0.6694862", "0.6692878", "0.6647446", "0.6643584", "0.6643584", "0.6643584", "0.6643584", "0.6643584", "0.6643584", "0.6616779", "0.6600424", "0.6564935", "0.6544319", "0.6516955", "0.64848095", "0.64831096", "0.64831096", "0.6475164", "0.64268744", "0.6420236", "0.6416227", "0.6390307", "0.6369348", "0.6365405", "0.63653225", "0.6272377", "0.62252903", "0.6215073", "0.6207265", "0.6139719", "0.6139719", "0.61366", "0.6074687", "0.6057437", "0.6041829", "0.6041553", "0.6027504", "0.60214746", "0.60214746", "0.5984457", "0.5958063", "0.59514236", "0.5942012", "0.59305316", "0.58922553", "0.5891589", "0.58814245", "0.5871847", "0.58715767", "0.5857801", "0.58486724", "0.58261955", "0.5821274", "0.5818462", "0.5811276", "0.5804674", "0.5793326", "0.57211983", "0.5710512", "0.56993115", "0.5695542", "0.56856483", "0.5678883", "0.5672689", "0.56689835", "0.5642998", "0.56055874", "0.55957043", "0.55873984", "0.5570887", "0.55534446", "0.55485755", "0.55288845", "0.5525121", "0.5523479", "0.55094075", "0.5508946", "0.54997844", "0.5487024", "0.54843634", "0.54755497", "0.54755497", "0.54755497", "0.54755497", "0.54755497", "0.54755497", "0.54755497", "0.54755497", "0.54755497" ]
0.66551626
13
Canonicalize a path realpath(" ==> "
function realpath(path) { // /a/b/./c/./d ==> /a/b/c/d path = path.replace(DOT_RE, "/") // "file:///a//b/c" ==> "file:///a/b/c" // "http://a//b/c" ==> "http://a/b/c" // "https://a//b/c" ==> "https://a/b/c" // "/a/b//" ==> "/a/b/" path = path.replace(MULTIPLE_SLASH_RE, "$1\/") // a/b/c/../../d ==> a/b/../d ==> a/d while (path.match(DOUBLE_DOT_RE)) { path = path.replace(DOUBLE_DOT_RE, "/") } return path }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetNormalizedPath() {\n}", "function canonical_uri(src,base_path) {\n\t\tvar absolute_regex = /^\\w+\\:\\/\\//;\n\t\t\n\t\t// is `src` is protocol-relative (begins with // or ///), prepend protocol\n\t\tif (/^\\/\\/\\/?/.test(src)) {\n\t\t\tsrc = location.protocol + src;\n\t\t}\n\t\t// is `src` page-relative? (not an absolute URL, and not a domain-relative path, beginning with /)\n\t\telse if (!absolute_regex.test(src) && src.charAt(0) != \"/\") {\n\t\t\t// prepend `base_path`, if any\n\t\t\tsrc = (base_path || \"\") + src;\n\t\t}\n\t\t// make sure to return `src` as absolute\n\t\treturn absolute_regex.test(src) ? src : ((src.charAt(0) == \"/\" ? root_domain : root_page) + src);\n\t}", "function canonical_uri(src, base_path) {\n var absolute_regex = /^\\w+\\:\\/\\//;\n // is `src` is protocol-relative (begins with // or ///), prepend protocol\n if (/^\\/\\/\\/?/.test(src)) {\n src = location.protocol + src;\n }\n // is `src` page-relative? (not an absolute URL, and not a domain-relative path, beginning with /)\n else if (!absolute_regex.test(src) && src.charAt(0) != \"/\") {\n // prepend `base_path`, if any\n src = (base_path || \"\") + src;\n }\n // make sure to return `src` as absolute\n return absolute_regex.test(src) ? src : ((src.charAt(0) == \"/\" ? root_domain : root_page) + src);\n }", "function realpath( path ){\n\t// /a/b/./c/./d ==> /a/b/c/d\n\tpath = path.replace( DOT_RE, \"/\" )\n\t/*\n\t @author wh1100717\n\t a//b/c ==> a/b/c\n\t a///b/////c ==> a/b/c\n\t DOUBLE_DOT_RE matches a/b/c//../d path correctly only if replace // with / first\n\t */\n\tpath = path.replace( MULTI_SLASH_RE, \"$1/\" )\n\t// a/b/c/../../d ==> a/b/../d ==> a/d\n\twhile ( path.match( DOUBLE_DOT_RE ) ){\n\t\tpath = path.replace( DOUBLE_DOT_RE, \"/\" )\n\t}\n\treturn path\n}", "function _joinAndCanonicalizePath(parts){var path=parts[_ComponentIndex.Path];path=path==null?'':_removeDotSegments(path);parts[_ComponentIndex.Path]=path;return _buildFromEncodedParts(parts[_ComponentIndex.Scheme],parts[_ComponentIndex.UserInfo],parts[_ComponentIndex.Domain],parts[_ComponentIndex.Port],path,parts[_ComponentIndex.QueryData],parts[_ComponentIndex.Fragment]);}", "function normalizePath(path) { return path.replace(/\\\\/g, '/') }", "function _joinAndCanonicalizePath(parts) {\n\t var path = parts[_ComponentIndex.Path];\n\t path = lang_1.isBlank(path) ? '' : _removeDotSegments(path);\n\t parts[_ComponentIndex.Path] = path;\n\t return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n\t}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n }", "function realpath(path) {\n\t// /a/b/./c/./d ==> /a/b/c/d\n\tpath = path.replace(DOT_RE, \"/\");\n\n\t// a/b/c/../../d ==> a/b/../d ==> a/d\n\twhile (path.match(DOUBLE_DOT_RE)) {\n\t\tpath = path.replace(DOUBLE_DOT_RE, \"/\");\n\t}\n\n\treturn path;\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function realpath(path) {\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\");\n\n // a//b/c ==> a/b/c\n path = path.replace(MULTI_SLASH_RE, \"$1/\");\n\n // a/b/c/../../d ==> a/b/../d ==> a/d\n while (path.match(DOUBLE_DOT_RE)) {\n path = path.replace(DOUBLE_DOT_RE, \"/\");\n }\n\n return path;\n }", "function realpath(path) {\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\")\n /*\n @author\n a//b/c ==> a/b/c\n a///b/////c ==> a/b/c\n DOUBLE_DOT_RE matches a/b/c//../d path correctly only if replace // with / first\n */\n path = path.replace(MULTI_SLASH_RE, \"$1/\")\n\n // a/b/c/../../d ==> a/b/../d ==> a/d\n while (path.match(DOUBLE_DOT_RE)) {\n path = path.replace(DOUBLE_DOT_RE, \"/\")\n }\n\n return path\n}", "function relative(from, to) {\n assertPath(from);\n assertPath(to);\n if (from === to)\n return \"\";\n var fromOrig = resolve(from);\n var toOrig = resolve(to);\n if (fromOrig === toOrig)\n return \"\";\n from = fromOrig.toLowerCase();\n to = toOrig.toLowerCase();\n if (from === to)\n return \"\";\n // Trim any leading backslashes\n var fromStart = 0;\n var fromEnd = from.length;\n for (; fromStart < fromEnd; ++fromStart) {\n if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH)\n break;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n for (; fromEnd - 1 > fromStart; --fromEnd) {\n if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH)\n break;\n }\n var fromLen = fromEnd - fromStart;\n // Trim any leading backslashes\n var toStart = 0;\n var toEnd = to.length;\n for (; toStart < toEnd; ++toStart) {\n if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH)\n break;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n for (; toEnd - 1 > toStart; --toEnd) {\n if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH)\n break;\n }\n var toLen = toEnd - toStart;\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n return toOrig.slice(toStart + i + 1);\n }\n else if (i === 2) {\n // We get here if `from` is the device root.\n // For example: from='C:\\\\'; to='C:\\\\foo'\n return toOrig.slice(toStart + i);\n }\n }\n if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n lastCommonSep = i;\n }\n else if (i === 2) {\n // We get here if `to` is the device root.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n lastCommonSep = 3;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === CHAR_BACKWARD_SLASH)\n lastCommonSep = i;\n }\n // We found a mismatch before the first common path separator was seen, so\n // return the original `to`.\n if (i !== length && lastCommonSep === -1) {\n return toOrig;\n }\n var out = \"\";\n if (lastCommonSep === -1)\n lastCommonSep = 0;\n // Generate the relative path based on the path difference between `to` and\n // `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n if (out.length === 0)\n out += \"..\";\n else\n out += \"\\\\..\";\n }\n }\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0) {\n return out + toOrig.slice(toStart + lastCommonSep, toEnd);\n }\n else {\n toStart += lastCommonSep;\n if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH)\n ++toStart;\n return toOrig.slice(toStart, toEnd);\n }\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"b\" /* isBlank */])(path) ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function normalizePath(p) {\n return fslib_1.npath.toPortablePath(p);\n }", "async realpath() {\n if (this.#realpath)\n return this.#realpath;\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)\n return undefined;\n try {\n const rp = await this.#fs.promises.realpath(this.fullpath());\n return (this.#realpath = this.resolve(rp));\n }\n catch (_) {\n this.#markENOREALPATH();\n }\n }", "function realpath(path) {\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\")\n\n /*\n @author wh1100717\n a//b/c ==> a/b/c\n a///b/////c ==> a/b/c\n DOUBLE_DOT_RE matches a/b/c//../d path correctly only if replace // with / first\n */\n path = path.replace(MULTI_SLASH_RE, \"$1/\")\n\n // a/b/c/../../d ==> a/b/../d ==> a/d\n while (path.match(DOUBLE_DOT_RE)) {\n path = path.replace(DOUBLE_DOT_RE, \"/\")\n }\n\n return path\n }", "function realpath(path) {\n path = path.replace(RE_DOT, \"/\"); // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(RE_MULTI_SLASH, \"$1/\"); // a///b/////c ==> a/b/c\n while (path.match(RE_DOUBLE_DOT)) { // a/b/c/../../d ==> a/b/../d ==> a/d\n path = path.replace(RE_DOUBLE_DOT, \"/\");\n }\n return path.replace(RE_SINGAL_DOT, ''); // remove /.\n}", "function normalizeLink(s) {\n return s.replace(/\\\\/g, '/');\n}", "formAbsolutePath (filename) {\n if (path.isAbsolute(filename)) {\n return filename\n }\n\n return path.join(process.cwd(), '..', '..', filename)\n }", "function absPath(path) {\n\t\tif (!(path.match(/^\\//) || path.match(/^https?:/i))) {\n\t\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\t\tpath = (scripts[scripts.length-1].src).replace(/[^\\/]*$/,path);\n\t\t}\n\t\treturn path;\n\t}", "function convertPathToForwardSlash(path) {\n return path.replace(/\\\\/g, '/');\n}", "function realpath(path) {\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\")\n\n /*\n @author wh1100717\n a//b/c ==> a/b/c\n a///b/////c ==> a/b/c\n DOUBLE_DOT_RE matches a/b/c//../d path correctly only if replace // with / first\n */\n path = path.replace(MULTI_SLASH_RE, \"$1/\")\n\n // a/b/c/../../d ==> a/b/../d ==> a/d\n while (path.match(DOUBLE_DOT_RE)) {\n path = path.replace(DOUBLE_DOT_RE, \"/\")\n }\n\n return path\n}", "function absPath(filepath) {\n return filepath.match(/^[\\/~]/) ? filepath : require('path').join(process.cwd(), filepath);\n}", "function rel2abs(p) {\n return path.resolve(process.cwd(), p);\n}", "function path_resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath;}path=url.path;}var isAbsolute=exports.isAbsolute(path);var parts=path.split(/\\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==='.'){parts.splice(i,1);}else if(part==='..'){up++;}else if(up>0){if(part===''){// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\nparts.splice(i+1,up);up=0;}else{parts.splice(i,2);up--;}}}path=parts.join('/');if(path===''){path=isAbsolute?'/':'.';}if(url){url.path=path;return urlGenerate(url);}return path;}", "function normalize(path) {\n if (path === '') {\n return '';\n }\n return removeSlash(posix.normalize(path));\n }", "function normalize(path) {\n if (path === '') {\n return '';\n }\n return removeSlash(posix.normalize(path));\n }", "abs (relativePath) {\n return nodePath.resolve(relativePath);\n }", "function normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}", "resolveAsPath() { }", "static getRealPath(linkPath) {\n return FileSystem._wrapException(() => {\n return fsx.realpathSync(linkPath);\n });\n }", "function pathCorrect (filepath) {\n\tpathArray = filepath.split(path.sep);\n\tvar correctedPath = path.normalize(pathArray.join('\\\\\\\\'));\n\tcorrectedPath = correctedPath.replace(/\\\"/g,'');\n\treturn correctedPath;\n}", "function transformPath(path) {\n return (path.substring(0, 1) == '!') ? ('!' + tmpPath + path.substring(1)) : (tmpPath + path);\n}", "function toRelativePath(path) {\n\ttoRelative\n}", "function normalizePath(contents, root, path) {\n const driveName = contents.driveName(root);\n const localPath = contents.localPath(root);\n const resolved = coreutils_1.PathExt.resolve(localPath, path);\n return driveName ? `${driveName}:${resolved}` : resolved;\n }", "function resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function resolve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var resolvedPath = '';\r\n var resolvedAbsolute = false;\r\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\r\n var path = i >= 0 ? args[i] : '/';\r\n // Skip empty entries\r\n if (!path) {\r\n continue;\r\n }\r\n resolvedPath = path + \"/\" + resolvedPath;\r\n resolvedAbsolute = path.charAt(0) === '/';\r\n }\r\n // At this point the path should be resolved to a full absolute path, but\r\n // handle relative paths to be safe (might happen when process.cwd() fails)\r\n // Normalize the path\r\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) {\r\n return !!p;\r\n }), !resolvedAbsolute).join('/');\r\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\r\n}", "function getCanonicalNamePlain(loader, normalized, isPlugin) {\n // now just reverse apply paths rules to get canonical name\n var pathMatch;\n\n // if we are in a package, remove the basePath\n var pkgName = getPackage(loader.packages, normalized);\n if (pkgName) {\n var pkg = loader.packages[pkgName];\n\n // sanitize basePath\n var basePath = pkg.basePath && pkg.basePath != '.' ? pkg.basePath : '';\n if (basePath) {\n if (basePath.substr(0, 2) == './')\n basePath = basePath.substr(2);\n if (basePath[basePath.length - 1] != '/')\n basePath += '/';\n\n if (normalized.substr(pkgName.length + 1, basePath.length) == basePath)\n normalized = pkgName + normalized.substr(pkgName.length + basePath.length);\n }\n }\n\n // first check exact path matches\n for (var p in loader.paths) {\n if (loader.paths[p].indexOf('*') != -1)\n continue;\n\n var curPath = normalizePath(loader, p, isPlugin);\n\n if (normalized === curPath) {\n // always stop on first exact match\n pathMatch = p;\n break;\n }\n }\n\n // then wildcard matches\n var pathMatchLength = 0;\n var curMatchLength;\n if (!pathMatch)\n for (var p in loader.paths) {\n if (loader.paths[p].indexOf('*') == -1)\n continue;\n\n // normalize the output path\n var curPath = normalizePath(loader, p, isPlugin);\n\n // do reverse match\n var wIndex = curPath.indexOf('*');\n if (normalized.substr(0, wIndex) === curPath.substr(0, wIndex)\n && normalized.substr(normalized.length - curPath.length + wIndex + 1) === curPath.substr(wIndex + 1)) {\n curMatchLength = curPath.split('/').length;\n if (curMatchLength >= pathMatchLength) {\n pathMatch = p.replace('*', normalized.substr(wIndex, normalized.length - curPath.length + 1));\n pathMatchLength = curMatchLength;\n }\n }\n }\n\n // when no path was matched, act like the standard rule is *: baseURL/*\n if (!pathMatch) {\n if (normalized.substr(0, loader.baseURL.length) == loader.baseURL)\n pathMatch = normalized.substr(loader.baseURL.length);\n else if (normalized.match(absURLRegEx))\n throw new Error('Unable to calculate canonical name to bundle ' + normalized);\n else\n pathMatch = normalized;\n }\n\n return pathMatch;\n}", "function relative(from, to) {\r\n // tslint:disable:no-parameter-reassignment\r\n from = resolve(from).substr(1);\r\n to = resolve(to).substr(1);\r\n var fromParts = trim(from.split('/'));\r\n var toParts = trim(to.split('/'));\r\n var length = Math.min(fromParts.length, toParts.length);\r\n var samePartsLength = length;\r\n for (var i = 0; i < length; i++) {\r\n if (fromParts[i] !== toParts[i]) {\r\n samePartsLength = i;\r\n break;\r\n }\r\n }\r\n var outputParts = [];\r\n for (var i = samePartsLength; i < fromParts.length; i++) {\r\n outputParts.push('..');\r\n }\r\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\r\n return outputParts.join('/');\r\n}", "async function normalizePath(path) {\n if (Platform.OS === \"ios\" || Platform.OS === \"android\") {\n const filePrefix = \"file://\";\n if (path.startsWith(filePrefix)) {\n path = path.substring(filePrefix.length);\n try {\n path = decodeURI(path);\n } catch (e) {}\n }\n }\n return path;\n }", "async function normalizePath(path) {\n if (Platform.OS === \"ios\" || Platform.OS === \"android\") {\n const filePrefix = \"file://\";\n if (path.startsWith(filePrefix)) {\n path = path.substring(filePrefix.length);\n try {\n path = decodeURI(path);\n } catch (e) {}\n }\n }\n return path;\n }", "function _makeFsPath(uri) {\n var value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + uri.authority + uri.path;\n }\n else if (uri.path.charCodeAt(0) === 47 /* Slash */\n && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n && uri.path.charCodeAt(2) === 58 /* Colon */) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}", "function convertAbsolute(pathAbsolute) {\n return path.resolve(pathAbsolute);\n}", "abs (relativePath) {\n return this.url(relativePath).href;\n }", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function normalizePath(path) {\r\n var isPathAbsolute = isAbsolute(path);\r\n var trailingSlash = path.substr(-1) === '/';\r\n // Normalize the path\r\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) {\r\n return !!p;\r\n }), !isPathAbsolute).join('/');\r\n if (!normalizedPath && !isPathAbsolute) {\r\n normalizedPath = '.';\r\n }\r\n if (normalizedPath && trailingSlash) {\r\n normalizedPath += '/';\r\n }\r\n return (isPathAbsolute ? '/' : '') + normalizedPath;\r\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n}", "normalizePath(path) {\n if (path === null || path === undefined) {\n return null;\n }\n // Perform the standard path replacement, but also normalize the path\n // to remove the '.' and '..' sections so we have a better representation\n // of the actual requested path.\n return pathModule.normalize(\n pathModule.toNamespacedPath(\n getPathFromURL(path)\n )\n );\n }", "function normalize(path) {\n var absolute\n var value\n\n assertPath(path)\n\n absolute = path.charCodeAt(0) === 47 /* `/` */\n\n // Normalize the path according to POSIX rules.\n value = normalizeString(path, !absolute)\n\n if (!value.length && !absolute) {\n value = '.'\n }\n\n if (value.length && path.charCodeAt(path.length - 1) === 47 /* / */) {\n value += '/'\n }\n\n return absolute ? '/' + value : value\n}", "function fix_slashes(pathname) {\n if (pathname.slice(-1) != '/') {\n return pathname + '/';\n }\n return pathname;\n}", "function fix_slashes(pathname) {\n if (pathname.slice(-1) != '/') {\n return pathname + '/';\n }\n return pathname;\n}", "function abspath(rawPath) {\n if (rawPath.length && rawPath[0] === '.') {\n return path.resolve(path.join(__dirname, rawPath));\n } else {\n return path.resolve(rawPath);\n }\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const start = res.length - 1;\n var j = start;\n for (; j >= 0; --j) {\n if (res.charCodeAt(j) === 47 /*/*/) break;\n }\n if (j !== start) {\n if (j === -1) res = '';else res = res.slice(0, j);\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += '/..';else res = '..';\n }\n } else {\n if (res.length > 0) res += '/' + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n }", "function canonFilenameOrigin(origin) {\n return origin.replace(/^\\//, '').replace(/\\\\/g, '/');\n }", "function resolve$2() {\n var resolvedPath = '',\n resolvedAbsolute = false\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? arguments[i] : '/'\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings')\n } else if (!path) {\n continue\n }\n\n resolvedPath = path + '/' + resolvedPath\n resolvedAbsolute = path.charAt(0) === '/'\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(\n filter(resolvedPath.split('/'), function (p) {\n return !!p\n }),\n !resolvedAbsolute\n ).join('/')\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'\n}", "function normalize(s) {\n s = path.resolve(s);\n if (WIN_BUILD) s = s.toLowerCase();\n return s;\n }", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n }", "function xnormalize(fpath) {\n if (!fpath) return \"\";\n var parts = fpath.split(/[\\\\\\/]/g);\n var roots = [];\n parts.forEach( function(part) {\n if (!part || part===\".\") {\n /* nothing */\n }\n else if (part===\"..\") {\n if (roots.length > 0 && roots[roots.length-1] !== \".parent\") {\n roots.pop();\n }\n else {\n roots.push(\".parent\");\n }\n }\n else {\n roots.push(part);\n }\n });\n return roots.join(\"/\");\n}", "function pathfix(t, from=\"src=\\\"\", to=\"src=\\\"/\", offset = 0){\n\tt = t.toString();\n\tlet i = t.slice(offset).indexOf(from);\n\tif (i === -1) return t;\n\tlet pre = t.slice(0, i);\n\tlet pos = t.slice(i);\n\n\tif (pos.slice(5, 12) !== \"http://\" && pos.slice(5, 6) !== \"/\") {\n\t\tpos = pos.replace(from, to);\n\t\treturn pre + pathfix(pos, i + 3);\n\t}\n}", "function fixPath(path) {\n \n \n if(path.startsWith('\\\\\\\\') === false) {\n \n console.log('Path does not starts with \\\\\\\\. Throw error');\n throw \"Path does not starts with \\\\\\\\\";\n \n } else {\n \n // storing path slash into variable\t \n var result = '\\\\\\\\';\n for(var i = 0; i < path.length; i++) {\n \n // Current character is back slash or not\n if(path.charAt(i) === '\\\\') {\n \n // Is result ends with back slash?\n if(result.endsWith('\\\\') === false) {\n result += '\\\\';\n }\n } else {\n result += path.charAt(i);\n }\n }\n return result;\n \n }\n \n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += '/..';else res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) res += '/' + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "async function normalizePath(pathToNormalize) {\n if (is_wsl_1.default) {\n return convertUNIXPathToWindows(pathToNormalize);\n }\n return pathToNormalize;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\r\n var res = '';\r\n var lastSegmentLength = 0;\r\n var lastSlash = -1;\r\n var dots = 0;\r\n var code;\r\n for (var i = 0; i <= path.length; ++i) {\r\n if (i < path.length)\r\n code = path.charCodeAt(i);\r\n else if (code === 47 /*/*/)\r\n break;\r\n else\r\n code = 47 /*/*/;\r\n if (code === 47 /*/*/) {\r\n if (lastSlash === i - 1 || dots === 1) {\r\n // NOOP\r\n } else if (lastSlash !== i - 1 && dots === 2) {\r\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\r\n if (res.length > 2) {\r\n var lastSlashIndex = res.lastIndexOf('/');\r\n if (lastSlashIndex !== res.length - 1) {\r\n if (lastSlashIndex === -1) {\r\n res = '';\r\n lastSegmentLength = 0;\r\n } else {\r\n res = res.slice(0, lastSlashIndex);\r\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n } else if (res.length === 2 || res.length === 1) {\r\n res = '';\r\n lastSegmentLength = 0;\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n }\r\n if (allowAboveRoot) {\r\n if (res.length > 0)\r\n res += '/..';\r\n else\r\n res = '..';\r\n lastSegmentLength = 2;\r\n }\r\n } else {\r\n if (res.length > 0)\r\n res += '/' + path.slice(lastSlash + 1, i);\r\n else\r\n res = path.slice(lastSlash + 1, i);\r\n lastSegmentLength = i - lastSlash - 1;\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n } else if (code === 46 /*.*/ && dots !== -1) {\r\n ++dots;\r\n } else {\r\n dots = -1;\r\n }\r\n }\r\n return res;\r\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolveFullURL(relativePath, documentURL) {\n if (relativePath.includes('://')) {\n return relativePath;\n } else if (relativePath.startsWith('/')) {\n // Until before first single slash (\"https://test.com/toast/index.html\" => \"https://test.com\")\n let relativeDocumentURL = documentURL.match(/\\w+:\\/\\/[^\\/]+/);\n return relativeDocumentURL + relativePath;\n } else {\n // Until last slash (\"https://test.com/toast/index.html\" => \"https://test.com/toast/\")\n let relativeDocumentURL = documentURL.match(/.+\\//);\n return relativeDocumentURL + relativePath;\n }\n}", "function normalize(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "function normalizePath(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "function normalizePath(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "function normalizePath(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "function normalizeDirectory(s) {\n return s.replace(/\\\\\\\\\\\\/g, '\\\\').replace(/\\\\\\\\/g, '\\\\');\n}", "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n let res = '';\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n }\n else if (code === 47 /*/*/) {\n break;\n }\n else {\n code = 47 /*/*/;\n }\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n }\n else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 ||\n lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== 46 /*.*/ ||\n res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n}", "function absolutePath( inputPath ){\n return /^\\//.test(inputPath) ? inputPath : path.join(process.cwd(), inputPath)\n}", "function drop_double_slashes(pathname) {\n return pathname.replace(/\\/\\//g,'/');\n}", "function resolve() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function resolve() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function resolve() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }" ]
[ "0.6709759", "0.6702698", "0.6609128", "0.6456524", "0.64326733", "0.64309305", "0.63968444", "0.63194084", "0.62933767", "0.6244801", "0.6244801", "0.6244801", "0.6244801", "0.6218411", "0.6218411", "0.6218411", "0.6217389", "0.62084955", "0.6163006", "0.6118867", "0.6113805", "0.6081439", "0.6062025", "0.60521215", "0.60243356", "0.5993132", "0.5989181", "0.594807", "0.5917066", "0.5890593", "0.5886102", "0.5879954", "0.5868461", "0.5862152", "0.583248", "0.583248", "0.58295006", "0.5786094", "0.5760562", "0.5752971", "0.5741053", "0.5726479", "0.5706742", "0.56875885", "0.5684726", "0.5684726", "0.5684726", "0.56782836", "0.56774735", "0.5663667", "0.56574667", "0.56574667", "0.5645225", "0.5641078", "0.56381595", "0.56359905", "0.56359905", "0.56359905", "0.56350636", "0.56350636", "0.56342626", "0.5622907", "0.5622907", "0.5622907", "0.56221277", "0.56214064", "0.56194973", "0.56194973", "0.56177074", "0.5607741", "0.56000876", "0.5594365", "0.5591942", "0.5591477", "0.5591287", "0.55894226", "0.55681634", "0.5562496", "0.5548986", "0.554413", "0.55392873", "0.55392873", "0.55392873", "0.55392873", "0.55392873", "0.5538289", "0.55377597", "0.55306995", "0.55306995", "0.55306995", "0.5530446", "0.5525202", "0.5525166", "0.552188", "0.5517432", "0.5506284", "0.5506284", "0.5506284", "0.55040616", "0.55040616" ]
0.65180767
3
Normalize an uri normalize("path/to/a") ==> "path/to/a.js"
function normalize(uri) { // Call realpath() before adding extension, so that most of uris will // contains no `.` and will just return in realpath() call uri = realpath(uri) // Add the default `.js` extension except that the uri ends with `#` if (HASH_END_RE.test(uri)) { uri = uri.slice(0, -1) } else if (!URI_END_RE.test(uri)) { uri += ".js" } // issue #256: fix `:80` bug in IE return uri.replace(":80/", "/") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(path) {\n var last = path.length - 1\n var lastC = path.charAt(last)\n\n // If the uri ends with `#`, just return it without '#'\n if (lastC === \"#\") {\n return path.substring(0, last)\n }\n\n return (path.substring(last - 2) === \".js\" ||\n path.indexOf(\"?\") > 0 ||\n lastC === \"/\") ? path : path + \".js\"\n}", "function normalize(path) {\n var last = path.length - 1\n var lastC = path.charCodeAt(last)\n\n // If the uri ends with `#`, just return it without '#'\n if (lastC === 35 /* \"#\" */ ) {\n return path.substring(0, last)\n }\n\n return (path.substring(last - 2) === \".js\" ||\n path.indexOf(\"?\") > 0 ||\n lastC === 47 /* \"/\" */ ) ? path : path + \".js\"\n }", "function normalize( path ){\n\tvar last = path.length - 1\n\tvar lastC = path.charAt( last )\n\t// If the uri ends with `#`, just return it without '#'\n\tif ( lastC === \"#\" ){\n\t\treturn path.substring( 0, last )\n\t}\n\treturn (path.substring( last - 2 ) === \".js\" ||\n\tpath.indexOf( \"?\" ) > 0 ||\n\tpath.substring( last - 3 ) === \".css\" ||\n\tlastC === \"/\") ? path : path + \".js\"\n}", "function normalize(path) {\n\tvar last = path.length - 1;\n\tvar lastC = path.charAt(last);\n\n\t// If the uri ends with `#`, just return it without '#'\n\tif (lastC === \"#\") {\n\t\treturn path.substring(0, last);\n\t}\n\tvar arr = path.split(\".\");\n\tvar extname = \"js\";\n\tif (arr.length > 1) {\n\t\textname = arr[arr.length - 1];\n\t\tif (indexOf.call(data.extnames, extname) == -1) {\n\t\t\treturn path + \".js\";\n\t\t} else {\n\t\t\treturn path;\n\t\t}\n\t} else {\n\t\treturn path + \".js\";\n\t}\n}", "function normalize(path) {\n var last = path.length - 1;\n var lastC = path.charAt(last);\n\n // If the uri ends with `#`, just return it without '#'\n if (lastC === \"#\") {\n return path.substring(0, last);\n }\n\n return (path.substring(last - 2) === \".js\" ||\n path.indexOf(\"?\") > 0 ||\n path.substring(last - 3) === \".css\" ||\n lastC === \"/\") ? path : path + \".js\";\n }", "function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath;}path=url.path;}var isAbsolute=exports.isAbsolute(path);var parts=path.split(/\\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==='.'){parts.splice(i,1);}else if(part==='..'){up++;}else if(up>0){if(part===''){// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\nparts.splice(i+1,up);up=0;}else{parts.splice(i,2);up--;}}}path=parts.join('/');if(path===''){path=isAbsolute?'/':'.';}if(url){url.path=path;return urlGenerate(url);}return path;}", "function normalize(aPath) {\n\t\t var path = aPath;\n\t\t var url = urlParse(aPath);\n\t\t if (url) {\n\t\t if (!url.path) {\n\t\t return aPath;\n\t\t }\n\t\t path = url.path;\n\t\t }\n\t\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t\t var parts = path.split(/\\/+/);\n\t\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t\t part = parts[i];\n\t\t if (part === '.') {\n\t\t parts.splice(i, 1);\n\t\t } else if (part === '..') {\n\t\t up++;\n\t\t } else if (up > 0) {\n\t\t if (part === '') {\n\t\t // The first part is blank if the path is absolute. Trying to go\n\t\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t\t // directly after the root.\n\t\t parts.splice(i + 1, up);\n\t\t up = 0;\n\t\t } else {\n\t\t parts.splice(i, 2);\n\t\t up--;\n\t\t }\n\t\t }\n\t\t }\n\t\t path = parts.join('/');\n\t\n\t\t if (path === '') {\n\t\t path = isAbsolute ? '/' : '.';\n\t\t }\n\t\n\t\t if (url) {\n\t\t url.path = path;\n\t\t return urlGenerate(url);\n\t\t }\n\t\t return path;\n\t\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === \".\") {\n parts.splice(i, 1);\n } else if (part === \"..\") {\n up++;\n } else if (up > 0) {\n if (part === \"\") {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join(\"/\");\n\n if (path === \"\") {\n path = isAbsolute ? \"/\" : \".\";\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalizeURI(uri) {\n var val= uri.split('/').reduce(function(prev, curr, idx) {\n if (curr !== '..' || idx === 0) {\n prev.push(curr);\n } else {\n prev.pop();\n }\n return prev;\n }, []).join('/');\n return val;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = (path.charAt(0) === '/');\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalizeURI(uri) {\n return removeDoubleSlashes(uri).split('/').reduce(function(prev, curr, idx) {\n if (prev.length === 0 || curr !== '..') {\n prev.push(curr);\n } else {\n prev.pop();\n }\n return prev;\n }, []).join('/');\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n\n if (url) {\n if (!url.path) {\n return aPath;\n }\n\n path = url.path;\n }\n\n var isAbsolute = exports.isAbsolute(path);\n var parts = path.split(/\\/+/);\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n\n if (url) {\n if (!url.path) {\n return aPath;\n }\n\n path = url.path;\n }\n\n var isAbsolute = exports.isAbsolute(path);\n var parts = path.split(/\\/+/);\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n\n if (url) {\n if (!url.path) {\n return aPath;\n }\n\n path = url.path;\n }\n\n var isAbsolute = exports.isAbsolute(path);\n var parts = path.split(/\\/+/);\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n\n return path;\n}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n\n if (url) {\n if (!url.path) {\n return aPath;\n }\n\n path = url.path;\n }\n\n var isAbsolute = exports.isAbsolute(path);\n var parts = path.split(/\\/+/);\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n\n return path;\n}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n\n if (url) {\n if (!url.path) {\n return aPath;\n }\n\n path = url.path;\n }\n\n var isAbsolute = exports.isAbsolute(path);\n var parts = path.split(/\\/+/);\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }" ]
[ "0.7741806", "0.7677585", "0.7638272", "0.74466026", "0.7421231", "0.72541517", "0.7086319", "0.7053448", "0.7053448", "0.7053448", "0.7049185", "0.7025306", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.7021984", "0.70142853", "0.7012375", "0.7012375", "0.7012153", "0.7010123", "0.7010123", "0.7010123", "0.7010123", "0.7004981", "0.7004981", "0.7001045", "0.6984982", "0.697327", "0.697327", "0.697327", "0.697327", "0.697327", "0.697327", "0.697327", "0.697327", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845", "0.69236845" ]
0.7648592
2
Run a queue of functions as quickly as possible, passing value to each.
function runHandlers(queue, value) { for (var i = 0; i < queue.length; i++) { queue[i](value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runHandlers(queue, value) {\n for (var i = 0; i < queue.length; i++) {\n queue[i](value);\n }\n}", "function runHandlers(queue, value) {\n\t\tfor (var i = 0; i < queue.length; i++) {\n\t\t\tqueue[i](value);\n\t\t}\n\t}", "function runQueue() {\n if(queue.length) {\n const f = queue.shift();\n window.setTimeout(() => {\n f();\n runQueue();\n }, 50);\n }\n }", "function runQueue(queue) {\n\t\twhile(queue.length > 0) {\n\t\t\tqueue.shift().run();\n\t\t}\n\t}", "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}", "function queue(arr) {\n\tarr[c]();\n\tc++;\n}", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "foreach(func){\n var data, _next;\n _next = this.next;\n this.next = null;\n\n while( (data = this.process()) != null )\n func(data);\n\n this.next = _next;\n }", "function processQueue(cb){\n\n}", "function clearQueue() {\n // get item at front of queue and call fn\n var fn = queue.shift();\n if (fn) fn();\n\n // run again on next tick\n clearQueueLater();\n}", "function enqueue(fn) {\n if (!DEFERREDQUEUE.length) {\n requestAnimationFrame(function () {\n var q = DEFERREDQUEUE.length;\n while (DEFERREDQUEUE.length) {\n var func = DEFERREDQUEUE.shift();\n func();\n };\n __PS_MV_REG = [];\n return main.debug ? console.log('queue flushed', q) : null;\n });\n };\n __PS_MV_REG = [];\n return DEFERREDQUEUE.push(fn);\n}", "function startQueue() {\n if(running)\n return;\n running = true;\n setTimeout(doNext,queue[0].delay);\n\n function doNext() {\n queue[0].fn();\n removeItem(queue,0);\n if(queue.length>0) {\n setTimeout(doNext,queue[0].delay);\n } else\n running = false;\n }\n }", "function next(queue) {\n var n = queue.current.length;\n for (var i = n; i < queue.max; i++) {\n var qi = queue.items.shift();\n if (!qi) {\n return;\n }\n queue.current.push(qi.resolve(queue));\n }\n }", "function run() {\n running = true;\n if (queue.length == 0) {\n debug('queue flushed');\n running = false;\n return;\n }\n\n var req = queue.splice(0, 1)[0];\n var cached = db.get(req.url);\n\n if (cached && typeof cached.err === 'undefined' && typeof cached.body !== 'undefined') {\n debug(req.url + ' found in cache');\n var $ = cheerio.load(cached.body);\n req.callback(null, $);\n debug('callback called, running next item immediately because no web request was made');\n setImmediate(function() {\n run();\n })\n } else {\n debug(req.url + ' not found in cache, requesting...');\n module.exports.requestOptions.url = req.url;\n debug('request options: ' + JSON.stringify(module.exports.requestOptions, null, 2));\n request(module.exports.requestOptions, function(e, r, b) {\n if (e) {\n debug('error requesting url ' + req.url);\n debug(e);\n db.set(req.url, {err: e, body: b});\n req.callback(e);\n return;\n }\n\n db.set(req.url, {body: b});\n var $ = cheerio.load(b);\n req.callback(null, $);\n debug('callback called, running next item with timeout interval ' + module.exports.interval);\n setTimeout(function() {\n run();\n }, module.exports.interval);\n });\n }\n}", "function flush_queue() {\n $.each(action_queue, function () {\n // $ is a special case that means onload\n if (this.method === '$') {\n this.params.apply(this.node, []);\n }\n // otherwise call method on the jquery object with given params.\n else {\n if (!isTypeOf(this.params, 'Array')) {\n this.params = [this.params];\n }\n this.node[this.method].apply(this.node, this.params);\n }\n });\n action_queue = [];\n }", "function flush() {\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\twhile (i < fnQueueLen) {\n\t\t\t\t\t\tfn(fnQueue[i], fnQueue[i + 1]);\n\t\t\t\t\t\tfnQueue[i++] = $undefined;\n\t\t\t\t\t\tfnQueue[i++] = $undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tfnQueueLen = 0;\n\t\t\t\t\tif (fnQueue.length > initQueueSize) fnQueue.length = initQueueSize;\n\t\t\t\t}", "function processQueue(processFn)\n\t{\n\t\t// get the first element from the queue\n\t\tvar element = _.first(_queryQueue);\n\t\t_queryQueue = _.rest(_queryQueue);\n\n\t\t// still elements in queue\n\t\tif (element)\n\t\t{\n\t\t\t_queryInProgress = element;\n\n\t\t\tif (_.isFunction(processFn))\n\t\t\t{\n\t\t\t\tprocessFn(element);\n\t\t\t}\n\t\t}\n\t\t// no more query to process\n\t\telse\n\t\t{\n\t\t\t_queryInProgress = false;\n\t\t}\n\t}", "function executeForEach(arr, func) {\n for (let i = 0; i < arr.length; i++) {\n func(arr[i]);\n }\n}", "function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }", "function myEach(arr, fn) {\n var tasksNo = arr.length;\n for (var i =0; i < tasksNo; i++){\n fn(arr[i]);\n }\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n\n while (++i < len) {\n oldQueue[i]();\n }\n\n len = queue.length;\n }\n\n draining = false;\n }", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n\n while (++i < len) {\n oldQueue[i]();\n }\n\n len = queue.length;\n }\n\n draining = false;\n }", "_run(positionOrDt) {\n // Run all of the _queue directly\n var allfinished = true;\n\n for (var i = 0, len = this._queue.length; i < len; ++i) {\n // Get the current function to run\n var current = this._queue[i]; // Run the function if its not finished, we keep track of the finished\n // flag for the sake of declarative _queue\n\n var converged = current.runner.call(this, positionOrDt);\n current.finished = current.finished || converged === true;\n allfinished = allfinished && current.finished;\n } // We report when all of the constructors are finished\n\n\n return allfinished;\n }", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n\n while (++i < len) {\n oldQueue[i]();\n }\n\n len = queue.length;\n }\n\n draining = false;\n}", "function loop(value, testFn, updateFn, bodyFn) {}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n }", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n }", "function process_float_queue() {\n while (floats.length > 0) {\n var $float = $(floats.shift());\n \n var new_float_coords = available_space($float);\n \n $float.css({left: new_float_coords.left}).appendTo($sandbox);\n }\n }", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "function run() {\n\tvar len = series.length,\n\t\tctx = {},\n\t\ti = 0;\n\n\tseries[ i ].call( ctx, next );\n\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( i < len ) {\n\t\t\tseries[ i ].call( ctx, next );\n\t\t}\n\t}\n}", "function each(f, xs) {\n var ys = seq$a(xs);\n\n while (ys) {\n f(first$d(ys));\n ys = next$a(ys);\n }\n }", "traverseQueue() {\n if (this.queue.length > 0) {\n /* Get the next index */\n const data = this.queue[0];\n /* compare cached version to next props */\n this.interpolator = d3.interpolate(this.state, data);\n timer(this.functionToBeRunEachFrame, this.props.delay);\n } else if (this.props.onEnd) {\n this.props.onEnd();\n }\n }", "enqueue(values) {\n values.forEach(v => {\n this.queue.binaryTree.push(v);\n this.queue.siftUp(this.queue.size() - 1);\n });\n }", "backtrackTheChain() {\r\n this.orderQueue.forEach(([waitingPromise, successCallback]) => {\r\n //if the passed arg is not a function simply return the observed value w.out executing\r\n if (typeof successCallback !== 'function') return waitingPromise.onFulfilled(this.val);\r\n const res = successCallback(this.val);\r\n if (res && res.then === 'function') { //check if promise\r\n res.then(val => waitingPromise.onFulfilled(val), val => waitingPromise.onRejected(val));\r\n } else {\r\n waitingPromise.onFulfilled(res);\r\n }\r\n })\r\n this.orderQueue = [];\r\n }", "function executeForEach(array, func) {\r\n for (let i = 0; i < array.length; i++) {\r\n func(array[i]);\r\n }\r\n return array;\r\n}", "function addToQueue(fn) {\n if (working) {\n queue.push(fn);\n } else {\n fn();\n }\n}", "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "async _execute() {\n if (this._executing || !this._queue.length) {\n return;\n } else {\n this._executing = true;\n }\n\n // execute the function with highest priority\n this._sortQueue();\n const entry = this._queue.pop();\n await entry.func();\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 setupQueueFunctionQueued() {\n // Generate all currently queued functions.\n generateAvailableQueued();\n }", "function nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n }", "function run(fn) {\n if (fn)\n fn(next);\n else\n callback(null, results);\n }", "function flushQueue(context) {\n var buffer = context[8 /* HostInstructionsQueue */];\n if (buffer) {\n for (var i = 1 /* ValuesStartPosition */; i < buffer.length; i += 3 /* Size */) {\n var fn = buffer[i + 1 /* InstructionFnOffset */];\n var args = buffer[i + 2 /* ParamsOffset */];\n fn.apply(this, args);\n }\n buffer.length = 1 /* ValuesStartPosition */;\n }\n}", "function Run5times(){\r\n for(let i=0 ; i < 5; i++){\r\n // do these things 5 times\r\n collectItem();\r\n }\r\n}", "function processQueue(){\n\t\trequestAnimFrame(processQueue);\n\t\tvar now = Date.now();\n\t\twhile (msgQueue.length > 0 && msgQueue[0].timetag < now){\n\t\t\tvar first = msgQueue.shift();\n\t\t\tif (first.address === \"_set\"){\n\t\t\t\tfirst.data();\n\t\t\t} else {\n\t\t\t\t_send(first);\n\t\t\t}\n\t\t}\n\t\t//send an update message to all the listeners\n\t\tupdateMessage.data = now - lastUpdate;\n\t\t_send(updateMessage);\n\t\tlastUpdate = now;\n\t}", "function executeQueue() {\n\t\t\tif (outQueue.length < 1) {\n\t\t\t\texecutingQueue = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar nextRequest,\n\t\t\t\tcollectorUrl,\n\t\t\t\ti;\n\n\t\t\texecutingQueue = true;\n\n\t\t\tfor (i in outQueue) {\n\n\t\t\t\tif (outQueue[i] && outQueue.hasOwnProperty(i)) {\n\n\t\t\t\t\tnextRequest = outQueue[i];\n\n\t\t\t\t\t// Let's check that we have a Url to ping\n\t\t\t\t\tif (!lodash.isString(configCollectorUrl)) {\n\t\t\t\t\t\tthrow \"No Snowplow collector configured, cannot track\";\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Send image request to the Snowplow Collector using GET.\n\t\t\t\t\t * The Collector serves a transparent, single pixel (1x1) GIF\n\t\t\t\t\t * Use IIFE to close over i because i may change between setting image.onload and the image loading.\n\t\t\t\t\t */\n\t\t\t\t\t(function(queueIndex) {\n\t\t\t\t\t\tvar image = new Image(1,1);\n\n\t\t\t\t\t\timage.onload = function() {\n\n\t\t\t\t\t\t\t// We succeeded, let's remove this request from the queue\n\t\t\t\t\t\t\tdelete outQueue[queueIndex];\n\t\t\t\t\t\t\tif (localStorageAccessible) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem(queueName, json2.stringify(outQueue));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texecuteQueue();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timage.onerror = function() {}\n\n\t\t\t\t\t\timage.src = configCollectorUrl + nextRequest;\n\n\t\t\t\t\t}(i));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texecutingQueue = false;\n\n\t\t\t// If every request has been sent, set the queue to []\n\t\t\tif (lodash.compact(outQueue).length === 0) {\n\t\t\t\toutQueue = [];\n\t\t\t}\n\t\t}", "forEach(fn, thisp = this) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }", "function processQueue() {\n\t\t\t\t\tvar skip = scope && scope.$$destroyed;\n\t\t\t\t\tvar queue = !skip ? nextTick.queue : [];\n\t\t\t\t\tvar digest = !skip ? nextTick.digest : null;\n\n\t\t\t\t\tnextTick.queue = [];\n\t\t\t\t\tnextTick.timeout = null;\n\t\t\t\t\tnextTick.digest = false;\n\n\t\t\t\t\tqueue.forEach(function (callback) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t});\n\n\t\t\t\t\tif (digest) $rootScope.$digest();\n\t\t\t\t}", "function forEach(seq,fn) { for (var i=0,n=seq&&seq.length;i<n;i++) fn(seq[i]); }", "function worker() {\n // deleting obsolete data\n executed = executed.filter(obj => obj.executedAt + 1000 > Date.now());\n\n // running available requests\n for (let q in queue) {\n // max 2 request in 1 sec. for one client\n if (queue.hasOwnProperty(q) && executed.filter(obj => obj.client === queue[q].client).length < 2) {\n // remember for control API restrictions\n executed.push({\n client: queue[q].client,\n executedAt: Date.now(),\n });\n // execute request\n queue[q].callback();\n // exclude repeated request\n queue[q] = null;\n }\n }\n\n // clear queue\n queue = queue.filter(obj => obj);\n setTimeout(worker, 300);\n}", "function executeforEach(arr, func) {\n arr.forEach((elem) => {\n func(elem);\n });\n}", "function processQueue()\r\n{\r\n for(var i = 0 ; i < queue.length ; i++) {\r\n\r\n // get image\r\n loadImage(queue[i].renderer, queue[i].params, queue[i].tag, queue[i].target, false, true, queue[i].sequence);\r\n\r\n // store parameters for image update\r\n var obj = document.getElementById(queue[i].tag2);\r\n if(obj) {\r\n obj.value = queue[i].tag2params;\r\n }\r\n }\r\n\r\n // clear queue\r\n queue = [];\r\n}", "function executeforEach(arr, func) {\n\tfor(let i of arr) {\n\t\tfunc(i);\n\t}\n}", "function dequeue() {\n while (active < consecutive && queue.length) {\n var task = queue.shift();\n exec(task);\n }\n }", "function flush(){release();var task;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}" ]
[ "0.7692049", "0.76008296", "0.71150464", "0.69867754", "0.6865169", "0.68179584", "0.66173464", "0.66173464", "0.66173464", "0.66173464", "0.6465038", "0.6377458", "0.62527335", "0.6059452", "0.60239965", "0.59751266", "0.5897051", "0.58910185", "0.58795387", "0.5873245", "0.58001256", "0.5760913", "0.5760913", "0.5751256", "0.57489634", "0.57489634", "0.5742301", "0.5739164", "0.57362914", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.57154316", "0.5697574", "0.5697574", "0.5688197", "0.5651591", "0.56471276", "0.5637957", "0.56309086", "0.56278557", "0.56268954", "0.56185424", "0.5615049", "0.5614317", "0.5614317", "0.5613813", "0.5613059", "0.5609062", "0.5597613", "0.55861807", "0.5558994", "0.55586386", "0.55547357", "0.55497336", "0.5530881", "0.5529238", "0.55255336", "0.5519123", "0.5515798", "0.5511371", "0.550418", "0.5499936", "0.5496428" ]
0.75986105
2
Drain the handler queue entirely, being careful to allow the queue to be extended while it is being processed, and to continue processing until it is truly empty.
function drainQueue() { runHandlers(handlerQueue); handlerQueue = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drainQueue() {\n\t\trunHandlers(handlerQueue);\n\t\thandlerQueue = [];\n\t}", "function drainQueue() {\n runHandlers(handlerQueue);\n handlerQueue = [];\n}", "function processQueue() {\n emptyQueue = true;\n drainQueue(true);\n }", "function handleQueue() {\n if (this._is_connected && this._queue.length && !this._emptying_queue) {\n this._emptying_queue = true;\n sendQueueEntry.call(this);\n }\n}", "function drainQueue(jobInfo) {\n function drainNext() {\n return drainQueue;\n }\n\n var queue = jobInfo.job._queue;\n\n if (queue.length === 0 && eventQueue.length > 0) {\n queue = jobInfo.job._queue = copyAndClearQueue();\n }\n\n jobInfo.setPromise(drainOneEvent(queue).then(drainNext, drainNext));\n }", "function drainQueue() {\n taskit.runTasks(queue);\n queue = [];\n }", "processQueue_() {\n if (!this.queue_.length) return;\n const [size, callback] = this.queue_[0];\n\n if (this.getBufferSize_() < size) return;\n\n const chunk = this.consumeBuffer_(size);\n this.queue_.shift();\n callback(chunk);\n this.processQueue_();\n }", "exit() {\n if (!this._length) {\n throw new Error(\n 'cannot exit limited concurrency: all slots are available already');\n }\n this._length--;\n if (!this._queue.length) {\n return;\n }\n const handler = this._queue.shift();\n handler();\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,", "processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.resetTimer = this.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }", "drain() {\n const tail = this.tail;\n return tail.then(() => {\n if (this.tail === tail) {\n return;\n }\n return this.drain();\n });\n }", "onEnd() {\n this.requestQueueLength--;\n if (this.requestQueueLength || !this.callbacks.onEnd) {\n return;\n }\n this.callbacks.onEnd(this.requestQueueLength);\n }", "drainMessageQueue_() {\n // It's possible that we finish registering and receiving messages from WSS\n // before our peer connection is created or started. We need to wait for the\n // peer connection to be created and started before processing messages.\n //\n // Also, the order of messages is in general not the same as the POST order\n // from the other client because the POSTs are async and the server may handle\n // some requests faster than others. We need to process offer before\n // candidates so we wait for the offer to arrive first if we're answering.\n // Offers are added to the front of the queue.\n if (!this.pc_ || !this.started_ || !this.hasRemoteSdp_) {\n return;\n }\n for (let i = 0, len = this.messageQueue_.length; i < len; i++) {\n this.processSignalingMessage_(this.messageQueue_[i]);\n }\n this.messageQueue_ = [];\n }", "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "dequeue () {\n\t while (!this._deflating && this._queue.length) {\n\t const params = this._queue.shift();\n\n\t this._bufferedBytes -= params[1].length;\n\t params[0].apply(this, params.slice(1));\n\t }\n\t }", "dequeue () {\n while (!this.deflating && this.queue.length) {\n const params = this.queue.shift();\n\n this.bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "_m_queue_drain() {\n const lo_this = this;\n\n const li_duration_global_ms = f_chrono_stop(lo_this._as_queue_chrono_name);\n const li_call_per_sec = f_number_round_with_precision((1000 * lo_this._ai_call_count_exec_total / li_duration_global_ms), 1);\n\n if (lo_this._ai_call_count_exec_total) {\n f_console_verbose(1, `${lo_this.m_get_context(\"drain\")} - performed a total of [${lo_this._ai_call_count_exec_total}] calls in [${f_human_duration(li_duration_global_ms, true)}] at cps=[${li_call_per_sec}], max-parallel=[${lo_this._ai_parallel_max}], max-length=[${lo_this._ai_queue_len_max}], dur-avg=[${f_human_duration((lo_this._ai_call_duration_total_ms / lo_this._ai_call_count_exec_total), true)}], dur-min=[${f_human_duration(lo_this._ai_call_duration_min_ms, true)}], dur-max=[${f_human_duration(lo_this._ai_call_duration_max_ms, true)}]`);\n }\n\n // is there a call-back associated to the event [queue_drain] ?\n const pf_queue_drain = lo_this.m_pick_option(null, \"pf_queue_drain\", true);\n if (pf_queue_drain) {\n pf_queue_drain();\n }\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 }", "dequeue () {\n\t while (!this.deflating && this.queue.length) {\n\t const params = this.queue.shift();\n\n\t this.bufferedBytes -= params[1].length;\n\t params[0].apply(this, params.slice(1));\n\t }\n\t }", "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(cb) {\n if (!state.buffer.length)\n return cb()\n var done = multicb()\n var wait = false\n state.buffer.forEach(function(entry) {\n if (hasHandled(entry.depId, entry.seq)) {\n // dep has been handled, run it now\n applyMessage(entry.msg, done())\n wait = true\n }\n })\n if (!wait)\n return cb()\n done(cb)\n }", "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 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", "denqueue() {\n debug(`\\nLOG: remove the queue`);\n this.queue.shift();\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 $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 processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "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 processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }" ]
[ "0.8368115", "0.8304939", "0.70665467", "0.701564", "0.68049484", "0.6587707", "0.6466933", "0.63364094", "0.62661076", "0.62456757", "0.62418073", "0.62328243", "0.6208933", "0.6208856", "0.6208856", "0.6208856", "0.6208856", "0.61453366", "0.6136541", "0.6108031", "0.6093683", "0.6093683", "0.6093683", "0.6093683", "0.6093683", "0.60834724", "0.60783815", "0.60783815", "0.60783815", "0.60783815", "0.60627294", "0.6059586", "0.6014184", "0.59012306", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5899652", "0.5887597", "0.5878159", "0.5878159", "0.586364", "0.586226" ]
0.84176576
0
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\n });\n });\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "function oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "function PropertyDetection() {}", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "constructor()\n {\n this.likes = [];\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "transient private internal function m185() {}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function OOPExample(who) {\n this.me = who;\n}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\n}", "function LiteralObject() {\r\n}", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "getLikes(state, data) {\n state.likes = data\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function Animal() {\n this.kind = \"Dog\"\n}", "getMeta () {\n }", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}" ]
[ "0.52719957", "0.5258603", "0.5189542", "0.5181587", "0.51222587", "0.50485057", "0.4895682", "0.48634082", "0.48405623", "0.4833185", "0.48265588", "0.48152655", "0.48029664", "0.47881085", "0.47855937", "0.4759736", "0.47531617", "0.47402334", "0.4730283", "0.47066608", "0.47066608", "0.4691235", "0.4690913", "0.4690598", "0.46900856", "0.46649086", "0.46614277", "0.46434027", "0.46270078", "0.46097907", "0.45988998", "0.45935017", "0.4592764", "0.45884836", "0.45879704", "0.45853597", "0.4585284", "0.4579574", "0.4578069", "0.4578069", "0.4578069", "0.4576527", "0.4572429", "0.4567408", "0.4567408", "0.45654222", "0.45603994", "0.45603994", "0.45603994", "0.45549092", "0.45382926", "0.4537875", "0.4533901", "0.45336092", "0.4527549", "0.4521531", "0.45214704", "0.45214704", "0.45157385", "0.45064023", "0.45063153", "0.4502072", "0.4501808", "0.4497188", "0.44969282", "0.44908035", "0.44891724", "0.4480031", "0.44781724", "0.44769347", "0.44769347", "0.44697535", "0.44651616", "0.44612855", "0.4457256", "0.44532225", "0.44494516", "0.44468775", "0.44468775", "0.44459015", "0.44455904", "0.44404754", "0.44398317", "0.44326937", "0.44292706", "0.44283965", "0.4428095", "0.44202358", "0.44189432", "0.4417112", "0.44127247", "0.44042107", "0.4402958", "0.4401278", "0.43965617", "0.43863535", "0.4386326", "0.4386326", "0.4386326", "0.43840668", "0.43840668" ]
0.0
-1
c is a single hex digit (string)
function inc_digit(c) { if (c == "9") { return "a"; } else if (c == "f") { return "0"; } else { return String.fromCharCode(c.charCodeAt() + 1) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hexVal (c) {\n return (\n c < 58 ? c - 48 : // 0 - 9\n c < 71 ? c - 55 : // A - F\n c - 87 // a - f\n );\n}", "componentToHex(c) {\n let hex = c.toString(16);\n return hex.length === 1 ? \"0\" + hex : hex;\n }", "function isHexDigit(c){\r\n return /^[0-9A-Fa-f]$/.test(c);\r\n}", "function componentToHex(c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n}", "function componentToHex(c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n}", "function componentToHex(c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n}", "function componentToHex(c) {\n var hex = parseFloat(c).toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n }", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length === 1 ? \"0\" + hex : hex;\n }", "function componentToHex (c) {\n var v = Number(c).toString(16);\n if (v.length < 2) {\n v = '0' + v;\n }\n return (v);\n}", "function componentToHex(c) {\n\tvar hex = c.toString(16);\n\treturn hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n }", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n }", "function componentToHex(c) {\n\t\tc = Math.round(c * 255).toString(16);\n\t\treturn c.length === 1 ? '0' + c : c;\n\t}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16)\n return hex.length == 1 ? '0' + hex : hex\n}", "function componentToHex(c) {\n\t\t var hex = c.toString(16);\n\t\t return hex.length == 1 ? \"0\" + hex : hex;\n\t\t}", "function componentToHex (c) {\n \tvar hex = c.toString(16);\n \treturn hex.length == 1 ? \"0\" + hex : hex;\n }", "function componentToHex(c) {\n\t\tvar hex = c.toString(16);\n\t\treturn hex.length == 1 ? \"0\" + hex : hex;\n\t}", "function componentToHex(c) {\n let hex = c.toString(16);\n return hex.length === 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function componentToHex(c) {\n var hex = c.toString(16);\n return hex.length == 1 ? \"0\" + hex : hex;\n}", "function charToHex(c) {\r\n var ZERO = 48;\r\n var NINE = ZERO + 9;\r\n var littleA = 97;\r\n var littleZ = littleA + 25;\r\n var bigA = 65;\r\n var bigZ = 65 + 25;\r\n var result;\r\n\r\n if (c >= ZERO && c <= NINE) {\r\n result = c - ZERO;\r\n } else if (c >= bigA && c <= bigZ) {\r\n result = 10 + c - bigA;\r\n } else if (c >= littleA && c <= littleZ) {\r\n result = 10 + c - littleA;\r\n } else {\r\n result = 0;\r\n }\r\n return result;\r\n}", "function componentToHex(c) {\n const hex = c.toString(16);\n return hex.length == 1 ? '0' + hex : hex;\n}", "function hex( c ) {\n var m = /rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)/.exec(c);\n return m ? '#' + (1 << 24 | m[1] << 16 | m[2] << 8 | m[3]).toString(16).substr(1) : c;\n}", "function bytesToHex(c)\n{\n var digits = \"0123456789abcdef\";\n var num = c.length;\n var s = \"\";\n for (var i = 0; i < num; ++i) {\n var hi = Math.floor(c[i] >> 4);\n var lo = c[i] & 0xF;\n s += digits[hi] + digits[lo];\n }\n return s;\n}", "function toHex(c) {\n var m = c.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);\n // short skirt to long jacket\n return (m ? rgb(m[1], m[2], m[3]) : c).replace(/#(\\w)(\\w)(\\w)$/, '#$1$1$2$2$3$3');\n }", "function char(x) { return parseInt(x, 16); }", "function cpFC(s){var hi,lo\n if(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(s)){\n hi=s.charCodeAt(0)\n lo=s.charCodeAt(1)\n return 0x10000+(((hi&0x3FF) << 10) | (lo&0x3FF))}\n return s.charCodeAt(0)}", "function hex(s) {\n\tif (typeof s === 'string')\n\t\treturn parseInt(s.replace('#', '0x').replace(/'/g, ''), 16);\n\telse return s;\n}", "function c(n){\r\n\treturn String.fromCharCode(n);\r\n}", "function getRandomChar(c) {\n var r = Math.random() * 16;//random number between 0 and 16\n if(d > 0){\n r = (d + r)%16 | 0;\n d = Math.floor(d/16);\n } else { r = (d2 + r)%16 | 0;\n d2 = Math.floor(d2/16);\n }\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n }", "function _char(c) {\n if (!_CHARS[c]) {\n _CHARS[c] = '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);\n }\n return _CHARS[c];\n}", "function _char(c) {\n if (!_CHARS[c]) {\n _CHARS[c] = '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);\n }\n return _CHARS[c];\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n }", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function hexcode(v) { return v < 10 ? 0x30 + v : 0x61 + v - 10 }", "function sc_char2integer(c)\n { return c.val.charCodeAt(0); }", "function hextodec(hex_value){\n if (hex_value.length % 2) { hex_value = '0' + hex_value; }\n var bn = BigInt('0x' + hex_value);\n var d = bn.toString(10);\n return d;\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "static getAHexCharacter() {\n const characters = [\n '0', '1', '2', '3',\n '4', '5', '6', '7',\n '8', '9', 'A', 'B',\n 'C', 'D', 'E', 'F',\n ];\n\n const randomNumber = this.generateRandomNumber(characters.length);\n\n return characters[randomNumber];\n }", "function ord(c) {\n return c.charCodeAt(0);\n }", "function hexSingle(n) {\r\n\t\tn = parseInt(n,10); \r\n\t\tif (isNaN(n)) return \"00\";\r\n\t\tn = Math.max(0,Math.min(n,255));\r\n\t\treturn \"0123456789ABCDEF\".charAt((n-n%16)/16) + \"0123456789ABCDEF\".charAt(n%16);\t\r\n\t}", "function ord (c) {\n return c.charCodeAt(0)\n}", "function hexc(colorval) {\n var parts = colorval.match(/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/);\n delete(parts[0]);\n for (var i = 1; i <= 3; ++i) {\n parts[i] = parseInt(parts[i]).toString(16);\n if (parts[i].length == 1) parts[i] = '0' + parts[i];\n }\n return '#' + parts.join('');\n}", "function decToHex(d) { var dr = Number(d).toString(16); while(dr.length < 4) { dr = '0'+dr; } return '0x'+dr.toUpperCase(); }", "function getChar(c){\n return String.fromCodePoint(c);\n}", "cpfIBytes(c) {\n var hex = c.charCodeAt(0);\n if (hex < 0x20 || hex > 0x2F) {\n this.charProcFunc = this.cpfDefault;\n }\n }", "hex(x) {\n var hexDigits = new Array(\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\");\n return isNaN(x) ? \"00\" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];\n }", "function f(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;\n// must be an even number of digits\nvar a=t.length;$(a%2===0,\"Invalid hex string\"),r>a/2&&(r=a/2);for(var s=0;r>s;s++){var l=parseInt(t.substr(2*s,2),16);$(!isNaN(l),\"Invalid hex string\"),e[n+s]=l}return o._charsWritten=2*s,s}", "rawC () {\n return parseInt(this.C, 16);\n }", "function sc_char2string(c) { return c.val; }", "function hexc(colorval) {\n var parts = colorval.match(/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/);\n delete(parts[0]);\n for (var i = 1; i <= 3; ++i) {\n parts[i] = parseInt(parts[i]).toString(16);\n if (parts[i].length == 1) parts[i] = '0' + parts[i];\n }\n color = '#' + parts.join('');\n }", "function hex(b) {\n return ('0' + b.toString(16)).substr(-2);\n}", "function replacer(c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }", "stringToHex(str) {\n\t\treturn parseInt(str.replace(/^#/, \"0x\"), 16);\n\t}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 /* a */ && code <= 102 /* z */ || code >= 65 /* A */ && code <= 70 /* Z */ || code >= 48 /* A */ && code <= 57 /* Z */;\n}", "function isASCIIDigit(c) {\n return c >= 0x30 && c <= 0x39;\n}", "function fC2N(c) {\n if (0x30 <= c.charCodeAt(0) && c.charCodeAt(0) < 0x3a) {return c.charCodeAt(0) - 0x30;}\n else if (0x41 <= c.charCodeAt(0) && c.charCodeAt(0) <= 0x5a) {return c.charCodeAt(0) - 0x41 + 10;}\n else if (0x61 <= c.charCodeAt(0) && c.charCodeAt(0) <= 0x78) {return c.charCodeAt(0) - 0x61 + 36;}\n\n return -1000;\n}", "function readHexChar (len) {\r\n const start = acornPos;\r\n let total = 0, lastCode = 0;\r\n for (let i = 0; i < len; ++i, ++acornPos) {\r\n let code = source.charCodeAt(acornPos), val;\r\n\r\n if (code === 95) {\r\n if (lastCode === 95 || i === 0) syntaxError();\r\n lastCode = code;\r\n continue;\r\n }\r\n\r\n if (code >= 97) val = code - 97 + 10; // a\r\n else if (code >= 65) val = code - 65 + 10; // A\r\n else if (code >= 48 && code <= 57) val = code - 48; // 0-9\r\n else break;\r\n if (val >= 16) break;\r\n lastCode = code;\r\n total = total * 16 + val;\r\n }\r\n\r\n if (lastCode === 95 || acornPos - start !== len) syntaxError();\r\n\r\n return total;\r\n }", "function isHexaColor(sNum) {\n return (typeof sNum === \"string\") && sNum.length === 6\n && !isNaN(parseInt(sNum, 16));\n}" ]
[ "0.7732673", "0.7485638", "0.7338237", "0.7304741", "0.7301328", "0.7301328", "0.7272534", "0.7268888", "0.7254141", "0.7247418", "0.7240753", "0.7240753", "0.72371835", "0.7225809", "0.7225809", "0.7225809", "0.7225809", "0.7225809", "0.7225809", "0.7224251", "0.7223993", "0.7215602", "0.7215115", "0.7203791", "0.71967214", "0.71967214", "0.7163306", "0.71406865", "0.7029909", "0.69095594", "0.6866155", "0.68655276", "0.6796729", "0.6767821", "0.67315245", "0.6730018", "0.6650781", "0.6650781", "0.6624277", "0.6615061", "0.6615061", "0.6615061", "0.66100174", "0.65684986", "0.65382713", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.65357715", "0.64966434", "0.64941305", "0.64594644", "0.63861406", "0.6362198", "0.6359433", "0.63347584", "0.6330401", "0.6321626", "0.6302844", "0.62988615", "0.62892", "0.6285199", "0.6271988", "0.62292206", "0.62288964", "0.6220669", "0.6220669", "0.6220669", "0.6220669", "0.6220669", "0.6220669", "0.6220669", "0.6215293", "0.6193825", "0.61892265", "0.61824423", "0.6164438" ]
0.0
-1
x is a string of hex digits
function increment(x) { var i = x.length - 1; var carry; var new_x = x.split(""); do { old_digit = x.charAt(i); new_digit = inc_digit(old_digit); new_x[i] = new_digit; if (new_digit == "0") { carry = true; i -= 1; } else { carry = false; } if (i < 0) { carry = false; } } while (carry); return new_x.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hex(x) {\n var hexDigits = new Array(\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\");\n return isNaN(x) ? \"00\" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];\n }", "function hexify(x) {\n return isNaN(x) ? \"00\" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];\n }", "function hexify(x)\n{\n\tvar hexies = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\n\treturn hexies.slice(x,x+1)\n}", "function hex1(x)\n{\n\treturn hexify(Math.floor(reblock(x)/16))\n}", "function hex(x) {\n for (var i = 0; i < x.length; i++)\n x[i] = makeHex(x[i]);\n return x.join('');\n}", "function hex(s) {\n\tif (typeof s === 'string')\n\t\treturn parseInt(s.replace('#', '0x').replace(/'/g, ''), 16);\n\telse return s;\n}", "function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n // write hex representation in reverse order\n do {\n bu8[ptr++] = h$_hs_bytestring_digits[x & 0xf];\n x >>>= 4;\n } while(x);\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n // write hex representation in reverse order\n do {\n bu8[ptr++] = h$_hs_bytestring_digits[x & 0xf];\n x >>>= 4;\n } while(x);\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n // write hex representation in reverse order\n do {\n bu8[ptr++] = h$_hs_bytestring_digits[x & 0xf];\n x >>>= 4;\n } while(x);\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n // write hex representation in reverse order\n do {\n bu8[ptr++] = h$_hs_bytestring_digits[x & 0xf];\n x >>>= 4;\n } while(x);\n\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n // write hex representation in reverse order\n do {\n bu8[ptr++] = h$_hs_bytestring_digits[x & 0xf];\n x >>>= 4;\n } while(x);\n\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n // write hex representation in reverse order\n do {\n bu8[ptr++] = h$_hs_bytestring_digits[x & 0xf];\n x >>>= 4;\n } while(x);\n\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n h$ret1 = next_free;\n return buf_d;\n}", "function rgbToHex(x) {\n let hex = Number(x).toString(16);\n if (hex.length < 2) {\n hex = \"0\" + hex;\n }\n return hex;\n}", "function getRGB(x){\n\tvar r=parseInt(x.substring(1,3),16)\n\tvar g=parseInt(x.substring(3,5),16)\n\tvar b=parseInt(x.substring(5),16)\n\treturn (\"La conversión de hexadecimal a RGB es \" +r+\",\"+g+\",\"+b)\n}", "function hex2(x)\n{\n\treturn hexify(Math.floor(reblock(x)%16))\n}", "function char(x) { return parseInt(x, 16); }", "function ensure0x(hex = '') {\n const hexString = hex.toString();\n if (typeof hexString === 'string' && hexString.indexOf('0x') !== 0) {\n return `0x${hexString}`;\n }\n return hexString;\n}", "function xHex(n, digits, prefix)\r\n{\r\n var p = '', n = Math.ceil(n);\r\n if (prefix) p = prefix;\r\n n = n.toString(16);\r\n for (var i=0; i < digits - n.length; ++i) {\r\n p += '0';\r\n }\r\n return p + n;\r\n}", "function strip0x(hex) {\n if (typeof hex === 'undefined') return '';\n if (typeof hex === 'string' && hex.indexOf('0x') === 0) {\n return hex.slice(2).toString();\n }\n return hex.toString();\n}", "function strip0x(hex) {\n if (typeof hex === 'undefined')\n return '';\n if (typeof hex === 'string' && hex.indexOf('0x') === 0) {\n return hex.slice(2).toString();\n }\n return hex.toString();\n}", "function hex_md5(x){\r\n if (debug_on) {\r\n document.writeln(\"<hr>\");\r\n document.writeln(\"<br>Indata: '\" + x + \"'<br>\");\r\n }\r\n \r\n return array_to_hex(md5_main(text_to_padded_array(x), x.length));\r\n}", "function isHex(s) {\n return /^0x[0-9a-f]+$/i.test(s);\n}", "function hexcode(v) { return v < 10 ? 0x30 + v : 0x61 + v - 10 }", "function __hex($num) {\r\nvar str = \"\";\r\nfor(var j = 7; j >= 0; j--)\r\nstr += _chars.charAt(($num >> (j * 4)) & 0x0F);\r\nreturn str;\r\n}", "function f(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;\n// must be an even number of digits\nvar a=t.length;$(a%2===0,\"Invalid hex string\"),r>a/2&&(r=a/2);for(var s=0;r>s;s++){var l=parseInt(t.substr(2*s,2),16);$(!isNaN(l),\"Invalid hex string\"),e[n+s]=l}return o._charsWritten=2*s,s}", "function hex2string(hexx) {\n var str = '';\n for (var i = 0; i < hexx.length; i++)\n str += String.fromCharCode(hexx[i], 10)[0];\n return str;\n}", "stringToHex(str) {\n\t\treturn parseInt(str.replace(/^#/, \"0x\"), 16);\n\t}", "function cutHex(h) {\n if (h.charAt(1) === \"x\") {\n return h.substring(2, 8);\n } else {\n return h.substring(1, 7);\n }\n}", "function hextodec(hex_value){\n if (hex_value.length % 2) { hex_value = '0' + hex_value; }\n var bn = BigInt('0x' + hex_value);\n var d = bn.toString(10);\n return d;\n}", "function hexVal (c) {\n return (\n c < 58 ? c - 48 : // 0 - 9\n c < 71 ? c - 55 : // A - F\n c - 87 // a - f\n );\n}", "function hexSingle(n) {\r\n\t\tn = parseInt(n,10); \r\n\t\tif (isNaN(n)) return \"00\";\r\n\t\tn = Math.max(0,Math.min(n,255));\r\n\t\treturn \"0123456789ABCDEF\".charAt((n-n%16)/16) + \"0123456789ABCDEF\".charAt(n%16);\t\r\n\t}", "function hexaEncode(s) {\r\n var result = \"\";\r\n var sl = s.length;\r\n var i = 0;\r\n while (i < sl) {\r\n result += digitToHex(s.charCodeAt(i));\r\n i++;\r\n }\r\n return result;\r\n}", "function hexString(number) {\n if (guiUtils.isString(number)) {\n if (number.substring(0, 1) === \"#\") {\n number = parseInt(number.substring(1), 16);\n } else {\n number = parseInt(number);\n }\n }\n if (!guiUtils.isNumber(number)) {\n console.error('hexString: Input is not a number or number string, its value is ' + number);\n number = 0;\n }\n number = Math.max(0, Math.min(255, Math.round(number)));\n let result = number.toString(16);\n if (result.length === 1) {\n result = \"0\" + result;\n }\n return result;\n}", "function chr(x) {\n \t\treturn String.fromCharCode(0xFF & x);\n \t}", "function okhash(x) {\n if (!x || !x.length) return 0;\n for (var i = 0, h = 0; i < x.length; i++) {\n h = ((h << 5) - h) + x.charCodeAt(i) | 0;\n } return h;\n }", "function processHEX(val) {\n //does the hex contain extra char?\n var hex = (val.length >6)?val.substr(1, val.length - 1):val;\n // is it a six character hex?\n if (hex.length > 3) {\n\n //scrape out the numerics\n var r = hex.substr(0, 2);\n var g = hex.substr(2, 2);\n var b = hex.substr(4, 2);\n\n // if not six character hex,\n // then work as if its a three character hex\n } else {\n\n // just concat the pieces with themselves\n var r = hex.substr(0, 1) + hex.substr(0, 1);\n var g = hex.substr(1, 1) + hex.substr(1, 1);\n var b = hex.substr(2, 1) + hex.substr(2, 1);\n\n }\n // return our clean values\n return [\n parseInt(r, 16),\n parseInt(g, 16),\n parseInt(b, 16)\n ]\n}", "function processHEX(val) {\n //does the hex contain extra char?\n var hex = (val.length >6)?val.substr(1, val.length - 1):val;\n // is it a six character hex?\n if (hex.length > 3) {\n\n //scrape out the numerics\n var r = hex.substr(0, 2);\n var g = hex.substr(2, 2);\n var b = hex.substr(4, 2);\n\n // if not six character hex,\n // then work as if its a three character hex\n } else {\n\n // just concat the pieces with themselves\n var r = hex.substr(0, 1) + hex.substr(0, 1);\n var g = hex.substr(1, 1) + hex.substr(1, 1);\n var b = hex.substr(2, 1) + hex.substr(2, 1);\n\n }\n // return our clean values\n return [\n parseInt(r, 16),\n parseInt(g, 16),\n parseInt(b, 16)\n ]\n}", "function toHex(n){return (n<16?\"0\":\"\")+n.toString(16);}", "function fakeBin(x) {\n return x.replace(/[1234]/g, \"0\").replace(/[56789]/g, \"1\");\n}", "function okhash(x) {\n if (!x || !x.length) return 0;\n for (var i = 0, h = 0; i < x.length; i++) {\n h = ((h << 5) - h) + x.charCodeAt(i) | 0;\n } return h;\n }", "function ensureHexBuffer(x) {\n if (x === null || x === 0) return Buffer.alloc(0);\n else if (Buffer.isBuffer(x)) x = x.toString('hex');\n if (typeof x === 'number') x = `${x.toString(16)}`;\n else if (typeof x === 'string' && x.slice(0, 2) === '0x') x = x.slice(2);\n if (x.length % 2 > 0) x = `0${x}`;\n return Buffer.from(x, 'hex');\n}", "function bin2hex(s) {\r\n\tvar i, l, o0o = '',\r\n\tn;\r\n\ts += '';\r\n\tfor (i = 0, l = s.length; i < l; i++) {\r\n\t\tn = s.charCodeAt(i).toString(16);\r\n\t\to0o += n.length < 2 ? '0' + n : n;\r\n\t}\r\n\treturn o0o;\r\n}", "function hex(val) {\n var hex_rep = val.toString(16);\n return (hex_rep.length === 1) ? '0' + hex_rep : hex_rep;\n}", "function hex(b) {\n return ('0' + b.toString(16)).substr(-2);\n}", "function hex_sha1(s){\n\n return binb2hex(core_sha1(AlignSHA1(s)));\n\n }", "function rstr2hex(input){var hexTab='0123456789abcdef';var output='';var x;var i;for(i=0;i<input.length;i+=1){x=input.charCodeAt(i);output+=hexTab.charAt(x>>>4&0x0f)+hexTab.charAt(x&0x0f);}return output;}", "function hex(s) {\n\n // hex(\"rgb(255, 0, 0)\") returns #FF0000\n var m = /rgba?\\((\\d+), (\\d+), (\\d+)/.exec(s);\n if (m) {\n s = (m[1] << 16 | m[2] << 8 | m[3]).toString(16);\n while (s.length < 6)\n s = \"0\" + s;\n return \"#\" + s;\n }\n\n // hex(\"#F00\") returns #FF0000\n var c = s.split(\"\");\n if (s.length === 4)\n return \"#\" + c[1] + c[1] + c[2] + c[2] + c[3] + c[3];\n\n // hex(\"#FF0000\") returns #FF0000\n return s;\n\n }", "function disarm_hex(s) {\r\n var hexDigits = \"0123456789abcdefABCDEF\";\r\n var hs = \"\", i;\r\n\r\n // Extract hexadecimal data between sentinels, if present\r\n\r\n if ((i = s.indexOf(hexSentinel)) >= 0) {\r\n s = s.substring(i + hexSentinel.length, s.length);\r\n }\r\n if ((i = s.indexOf(hexEndSentinel)) >= 0) {\r\n s = s.substring(0, i);\r\n }\r\n\r\n // Assemble string of valid hexadecimal digits\r\n\r\n for (i = 0; i < s.length; i++) {\r\n var c = s.charAt(i);\r\n if (hexDigits.indexOf(c) >= 0) {\r\n hs += c;\r\n }\r\n }\r\n //dump(\"hs\", hs);\r\n return hexToByteArray(hs);\r\n}", "function hex_sha1(s) {\n\n return binb2hex(core_sha1(AlignSHA1(s)));\n\n}", "function parseHex(string, expand) {\nstring = string.replace(/[^A-F0-9]/ig, '');\nif( string.length !== 3 && string.length !== 6 ) return '';\nif( string.length === 3 && expand ) {\nstring = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];\n}\nreturn '#' + string;\n}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * 8));}", "function isHex(num)\r\n{\r\n\treturn /^[0-9a-fA-f]+$/.test(num);\r\n}", "function fullHex(hex) {\n return hex.length == 4 ? ['#', hex.substring(1, 2), hex.substring(1, 2), hex.substring(2, 3), hex.substring(2, 3), hex.substring(3, 4), hex.substring(3, 4)].join('') : hex;\n }", "function fromHexString(s) {\n if (s[0] !== '#')\n return fromHex(0);\n if (s.length === 4) { // #rgb\n return fromHexString(\"#\" + s[1] + s[1] + s[2] + s[2] + s[3] + s[3]);\n }\n else if (s.length === 7) { // #rrggbb\n return fromHex(parseInt(s.substr(1), 16));\n }\n return fromHex(0);\n }", "function x24_r64(x) {\n \t\treturn rchr(x>>18) + rchr(x>>12) + rchr(x>>6) + rchr(x);\n \t}", "function rgb2Hex(s) {\n //@ts-ignore\n return s.match(/[0-9]+/g).reduce(function (a, b) { return a + (b | 256).toString(16).slice(1); }, '#').toString(16);\n}", "function fun4(){\nvar number = prompt('enter the number in 16-hex');\n\nvar newNumber = function(str){\n\tvar regExp = /[G-Z]/g; //regExp for check 16-hex number\n\tvar result;\n\n\tif(!regExp.test(str)){\nconsole.log(parseInt(str,16)); // transformation to 10-hex number\n\t\n\t}\nelse{\n\tconsole.log('no 16-hex number ')\n}\n}\nnewNumber(number);\n}", "function makeHex(){\n\tvar hax = ''; // define variable to collect values to be used as hexadecimal\n\tfor (var y = 0;y<6;y++){ // there are 6 values in a hexadecimal, so loop 6 times\n\t\tvar single = random(); // execute random function 6x to get random values\n\t\thax = hax + single; // collect the 6 values and turn into a single string\n\t}\n\treturn \"#\"+hax; // add a \"#\" symnbol to make it legit hexadecimal\n}", "function fullHex(hex) {\r\n return hex.length == 4 ?\r\n [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2)\r\n , hex.substring(2, 3), hex.substring(2, 3)\r\n , hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('') : hex\r\n}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}", "function hex_sha(string){var shaObj=new jsSHA(string);return shaObj.getHash(\"HEX\");}", "function isHexDigit(c){\r\n return /^[0-9A-Fa-f]$/.test(c);\r\n}", "parseHexEscapeSequence() {\n this.expect('x');\n const HexDigit_a = this.next();\n if (!isHexDigit(HexDigit_a)) {\n throw new SyntaxError('Not a hex digit');\n }\n const HexDigit_b = this.next();\n if (!isHexDigit(HexDigit_b)) {\n throw new SyntaxError('Not a hex digit');\n }\n return {\n type: 'HexEscapeSequence',\n HexDigit_a,\n HexDigit_b,\n };\n }", "function fullHex(hex) {\n return hex.length == 4 ?\n [ '#',\n hex.substring(1, 2), hex.substring(1, 2)\n , hex.substring(2, 3), hex.substring(2, 3)\n , hex.substring(3, 4), hex.substring(3, 4)\n ].join('') : hex\n }", "function dec2hex(s) {\n return (s < 15.5 ? '0' : '') + Math.round(s).toString(16);\n}", "function hexify (number) {\n const hexChars = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']\n if (isNaN(number)) {\n return '00'\n }\n return hexChars[(number - number % 16) / 16] + hexChars[number % 16]\n }", "function isHexaColor(sNum) {\n return (typeof sNum === \"string\") && sNum.length === 6\n && !isNaN(parseInt(sNum, 16));\n}", "function checkHex (str) {\n\t\tvar i, k;\n\t\tif (str.length%2) {\n\t\t\treturn convert(str);\n\t\t} else {\n\t\t\tk = false;\n\t\t\tfor (i=0;i<str.length;i+=2) {\n\t\t\t\tif (isNaN(parseInt(str.substr(i,1), 16))) { k = true; }\n\t\t\t\tif (isNaN(parseInt(str.substr(i+1,1), 16))) { k = true; }\n\t\t\t}\n\t\t\tif (k) { return convert(str); }\n\t\t\treturn str;\n\t\t}\n\t\tfunction convert (chars) {\n\t\t\tvar i, hex = \"\";\n\t\t\tfor (i=0;i<str.length;i++) {\n\t\t\t\thex += str.charCodeAt(i).toString(16);\n\t\t\t}\n\t\t\treturn hex;\n\t\t}\n\t\treturn hex;\n\t}", "function decToHex(d) { var dr = Number(d).toString(16); while(dr.length < 4) { dr = '0'+dr; } return '0x'+dr.toUpperCase(); }", "function convertToHex(binary){\n var parts = binary.match(/.{1,4}/g);\n var hexString =\"\";\n //console.log(parts)\n for (var i = 0; i < parts.length; i++) {\n //console.log(parseInt(parts[i],2));\n hexString = hexString + parseInt(parts[i],2).toString(16);\n }\n //console.log(hexString)\n return hexString\n}", "function h$_hs_bytestring_long_long_uint_hex(x_a, x_b, buf_d, buf_o) {\n // write hex representation in reverse order\n var c, i, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n if(x_a === 0 && x_b === 0) {\n bu8[ptr++] = 48; // '0'\n } else if(x_a === 0) {\n while(x_b !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n } else {\n for(i=0;i<8;i++) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n while(x_a !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_a & 0xf];\n x_a >>>= 4;\n }\n }\n\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function array_to_hex(x){\r\n var hexstring = \"0123456789ABCDEF\";\r\n /* var hexstring = \"0123456789abcdef\"; */\r\n var output_string = \"\";\r\n \r\n for (var i = 0; i < x.length * 4; i++) {\r\n var tmp_i = shift_right(i, 2);\r\n \r\n output_string += hexstring.charAt((shift_right(x[tmp_i], ((i % 4) * 8 + 4))) & 0xF) +\r\n hexstring.charAt(shift_right(x[tmp_i], ((i % 4) * 8)) & 0xF);\r\n }\r\n return output_string;\r\n}", "function hex(val) {\n\t\t\tval = val.toString(16);\n\t\t\tif (val.length < 2) val = '0'+val;\n\t\t\treturn val;\n\t\t}", "function fullHex(hex) {\n return hex.length == 4 ?\n [ '#',\n hex.substring(1, 2), hex.substring(1, 2)\n , hex.substring(2, 3), hex.substring(2, 3)\n , hex.substring(3, 4), hex.substring(3, 4)\n ].join('') : hex\n}", "function fullHex(hex) {\n return hex.length == 4 ?\n [ '#',\n hex.substring(1, 2), hex.substring(1, 2)\n , hex.substring(2, 3), hex.substring(2, 3)\n , hex.substring(3, 4), hex.substring(3, 4)\n ].join('') : hex\n}", "function strvalue_2_hexstring_33(str,len){\n\tvar returnValue='';\n\tfor(var i=str.length-2;i>-2;i-=2){\n\t\tif(i == -1) \n\t\t\treturnValue = returnValue + byte_2_hex(parseInt(str.substr(0,1),16)+0x33);\n\t\telse\n\t\t\treturnValue = returnValue + byte_2_hex(parseInt(str.substr(i,2),16)+0x33);\n\t}\n\twhile(returnValue.length<len*2){\n\t\treturnValue=returnValue + '3';\n\t}\n\treturn returnValue;\n}", "function h$_hs_bytestring_long_long_uint_hex(x_a, x_b, buf_d, buf_o) {\n // write hex representation in reverse order\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n if(x_a === 0 && x_b === 0) {\n bu8[ptr++] = 48; // '0'\n } else {\n while(x_b !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n while(x_a !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_a & 0xf];\n x_a >>>= 4;\n }\n }\n\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_long_long_uint_hex(x_a, x_b, buf_d, buf_o) {\n // write hex representation in reverse order\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n if(x_a === 0 && x_b === 0) {\n bu8[ptr++] = 48; // '0'\n } else {\n while(x_b !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n while(x_a !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_a & 0xf];\n x_a >>>= 4;\n }\n }\n\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n h$ret1 = next_free;\n return buf_d;\n}", "function hex_sha1(s) {\n return binb2hex(core_sha1(str2binb(s), s.length * chrsz));\n}", "function h$_hs_bytestring_long_long_uint_hex(x_a, x_b, buf_d, buf_o) {\n // write hex representation in reverse order\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n if(x_a === 0 && x_b === 0) {\n bu8[ptr++] = 48; // '0'\n } else {\n while(x_b !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n while(x_a !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_a & 0xf];\n x_a >>>= 4;\n }\n }\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_long_long_uint_hex(x_a, x_b, buf_d, buf_o) {\n // write hex representation in reverse order\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n if(x_a === 0 && x_b === 0) {\n bu8[ptr++] = 48; // '0'\n } else {\n while(x_b !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n while(x_a !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_a & 0xf];\n x_a >>>= 4;\n }\n }\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function h$_hs_bytestring_long_long_uint_hex(x_a, x_b, buf_d, buf_o) {\n // write hex representation in reverse order\n var c, ptr = buf_o, next_free;\n var bu8 = buf_d.u8;\n if(x_a === 0 && x_b === 0) {\n bu8[ptr++] = 48; // '0'\n } else {\n while(x_b !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_b & 0xf];\n x_b >>>= 4;\n }\n while(x_a !== 0) {\n bu8[ptr++] = h$_hs_bytestring_digits[x_a & 0xf];\n x_a >>>= 4;\n }\n }\n // invert written digits\n next_free = ptr--;\n while(buf_o < ptr) {\n c = bu8[ptr];\n bu8[ptr--] = bu8[buf_o];\n bu8[buf_o++] = c;\n }\n { h$ret1 = (next_free); return (buf_d); };\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n }", "function in_hex() {\n let backend = entrada_selecionada();\n let s = NaN;\n do {\n s = parseInt(prompt(\"Insira uma word de quatro nibbles como 00A0 ou F0DA.\",\n \"0000\"), 16);\n } while (isNaN(s));\n backend.inserir(s);\n update_entrada();\n}", "function hexToDigit(s) {\r\n var result = 0;\r\n var sl = Math.min(s.length, 2);\r\n for (var i = 0; i < sl; ++i) {\r\n result <<= 4;\r\n result |= charToHex(s.charCodeAt(i))\r\n }\r\n return result;\r\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function convertToHex(n) {\n return Number(n).toString(16);\n}", "function rstr2hex(input) {\r\n\t\t var hex_tab = '0123456789abcdef',\r\n\t\t output = '',\r\n\t\t x,\r\n\t\t i;\r\n\t\t for (i = 0; i < input.length; i += 1) {\r\n\t\t x = input.charCodeAt(i);\r\n\t\t output += hex_tab.charAt((x >>> 4) & 0x0F) +\r\n\t\t hex_tab.charAt(x & 0x0F);\r\n\t\t }\r\n\t\t return output;\r\n\t\t }" ]
[ "0.809851", "0.8075778", "0.79198825", "0.7572682", "0.7567683", "0.7494706", "0.7391833", "0.7391833", "0.7391833", "0.7381191", "0.7381191", "0.73471767", "0.7298553", "0.71644753", "0.7136094", "0.69190353", "0.6855642", "0.6842635", "0.67922825", "0.67829025", "0.67313915", "0.672168", "0.6717422", "0.6659765", "0.66190916", "0.6607564", "0.65825707", "0.65756655", "0.65416664", "0.65388745", "0.6493719", "0.64495873", "0.6432605", "0.6428642", "0.64125293", "0.63952106", "0.63952106", "0.6394064", "0.6382405", "0.63802165", "0.6368756", "0.6356466", "0.6352582", "0.6333503", "0.6329559", "0.6329088", "0.6322716", "0.6310268", "0.62982154", "0.6296918", "0.6286154", "0.6284933", "0.62839216", "0.62812066", "0.62782043", "0.62779385", "0.6268237", "0.6259323", "0.625917", "0.62542295", "0.62542295", "0.62542295", "0.62542295", "0.62542295", "0.62542295", "0.62542295", "0.62538", "0.6253348", "0.6239236", "0.62390596", "0.6222928", "0.62193817", "0.6208641", "0.62080127", "0.6205001", "0.6198269", "0.6195598", "0.6190141", "0.61871636", "0.6186214", "0.6186214", "0.6185676", "0.6182769", "0.6176951", "0.61743224", "0.6173227", "0.6173227", "0.6173227", "0.61681056", "0.6164791", "0.6159904", "0.61538124", "0.61538124", "0.61538124", "0.61538124", "0.61538124", "0.61538124", "0.61538124", "0.61538124", "0.6153808", "0.61366135" ]
0.0
-1
request is a url
function redirect(request, key, expire, args) { if (args == "") { url = request + "?"; } else { url = request + "&"; } url += "key=" + key + "&expire=" + expire; window.location = url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isResource(request) {\n return request.url.match(/\\/imgs\\/.*$/) && request.method === 'GET';\n}", "function _isSentryRequest(url) {\n const client = getCurrentHub().getClient();\n const dsn = client && client.getDsn();\n return dsn ? url.includes(dsn.host) : false;\n }", "function checkURL(req, res, next) {\n console.log(req.query.url);\n if (req.query.url === undefined) {\n res.status(400).json({\n success: false,\n message: \"Invalid URL\"\n });\n } else {\n next();\n }\n}", "function checkURL(req, res, next) {\n console.log(req.query.url);\n if (req.query.url === undefined) {\n res.status(400).json({\n success: false,\n message: \"Invalid URL\",\n });\n } else {\n next();\n }\n}", "match(ctx){\n // ctx 上下文 可以获取请求的地址\n console.log(ctx.request.url);\n if(ctx.request.url=='/shop' || ctx.request.url=='/news'){\n return true;\n }\n return false; \n }", "test() {\n return this.urlFromRequest().href.match(metadataUrlRegex);\n }", "get url () {\n\t if (!(this instanceof Request)) {\n\t throw new TypeError('Illegal invocation')\n\t }\n\n\t // The url getter steps are to return this’s request’s URL, serialized.\n\t return URLSerializer(this[kState].url)\n\t }", "checkUrl(/* e */) {\n if (this.location.pathname === this.fragment) {\n return false\n }\n\n this.loadUrl()\n }", "function checkUrl(){\n\t\n\tvar task = getUrlVar('task');\n\tvar id = getUrlVar('id');\n\tvar radius_simplify = getUrlVar('rs');\n\t//if the id is a number\n\tif (!isNaN(id)){\t\t\n\t\t$('#tabs').tabs('select', 1);\n\t\tswitch(task){\n\t\t\tcase 'ego-centric': \t\n\t\t\t\tviewerControl.displayNetwork('CONTRIBUTOR', id, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'event-centric':\n\t\t\t\tviewerControl.displayNetwork('EVENT', id, 0, radius_simplify) \n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}\n}", "async function getRequest(request) {\n //URL Objekt wird erzeugt, um URL dann aufzuteilen in Path und SearchParams\n let url = new Url.URL(request.url, \"http://localhost:8100/\");\n console.log(\"POST\", url.pathname);\n // protokoll host path parameter\n // http:// localhost:8100 /showmyrezepte ?user=Esra\n //Standardantwort, wenn kein gültiger Path übergeben wird -> z.b. /help\n let response = \"error\";\n //Antwort berechnen, je nach path\n switch (url.pathname) {\n case \"/showrezepte\":\n response = await getAllRez(url.searchParams);\n break;\n case \"/showlikedrezepte\":\n response = await getLikedRez(url.searchParams);\n break;\n case \"/showmyrezepte\":\n response = await getMyRez(url.searchParams);\n break;\n case \"/login\":\n response = await login(url.searchParams);\n break;\n case \"/register\":\n response = await register(url.searchParams);\n break;\n case \"/createrezept\":\n response = await createRez(url.searchParams);\n break;\n case \"/editrezept\":\n response = await editRez(url.searchParams);\n break;\n case \"/likerezept\":\n response = await likeRez(url.searchParams);\n break;\n case \"/unlikerezept\":\n response = await unlikeRez(url.searchParams);\n break;\n case \"/deleterezept\":\n response = await deleteRez(url.searchParams);\n break;\n }\n return response;\n }", "function validator_url(x){\n \n }", "function getUrlParam(request) {\n const searchParams = new URL(request.url).searchParams\n let url = searchParams.get('url')\n if (url && !url.match(/^[a-zA-Z]+:\\/\\//)) url = 'http://' + url\n\n return url\n}", "function req(req) {\r\n\t\t\treturn req !== undefined;\r\n\t\t}", "function checkURL() {\n\t\tvar url = window.location.href;\n\t\t\n\t\tif(url != lastQuery) {\n\t\t\tvar parsedURL = parseURL(url);\n\t\t\t\n\t\t\tvar routeAndParams = findMatchingRoute(parsedURL);\n\t\t\t\n\t\t\tif(routeAndParams !== false) {\n\t\t\t\ttry {\n\t\t\t\t\tvar route = routeAndParams[0];\n\t\t\t\t\tvar params = routeAndParams[1];\n\t\t\t\t\t\n\t\t\t\t\troute[2].call(route[3], params);\n\t\t\t\t} catch(e) {\n\t\t\t\t\tif(e.message != \"StopProcessingHandlerException\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlastQuery = url;\n\t\t}\n\t}", "function verifyCurrentUrl(url) {\n return requestMatches(url);\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 htmlGetRequest(request) {\n return request.method === 'GET' && (request.headers.get('accept') !== null && request.headers.get('accept').indexOf('text/html') > -1)\n}", "function handleRequest(request,response){\n\n //capture the url the request is made to\n\n var path =req.url;\n\n //depending on the URL,display a different HTML file \n\n response.end(\"It Works!!\" +request.url);\n\n}", "function requestHandler(request, response) {\n if (request.url == \"/\") {\n response.end(\"Welcome!\");\n } else if (request.url == \"/urls\") {\n response.end(\"www.lighthouselabs.ca\\nwww.google.com\");\n } else {\n response.statusCode = 404;\n response.end(\"Unknown Path\");\n }\n} //this send the URL and REquest method which is in our case '/'' and 'GET'", "static filterHttpRequest (request) {}", "function matchesSource(request) {\n console.log(\"matchesSource\")\n return (request.source === SOURCE);\n }", "function handleRequest(request, response){\n response.end('It Works: ' + request.url);\n}", "function getSomeMission(request){\n\t//Get the URL mission\n\tvar element = document.getElementsByTagName(\"a\");\n\tvar countFound = 0;\n\tvar url;\n\tvar urlIsObtained = false;\n\tfor(count = 0; count <= element.length - 1; count++){\n\t\taux = element[count];\n\t\turl = aux.href;\n\t\taux = aux.childNodes[0];\n\t\taux = aux.nodeValue;\n\t\tif (aux != null){\n\t\t\tif (request.job == defaultJob.checkBalance){\n\t\t\t\tif (aux.search(labels.checkBalance[request.language]) >= 0){\n\t\t\t\t\tcountFound++;\n\t\t\t\t\t//url = url.split(\"?\")[1];\n\t\t\t\t\trequest.url = url;\n\t\t\t\t\tconsole.log(request.url);\n\t\t\t\t\turlIsObtained = true;\n\t\t\t\t\tbreak;\t\t\n\t\t\t\t}\n\t\t\t} else \n\t\t\tif (request.job == defaultJob.transferMoney){\n\t\t\t\tif (aux.search(labels.transferMoney[request.language]) >= 0){\n\t\t\t\t\tcountFound++;\n\t\t\t\t\t//url = url.split(\"?\")[1];\n\t\t\t\t\trequest.url = url;\n\t\t\t\t\tconsole.log(request.url);\n\t\t\t\t\turlIsObtained = true;\n\t\t\t\t\tbreak;\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}\n\treturn request;\n}", "function handleRequest(request, response){\n\ttry {\n\t\tif(request.url==\"/\"){\n\t\t\tresponse.end(\"AUTHY SERVER RUNNING....\");\n\t\t\treturn;\n\t\t}\n //log the request on console\n console.log(request.url);\n //Disptach the request to handle different URL paths\n dispatcher.dispatch(request, response);\n } catch(err) {\n console.log(err);\n response.end(\"ERROR \"+err.message);\n }\n}", "function urlCheck() {\n var url = document.location.search;\n var split = url.split(\"=\")\n var searchset = split[1]\n var splitset = searchset.split(\"/\")\n var input = splitset[0]\n var type = splitset[1]\n\n if (type == \"ingredient\") {\n fetchIngredient(input)\n } else if (type == \"name\") {\n fetchName(input)\n } else if (type == \"random\") {\n randomDrink()\n }\n}", "function handleRequestTwo(request, response) { //whats the request? req to the url.\n//console.log(request.url);\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"I guess javasccript is not your forte! \" + request.url);\n} //creates the strung & sends it back to the browser.", "function onRequest(request, response){\n var my_path = url.parse(request.url).pathname;\n var full_path = path.join(process.cwd(),my_path);\n var url_parts = url.parse(request.url, true);//??true\n\n //\"http://monserveur.com/hello?name=xxxx\"\n //Format of GET\n if(request.url == \"/\"){\n response.writeHeader(200, {\"Content-Type\": \"text/html\"});\n response.write(\"Welcome to the home page! \\n\");\n response.end();\n }\n else if(my_path == \"/hello\"){\n //查询字符串: name=xxxx\n var query = url_parts.query;\n fs.readFile(\"record.txt\",function(err,file){\n console.log(file);\n });\n nameData = nameData + \", \" + query.name;\n response.writeHeader(200, {\"Content-Type\": \"text/html\"});\n response.write(\"Bonjour \" + nameData);\n response.end();\n\n //Open a txt.file and write the name in the file\n fs.open('record.txt','w','777',function(err,fd){\n if(err) console.log(\"Open file error!\");\n fs.appendFile('record.txt', nameData, function(err){\n if(err) console.log(\"Append name Error!\");\n });\n })\n }\n else{\n response.writeHeader(200, {\"Content-Type\": \"text/html\"});\n response.write(\"Other\");\n response.end();\n }\n}", "function parseURL(request, response){\n \tvar parseQuery = true; \n var badHost = true; \n var urlObj = url.parse(request.url, parseQuery , badHost );\n console.log('path:');\n console.log(urlObj.path);\n console.log('query:');\n console.log(urlObj.query);\n \treturn urlObj;\n }", "function getLink(url) {\n //console.log(url);\n\trequest({url: url, followRedirect : false}, function (error, response, body) {\n\t\t\n\t\tif (!error && response.statusCode == 302) {\t\t\n\t\t\t//console.log('Get url : ' + response.headers['location']);\n checkCountry(url,response.headers['location']);\n\t\t\t//login(url,response.headers['location']);\n\t\t}\n\t});\n}", "function handleRequest(request, response){\n try{\n console.log(request.url);\n dispatcher.dispatch(request, response);\n } catch(err) {\n console.log(err);\n }\n}", "function handleRequest(request, response) {\n console.log(request.url);\n\n if (request.url === '/home') {\n response.write('Hola desde testing');\n response.end();\n }\n}", "function handleRequest(request, response){\n try {\n //log the request on console\n console.log(request.url);\n //Disptach\n dispatcher.dispatch(request, response);\n } catch(err) {\n console.log(err);\n }\n}", "function handleRequest(request, response){\n try {\n //log the request on console\n console.log(request.url);\n //Disptach\n dispatcher.dispatch(request, response);\n } catch(err) {\n console.log(err);\n }\n}", "function isUrl(string) {\n\t\treturn isUrlRegex.test(string);\n\t}", "function initRequest(url) {\n \n //window.alert(\"initRequest(\" + url + \") is called\");\n //console.log(\"initRequest(%s) is called\", url);\n \n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest(); \n } else if (window.ActiveXObject) {\n isIE = true;\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n }", "function onBeforeRequest(info) {\n\t console.log(\"request for url\", info.url, info);\n\t if (session.isClosed()) {\n\t return;\n\t }\n\t\n\t if (info.url.slice(0, \"chrome-extension://\".length) === \"chrome-extension://\") {\n\t return;\n\t }\n\t\n\t if (info.url.indexOf(\"/fromjs-internals/\") !== -1) {\n\t var parts = info.url.split(\"/fromjs-internals/\");\n\t var fileName = parts[1];\n\t return {\n\t redirectUrl: chrome.extension.getURL(fileName)\n\t };\n\t }\n\t\n\t if (info.type === \"main_frame\") {\n\t if (session.pageHasBeenLoaded()) {\n\t session.close();\n\t return;\n\t }\n\t\n\t var xhr = new XMLHttpRequest();\n\t xhr.open('GET', info.url, false);\n\t xhr.send(null);\n\t session.setPageHtml(xhr.responseText);\n\t\n\t var parts = info.url.split(\"/\");parts.pop();parts.push(\"\");\n\t var basePath = parts.join(\"/\");\n\t return;\n\t }\n\t\n\t if (urlLooksLikeJSFile(info.url) && info.type === \"script\") {\n\t if (session.isActive()) {\n\t session.loadScript(info.url);\n\t }\n\t return { cancel: true };\n\t }\n\t }", "function matchHandler (url)\n{\n request (url, cb);\n}", "function urlHandler(data) {\r\n // Called from either setUrlHandler or using window.location on load, so normalise the path\r\n var path = data.path || data;\r\n\r\n\r\n var request_ids = getParameterByName(path, 'request_ids');\r\n var latest_request_id = request_ids.split(',')[0];\r\n\r\n if (latest_request_id) {\r\n // Probably a challenge request. Play against sender\r\n getRequestInfo(latest_request_id, function(request) {\r\n \tplayAgainstSomeone(request.from.id);\r\n \tdeleteRequest(latest_request_id);\r\n });\r\n}\r\n}", "function isLicenseRequest(url) {\n return url === licenseAcquisitionURL || url === licenseUrlFromTicket;\n }", "isUrl(value) {\n return new RegExp(\n \"^(https?:\\\\/\\\\/)?((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*(\\\\?[;&a-z\\\\d%_.~+=-]*)?(\\\\#[-a-z\\\\d_]*)?$\"\n ).test(String(value).toLowerCase());\n }", "function canonUrl(url) {\n return url;\n }", "function getData(requestUrl) {\n \n\n}", "function constructGetUrlPath(request) {\n var type = request.type;\n assertNotNull(type, \"No request type given for building a GET request\");\n type = type.toLowerCase();\n var extractor = GET_URL_EXTRACTORS[type];\n assertNotNull(extractor, \"Unknown request type \" + type);\n var result = extractor(request);\n var parts = result.parts || [];\n var url = type;\n $.each(parts, function (i, v) {\n url += \"/\" + Jolokia.escape(v)\n });\n if (result.path) {\n url += (result.path[0] == '/' ? \"\" : \"/\") + result.path;\n }\n console.log(url);\n return url;\n }", "function is_url(str) {\n\t\treturn starts_with(str, 'http://') || starts_with(str, 'https://') || starts_with(str, '//');\n\t}", "function isUrl(line) {\r\n\tif (line != null) {\r\n\t\tif (line.search('http')==0) return true;\r\n\t}\r\n\treturn false;\r\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 Request() {\n var req = this;\n this.url = location;\n }", "function handleRequest(request,response){\n response.end(\"It works!!! Path Hit: \" + request.url);\n}", "function isURL(s) {\n return /^(http|https):/.test(s)\n}", "function isurl(theurl) {\n\treturn /^\\s*https?:\\/\\/.+$/.test(theurl);\n}", "function URLUtils() {}", "function handleRequestOne(request, response) { //whats the request? req to the url.\n//\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"You are a javascript wizard! \" + request.url);\n} //creates the strung & sends it back to the browser.", "function isUrl(url) {\n\n return !!(url.match(/^http(s)?:\\/\\/\\S+$/));\n \n}", "function RequestConnector(){\n this._requestMap = []; //private\n this.getPreviousRequest = function (request) {\n //request.QueryInterface(Components.interfaces.nsIHttpChannel)\n var requestMap = this._requestMap;\n for (var i=0;i<requestMap.length;i++){\n if (request==requestMap[i][0]) {\n var result = requestMap[i][1];\n this._removeEntry(i);\n return result;\n }\n }\n //How can two objects with different toString == I don't get this at all...\n //[xpconnect wrapped (nsISupports, nsIHttpChannel, nsIRequest, nsIChannel)]\n //== [xpconnect wrapped (nsISupports, nsIRequest, nsIChannel)]\n //It is worth understanding what's going on here.\n \n //The mechanism above generally works (for dc, dbpedia, Ralph's foaf).\n //Unfortunately, not working for http://www.w3.org/2001/sw/\n //The problem is this, it seems that when loading http://www.w3.org/2001/sw/\n //3 nsIHttpRequest are generated instead of 2: (originalURI --> URI)\n \n // sw/ --> sw/ , sw/ --> sw/Overview.rdf , sw/Overview.rdf --> sw/Overview.rdf\n // 303 200 200\n // text/html application/vnd.mozilla.maybe.feed text/html\n //thie last one is redundant and is there becuase of feed sniffing, I think\n //So, this is a hack:\n if (!(requestMap.length == 0) /*&& !(request.originalURI.spec == request.URI.spec)*/){\n tabulator.log.warn(\"In side the hack in request.js with originalURI: %s URI: %s\", \n request.originalURI.spec, request.URI.spec);\n for (var i = requestMap.length-1;i>=0;i--){\n if (requestMap[i][0].URI.spec == request.URI.spec /*&& \n requestMap[i][1].URI.spec == request.URI.originalURI.spec*/){\n tabulator.log.warn(\"redirecting back, but this might be a failure, see request.js\"); \n var fakePrevious = requestMap[i][1];\n //requestMap[i][0] = request;\n this._removeEntry(i);\n return fakePrevious;\n }\n \n }\n }\n \n tabulator.log.debug(\"found nothing in request array\");\n return null;\n };\n this.getDisplayURI = function (request){\n //returns the URI of the first non-301 response in a sequence of redirection if there is one\n // || request.URI.spec. seeAlso <http://lists.w3.org/Archives/Public/public-awwsw/2008Jan/0030.html>9\n var displayURI = request.URI.spec;\n \n // Does there exist an elegant way to write this?\n for (var requestIter=this.getPreviousRequest(request);requestIter;requestIter=this.getPreviousRequest(requestIter))\n if (requestIter.responseStatus != 301) displayURI = requestIter.URI.spec;\n return displayURI;\n };\n this.setPreviousRequest = function (thisRequest,previousRequest) {\n tabulator.log.debug(\"recording redirctions: previoiusRequest is %s with status %s, thisRequest is %s\",\n previousRequest.URI.spec, previousRequest.responseStatus, thisRequest.URI.spec);\n this._requestMap.push([thisRequest,previousRequest]);\n };\n this.releaseRequest = function (request){\n //tabulator.log.debug(\"attemp to remove %s\", request.URI.spec);\n var requestPointer = request;\n var mapLength = this._requestMap.length;\n for (var i=mapLength-1;i>=0;i--){\n if (requestPointer==this._requestMap[i][0]) {\n requestPointer = this._requestMap[i][1];\n this._removeEntry(i);\n }\n }\n };\n this._removeEntry = function (i) {\n tabulator.log.debug(\"%s removed, the length of the requestMap is %s\", \n this._requestMap[i][1].URI.spec, this._requestMap.length-1);\n tabulator.rdf.Util.RDFArrayRemove(this._requestMap, this._requestMap[i]); \n };\n}", "function httpRequester(url) {\n return url && url.startsWith('https://') ? https : http;\n}", "function onRequest(req) {\r\n\r\n\tconsole.log(JSON.stringify(req))\r\n\r\n\tlet host = req.Host;\r\n\tlet dest = req.Header['Sec-Fetch-Dest']\r\n\r\n\tif ('video' === dest) return false;\r\n\r\n\tvar allow = true;\r\n\tfor (v in blocked) {\r\n\t\tallow = host.indexOf(blocked[v]) === -1;\r\n\t\tif (!allow)\tbreak;\r\n\t}\r\n\r\n\tif (allow) {\r\n\t\t// console.log(host)\r\n\t} else {\r\n\t\tconsole.log('>>> BLOCK >>> ' + host)\r\n\t}\r\n\r\n\treturn allow;\r\n}", "function isRequest(input) {\n return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function checkRequest(commitType, url) {\n switch (commitType) {\n case REQ_NEW:\n case REQ_EDIT:\n case REQ_DELETE: //GITHUB delete\n case REQ_UPLOAD: //GITHUB upload\n return REQ_REGULAR;\n\n case TYPE_BLOB: //GITLAB delete\n case TYPE_TREE: //GITLAB upload\n // TODO: Add more checks to make it more reliable\n if (SERVER == SERVER_GL) {\n return REQ_REGULAR;\n } else {\n deactivate({\n rule: UNKNOWN_REQUEST\n });\n return UNKNOWN_REQUEST;\n }\n\n default:\n deactivate({\n rule: UNKNOWN_REQUEST\n });\n return UNKNOWN_REQUEST;\n }\n}", "static match(route, req) {\n return (req.url == route);\n }", "function getRequestParam(request){\n return querystring.parse( url.parse(request.url).query );\n}", "function get_request(name) {\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "function isTry(request) {\n if (request.kind === \"try\") {\n return request.request;\n }\n return null;\n}", "function requestUrl(req) {\n\tconst port = req.app.locals.port;\n\treturn `${req.protocol}://${req.hostname}:${port}${req.originalUrl}`;\n}", "function isUrl(str) {\n return isString(str) && !!str.match(/^((https?|ftp|rtsp|mms):\\/\\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.[a-z]{2,6}|localhost)(:[0-9]{1,4})?((\\/?)|(\\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\\/?)$/i);\n }", "function checkUrl() {\n\t\t\t\t\tif (UriParameters.fromQuery(window.location.search).get(\"sap-ui-xx-asyncRouting\") === \"true\") {\n\t\t\t\t\t\tLog.warning(\"Activation of async view loading in routing via url parameter is only temporarily supported and may be removed soon\", \"Target\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}", "function checkUrl() {\n\t\t\t\t\tif (UriParameters.fromQuery(window.location.search).get(\"sap-ui-xx-asyncRouting\") === \"true\") {\n\t\t\t\t\t\tLog.warning(\"Activation of async view loading in routing via url parameter is only temporarily supported and may be removed soon\", \"Target\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}", "function onRequest(request, response) {\n var pathname = url.parse(request.url).pathname;\n console.log(\"Request for \" + pathname + \" received.\");\n\n // handle-funktion mappar URL mot rätt funktion i requestHandler,\n // som vidarbefordrar requsetn till mongoDB-kopplingen\n // vidarebefordra också response- och requestobjekten i kedjan\n route(handle, pathname, request, response, mongo);\n }", "function handleRequest(request, response){\n response.end(\"It worked!!! Path Hit: \" + request.url);\n}", "async function validatePatchRequestSyntax(request){\n\n let requestSyntaxValidator = ( request.header('Content-Type')=='application/json' &&\n request.body.caption!=null &&\n request.body.url!=null &&\n request.body.caption.length!=0 &&\n request.body.url.length!=0 &&\n Object.keys(request.body).length==2);\n\n if(requestSyntaxValidator){\n let urlValidator=false;\n await isImageUrl(request.body.url).then((res)=>{urlValidator=res}).catch((err)=>{urlValidator=false});\n return urlValidator;\n }\n else{\n return false;\n }\n}", "function handleRequest (request, response) {\n response.end(\"it works!! Path Hit: \" + request.url);\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}" ]
[ "0.6592209", "0.6475749", "0.64422524", "0.64353544", "0.63690853", "0.63560677", "0.6278105", "0.6273924", "0.6256092", "0.62533903", "0.6251151", "0.6156149", "0.615417", "0.61241287", "0.6095675", "0.6072017", "0.6064829", "0.6051718", "0.6051438", "0.6051072", "0.6049161", "0.6048376", "0.6021199", "0.60108393", "0.6008574", "0.60064125", "0.6002671", "0.59993285", "0.59863746", "0.5976553", "0.59691745", "0.5955202", "0.5955202", "0.5951644", "0.59499925", "0.594592", "0.5944756", "0.5933879", "0.5933756", "0.5930657", "0.5930344", "0.5921639", "0.5913725", "0.59075004", "0.5902783", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.5899734", "0.58963865", "0.588716", "0.58719546", "0.5855559", "0.5854828", "0.58447295", "0.5841694", "0.5814406", "0.58099425", "0.5808047", "0.5801992", "0.58014995", "0.57992786", "0.5794061", "0.57724905", "0.577238", "0.5771804", "0.5766149", "0.57594514", "0.57594514", "0.5758619", "0.57523906", "0.57514143", "0.57426983", "0.57369304" ]
0.0
-1
solves the puzzle (in bursts, with sleep time inbetween bursts) then calls redirect with the solution.
function solve_puzzle(request, y, x, tries, bits, burst_len, sleep_time, expire, args) { var hash_x; for (i = 0; i < burst_len; i++) { hash_x = hex_md5(x); if (hash_x == y) { redirect(request, x, expire, args); return; } x = increment(x); } tries += burst_len; percent_done = Math.floor((tries / Math.pow(2, bits)) * 100.0); if (percent_done <= 100) { document.getElementById("redirect_status").innerHTML = "" + Math.floor((tries / Math.pow(2, bits)) * 100.0); var func = function() { solve_puzzle(request, y, x, tries, bits, burst_len, sleep_time, expire, args); } setTimeout(func, sleep_time); } else { document.getElementById("redirect_status").innerHTML = "ERROR"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solvefast(original, limit) {\n var turtle = solveboard(original, 100);\n var steps = 100;\n var rabbitsteps = 60;\n while (steps < limit) {\n if (turtle.solution !== null || turtle.track.length == 0) return turtle;\n var rabbit = solveboard(original, rabbitsteps);\n if (rabbit.solution !== null || rabbit.track.length == 0) return rabbit;\n turtle = solvenext(turtle.track, rabbitsteps);\n steps += 2 * rabbitsteps;\n rabbitsteps += 10;\n }\n}", "function solvefast(original, limit) {\n var turtle = solveboard(original, 100);\n var steps = 100;\n var rabbitsteps = 60;\n while (steps < limit) {\n if (turtle.solution !== null || turtle.track.length == 0) return turtle;\n var rabbit = solveboard(original, rabbitsteps);\n if (rabbit.solution !== null || rabbit.track.length == 0) return rabbit;\n turtle = solvenext(turtle.track, rabbitsteps);\n steps += 2 * rabbitsteps;\n rabbitsteps += 10;\n }\n}", "function solve() {\n\t// log(newList(lines, 2, \"jmp\" + \" \" + \"+4\"))\n\tdebugger;\n\t// log(lines)\n\tfor (let i in lines) {\n\t\tlog(\"i =\", i)\n\t\tconst [code, arg] = lines[i].split(' ');\n\t\tif (code == \"jmp\") {\n\t\t\tlet newLines = newList(lines, Number(i), \"nop\" + \" \" + arg);\n\t\t\t// ok in test case i = 7 should work but it doesnt ?\n\t\t\tlog(newLines);\n\t\t\t// return 0;\n\t\t\tlet res = run(newLines);\n\t\t\t// log(res); // ok it always worked\n\t\t\tif (res !== \"failed\") {\n\t\t\t\tlog(res);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tfor (let i in lines) {\n\t\tlog(\"i =\", i)\n\t\tconst [code, arg] = lines[i].split(' ');\n\t\tif (code == \"nop\") {\n\t\t\tlet newLines = newList(lines, Number(i), \"jmp\" + \" \" + arg);\n\t\t\t// log(newLines);\n\t\t\t// return 0;\n\t\t\tlet res = run(newLines);\n\t\t\tif (!res == \"failed\") {\n\t\t\t\tlog(res);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tlog(\"MISSION FAILED WE WILL GET THEM NEXT TIME\");\n}", "function generateSolution () {\n banner.innerHTML = 'JS-Simon'\n solution.push(Math.floor((Math.random() * 4) + 1))\n timeout -= 25\n animateSolution()\n}", "function solve()\n{\n\n /* re-seed with a random number */\n rnd.seed = Math.floor(Math.random() * 1000000000);\n \n /* initialize the flag */\n stop = false;\n \n /* Initialize the stack at the first element */\n var stack = [ { m: instance.start.m, n: instance.start.n, neighbors: dirs.shuffle() } ] ;\n \n /* Add a new breadcrumb every zillisecond */\n setTimeout(function() { solver(instance, stack) }, 10);\n \n /* Disable the form button again */\n document.forms.mazeform.slv.disabled = true;\n}", "solve() {\n if (this.gameWon() || this.state.busy) { return; }\n this.setState({ busy: true });\n const reversedMovesFromSolved = this.state.movesFromSolved.reverse();\n const movesToMake = this.invertMoves(reversedMovesFromSolved);\n this.runAI(movesToMake);\n }", "function solve() {\n cheating = true;\n this.publish(puzzleS);\n}", "function stepsToSolveHanoiT(height, srcP, desP, bufferP) { // stole from the internet\n if (height >= 1) {\n \n // Move a tower of height-1 to the buffer peg, using the destination peg.\n stepsToSolveHanoiT(height - 1, srcP, bufferP, desP);\n \n // Move the remaining disk to the destination peg.\n console.log('Move disk from Tower ', srcP, ' to Tower ', desP);\n \n // Move the tower of `height-1` from the `buffer peg` to the `destination peg` using the `source peg`. \n stepsToSolveHanoiT(height - 1, bufferP, desP, srcP);\n }\n \n return;\n }", "function nextWorkout(){\n var next = response.workout.shift();\n if (next) {\n return next\n } \n //if no more workouts, count log completions and redirect to menu page\n else {\n $.post(\"/logCompletion\", {routineUsed: location.pathname.slice(1)})\n .done(function(res){\n // send data <- hint\n res.send(res)\n // var log = {location.pathname.slice(1)}\n // console.log(log, \"log\");\n //window.location.pathway\n\n });\n window.location.href = redirect;\n }\n}", "function risengrod(){\n setTimeout(function(){location.href = \"maze.php\";}, 250);\n}", "function set_redirect_timeout()\n{\n\tsetTimeout(document.location=\"scrabble.php\", 2000);\n}", "function pushSolution() {\r\n\r\n if (submitted) return;\r\n submitted = true;\r\n\r\n if (iControlBots) {\r\n for (var i = 1; i <= numPlayers; i++) {\r\n if (!activePlayers[i]) { // for the inactive player\r\n submitBotSolution(i);\r\n }\r\n }\r\n }\r\n\r\n if (currentRound == 0) {\r\n doneAllInstructions();\r\n return;\r\n }\r\n\r\n $('#submitButton').attr(\"value\",\"Waiting for other players\");\r\n \r\n var dist = getDist(cityOrder);\r\n var millis = new Date().getTime() - clockStartTime;\r\n if (clockTimer != null) {\r\n clearInterval(clockTimer);\r\n clockTimer = null;\r\n }\r\n showMidRoundPopup(dist, millis);\r\n \r\n}", "solve()\n {\n let solved = false;\n this.updatePossibilities();\n\n while (! solved)\n {\n solved = true;\n rows:\n for (let i = 0; i < 9; i++)\n {\n cols:\n for (let j = 0; j < 9; j++)\n {\n if (Array.isArray(this.solution[i][j])\n && this.solution[i][j].length == 1)\n {\n solved = false;\n this.solution[i][j] = this.solution[i][j][0];\n this.updateRowPossibilities(i);\n this.updateColPossibilities(j);\n break rows;\n }\n }\n }\n }\n\n this.puzzleToPuzzleString(true);\n }", "async solve(delay) {\n // sets solving to be true which disables user input\n this.setState({ solving: true });\n //resets the board, discarding any changes the user made to it.\n this.setBoard(this.state.currentBoard);\n await this.sleep(40);\n\n // start at position 0, 0 and add valid moves to the stack\n let moves = [];\n let position = { row: 0, col: 0 };\n moves = moves.concat(this.getValidMoves(position));\n let move;\n\n // as long as there are available moves continue.\n while (moves.length > 0) {\n // stop solving if the user has set solving to be false.\n if (this.state.stop) {\n this.setState({ stop: false, solving: false });\n return;\n }\n\n // pop the next move of the move stack.\n move = moves.pop();\n\n // if the move is supposed to be at the current position we can make that move\n if (move.row === position.row && move.col === position.col) {\n this.addPiece(move.row, move.col, move.type);\n // pause to make algorithm visual\n await this.sleep(delay);\n\n // if the board is valid after the move has been made, push the move back on\n // the stack, update the position to the next available one, check if we have reached the end of the\n // board which would tell us that we have found a solution and we break out. If we're not at the end,\n // get all valid moves at that position and push them to the move stack\n if (this.isValid()) {\n moves.push(move);\n position = this.nextPos(position);\n if (position.col >= this.state.board[0].length) {\n break;\n } else moves = moves.concat(this.getValidMoves(position));\n } else {\n // is the board is not valid after adding the piece, we remove it again.\n this.removePiece(move.row, move.col);\n await this.sleep(delay);\n }\n } else {\n // if the move position is not the current position, we know that we have tried all moves at our\n // current position so we undo the move from the stack and set our position to where that move was made.\n this.removePiece(move.row, move.col);\n await this.sleep(delay);\n position = { row: move.row, col: move.col };\n }\n }\n // after solving is finished we change the state to enable user input again\n this.setState({ solving: false });\n }", "function diecard(){\r\n setTimeout(function(){location.href = \"gamesite.php\";}, 1500);\r\n \r\n}", "function processStep() {\r\n finished = true;\r\n for (var i = 0; i < searchResults.length; ++i) {\r\n for (var j = 0; j < searchResults[i].length; ++j) {\r\n for (var k = 0; k < searchResults[i][j].length; ++k) {\r\n\t\t\t\t//wyciagniecie z obiektow reprezentujacych znalezione rekordy informacji potrzebnych do rozszerzenia podslowa\r\n var searchedSeed = searchResults[i][j][k];\r\n var moveLeft = searchedSeed.moveLeft;\r\n var indexInDbSet = searchedSeed.index - moveLeft;\r\n var indexInSequence = i - moveLeft;\r\n var databaseSet = databaseSets[searchedSeed.DbSetNr];\r\n var seed = searchedSeed.seed;\r\n var currScore = searchedSeed.score;\r\n if (currScore >= tresholdC&&seed.length<sequence.length) { //przetwarzamy tylko rekordy o minimalnej zgodności\r\n var result = expand(seed,sequence,databaseSet,indexInSequence, indexInDbSet, matrix,currScore);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//jezeli udało się rozszerzyć chociaz jeden rekord to nie skonczylismy\r\n\t\t\t\t\tif(result.expandedLeft || result.expandedRight)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfinished = false; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n //logika aktualizujaca rekord w searchResults - do napisania\r\n searchResults[i][j][k].score = result.newScore;\r\n\t\t\t\t\t//aktualizacja wskaznika pokazujacego o ile slowo zostalo rozszerzone w lewo\r\n\t\t\t\t\tif(result.expandedLeft)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsearchResults[i][j][k].moveLeft = searchResults[i][j][k].moveLeft + 1; \r\n\t\t\t\t\t}\r\n\t\t\t\t\tsearchResults[i][j][k].seed = result.newSeed; \r\n }\r\n }\r\n }\r\n }\r\n if(finished) alert(\"Wykonano wszystkie kroki algorytmu, możesz przejść do kolejnego etapu.\")\r\n}", "function checkSolution () {\n let failed = false\n solutionPlaying = true\n for (let z = 0; z < mySolution.length; z++) {\n if (mySolution[z] !== solution[z]) {\n failed = true\n banner.innerHTML = 'Sorry!'\n setTimeout(() => {\n new Audio('sounds/fail.mp3').play()\n }, 700)\n setTimeout(introAnimation, 500)\n setTimeout(checkHighScore, 3000)\n setTimeout(resetGame, 3000)\n }\n }\n if (mySolution.length >= solution.length && failed !== true) {\n if (mySolution.toString() === solution.toString()) {\n theScore++\n updateScore()\n banner.innerHTML = 'Good!'\n setTimeout(generateSolution, 1000)\n }\n mySolution = []\n failed = false\n }\n solutionPlaying = false\n}", "loop({ distance, maxPlacementRange, placeOnTopOfTargetBlock}) {\n console.log(`${this.bot.username}|Start of Bot Loop`, JSON.stringify(this.state), this.bot.entity.position)\n\n\n if(this.state.followingSpeaker) {\n if (distance(this.bot.entity.position, this.state.followingSpeaker.position) < this.wrapper.maxPlacementRange) {\n this.state.followingSpeaker = null//done following\n }\n return \n }\n\n\n if (!this.state.targetBlock) { // No target block, find one\n this.state.targetBlock = this.findNewTarget()\n\n\n if(this.state.targetBlock) { // found target block\n console.log(`${this.bot.username}|Found new Target Block: ${this.state.targetBlock.displayName}@${this.state.targetBlock.position}`)\n this.bot.navigate.to(this.state.targetBlock.position.offset(0, 1, 2), {tooFarThreshold: 10, timeout: 2000}); //need to find offset on side of bot\n } else { // couldn't find targetBlock\n this.wander()\n }\n } else { // Already in progress with target\n\n let distanceToTarget = distance(this.bot.entity.position, this.state.targetBlock.position)\n console.log(\"Distance: \", 1.5, ' < ', distanceToTarget, ' < ', maxPlacementRange)\n\n // if can place, then do\n const itemToPlace = this.getPlacementBlockForTarget(this.state.targetBlock)\n if( distanceToTarget < maxPlacementRange && distanceToTarget > 1.5 && itemToPlace ){\n placeOnTopOfTargetBlock(itemToPlace.name, this.state.targetBlock)\n .then(()=>{\n this.state.targetBlock = null\n }).catch((err)=>{\n this.state.targetBlock = null\n console.error(\"Error Placing\", err)\n })\n } else {\n // make sure not stuck or block changed\n\n if(distance(this.state.lastPosition, this.bot.entity.position)<1){\n console.log(\"I am stuck :( wandering and trying again\")\n this.wander()\n } else if(distanceToTarget <= 1.5) {\n this.bot.navigate.to(this.state.targetBlock.position.offset(0, 1, 2), {tooFarThreshold: 10, timeout: 2000}); //need to find offset on side of bot\n }\n }\n }\n\n this.state.lastPosition = JSON.parse(JSON.stringify(this.bot.entity.position)) // clone out position for comparisons\n }", "function solve() {\r\n\t// run test if the puzzle is shuffled\r\n\tif(SHUFFLE) {\r\n\t\t// initially good\r\n\t\tvar good = true;\r\n\t\t// test all the pieces\r\n\t\tfor(var i = 0; i < PIECES.length; i++) {\r\n\t\t\t// expected position for each piece\r\n\t\t\tvar left = i%PUZZLESIZE*TILESIZE;\r\n\t\t\tvar top = Math.floor(i/PUZZLESIZE)*TILESIZE;\r\n\t\t\t// if the position is not expected, it is no more good\r\n\t\t\tif(!(PIECES[i].style.left == left+\"px\" && PIECES[i].style.top == top+\"px\")) {\r\n\t\t\t\tgood = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if still good, call victory to show notification\r\n\t\tif(good) {\r\n\t\t\tvictory();\r\n\t\t}\r\n\t}\r\n}", "function double_jump(i, j)\n{\n\tconsole.log(j);\n\tif (i > j){\n\t\treturn gravita(0, \"doppio\");\n\t}\n\n\ty-=1\n\n var interv = setTimeout(function() {\n double_jump(i+1);\n }, 100);\n}", "function step() {\n\t\tswitch(game.mode) {\n\t\t\tcase \"start\":\n\t\t\t\tgame.showStart();\n\t\t\t\tbreak;\n\t\t\tcase \"dead\":\n\t\t\t\tgameTimeout = setTimeout(function(){\n\t\t\t\t\t\n\t\t\t\t\tstep();\n\t\t\t\t}, 500);\n\t\t\t\tgame.mode = \"main\";\n\t\t\t\tbreak;\n\t\t\tcase \"main\":\n\t\t\t\tgame.scoreboard.update();\n\t\t\t\tif (moles >= moleLimit) {\n\t\t\t\t\tsound_tada.play();\n\t\t\t\t\tgame.mode = \"end\";\n\t\t\t\t\tgameTimeout = setTimeout(step, 10);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tgame.live();\n\t\t\t\tgame.togglePop();\n\t\t\t\tif (popping) game.move();\n\t\t\t\tpopping = (popping) ? false : true;\n\t\t\t\tgameTimeout = setTimeout(step, (popping) ? hidingInterval : poppingInterval);\n\t\t\t\tbreak;\n\t\t\tcase \"credits\":\n \t\t\t\twindow.location.href = window.location.href.replace('index', 'credits');\n\t\t\t\tbreak;\n\t\t\tcase \"end\":\n\t\t\tdefault:\n\t\t\t\tgame.mole.style.display = \"none\";\n\t\t\t\tgame.quote.css('display', 'none');\n\t\t\t\tgame.scoreboard.innerHTML = \"Final Score: \" + score + \"<br />Moles: \" + hits + \" / \" + moles;\n\t\t\t\tgame.endScreen.style.display = \"block\";\n\t\t\t\tgame.endCreditsButton.style.display = \"block\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "solveForTarget( t ) {\n\n this.tmpTarget.set( t.x, t.y );\n let p = this.precision;\n\n let isSameBaseLocation = this.lastBaseLocation.approximatelyEquals( this.baseLocation, p );\n\n // If we have both the same target and base location as the last run then do not solve\n if ( this.lastTargetLocation.approximatelyEquals( this.tmpTarget, p ) && isSameBaseLocation ) return this.currentSolveDistance;\n \n // Keep starting solutions and distance\n let startingDistance;\n let startingSolution = null;\n\n // If the base location of a chain hasn't moved then we may opt to keep the current solution if our \n // best new solution is worse...\n if ( isSameBaseLocation ) {\n startingDistance = this.bones[ this.numBones-1 ].end.distanceTo( this.tmpTarget );\n startingSolution = this.cloneBones();\n } else {\n // Base has changed? Then we have little choice but to recalc the solution and take that new solution.\n startingDistance = MAX_VALUE;\n }\n \n // Not the same target? Then we must solve the chain for the new target.\n\t\t// We'll start by creating a list of bones to store our best solution\n let bestSolution = [];\n \n // We'll keep track of our best solve distance, starting it at a huge value which will be beaten on first attempt\n let bestSolveDistance = MAX_VALUE;\n let lastPassSolveDistance = MAX_VALUE;\n \n // Allow up to our iteration limit attempts at solving the chain\n let solveDistance;\n \n let i = this.maxIteration;\n\n while( i-- ){\n\n // Solve the chain for this target\n solveDistance = this.solveIK( this.tmpTarget );\n \n // Did we solve it for distance? If so, update our best distance and best solution, and also\n // update our last pass solve distance. Note: We will ALWAYS beat our last solve distance on the first run\n\n if ( solveDistance < bestSolveDistance ) { \n\n bestSolveDistance = solveDistance;\n bestSolution = this.cloneBones();\n \n // If we are happy that this solution meets our distance requirements then we can exit the loop now\n if ( solveDistance <= this.solveDistanceThreshold ) break;\n \n } else {\n\n // Did not solve to our satisfaction? Okay...\n // Did we grind to a halt? If so break out of loop to set the best distance and solution that we have\n if ( Math.abs( solveDistance - lastPassSolveDistance ) < this.minIterationChange ) break;\n\n }\n \n // Update the last pass solve distance\n lastPassSolveDistance = solveDistance;\n \n }\n\n // Did we get a solution that's better than the starting solution's to the new target location?\n if ( bestSolveDistance < startingDistance ){\n // If so, set the newly found solve distance and solution as the best found.\n this.currentSolveDistance = bestSolveDistance;\n this.bones = bestSolution;\n } else {\n // Did we make things worse? Then we keep our starting distance and solution!\n this.currentSolveDistance = startingDistance;\n this.bones = startingSolution; \n }\n \n // Update our last base and target locations so we know whether we need to solve for this start/end configuration next time\n this.lastBaseLocation.copy( this.baseLocation );\n this.lastTargetLocation.copy( this.tmpTarget );\n \n return this.currentSolveDistance;\n\n }", "function startAttackNow(vi, ATask, antiFarm) { // 2_targetPosition_kind_repeat_startTime_interval_troops_kata1_kata2\n\ttry {\n\t\tflag ( \"startAttackNow(): Started! village: \" + vi );\n\t\t//var reqUrl = myhost + \"/a2b.php?z=\" + ATask[1] + \"&newdid=\" + vi;\n\t\tvar reqUrl = myhost + \"/build.php?id=39&tt=2&z=\" + ATask[1] + \"&newdid=\" + vi;\n\t\t//var reqUrl = myhost + \"/a2b.php\" + \"?newdid=\" + vi;\n\t\tif ( antiFarm != null && antiFarm != \"\" ) // if anti-farm mode\n\t\t\tTS_getRequest(reqUrl, startAttackNPrepare, vi, ATask, antiFarm);\n\t\telse { // if ( antiFarm == null ) // ie if not anti-farm mode\n\t\t\tvar nowt = new Date().getTime() - serverTimeDiff;\n\t\t\tvar comebackTime = parseInt(ATask[9])*2 + nowt; // time when troops will come back.\n\t\t\tvar attackIncomingTimes = GM_getValue( myacc() + \"_\" + vi + \"_incomingAttackTimes\", \"\" ).split(\"|\");\n\t\t\tfor ( var ctr = 0 ; ctr < attackIncomingTimes.length ; ctr++ ) {\n\t\t\t\tif ( ( attackIncomingTimes[ctr] - comebackTime ) < 60*1000 && attackIncomingTimes[ctr] > comebackTime ) {\n\t\t\t\t\tflag ( \"startAttackNow():: Skipping attack this interval as come back time will conincide with some incoming attack time!\" );\n\t\t\t\t\tcalldoing1(); // skip attack this run if comeback time is within 60 sec of any incoming attack and try next time.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tTS_getRequest(reqUrl, startAttackNPrepare, vi, ATask, \"\");\n\t\t}\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>startAttackNow():: Something went wrong, error: \" + err.name + \" :: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tprintErrorMSG(msg);\n\t\tthrow err;\n\t}\n}", "function solve(){\n var grid = cGrid;\n var point = {\n row: 0,\n col: 0\n };\n stepCount = 0; //resetStep\n exitRow = grid.length-1;\n var minDistance = -1;\n\n //2. Walk through grid, loop each step\n do{\n let nextSteps = [];\n let step = {};\n\n for( var direct in directions){\n step = movable(point, grid, direct);\n if(step.canMove){\n step.direction = direct;\n nextSteps.push(step);\n }\n }\n \n //If no direction walkable, exit\n if(nextSteps.length == 0){\n noExit = true;\n break;\n }\n\n //3. sort distance and take the shortest direction\n nextSteps.sort((a, b) => (a.minDistance - b.minDistance));\n\n //mark current step and make the move\n point = markElement(point, grid, nextSteps);\n\n //5. test exit condition\n if (point.row == exitRow && point.col == exitCol){\n exitReached = true;\n grid[exitRow][exitCol] = colValues.PATH;\n document.getElementById(`${exitRow}:${exitCol}`).setAttribute(\"blockValue\", \"step\");\n stepCount ++;\n break;\n }\n } while(true);\n\n writeResults();\n}", "solve() {\n if (this.open.length != 0) {\n //set current node to the first node in the sorted list\n this.current = this.open.shift();\n\n // check neighbor nodes\n this.checkNeighbors(this.current.x, this.current.y);\n\n //draw on the canvas\n drawCheck(this.current.x, this.current.y, 0);\n this.displayPathLength();\n\n //check if the goal was reached\n if (this.current.y == this.end.y && this.current.x == this.end.x) {\n this.open = [];\n }\n this.steps++;\n } else {\n this.showResult();\n active=false;\n }\n }", "function solve132()\n{\n var firewall_Arr_IntInt = getFirewall_Arr_IntInt(input);\n var firewallLength_Int = firewall_Arr_IntInt.length;\n var delay_Int = 0;\n while(true)\n {\n let caught_bool = false;\n for(let i = 0; i < firewallLength_Int; i++)\n {\n if( isScannerAtTop((firewall_Arr_IntInt[i][0] + delay_Int), firewall_Arr_IntInt[i][1]) )\n {\n caught_bool = true;\n break;\n }\n }\n if(!caught_bool)\n {\n return delay_Int;\n }\n delay_Int++;\n }\n return -1;\n}", "function get_next_step(currentLocation,destination,map,previousPathsTaken,radius){\n \n //r.log(currentLocation);\n //r.log(destination);\n if(get_distance(currentLocation,destination) < radius){\n return destination;\n }\n \n //generate open list (list of squares that I can move based on the radius, map, visible robots, previous path)\n //calculate g for open list\n //calculate h for open list\n //pick lowest g+h value as next step\n // if there is more than one g+h min value, pick one with lowest h cost\n \n var direction = get_direction(currentLocation,destination);\n var maxMovement = get_max_movement(direction,radius,map,currentLocation);\n \n var openPaths;// = get_possible_steps(currentLocation,map);\n var newLocation = [currentLocation[0],currentLocation[1]];\n \n var moveAvailable = false;\n var i;\n if( (maxMovement[0] != 0 || maxMovement[1] != 0) && map[newLocation[1] + maxMovement[1]][newLocation[0] + maxMovement[0]] == true){\n newLocation[0] = newLocation[0] + maxMovement[0];\n newLocation[1] = newLocation[1] + maxMovement[1];\n moveAvailable = true;\n }\n for(i = maxMovement[0];i > 0 && !moveAvailable; i--){\n if( map[newLocation[1]][newLocation[0] + i] == true){\n newLocation[0] = newLocation[0] + i;\n break;\n }\n }\n for(i = maxMovement[1];i > 0 && !moveAvailable; i--){\n if( map[newLocation[1] + i][newLocation[0]] == true){\n newLocation[1] = newLocation[1] + i;\n break;\n }\n }\n if(!moveAvailable && (newLocation[0] != currentLocation[0] || newLocation[1] != currentLocation[1])){\n moveAvailable = true;\n }\n \n if(moveAvailable == true){\n if(!check_if_coor_in_path(newLocation,previousPathsTaken)){//this option does not allow backtracking\n return newLocation;\n }\n newLocation = [currentLocation[0],currentLocation[1]];\n }\n openPaths = get_possible_step_list(currentLocation,map,radius);\n //else if could not move, need to figure out where to move to continue.\n //this could break if enter into tunnel\n //return random open path\n var newPath = get_random_from_list(openPaths);\n //console.log(check_if_coor_in_path(newPath,previousPathsTaken));\n //console.log([newLocation[0] + newPath[0],newLocation[1] + newPath[1]]);\n //console.log(check_if_coor_in_path([newLocation[0] + newPath[0],newLocation[1] + newPath[1]],previousPathsTaken));\n while(check_if_coor_in_path([newLocation[0] + newPath[0],newLocation[1] + newPath[1]],previousPathsTaken)){ //this option does not allow backtracking\n newPath = get_random_from_list(openPaths);\n }\n \n return [newLocation[0] + newPath[0],newLocation[1] + newPath[1]];\n}", "solveForTarget( t ) {\n\n this.tmpTarget.set( t.x, t.y, t.z );\n let p = this.precision;\n\n let isSameBaseLocation = this.lastBaseLocation.approximatelyEquals( this.baseLocation, p );\n\n // If we have both the same target and base location as the last run then do not solve\n if ( this.lastTargetLocation.approximatelyEquals( this.tmpTarget, p ) && isSameBaseLocation ) return this.currentSolveDistance;\n\n // Keep starting solutions and distance\n let startingDistance;\n let startingSolution = null;\n\n // If the base location of a chain hasn't moved then we may opt to keep the current solution if our \n // best new solution is worse...\n if ( isSameBaseLocation ) {\n startingDistance = this.bones[ this.numBones-1 ].end.distanceTo( this.tmpTarget );\n startingSolution = this.cloneBones();\n } else {\n // Base has changed? Then we have little choice but to recalc the solution and take that new solution.\n startingDistance = MAX_VALUE;\n }\n \n /*\n * NOTE: We must allow the best solution of THIS run to be used for a new target or base location - we cannot\n * just use the last solution (even if it's better) - because that solution was for a different target / base\n * location combination and NOT for the current setup.\n */\n \n // Not the same target? Then we must solve the chain for the new target.\n // We'll start by creating a list of bones to store our best solution\n let bestSolution = [];\n \n // We'll keep track of our best solve distance, starting it at a huge value which will be beaten on first attempt\n let bestSolveDistance = MAX_VALUE;\n let lastPassSolveDistance = MAX_VALUE;\n \n // Allow up to our iteration limit attempts at solving the chain\n let solveDistance;\n\n let i = this.maxIteration;\n\n while( i-- ){ \n\n // Solve the chain for this target\n solveDistance = this.solveIK( this.tmpTarget );\n \n // Did we solve it for distance? If so, update our best distance and best solution, and also\n // update our last pass solve distance. Note: We will ALWAYS beat our last solve distance on the first run. \n if ( solveDistance < bestSolveDistance ) { \n\n bestSolveDistance = solveDistance;\n bestSolution = this.cloneBones();\n \n // If we are happy that this solution meets our distance requirements then we can exit the loop now\n if ( solveDistance <= this.solveDistanceThreshold ) break;\n \n } else {// Did not solve to our satisfaction? Okay...\n \n // Did we grind to a halt? If so break out of loop to set the best distance and solution that we have\n if ( Math.abs( solveDistance - lastPassSolveDistance ) < this.minIterationChange ) break; \n\n }\n \n // Update the last pass solve distance\n lastPassSolveDistance = solveDistance;\n \n } // End of loop\n\n // Did we get a solution that's better than the starting solution's to the new target location?\n if ( bestSolveDistance < startingDistance ){\n // If so, set the newly found solve distance and solution as the best found.\n this.currentSolveDistance = bestSolveDistance;\n this.bones = bestSolution;\n } else {\n // Did we make things worse? Then we keep our starting distance and solution!\n this.currentSolveDistance = startingDistance;\n this.bones = startingSolution; \n }\n \n // Update our base and target locations\n this.lastBaseLocation.copy( this.baseLocation );\n this.lastTargetLocation.copy( this.tmpTarget );\n \n return this.currentSolveDistance;\n \n }", "solve(opts) {\n var options = Object.assign({maxIterations: 256}, opts);\n var algorithm = (new jsprit.SchrimpfFactory()).createAlgorithm(this.problem);\n algorithm.setMaxIterations(options.maxIterations);\n return algorithm.searchSolutionsP().then((solutionRoutes) => {\n return jsprit.Solutions.bestOfP(solutionRoutes);\n }).then((bestSolution) => {\n return this._buildResponse(bestSolution);\n });\n }", "function startTrannow(vi, tranTask) { // 8_241654_500,500,500,500_0_1245413194000_interval\n//printErrorMSG(\"startTrannow(vi, tranTask)\"+vi+\"trantask=\"+tranTask);\n\ttry {\n\t\t//flag ( \"startTrannow():: Started! vi: \" + vi );\n\t\t//TS_debug(\"come into startTrannow() at \" + getvillagefromdid(vi));\n\t\tvar merchant = getMerchantNow( vi );\n\t\tif ( merchant[0] > 0){\n\t\t\tgetTargetResource(tranTask[2], // first get target resources and then start transfer\n\t\t\tfunction(){\n\t\t\t//var urlSuffix = GM_getValue ( currentServer() + \"_\" + getuid() + \"_\" + vi + \"_marketExists\", \"&gid=17\");\n\t\t\tvar urlSuffix = (analyzeBuildingData(17, \"id\", vi)) ? \"&id=\"+analyzeBuildingData(17, \"id\", vi) :\"&gid=17\";\n\t\t\tvar turl = myhost + \"/build.php?newdid=\" + vi + urlSuffix +\"&t=5\";\n\t\t\tGM_xmlhttpRequest({\n\t\t\tmethod: 'GET',\n\t\t\turl: turl,\n\t\t\t\n\t\t\tonload: function(responseDetails){\n\t\t\t\tif ( gatherStats(responseDetails.responseText) ) {\n\t\t\t\t\t// attempt reloading page, captcha ll be found there too and script will stop.\n\t\t\t\t\twindow.location.replace(myhost + \"/spieler.php\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t//TS_debug(\"here is startTrannow callback function\")\n\n\t\t\t\t// v_kir 2010.01.25\n\n\t\t\t\tvar ssDoc = document/*.implementation.createDocument(\"\", \"\", null)*/;\n\t\t\t\tvar ssElem = document.createElement('DIV');\n\t\t\t\tssElem.innerHTML = responseDetails.responseText;\n\t\t\t\t//ssDoc.appendChild(ssElem);\n\t\t\t\trefreshPageInfo(ssElem);//\n\n\t\t\t\tvar formCount = ssDoc.evaluate('.//form [ @name=\"snd\" and ( @method=\"POST\" or @method=\"post\" ) ]', ssElem, null, XPSnap, null).snapshotLength;\n\t\t\t\t \n\t\t\t\tif ( formCount > 1 ) {\n\t\t\t\t\tvar tarLoc = ( tranTask[0] == \"5\" ) ? tranTask[3] : tranTask[1] ;\n\t\t\t\t\tvar urlToBuilding = \"<a class='spantooltip' style='color: Green' href='\"+\n\t\t\t\t\t\tmyhost+\"/build.php?newdid=\"+vi+\"&gid=17&t=5&z=\"+ tarLoc +\"'>Send Resources</a>\";\n\t\t\t\t\t\t/*myhost+\"/build.php?newdid=\"+vi+\"&gid=17&t=5&z=\"+ tarLoc +\"'>Send Resources</a>\" added t=5 .RS*/\n\t\t\t\t\tplaySound ( \"<b>startTrannow():: Some Problem, send resources once manually! \" + urlToBuilding + \"</b>\" );\n\t\t\t\t\t//var nextTime = getGMCookie ( \"MerchantReturnTime\", vi );\n\t\t\t\t\tvar nextTime = minMerchantReturnTime (vi);\n\t\t\t\t\tif ( !nextTime || nextTime < new Date().getTime() ) {\n\t\t\t\t\t\t// delay by transsInterval + random ( 15 mins )\n\t\t\t\t\t\tnextTime = getRandomizedTime( Number(transsInterval), 5*60*1000 );\n\t\t\t\t\t}\n\t\t\t\t\tGM_setValue(myacc() + \"_\" + vi + \"_to_\" + tranTask[2] + \"_autoTransTime\", nextTime.toString());\n\t\t\t\t\t\n\t\t\t\t\tcalldoing1();\n\t\t\t\t\tshowTaskList();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar xpathId = \"\";\n\t\t\t\tswitch ( aTravianVersion ) {\n\t\t\t\t\tcase \"3.6\": xpathId = './/div[@id=\"textmenu\"]/descendant::a[@href]'; break;\n\t\t\t\t\tcase \"4.0\": xpathId = './/div[@class=\"contentNavi subNavi \"]//div[@class=\"container active\"]//a[@href]'; break;\n\t\t\t\t\t/* xpathId = './/div[@class=\"contentNavi tabNavi\"]//div[@class=\"container active\"]//a[@href]'; break; AND ssElem With document changed.RS*/\n\t\t\t\t\tdefault: throwLogicError ( \"createbuildlink():: Travian Version not set!!\" );\n\t\t\t\t}\n\t\t\t\tvar ids = ssDoc.evaluate(xpathId, ssElem, null, XPFirst, null);\n\t\t\t\ttheid = ids.singleNodeValue.href.match(/\\bid=\\d{1,}\\b/)[0].split(\"id=\")[1];\n\n\t\t\t\tvar comm = [\"\", \"\"];\n /*\n\t\t\t\t// find max resources per merchant\n\t\t\t\tvar pp = ssDoc.evaluate('.//table[@id=\"send_select\"]/descendant::td[@class=\"max\"]/a', ssElem, null, XPFirst, null);\n\t\t\t\tcomm[1] = pp.singleNodeValue.innerHTML.match(/\\d{3,4}/);\n\n\t\t\t\t// get merchants available in village\n\t\t\t\tvar xpathMerchantCount = \"\";\n\t\t\t\tswitch ( aTravianVersion ) {\n\t\t\t\t\tcase \"3.6\": xpathMerchantCount = './/table[@id=\"target_select\"]/descendant::td[@class=\"mer\"]'; break;\n\t\t\t\t\tcase \"4.0\": xpathMerchantCount = './/div[contains(@class,\"boxes boxesColor gray traderCount\")]/div[@class=\"boxes-contents cf\"]'; break;\n\t\t\t\t\t//xpathMerchantCount = './/div[contains(@class,\"traderCount\")]/div[@class=\"boxes-contents cf\"]'; break;\n\t\t\t\t\tdefault: throwLogicError ( \"startTrannow():: Travian Version not set!!\" );\n\t\t\t\t}\n\t\t\t\tvar qq = ssDoc.evaluate(xpathMerchantCount, ssElem, null, XPFirst, null);\n\t\t\t\ttraderCountZ = qq.singleNodeValue.innerHTML.match(/\\d{1,}/g);\n\t\t\t\tcomm[0] = Math.min(traderCountZ[0],traderCountZ[1]);\n //maxmerchant = Math.max(qq[0],qq[1]);\n\t\t\t\t//comm[0] = qq.singleNodeValue.innerHTML.split(\" \")[1].split(\"/\")[0];\n\n\t\t\t\t//flag ( \"startTrannow():: Merchants available: \" + comm[0] + \", & each Merchants can load: \" + comm[1] );\n\t\t\t\tcomm[0] = parseInt(comm[0]); // current count of merchants in village\n\t\t\t\tcomm[1] = parseInt(comm[1]); // max resource per merchant\n \t\t\t\t\n\t\t\t\tsetCookie (\"merchantCount\",comm[0],vi);\n\t\t\t\tsetCookie (\"merchantCap\",comm[1],vi);\n\t\t\t\t//var merchantCount = GM_setValue(myacc() + \"_\" + vi + \"_merchantCount\" , comm[0].toString() );//.RS\n\t\t\t\t//var merchantCap = GM_setValue(myacc() + \"_\" + vi + \"_merchantCap\" , comm[1].toString() );//RS\n\t\t\t\t// startTrannow() only transfers resources to own villages, hence we can check destination resources for overflow which is\n\t\t\t\t// done by getMaxTransAmount()\n\t\t\t\t*/\n\t\t\t\tcomm = getMerchantNow (vi);\n\t\t\t\tvar balance = getMaxTransAmount(vi, tranTask);\n\t\t\t\tif ( balance != false ) {\n\t\t\t\t\t//flag ( \"startTrannow():: Amount to transfer: \" + balance );\n\t\t\t\t\tvar delayCustomTransfer = false;\n\t\t\t\t\tif ( comm[0] > 0 ) {\n\t\t\t\t\t\t// get max amount than can be transfered based on merchants available and resources to retain in source village\n\t\t\t\t\t\tbaalaa = getTranAmount ( balance, comm );\n\t\t\t\t\t\tvar baalaasum = 0;\n\t\t\t\t\t\tfor ( var ictr = 0; ictr < baalaa.length ; ictr++ )\n\t\t\t\t\t\t\tbaalaasum += Number(baalaa[ictr]);\n\t\t\t\t\t\tif ( baalaasum == 0 )\n\t\t\t\t\t\t\tdelayCustomTransfer = true;\n\t\t\t\t\t\telse if ( !autoTranRequire(tranTask, baalaa, vi, theid) ){\n\t\t\t\t\t\t delayCustomTransfer = 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\tdelayCustomTransfer = true;\n\t\t\t\t\tif ( delayCustomTransfer == true ) { // if merchants are not available or total resource to transfer is 0\n\t\t\t\t\t\t//var nextTime = getGMCookie ( \"MerchantReturnTime\", vi );\n\t\t\t\t\t\tvar nextTime = minMerchantReturnTime (vi);\n\t\t\t\t\t\tif ( !nextTime || nextTime < new Date().getTime() ) {\n\t\t\t\t\t\t\t//TS_debug(\"a market place with no merchant is impossible. bug in script\");\n\t\t\t\t\t\t\t// delay by transsInterval + random ( 15 mins )\n\t\t\t\t\t\t\tnextTime = getRandomizedTime( Number(transsInterval), 15*60*1000 );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tGM_setValue(myacc() + \"_\" + vi + \"_to_\" + tranTask[2] + \"_autoTransTime\", nextTime.toString());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//flag ( \"startTrannow():: No merchant now or resource to be sent is 0, delaying auto-transport.nextTime =\"+ new Date(nextTime) +\"!\");\n\t\t\t\t\t\tcalldoing1();\n\t\t\t\t\t\tshowTaskList();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// delay by transsInterval + random ( 5 mins )\n\t\t\t\t\tvar nextTime = getRandomizedTime( Number(transsInterval), 5*60*1000 );\n\t\t\t\t\t\n\t\t\t\t\tGM_setValue(myacc() + \"_\" + vi + \"_to_\" + tranTask[2] + \"_autoTransTime\", nextTime.toString());\n\t\t\t\t\tTS_debug(\"getMaxTransAmount returned false. vi= \" + vi);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//flag ( \"startTrannow():: Not enough resources to send, delaying auto-transport.NextTime =\"+ new Date(nextTime) +\"!\");\n\t\t\t\t\tcalldoing1();\n\t\t\t\t\tshowTaskList();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\t});\n\t\n\t }else{\n\t\t\tvar nextTime = minMerchantReturnTime (vi);\n\t\t\tif ( !nextTime || nextTime < new Date().getTime() ) {\n\t\t\t// delay by transsInterval + random ( 15 mins )\n\t\t\t nextTime = getRandomizedTime( Number(transsInterval), 5*60*1000 );\n\t\t\t}\n\t\t\t\n\t\t\tGM_setValue(myacc() + \"_\" + vi + \"_to_\" + tranTask[2] + \"_autoTransTime\", nextTime.toString());\n\t\t\t\t\t\n\t\t\tcalldoing1();\n\t\t\tshowTaskList();\n\t\t\treturn false;\n\t\t};\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tprintErrorMSG(msg);\n\t\tvar msg = \"<b>startTrannow():: Something went wrong, error: \" + err.name + \" :: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tthrow err;\n\t}\n}", "function solve() {\r\n//\t\tvar stepId = setInterval(function() {\r\n//\t\t\tsolvealgo();\t\t\t\r\n//\t\t\t\r\n//\t\t\tif (clickablecells.length == 0) {\r\n//\t\t\t\tclearInterval(stepId);\r\n//\t\t\t}\r\n//\t\t}, 1000);\r\n\t\t\t\r\n\t\tfunction clickRandom(cells) {\r\n\t\t\tvar rand = Math.floor(Math.random()*cells.length);\r\n\t\t\t$(cells[rand]).trigger({ type: 'mousedown', which: 1});\r\n\t\t}\r\n\t\t\r\n\t\tfunction clickCell(cellid) {\r\n\t\t\t$('#' + cellid).trigger({ type: 'mousedown', which: 1});\r\n\t\t}\r\n\t\t\r\n\t\tfunction flagCell(cellid) {\r\n\t\t\tvar cell = $('#' + cellid);\r\n\t\t\t\r\n\t\t\tif (cell.text().length == 0) {\r\n\t\t\t\tcell.trigger({ type: 'mousedown', which: 3});\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar added = [],\r\n\t\t\tones = [], // Array of cells with value 1\r\n\t\t\tfoundmines = [],\r\n\t\t\tsolvedmines = []; // Completed cells\r\n\t\t\r\n\t\tsolvealgo();\r\n\t\tfunction solvealgo() {\r\n\t\t\tif (ones.length <= 1) {\r\n\t\t\t\tclickRandom($('.clickable'));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < clickedcells.length; i++) {\r\n\t\t\t\tvar cellId = clickedcells[i],\r\n\t\t\t\t\tcellValue = cells[cellId];\r\n\t\t\t\t\r\n\t\t\t\tif (added.indexOf(cellId) < 0) {\r\n\t\t\t\t\tif (cellValue == 1) {\r\n\t\t\t\t\t\tones.push(cellId);\r\n\t\t\t\t\t\tadded.push(cellId);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < ones.length; i++) {\r\n\t\t\t\tvar mineNearby = searchNearby(ones[i], 1, 'mine');\r\n\t\t\t\tif (mineNearby != null) {\r\n\t\t\t\t\tconsole.log('mine' + ' search near ' + ones[i] + ', found ' + mineNearby);\r\n\t\t\t\t\tfoundmines.push(mineNearby);\r\n\t\t\t\t\tflagCell(mineNearby);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < foundmines.length; i++) {\r\n\t\t\t\tvar oneNearby = searchNearby(foundmines[i], 1, 'val');\r\n\t\t\t\tconsole.log('val' + ' search near ' + foundmines[i] + ', found ' + oneNearby);\r\n\t\t\t\tfor (var m = 0; m < mineNearby.length; m++) {\r\n//\t\t\t\t\tclickCell(mineNearby[m]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction searchNearby(id, num, type) {\r\n\t\t\t\tvar searchForUnclicked = 'mine',\r\n\t\t\t\t\tsearchForValue = 'val',\r\n\t\t\t\t\tlookingfor = 'clickable',\r\n\t\t\t\t\tfound = [],\r\n\t\t\t\t\tnw = id - SIZE - 1, nwcell = $('#' + nw),\r\n\t\t\t\t\tn = id - SIZE, ncell = $('#' + n),\r\n\t\t\t\t\tne = id - SIZE + 1, necell = $('#' + ne),\r\n\t\t\t\t\tw = id - 1, wcell = $('#' + w),\r\n\t\t\t\t\te = id + 1, ecell = $('#' + e),\r\n\t\t\t\t\tsw = id + SIZE - 1, swcell = $('#' + sw),\r\n\t\t\t\t\ts = id + SIZE, scell = $('#' + s),\r\n\t\t\t\t\tse = id + SIZE + 1, secell = $('#' + se);\r\n\t\t\t\t\r\n\t\t\t\tif (id % SIZE > 0) { // west\r\n\t\t\t\t\tif (type == searchForUnclicked && nwcell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && nwcell.text() == num) found.push(nw);\r\n\t\t\t\t\tif (type == searchForUnclicked && wcell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && wcell.text() == num) found.push(w);\r\n\t\t\t\t\tif (type == searchForUnclicked && swcell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && swcell.text() == num) found.push(sw);\r\n\t\t\t\t} \r\n\t\t\t\tif (id % SIZE < SIZE - 1) { // east\r\n\t\t\t\t\tif (type == searchForUnclicked && necell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && necell.text() == num) found.push(ne);\r\n\t\t\t\t\tif (type == searchForUnclicked && ecell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && ecell.text() == num) found.push(e);\r\n\t\t\t\t\tif (type == searchForUnclicked && secell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && secell.text() == num) found.push(se);\r\n\t\t\t\t}\r\n\t\t\t\tif (type == searchForUnclicked && ncell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && ncell.text() == num) found.push(n);\r\n\t\t\t\tif (type == searchForUnclicked && scell.hasClass(lookingfor) ||\r\n\t\t\t\t\t\ttype == searchForValue && scell.text() == num) found.push(s);\r\n\t\t\t\t\r\n\t\t\t\treturn (type == searchForUnclicked && found.length == num ||\r\n\t\t\t\t\t\ttype == searchForValue) ? found : null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function startLoop() {\n var result = 'Nothing to get.';\n interval = setInterval( function() {\n $.get(\"/solve_result\", function(data) {\n console.log(data);\n result = data;\n });\n \n try {\n if (result != 'Nothing to get.') {\n result_recived = true;\n result = JSON.parse(result.slice(0, -1));\n result = result['RESPONSE']['FINISHED'];\n var success = result['SUCCESSFUL'];\n result_recived = true;\n if (success) {\n if (playground) {\n var time = result['TIME_FINISHED'] - result['TIME_STARTED'];\n var answer = result['INDIVIDUAL'];\n element.children('.time').text('Successfully found a solution in ' + time + 'ms');\n var values = BitStringToBoolean(answer);\n element.children('.answer').children('.a').html(values[0]);\n element.children('.answer').children('.b').html(values[1]);\n element.children('.answer').children('.c').html(values[2]);\n element.children('.answer').children('.d').html(values[3]);\n element.slideDown(\"slow\");\n } else {\n var time = result['TIME_FINISHED'] - result['TIME_STARTED'];\n var answer = result['INDIVIDUAL'];\n element.children('.time').text('Successfully found a solution in ' + time + 'ms');\n element.children('.answer').html('<b>A</b> solution: ' + answer);\n element.slideDown(\"slow\");\n }\n } else {\n element.children('.time').text('No soloution could be found. :(');\n element.children('.answer').html('');\n element.slideDown(\"slow\");\n }\n }\n } catch(e) {\n element.children('.time').html('');\n element.children('.answer').html('Something is wrong with your CNF.');\n element.slideDown(\"slow\");\n }\n if(result_recived) clearInterval(interval);\n }, 150 ); // run\n }", "generateSolutions(puzzle, onSolution, options) {\n const opts = Object.assign({}, GeneratorDefaultOptions, options);\n let maxDepth = opts.initialDepth;\n\n let shouldStop = false;\n let bestSolution = null;\n\n const root = new Node(puzzle.copy().normalize().encode(), null, -1, Heuristic.ContiguousGroups(puzzle), 0);\n \n let queue = new Heap((a, b) => a.priority - b.priority);\n queue.push(root);\n\n const seen = {};\n\n const solveLoop = new Promise(res => {\n const processQueue = async () => {\n if (queue.empty() || shouldStop) return res();\n \n const cur = queue.pop();\n \n if (seen[cur.position]) {\n return setImmediate(processQueue);\n }\n \n const puzzle = ChainPuzzle.decode(cur.position);\n \n if (puzzle.isSolved()) {\n const solution = OperationSequence.reorder(getPathOperations(cur));\n\n onSolution(solution);\n bestSolution = solution;\n \n queue = pruneQueueDepth(queue, cur.depth - 1); // TODO: might not be necessary if the cost of this function is greater than checking if all current-depth nodes are solved\n maxDepth = cur.depth - 1;\n \n return setImmediate(processQueue);\n }\n \n if (cur.depth >= maxDepth) {\n return setImmediate(processQueue);\n }\n \n for (let op = 0; op < 6; op++) {\n if (op != cur.operation && (op%3 == cur.operation%3)) {\n continue;\n }\n \n const newPuzzle = puzzle.copy().transform(op).normalize();\n const newPosition = newPuzzle.encode();\n \n if (seen[newPosition]) {\n continue;\n }\n \n const newNode = new Node(newPosition, cur, op, Heuristic.ContiguousGroups(newPuzzle), cur.depth + 1);\n \n cur.children.push(newNode);\n queue.push(newNode);\n }\n \n seen[cur.position] = true;\n \n setImmediate(processQueue);\n }\n\n processQueue();\n });\n\n return async () => {\n shouldStop = true;\n await solveLoop;\n\n return bestSolution;\n };\n }", "function solveRestOfBoard() {\n if (BoardModel.state._priorState) {\n BoardModel.state = BoardModel.state._priorState;\n BoardView.renderState(BoardModel.state, 50);\n\n setTimeout(function() {\n // Show the next step in 40ms.\n solveRestOfBoard();\n }, 40);\n }\n else {\n BoardModel.state.computeCanMove();\n }\n }", "function doRoute(cords, old){\n\tsp.send(breakInt);\n\tif(cords.length != undefined && cords.length > 0){\n\t\tconsole.log(\"DOING ROUTE\");\n\t\tconsole.log(\"Target: \" + JSON.stringify(cords[0]));\n\t\t// Here is the logic of the function\n\t\tvar current = tpv;// TODO get GPS location\n\t\tconsole.log(\"Current: \" + JSON.stringify(current));\n\t\tif(withinThreshold(current, cords[0])){\n\t\t// if you are close enough\n\t\t\tvar cords2 = cords;\n\t\t\tcords2.shift();\n\t\t\tdoRoute(cords2, old);\n\t\t}else{\n\t\t\tsp.send(calculateVector(old, current, target));\n\t\t\tsp.send(forwardInt);\n\t\t\tsetTimeout(function(){\n\t\t\t\tdoRoute(cords, current);\n\t\t\t},delay);\n\t\t}\n\t}else{\n\t\tdoingRoute = false;\n\t\tconsole.log(\"Route Completed\");\n\t}\n}", "function portals(maxTime, manacost) {\n\n let isVisited = new Array(manacost.length).fill([])\n isVisited = isVisited.map(v => new Array(manacost[0].length).fill(0))\n\n isInRange = (x, y) => x >= 0 && y >= 0 && x < manacost.length\n && y < manacost[0].length\n\n isDupCoord = ([x, y], [a, b]) => x == a && y == b\n\n const direction = [[-1, 0], [0, 1], [1, 0], [0, -1]]\n\n bfs = ([x, y], signal) => {\n let res = []\n\n let queue = [{x, y, time: 0, manaCost: manacost[x][y]}]\n isVisited[x][y] = 1\n while(queue.length > 0){\n let data = queue.shift()\n\n if(data.time > maxTime)\n continue;\n\n if(data.x == manacost.length-1 && data.y == manacost[0].length-1 && signal)\n return 0\n\n res.push(data)\n\n for(let d of direction){\n let dX = d[0] + data.x\n let dY = d[1] + data.y\n if(isInRange(dX, dY) && isVisited[dX][dY] == 0 && manacost[dX][dY] > -1){\n isVisited[dX][dY] = 1\n queue.push({x: dX, y: dY, time: data.time + 1, manaCost: manacost[dX][dY]})\n }\n }\n }\n\n\n return res\n }\n\n let topToDown = bfs([0, 0], true)\n if(topToDown == 0) return 0\n\n isVisited = isVisited.map(v => v.map(t => 0))\n let downToTop = bfs([manacost.length-1, manacost[0].length-1], false)\n\n topToDown = topToDown.sort((a, b) => a.manaCost - b.manaCost)\n downToTop = downToTop.sort((a, b) => a.manaCost - b.manaCost)\n\n let portal = 1000000000\n\n console.log(topToDown, downToTop)\n\n for(let ttd of topToDown){\n for(let dtt of downToTop){\n if(ttd.time + dtt.time <= maxTime && !isDupCoord([ttd.x, ttd.y], [dtt.x, dtt.y])){\n portal = portal > ttd.manaCost + dtt.manaCost ? ttd.manaCost + dtt.manaCost : portal\n }\n }\n }\n\n return portal\n}", "function GRASP(points, matrix, time){\n //100 is relatively fast, so we can get away with it. In a practical\n //application, this would probably require more thought. Unfortunately, GRASP\n //with 100 iterations may be approaching or exceeding the runtime of some of\n //the lucky brute forces with 10 points...of course, with more than 10 points,\n //there is a low likelyhood that the brute force algorithm will actually be\n //fast enough to complete\n //\n //Note: this algorithm is fairly configurable. Between maxIterations and the\n //size of the candidate sets for the greedy construction, there are many\n //combinations of configurations which should be experimented with.\n var maxIterations = 100;\n var numCandidates = 20;\n var localSearchSize = 20;\n\n var best = {'path':[],'score':0,'dist':0};\n\n var pathCost = function(path){\n var last = 0;\n var sum = 0;\n for (var j = 0; j < path.length; j++){\n sum += matrix[last][path[j]];\n last = path[j];\n }\n return sum;\n };\n\n var pathScore = function(path){\n var score = 0;\n for (var j = 0; j < path.length; j++){\n score += points[path[j]].value;\n }\n return score;\n };\n\n var constructGreedySolution = function(candidate){\n //Simply select a random end point and insert greedy points in between the\n //beginning and end until distance is exceeded.\n var validPoints = [];\n for (var i = 1; i < points.length; i++){\n validPoints.push(i);\n }\n\n //pick a random end point\n var path = [getRandomIntInclusive(1,points.length-1)];\n\n while (validPoints.length > 0 && pathCost(path) < time){\n validPoints.splice(validPoints.indexOf(path[0]), 1);\n candidate.path = path;\n candidate.score = pathScore(path);\n candidate.dist = pathCost(path);\n\n //now insert the best point that we can find\n //the improvement is equal to scoreImprovement/distanceImprovement\n //(Ideally we are maximizing this globally)\n var bestPath = path.slice();\n var bestScore = 0;\n var bestDist = 0;\n\n var tempValidPoints = validPoints.slice();\n\n //use a max of 20 for construction (another arbitrary number that would\n //need to be played with in practice)\n for (var j = 0; j < Math.min(validPoints.length,numCandidates); j++){\n var index = getRandomIntInclusive(0,tempValidPoints.length-1);\n var tempPath = [tempValidPoints[index]].concat(path);\n var tempDist = pathCost(tempPath);\n var tempScore = pathScore(tempPath);\n tempValidPoints.splice(index,1);\n\n if (tempDist < time){\n if (tempScore > bestScore){\n bestPath = tempPath;\n bestScore = tempScore;\n bestDist = tempDist;\n }else if (tempScore === bestScore && tempDist < bestDist){\n bestPath = tempPath;\n bestScore = tempScore;\n bestDist = tempDist;\n }\n }\n }\n path = bestPath;\n }\n\n return candidate;\n };\n\n var localSearch = function(candidate){\n //Our local search will simply try to swap points in the candidate to see if\n //it makes an improvement\n\n //A neighbour of the candidate is the same path as the candidate but with a\n //single swap with a point that is not visited in the candidate solution.\n var validPoints = [];\n var i;\n\n for (i = 1; i < points.length; i++){\n if (candidate.path.indexOf(i) === -1){\n validPoints.push(i);\n }\n }\n\n for (i = 0; i < localSearchSize; i++){\n //swap two random points\n var randomIndex = getRandomIntInclusive(0,candidate.path.length-1);\n var randomPointIndex = getRandomIntInclusive(0,validPoints.length-1);\n var temp = candidate.path[randomIndex];\n candidate.path[randomIndex] = validPoints[randomPointIndex];\n validPoints[randomPointIndex] = temp;\n\n //if this is legal and an improvement\n var tempScore = pathScore(candidate.path);\n var tempDist = pathCost(candidate.path);\n\n if (tempDist < time && (tempScore > candidate.score || (tempScore === candidate.score && tempDist < candidate.dist) )){\n //keep the swap\n candidate.score = tempScore;\n candidate.dist = tempDist;\n }else{\n //swap back\n temp = candidate.path[randomIndex];\n candidate.path[randomIndex] = validPoints[randomPointIndex];\n validPoints[randomPointIndex] = temp;\n }\n }\n };\n\n //Main GRASP algorithm\n for (var i = 0; i < maxIterations; i++){\n var candidate = {'path':[],'score':0,'dist':0};\n constructGreedySolution(candidate);\n if (candidate.path.length > 0){\n localSearch(candidate);\n }\n if (best.score < candidate.score){\n best = candidate;\n }else if(best.score === candidate.score && candidate.dist < best.dist){\n best = candidate;\n }\n }\n\n return best;\n}", "async function solveGreedy(){\n for(var i = 0; i < max_moves && !all_flooded(); i++){\n var move = getGreedyMove();\n console.log(move);\n switch(move){\n case \"blue\":\n document.getElementById(\"blue\").click();\n break;\n case \"red\":\n document.getElementById(\"red\").click();\n break;\n case \"green\":\n document.getElementById(\"green\").click();\n break;\n case \"yellow\":\n document.getElementById(\"yellow\").click();\n break;\n case \"pink\":\n document.getElementById(\"pink\").click();\n break;\n case \"purple\":\n document.getElementById(\"purple\").click();\n break;\n }\n await sleep(100); //Sleeping 100 ms every click so we can watch the magic.\n }\n}", "function goToLaplides(){\n\t\tif(visitedLap===0){\n\t\t\tvisitedLap=1;\n\t\t\t// artifacts=1;\n\t\t\tgamePrompt(\"You enter orbit around Laplides. Looking down at the planet, you see signs of atomic war and realize there is no option but to turn around.\",beginTravel);\n\t\t}else{\n\t\t\tgamePrompt([\"You've already been here!\",\"Where to next?\"],beginTravel);\n\t\t}\n}", "function checkIfCorrect(){ var index = stepCounter;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tstepCounter ++;\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"index \" + index);\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"limit \" + Limit);\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"stepcounter \" + stepCounter);\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(thePlayerSequence);\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(thePartialSequence);\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(thePlayerSequence[index]);\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(thePartialSequence[index]); \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\t\t\tif (thePlayerSequence[index] == thePartialSequence[index] && stepCounter == Limit && Limit == Goal) {nextLevel();} // check if the level is complete and it calls nextLevel function\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\telse if (thePlayerSequence[index] == thePartialSequence[index] && stepCounter == Limit) {addAnother();}\t// check if the lpartial sequence has been completed and adds a new note to play\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\telse if (thePlayerSequence[index] == thePartialSequence[index]){console.log(\"good job\");}\t//check if the just played note is correct\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\telse {console.log(\"bad job\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tresetAll(); // calls the resetAll functiion which reset the game and starts over\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation.reload(); }//reload the page (refresh)\n\t\t\t\t\t\t\t\t\t\t\t\t}", "performFinalCorrection(amount) {\n\n console.log(\"entering performFinalCorrection()\");\n\n let who = this.sjs.id;\n\n let bumpMs = 300;\n\n let limit = 128;\n\n let acc = 0;\n\n let curMs = 0;\n\n while(acc < amount) {\n let thisOne = Math.min(limit,amount-acc);\n\n // if( (amount-limit) > 0 ) {\n // amount -= thisOne;\n // }\n\n setTimeout(()=>{\n console.log(\"run: \" + thisOne);\n this.sjs.dsp.setPartnerSfoAdvance(who, thisOne, 4, false);\n },curMs);\n\n curMs += bumpMs;\n acc += thisOne;\n }\n\n setTimeout(()=>{\n if( this.onDoneCb ) {\n this.onDoneCb();\n }\n }, curMs);\n\n }", "async function solveNaive(){\n for(var i = 0; !all_flooded();i++){\n var move = colours[i % 6]\n console.log(move);\n switch(move){\n case \"blue\":\n document.getElementById(\"blue\").click();\n break;\n case \"red\":\n document.getElementById(\"red\").click();\n break;\n case \"green\":\n document.getElementById(\"green\").click();\n break;\n case \"yellow\":\n document.getElementById(\"yellow\").click();\n break;\n case \"pink\":\n document.getElementById(\"pink\").click();\n break;\n case \"purple\":\n document.getElementById(\"purple\").click();\n break;\n }\n await sleep(100);\n }\n}", "function findFixVerify(options) {\r\n\tvar result = {\r\n\t\tparagraphs: []\r\n\t};\r\n var rejectedWorkers = [];\r\n \r\n if (options.writeOutput) {\r\n initializeOutput();\r\n }\r\n if (options.socket != null) {\r\n options.socket.connect();\r\n }\r\n\t\r\n\tprint(\"number of paragraphs: \" + options.paragraphs.length);\r\n\t\r\n\tfor (var paragraph_index = 0; paragraph_index < options.paragraphs.length; paragraph_index++) {\r\n\t\tattempt(function() {\r\n\t\t\tprint('\\n\\n\\n');\t\t\r\n\t\t\tprint(\"paragraph #\" + paragraph_index);\r\n\t\t\tvar paragraph = options.paragraphs[paragraph_index];\r\n \r\n // Find stage\r\n [patches, find_hit] = findPatches(paragraph_index, options, rejectedWorkers);\r\n\t\t\t\r\n // Keep track of which paragraphs have finished their computation\r\n var finishedArray = new Array();\r\n for (var i=0; i<patches.length; i++) {\r\n finishedArray[i] = false;\r\n }\r\n var paragraphResult = {\r\n\t\t\t\tparagraph: paragraph_index,\r\n\t\t\t\tpatches: []\r\n\t\t\t};\r\n \r\n var fixHITs = new Array();\r\n var verifyHITs = new Array();\r\n\t\t\tfor (var i=0; i<patches.length; i++) {\r\n\t\t\t\tprint('Patch #' + i + '\\n\\n');\r\n\t\t\t\tvar patch = patches[i];\r\n\t\t\t\tprint(json(patch));\r\n \r\n\t\t\t\tattempt(function() {\r\n // Fix stage\r\n [suggestions, fix_hit] = fixPatches(patch, paragraph_index, i, patches.length, options, rejectedWorkers);\r\n fixHITs[i] = fix_hit;\r\n\r\n // Verify stage\r\n [votes, verify_hit] = verifyPatches(patch, fix_hit, suggestions, paragraph_index, i, patches.length, options, rejectedWorkers);\r\n verifyHITs[i] = verify_hit;\r\n\t\t\t\t\t\r\n // Create output data structure\r\n var patchOutput = generatePatch(patch, find_hit, fix_hit, verify_hit, votes, options.verify.fields, suggestions, paragraph_index, options);\r\n paragraphResult.patches.push(patchOutput);\r\n \r\n // Write file output\r\n if (options.writeOutput) {\r\n outputEdits(HTML_output, lag_output, payment_output, paragraph, patch, find_hit,\r\n fix_hit, verify_hit, votes, suggestions, paragraph_index, patchOutput, options);\r\n }\r\n finishedArray[i] = true;\r\n\t\t\t\t} );\r\n\t\t\t\tprint('\\n\\n\\n');\r\n\t\t\t}\r\n\t\t\t\r\n if (!finishedPatches(finishedArray)) {\r\n // wait if not all the patches for the paragraph are complete\r\n stop();\r\n }\r\n \r\n // Now we merge patch revision bounds to see if there is any overlap between edits in various patches.\r\n // If so, we merge the patches together.\r\n paragraphResult.patches = findOverlapsAndMerge(paragraphResult.patches, paragraph_index);\r\n\t\t\tparagraphResult.patches.sort( function(a, b) { return a.start - b.start; } );\r\n \r\n\t\t\tresult.paragraphs.push(paragraphResult);\r\n \r\n options.socket.sendMessage(\"complete\", paragraphResult);\r\n\t\t\t\r\n\t\t\tonce(function() {\t// only do this once\r\n\t\t\t\t// log to the server\r\n\t\t\t\t//print(\"the paragraph result\")\r\n\t\t\t\t//print(json(paragraphResult))\r\n\t\t\t\t//var resultLog = prune(paragraphResult, 1000000); // copy it very deep\r\n\t\t\t\tparagraphResult.paragraphText = paragraph;\r\n\t\t\t\toptions.socket.sendMessage(\"complete\", paragraphResult, \"http://projects.csail.mit.edu/soylent/logger/logger.php\");\r\n\t\t\t});\r\n\t\t\t\r\n outputTimingData(patches, find_hit, fixHITs, verifyHITs);\r\n\t\t});\t\r\n\t}\r\n\t\r\n\tprint(json(result));\r\n\t\r\n\tif (rejectedWorkers.length > 0) {\r\n\t\tprint(\"Rejected workers:\");\r\n\t\tprint(json(rejectedWorkers.sort()));\r\n\t}\r\n \r\n if (options.writeOutput) {\r\n closeOutputs();\r\n }\r\n if (options.socket != null) {\r\n options.socket.close();\r\n }\r\n}", "function submitCheck(){\n if(on===true){//Locks game if on switch is not engaged.\n let check=0;\n for(let j=0;j<playerArray.length;j++){\n if(!strictOn){//The rules if strict mode disengaged.\n if(sequence[j] === playerArray[j]){ check++; }//Keeps running total of success.\n else{\n i=0;\n check=0;\n playerArray=[];\n center.style.background = 'red';//Mild red to signify a mistake.\n setTimeout(()=>{ center.style.background = '#ededcc'; }, 1000);\n setTimeout(()=>{ active(sequence[i]) }, 2000);\n }\n }else{//The rules if strict mode engaged.\n if(sequence[j] === playerArray[j]){ check++; }\n else{\n center.style.background = '#440000';//Angry red to signify complete failure.\n setTimeout(()=>{ center.style.background = '#ededcc'; }, 1000);\n//Intentionally turn game off to up the stakes:\n setTimeout(()=>{ pulse(); onOff(); }, 1000);\n }\n }\n }\n//Checks running total to determine if sequence completed:\n if(check === sequence.length){\n i=0;\n playerArray=[];\n startGame();\n }\n }\n}", "function nextStep(num) {\n var bw = []\n , guessForm = document.getElementById('input' + (num + 1))\n , objective = document.getElementById('input' + num).value\n , bwIndex;\n //Get b/w data from form\n bw[0] = parseInt(document.getElementById('black' + num).value, 10);\n bw[1] = parseInt(document.getElementById('white' + num).value, 10);\n //Eliminate all possiblities that aren't consistent with current state\n possible = eliminate(possible, objective, bw);\n //Incredibly original variable names!\n //Find next guess:\n if(bw[0] !== 4 && possible.length > 1) {\n bwIndex = bw.join(',');\n if(tempKnuth.hasOwnProperty(bwIndex)) {\n //Look up next guess\n tempKnuth = tempKnuth[bwIndex];\n if(tempKnuth !== undefined) {\n //We have another Knuth guess\n guessForm.value = tempKnuth.guess;\n }\n } else if (possible.length > 1) {\n //Knuth has failed us, time to brute force\n guessForm.value = possible[0];\n } else {\n console.log(possible);\n }\n } else if (possible.length === 1) {\n guessForm.value = possible[0];\n guessForm.style['background-color'] = '#00FF00';\n }\n}", "solve(){\r\n\t\tif (this.solutionCount >= this.maxSolutions){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor (let y = 0; y < GRID_SIZE; y++){\r\n\t\t\tfor (let x = 0; x < GRID_SIZE; x++){\r\n\t\t\t\tif (this.grid[y][x] == BLANK){\r\n\t\t\t\t\tfor (let i = 1; i <= MAX_NUMBERS; i++){\r\n\t\t\t\t\t\tif (this.isValid(x,y,i)){\r\n\t\t\t\t\t\t\tthis.grid[y][x] = i;\r\n\t\t\t\t\t\t\tthis.solve();\r\n\t\t\t\t\t\t\tthis.grid[y][x] = BLANK;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.solutionCount++;\r\n\t\tthis.solutions.push(this.snapshot(this.grid));\r\n\t}", "solve_intern(steps: number, gk: number) {\r\n let this2 = this;\r\n\r\n let dag_trigger = function () {\r\n this2.dag_update(\"on_solve\", true);\r\n\r\n //XXX hack, need to fix windowmanager.js to call this more often\r\n the_global_dag.exec(g_app_state.screen.ctx);\r\n }\r\n\r\n //propagate update flags to draw flags\r\n for (let v of this.verts) {\r\n if (v.flag & SplineFlags.UPDATE) {\r\n for (let i = 0; i < v.segments.length; i++) {\r\n let seg = v.segments[i];\r\n\r\n seg.flag |= SplineFlags.REDRAW_PRE;\r\n\r\n let l = seg.l;\r\n if (!l)\r\n continue;\r\n\r\n let _i = 0;\r\n do {\r\n if (_i++ > 5000) {\r\n console.warn(\"infinite loop!\");\r\n break;\r\n }\r\n\r\n l.f.flag |= SplineFlags.REDRAW_PRE;\r\n l = l.radial_next;\r\n } while (l !== seg.l);\r\n }\r\n }\r\n }\r\n\r\n this.propagate_draw_flags();\r\n\r\n if (window.DISABLE_SOLVE || config.DISABLE_SOLVE) {\r\n return new Promise((accept, reject) => {\r\n accept();\r\n });\r\n }\r\n\r\n if (!DEBUG.no_native && config.USE_WASM && native_api.isReady()) {\r\n let ret = native_api.do_solve(SplineFlags, this, steps, gk, true);\r\n\r\n ret.then(function () {\r\n this2._pending_solve = undefined;\r\n this2.solving = false;\r\n this2._do_post_solve();\r\n\r\n dag_trigger();\r\n\r\n if (this2._resolve_after) {\r\n let cb = this2._resolve_after;\r\n this2._resolve_after = undefined;\r\n\r\n this2._pending_solve = this2.solve_intern().then(function () {\r\n cb.call(this2);\r\n });\r\n this2.solving = true;\r\n }\r\n });\r\n\r\n return ret;\r\n } else if (!DEBUG.no_native && config.USE_NACL && window.common !== undefined && window.common.naclModule !== undefined) {\r\n let ret = do_solve(SplineFlags, this, steps, gk, true);\r\n\r\n ret.then(function () {\r\n this2._pending_solve = undefined;\r\n this2.solving = false;\r\n this2._do_post_solve();\r\n\r\n dag_trigger();\r\n\r\n if (this2._resolve_after) {\r\n let cb = this2._resolve_after;\r\n this2._resolve_after = undefined;\r\n\r\n this2._pending_solve = this2.solve_intern().then(function () {\r\n cb.call(this2);\r\n });\r\n this2.solving = true;\r\n }\r\n });\r\n\r\n return ret;\r\n } else {\r\n let do_accept;\r\n\r\n let promise = new Promise(function (accept, reject) {\r\n do_accept = function () {\r\n accept();\r\n }\r\n });\r\n\r\n let this2 = this;\r\n let timer = window.setInterval(function () {\r\n window.clearInterval(timer);\r\n\r\n do_solve(SplineFlags, this2, steps, gk);\r\n this2._pending_solve = undefined;\r\n this2.solving = false;\r\n\r\n do_accept();\r\n this2._do_post_solve();\r\n\r\n dag_trigger();\r\n\r\n if (this2._resolve_after) {\r\n let cb = this2._resolve_after;\r\n this2._resolve_after = undefined;\r\n\r\n this2._pending_solve = this2.solve_intern().then(function () {\r\n cb.call(this2);\r\n });\r\n this2.solving = true;\r\n }\r\n\r\n }, 10);\r\n\r\n return promise;\r\n }\r\n }", "function printSolution(pstx) {\n var nowX;\n var nowY;\n var nextX;\n var nextY;\n var sol = knightsBoards;\n //tells square number and path debugging purpose\n for (var y = 0; y < grid_N; y++) {\n for (var x = 0; x < grid_N; x++) {\n var z = x + (y * 10);\n //console.log(sol[x][y]);\n //console.log(\"square \" + z);\n }\n }\n // look for path\n for (var i = 0; i < 100; ++i) {\n //current point\n for (var y = 0; y < grid_N; y++) {\n for (var x = 0; x < grid_N; x++) {\n if (sol[x][y] == i) {\n nowX = x;\n nowY = y;\n }\n }\n }\n //next point\n for (var y = 0; y < grid_N; y++) {\n for (var x = 0; x < grid_N; x++) {\n //console.log(sol[x][y])\n if (sol[x][y] == (i + 1)) {\n nextX = x;\n nextY = y;\n }\n }\n }\n // draw lines\n pstx.beginPath();\n pstx.moveTo(nowX * 85 + 43, nowY * 85 + 43);\n pstx.lineTo(nextX * 85 + 43, nextY * 85 + 43);\n pstx.stroke();\n }\n}", "function check() {\n /**\n * check if output grid same as correct answer. if so, store info and move to next task\n */\n if (SENDING_TO_NEXT) {\n return;\n }\n update_grid_from_div($(`#output_grid .editable_grid`), CURRENT_OUTPUT_GRID);\n reference_output = TEST_PAIR.output.grid;\n submitted_output = CURRENT_OUTPUT_GRID.grid;\n\n for (i=0;i<ATTEMPT_JSONS.length;i++) {\n if (ATTEMPT_JSONS[i] == JSON.stringify(submitted_output)) {\n errorMsg(\"You have already tried this grid. Try a different output before checking your answer.\");\n return;\n }\n }\n\n // have to store as json string bc firebase cannot store nested arrays\n ATTEMPT_JSONS.push(JSON.stringify(submitted_output));\n\n if (reference_output.length != submitted_output.length || reference_output[0].length != submitted_output[0].length) {\n errorMsg(`Wrong answer. Try again. You have ${MAX_ATTEMPTS_BUILDER - ATTEMPT_JSONS.length} attempts left.`);\n ATTEMPTS_SEQUENCE.push({\n \"action\": {\"tool\": \"check\", \"correct\": false},\n \"grid\": array_copy(CURRENT_OUTPUT_GRID.grid),\n \"time\": (new Date() - START_DATE) / 1000\n });\n // used all attempts\n if (ATTEMPT_JSONS.length == MAX_ATTEMPTS_BUILDER) {\n SENDING_TO_NEXT = true;\n used_all_attempts();\n }\n return;\n }\n\n for (var i = 0; i < reference_output.length; i++) {\n ref_row = reference_output[i];\n for (var j = 0; j < ref_row.length; j++) {\n if (ref_row[j] != submitted_output[i][j]) {\n errorMsg(`Wrong answer. Try again. You have ${MAX_ATTEMPTS_BUILDER - ATTEMPT_JSONS.length} attempts left.`);\n ATTEMPTS_SEQUENCE.push({\n \"action\": {\"tool\": \"check\", \"correct\": false},\n \"grid\": array_copy(CURRENT_OUTPUT_GRID.grid),\n \"time\": (new Date() - START_DATE) / 1000\n });\n // used all attempts\n if (ATTEMPT_JSONS.length == MAX_ATTEMPTS_BUILDER) {\n SENDING_TO_NEXT = true;\n used_all_attempts();\n }\n return;\n }\n }\n }\n\n ATTEMPTS_SEQUENCE.push({\n \"action\": {\"tool\": \"check\", \"correct\": true},\n \"grid\": array_copy(CURRENT_OUTPUT_GRID.grid),\n \"time\": (new Date() - START_DATE) / 1000\n });\n\n SENDING_TO_NEXT = true;\n infoMsg(\"Correct!\");\n\n const newDate = new Date();\n const build_time = (newDate - START_DATE) / 1000;\n\n if (IS_VERIFICATION) {\n $(\"#speaker_certainty_modal\").modal('show');\n } else {\n\n show_loader();\n\n get_description_by_id(TASK_ID, DESC_ID, DESCRIPTIONS_TYPE).then(desc_to_update => {\n get_task_best_desc(TASK_ID, DESCRIPTIONS_TYPE).then(task_best => {\n\n let a = task_best.success_score + PRIORS[0];\n let b = (task_best.attempts - task_best.success_score) + PRIORS[1];\n \n let mean = a / (a + b);\n task_best.mean = mean;\n\n store_listener(DESC_ID, TASK_ID, uid, ATTEMPT_JSONS.length, ATTEMPT_JSONS, JSON.stringify(ATTEMPTS_SEQUENCE), build_time, true, DESCRIPTIONS_TYPE, maxIdleTime, task_best, desc_to_update, null, null)\n .then(function () { \n set_user_complete_time(uid, build_time, `${TASK_ID}_${DESCRIPTIONS_TYPE}_listener`).then(function() {\n next_task(TIMING_CREDIT / 60); \n }).catch(function (error) { console.error('Error storing response ' + error); });\n })\n .catch(function (error) { console.error(\"Error storing response: \" + error); });\n \n }).catch(err => {\n console.error(err);\n });\n });\n }\n}", "function main(){\r\n\tcur_t = 0\r\n\tkill_step = poisson(kill_step);\r\n\tcount_step = 0;\r\n\t//do {\r\n\tvar times = setInterval(function(){\r\n\t\tif (cur_t == steps) clearInterval(times);\r\n\r\n\t\tvar temp = couple_logistic_possison(pop, params, steps);\r\n\t\tif (count_step == kill_step){\r\n\t\t\tcata(kill_percentage, pop);\r\n\t\t\tkill_step = poisson(kill_step);\r\n\t\t\tcount_step = 0;\r\n\t\t}\r\n\r\n\t\tshow_graphics(temp);\r\n\r\n\t\tcur_t += 1;\r\n\t\tcount_step += 1;\r\n\t\treturn temp;\r\n\t\t}, 35);\r\n\t//} while (cur_t < steps)\t\r\n}", "think() {\r\n\r\n // First find the closest pipe\r\n let closest = null;\r\n let secclosest = null;\r\n let thirclosest = null;\r\n let record = Infinity;\r\n let recordtwo = Infinity;\r\n let recordthree = Infinity;\r\n for (let i = 0; i < cacti.length; i++) {\r\n let diff = cacti[i].x - this.x;\r\n if (diff > 0 && diff < record) {\r\n record = diff;\r\n closest = cacti[i];\r\n if(record < recordtwo){\r\n let temp = record;\r\n record = recordtwo;\r\n recordtwo = temp;\r\n secclosest = cacti[i];\r\n }\r\n if(recordtwo < recordthree){\r\n let temp = record;\r\n record = recordthree;\r\n recordthree = temp;\r\n thirclosest = cacti[i];\r\n }\r\n\r\n }\r\n }\r\n\r\n if (closest != null) {\r\n // Now create the inputs to the neural network\r\n let inputs = [];\r\n // x position of three closest cacti\r\n inputs[0] = map(closest.x, this.x, width, 0, 1);\r\n inputs[1] = map(secclosest.x, this.x, width, 0, 1);\r\n inputs[2] = map(thirclosest.x, this.x, width, 0, 1);\r\n // top of closest cactus\r\n inputs[3] = map(height/2 - closest.h, 0, height, 0, 1);\r\n // dino's y position\r\n inputs[4] = map(this.y, 0, height, 0, 1);\r\n // dino's y velocity\r\n inputs[5] = map(this.velocity, -5, 5, 0, 1);\r\n\r\n // Get the outputs from the network\r\n let action = this.brain.predict(inputs);\r\n // Decide to jump or not! (Jump is possible every 700ms)\r\n if (action[1] > action[0]) {\r\n if(this.y == height/2){\r\n this.up();\r\n }\r\n }\r\n }\r\n }", "runGeneration() {\n this.sort();\n \n const crossoverList = this.solutions[0].crossover(this.solutions[1]);\n this.solutions.push(crossoverList);\n \n for (let i=0; i<this.getSize(); i++) {\n if (utils.randPercent < this.mutationRate) {\n this.mutateSolution(this.solution[i]);\n }\n }\n }", "handleSolve() { \n if(!solving) {\n solving = true;\n grid = this.state.squares;\n for(let i = 0; i < 800; ++i) {\n if(grid[i] === 'p') {\n grid[i] = null;\n }\n if(!grid[i]) {\n document.getElementsByClassName('square')[i].style = 'background-color: white';\n }\n }\n visitedNodes = [];\n finalPath = [];\n //Deals with invalid grid\n if(!(start && end)) {\n this.setState({squares: grid});\n solving = false;\n alert('You must choose a start and an end!');\n return;\n }\n let solvable;\n if(algo === 1) {\n solvable = breadthFirstMain();\n } else if(algo === 2) {\n solvable = depthFirstMain();\n } else if(algo === 3){\n solvable = djikstrasMain();\n } else if(algo === 4){\n solvable = bellmanFordMain();\n } else {\n solvable = aStarMain();\n }\n let i = 0;\n let time = (algo == 4)? 5 : 10;\n //Displaying the result\n if(working) {\n let handle = setInterval(function() {\n if(visitedNodes.length !== 0) {\n colorGrid(i);\n }\n i = i + 2;\n if(i >= visitedNodes.length) {\n clearInterval(handle);\n if(solvable) {\n for(let i = finalPath.length - 1; i >= 0; i = i - 2) {\n document.getElementsByClassName('square')[finalPath[i - 1] * 40 + finalPath[i]].style = 'background-color: yellow';\n }\n } else {\n alert('No path found!');\n }\n solving = false;\n }\n }, time);\n } else {\n if(solvable) {\n for(let i = finalPath.length - 1; i >= 0; i = i - 2) {\n document.getElementsByClassName('square')[finalPath[i - 1] * 40 + finalPath[i]].style = 'background-color: yellow';\n }\n } else {\n alert('No path found!');\n }\n solving = false;\n }\n isSolved();\n }\n }", "playGame() {\n let oversleft = this.oversleft;\n let wicketsLeft = this.wicketsLeft;\n let runsRequired = this.runsRequired;\n\n if (Utils.validateNonNumericArray(this.validSingleBallScoreList)) {\n throw new Error('Invalid Single Ball Score List');\n }\n\n if (oversleft <= 0) {\n throw new Error('Invalid Overs');\n }\n\n if (wicketsLeft <= 0) {\n throw new Error('Invalid Wickets');\n }\n\n if (runsRequired <= 0) {\n throw new Error('Invalid Runs');\n }\n\n let overBall = 0;\n let nextBallResult;\n let batsmanToBat = [];\n const totalOvers = this.oversleft;\n\n batsmanToBat = Utils.getArrayColumn(this.batsmenMatrix, 0);\n if (batsmanToBat.length !== wicketsLeft) {\n throw new Error('Invalid Batsman Length');\n }\n\n const batsmanOnField = [];\n batsmanOnField.push(batsmanToBat.shift(), batsmanToBat.shift());\n console.log(`${oversleft} left.${runsRequired} runs to win.`);\n\n while (runsRequired && wicketsLeft && oversleft) {\n try {\n nextBallResult = this.predictNextBall(batsmanOnField[0]);\n } catch (exc) {\n throw exc;\n }\n overBall += 1;\n console.log(`${totalOvers - oversleft}.${overBall} ${batsmanOnField[0]} scored ${nextBallResult} run(s)`);\n\n if (nextBallResult === -1) {\n wicketsLeft -= 1;\n batsmanOnField.shift();\n if (batsmanToBat.length) {\n batsmanOnField.unshift(batsmanToBat.shift());\n }\n } else {\n runsRequired -= nextBallResult;\n }\n\n changeEnd(nextBallResult, batsmanOnField);\n\n if (runsRequired <= 0) {\n result = 1;\n break;\n }\n\n if (overBall === ballsPerOver) {\n changeEnd(nextBallResult, batsmanOnField);\n oversleft -= 1;\n overBall = 0;\n console.log(`${oversleft} left.${runsRequired} runs to win.`);\n }\n }\n\n if (result) {\n console.log('Batting Team won');\n } else {\n console.log('Batting log lost');\n }\n return result;\n }", "function solveSmallDeepeningTask(sdt, resolverArray) {\n\n //**console.log(sdt.wPlayer)\n\n //this is the function that runs a million times\n\n // var sdt.depth = sdt.depth\n\n // var sdt.table = sdt.table\n\n // var sdt.score = new Int32Array(1)\n // var sdt.score = sdt.score\n\n //gets one task, produces an array of more tasks\n //or empty array when done\n\n var result = []\n\n var newWNext = !sdt.wNext;\n\n if (sdt.depth === 2) { //on 2nd level remove invalids\n if (captured(sdt.table, newWNext)) {\n //invalid move, sakkban maradt\n\n result = [new SmallDeepeningTask(sdt.table, newWNext, sdt.depth + 1,\n sdt.moveTree, sdt.desiredDepth, 100,\n sdt.wPlayer, false, sdt.gameNum,\n sdt.mod, sdt.shouldIDraw)]\n\n }\n\n }\n\n //these new tasks go to a fifo array, we solve the tree bit by bit\n //keeping movestrings only, not eating memory with tables\n\n //get hitvalue for each move, keep best ones only\n //end of tree check if we got it wrong and go back if treevalue gets less!!!!!!!!!!!!!!!!\n\n if (sdt.trItm) { //we solved all moves for a table, time to go backwards\n\n //do some work in resolverArray\t\t\n //then clear that array\n\n resolveDepth(sdt.depth, resolverArray)\n\n } else {\n\n if (sdt.depth > sdt.desiredDepth) { //depth +1\n\n resolverArray[sdt.depth][resolverArray[sdt.depth].length] = new ResolverItem(sdt.score,\n sdt.moveTree, sdt.wPlayer); //this will fill in and then gets reduced to best movevalue only\n\n } else {\n\n var isNegative = (sdt.depth & 1)\n\n if (sdt.depth === sdt.desiredDepth) {\n //////depth reached, eval table\n\n var newScore;// = new Int32Array(1)\n\n //**console.log(sdt.shouldIDraw)\n\n if (isNegative) {\n\n newScore = (sdt.score << 16) - getHitScores(sdt.table,\n sdt.wNext, false, sdt.wPlayer,\n sdt.mod, sdt.shouldIDraw)[0]\n\n } else {\n\n newScore = (sdt.score << 16) + getHitScores(sdt.table,\n sdt.wNext, true, sdt.wPlayer,\n sdt.mod, sdt.shouldIDraw)[0]\n }\n\n result[result.length] = new SmallDeepeningTask(\n [], //no table\n newWNext,\n sdt.depth + 1,\n sdt.moveTree,\n sdt.desiredDepth,\n newScore, //sdt.score + thisValue\n sdt.wPlayer,\n false,\n sdt.gameNum,\n sdt.mod,\n sdt.shouldIDraw\n )\n\n } else {\n\n //depth not solved, lets solve it further\n\n var possibleMoves = []\n\n //below returns a copied table, should opt out for speed!!!!!!!\n\n addMovesToTable(sdt.table, sdt.wNext, true, possibleMoves) //this puts moves in strings, should keep it fastest possible\n\n //true to \t\t\t\t//it will not remove invalid moves to keep fast \n //keep illegal\t\t\t//we will remove them later when backward processing the tree\n\n //here we have possiblemoves filled in with good, bad and illegal moves\n\n for (var i = possibleMoves.length - 1; i >= 0; i -= 1) {\n\n var moveCoords = possibleMoves[i]\n\n var movedTable = []\n\n movedTable = fastMove(moveCoords, sdt.table, true) //speed! put this if out of here, makeamove only false at the last run\n\n\n var whatGetsHit = sdt.table[moveCoords[2]][moveCoords[3]];\n\n var thisValue = whatGetsHit[1] * 100//piece value, should += 1 when en-pass\n\n var valueToSave\n\n if (isNegative) { //does this work???!!!!!!!!!!!\n\n valueToSave = sdt.score - thisValue\n } else {\n\n valueToSave = sdt.score + thisValue\n }\n\n var newMoveTree = sdt.moveTree.concat([moveCoords,\n valueToSave])\n\n result[result.length] = new SmallDeepeningTask(\n movedTable,\n newWNext,\n sdt.depth + 1,\n newMoveTree,\n sdt.desiredDepth,\n valueToSave, //sdt.score + thisValue\n sdt.wPlayer,\n false,\n sdt.gameNum,\n sdt.mod,\n sdt.shouldIDraw\n )\n\n\n } // ) //end of for each move\n\n }\n\n result[result.length] = new TriggerItem(sdt.depth + 1, sdt.moveTree,\n sdt.wPlayer)\n //this will trigger move calc when processing array (will be placed before each set of smalltasks)\n\n }\n\n }\n\n return result\n\n}", "async function quickSolve() {\n let one = 0;\n for (let i = 0; i < GAME_STATE.length; i++) {\n if (GAME_STATE[i] === '0' && one === 0) {\n one = 1;\n } else if (GAME_ORIGINAL_STATE[i] === '0') {\n let theNumber = hardGames[GAME_NUMBER]['answer'][i];\n allTapBoxes[i].innerHTML = theNumber;\n GAME_STATE = GAME_STATE.replaceAt(i, theNumber.toString());\n localStorage.setItem('hardGameState', GAME_STATE);\n }\n }\n}", "function computerMove() {\n \n // get possible computer moves\n var compMoves = possibleMoves($('.pieceComputer').parent().attr('data-pos'),true,$('.piecePlayer').parent().attr('data-pos'),null); \n \n // get possible wall placements\n var noWalls = $(\"#nowalls\").val();\n noWalls = noWalls.split(','); \n \n // begin simulation \n simulation(noWalls,compMoves[1]);\n \n function simulation(wallSimulations,moveSimulations) {\n var playerWallsLeft = $('#showPlayerPieces').children().next().text();\n var compWallsLeft = $('#showCompPieces').children().next().text();\n var playerLoc = parseInt($('.piecePlayer').parent().attr('data-pos')); \n var oppLoc = parseInt($('.pieceComputer').parent().attr('data-pos')); \n var walls = $(\"#walls\").val(); \n var noWalls = $(\"#nowalls\").val().split(','); \n var arrWins_moves = new Array(0,0,0,0,0,0); \n var arrShortestMoves_b = shortestPath(null,null,null);\n var arrShortestMoves_a = new Array(); \n for (var p=0;p<wallSimulations.length;p++) { \n if (wallSimulations[p]=='') { break; }\n var limit = 0; \n // place current wall down and update board\n var whatWallPlace = $('#board td[data-pos='+wallSimulations[p]+']').attr('class');\n if (whatWallPlace==\"wallPlacementHoriz\") { \n var wallDown = placeHorizWall_COMPUTE(wallSimulations[p],noWalls,walls,playerWallsLeft,compWallsLeft,playerLoc,oppLoc,'c'); \n if (wallDown!='illegal') { var passW = wallDown[1].split(\",\").join(\",\"); } \n } \n else if (whatWallPlace==\"wallPlacementVert\") { \n var wallDown = placeVertWall_COMPUTE(wallSimulations[p],noWalls,walls,playerWallsLeft,compWallsLeft,playerLoc,oppLoc,'c');\n if (wallDown!='illegal') { var passW = wallDown[1].split(\",\").join(\",\"); } \n } \n // update shortest path for player and computer with each wall \n if (wallDown=='illegal') { var sp_a = new Array(0,0); } \n else { var sp_a = shortestPath(passW,null,null); } \n arrShortestMoves_a.push(sp_a);\n } \n var bestWall_sp = null; \n var worstLen = 0;\n var worstWallForComp = null;\n var wallPreventTrap = null;\n var doublePlaceWall = null;\n var doubleWallPathLen = 0;\n var futureWall = false; \n var high_change_player = arrShortestMoves_b[0]; \n var low_change_computer = arrShortestMoves_b[1]; \n var ranChancePlace = Math.random(); \n // determine if computer might fall into trap\n for (var q=0;q<arrShortestMoves_a.length;q++) { \n if (arrShortestMoves_a[q][1]>=low_change_computer+2 && wallSimulations[q]!='' && arrShortestMoves_a[q][1]>=worstLen) {\n worstWallForComp=q;\n worstLen = arrShortestMoves_a[q][1]; \n } \n } \n // find SINGLE wall that can trap computer and prevent it\n var walls_t = $(\"#walls\").val(); \n var noWalls_t = $(\"#nowalls\").val().split(',');\n if (worstWallForComp!=null && parseInt($('#showPlayerPieces').children().next().text())>1 && parseInt($('#showCompPieces').children().next().text())>0) {\n var whatWallBlocker = $('#board td[data-pos='+wallSimulations[worstWallForComp]+']').attr('class'); \n if (whatWallBlocker==\"wallPlacementHoriz\") { \n var nextPart = $('#board td[data-pos='+(wallSimulations[worstWallForComp])+']').next().next().attr('data-pos'); \n var walls_with_blocker = wallSimulations[worstWallForComp] + \",\" + nextPart;\n var inNo = placeHorizWall_COMPUTE(wallSimulations[worstWallForComp],noWalls_t,walls_t,10,10,playerLoc,oppLoc,'c'); \n }\n else if (whatWallBlocker==\"wallPlacementVert\") {\n var nvf = parseInt(wallSimulations[worstWallForComp].substr(0,wallSimulations[worstWallForComp].indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(wallSimulations[worstWallForComp].substr(wallSimulations[worstWallForComp].indexOf(\"-\")+1)) + boardWidth;\n var nextPart = nvf+\"-\"+nvs; \n var walls_with_blocker = wallSimulations[worstWallForComp] + \",\" + nextPart; \n var inNo = placeVertWall_COMPUTE(wallSimulations[worstWallForComp],noWalls_t,walls_t,10,10,playerLoc,oppLoc,'c');\n } \n for (var t=0;t<wallSimulations.length;t++) { \n if (inNo[0].indexOf(wallSimulations[t])!=-1) {\n var whatWallPlace = $('#board td[data-pos='+wallSimulations[t]+']').attr('class');\n if (whatWallPlace==\"wallPlacementHoriz\") { \n var test_wall_1 = wallSimulations[t];\n var test_wall_2 = $('#board td[data-pos='+(test_wall_1)+']').next().next().attr('data-pos'); \n var checkLegal = shortestPath(inNo[1]+\",\"+test_wall_1+\",\"+test_wall_2,null,null);\n if (checkLegal[1]==0) { \n wallPreventTrap = wallSimulations[t]; \n var actuallyLegal = pathToEndExists(wallPreventTrap+\",\"+test_wall_2,null,null); \n if (!actuallyLegal) { wallPreventTrap = null; }\n else { console.log(\"SINGLE TRAP: \"+wallSimulations[worstWallForComp]+\",\"+wallSimulations[t]); break; } \n } \n } \n else if (whatWallPlace==\"wallPlacementVert\") { \n var test_wall_1 = wallSimulations[t];\n var nvf = parseInt(test_wall_1.substr(0,test_wall_1.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1.substr(test_wall_1.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2 = nvf+\"-\"+nvs; \n var checkLegal = shortestPath(inNo[1]+\",\"+test_wall_1+\",\"+test_wall_2,null,null);\n if (checkLegal[1]==0) { \n wallPreventTrap = wallSimulations[t]; \n var actuallyLegal = pathToEndExists(wallPreventTrap+\",\"+test_wall_2,null,null);\n if (!actuallyLegal) { wallPreventTrap = null; }\n else { console.log(\"SINGLE TRAP: \"+wallSimulations[worstWallForComp]+\",\"+wallSimulations[t]); break; } \n } \n } \n } \n } \n } \n // find DOUBLE wall that can trap computer and (try to) prevent it (takes ~ 4 seconds) \n var walls_td = $(\"#walls\").val(); \n var noWalls_td = $(\"#nowalls\").val().split(','); \n var countD = 0; \n if (wallPreventTrap==null && parseInt($('#showPlayerPieces').children().next().text())>1 && parseInt($('#showCompPieces').children().next().text())>0 && \n arrShortestMoves_b[1]-arrShortestMoves_b[0]<=-2) { \n var compLoc = parseInt($('.pieceComputer').parent().attr('data-pos'));\n var finalLocToCheck = null;\n var fromLoc = wallSimulations.indexOf(compLoc-1+\"-\"+compLoc); \n if (fromLoc==-1) {\n var nextLoc = wallSimulations.indexOf(compLoc+\"-\"+compLoc+1);\n if (nextLoc==-1) {\n nextLoc = wallSimulations.indexOf(compLoc-9+\"-\"+compLoc); \n if (nextLoc==-1) { finalLocToCheck = null; } \n else { finalLocToCheck = nextLoc; } \n } else { finalLocToCheck = nextLoc; }\n } else { finalLocToCheck = fromLoc; } \n // find player double blocking walls\n for (var t=finalLocToCheck+35;t>finalLocToCheck-35;t--) { \n if (wallPreventTrap==null && typeof wallSimulations[t]!='undefined') { \n var whatWallPlace_0 = $('#board td[data-pos='+wallSimulations[t]+']').attr('class'); \n if (whatWallPlace_0==\"wallPlacementHoriz\") { \n var test_wall_1 = wallSimulations[t];\n var test_wall_2 = $('#board td[data-pos='+(test_wall_1)+']').next().next().attr('data-pos'); \n var checkLegal = placeHorizWall_COMPUTE(test_wall_1,noWalls_td,walls_td,10,10,playerLoc,oppLoc,'c'); \n } else if (whatWallPlace_0==\"wallPlacementVert\") { \n var test_wall_1 = wallSimulations[t];\n var nvf = parseInt(test_wall_1.substr(0,test_wall_1.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1.substr(test_wall_1.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2 = nvf+\"-\"+nvs; \n var checkLegal = placeVertWall_COMPUTE(test_wall_1,noWalls_td,walls_td,10,10,playerLoc,oppLoc,'c'); \n } \n if (checkLegal!='illegal' && typeof checkLegal!='undefined' && typeof checkLegal[0]!='undefined' && checkLegal[0]!='' && checkLegal[0]!=' ') { \n for (var a=finalLocToCheck+35;a>finalLocToCheck-35;a--) { \n if (test_wall_1!=wallSimulations[a] && test_wall_2!=wallSimulations[a] && wallPreventTrap==null &&\n checkLegal[0].toString().indexOf(wallSimulations[a])!=-1 && typeof wallSimulations[a]!='undefined') {\n var whatWallPlace_2 = $('#board td[data-pos='+wallSimulations[a]+']').attr('class'); \n if (whatWallPlace_2==\"wallPlacementHoriz\") {\n var test_wall_1_1 = wallSimulations[a];\n var test_wall_2_2 = $('#board td[data-pos='+(test_wall_1_1)+']').next().next().attr('data-pos'); \n var checkLegal_2 = placeHorizWall_COMPUTE(test_wall_1_1,checkLegal[0].join(\",\").split(\",\"),checkLegal[1],10,10,playerLoc,oppLoc,'c'); \n }\n else if (whatWallPlace_2==\"wallPlacementVert\") { \n var test_wall_1_1 = wallSimulations[a];\n var nvf = parseInt(test_wall_1_1.substr(0,test_wall_1_1.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1_1.substr(test_wall_1_1.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2_2 = nvf+\"-\"+nvs; \n var checkLegal_2 = placeVertWall_COMPUTE(test_wall_1_1,checkLegal[0].join(\",\").split(\",\"),checkLegal[1],10,10,playerLoc,oppLoc,'c'); \n } \n if (checkLegal_2!='illegal' && typeof checkLegal_2!='undefined') { \n var sp_t = shortestPath($(\"#walls\").val()+\",\"+test_wall_1+\",\"+test_wall_2+\",\"+test_wall_1_1+\",\"+test_wall_2_2,null,null);\n if (sp_t[1]>=low_change_computer+5) {\n // find one wall computer can place to make it all illegal \n for (var z=finalLocToCheck-35;z<finalLocToCheck+35;z++) { \n if (wallPreventTrap==null && test_wall_1!=wallSimulations[z] && test_wall_2!=wallSimulations[z] && \n test_wall_1_1!=wallSimulations[z] && test_wall_2_2!=wallSimulations[z] && typeof wallSimulations[z]!='undefined' &&\n checkLegal_2[0].toString().indexOf(wallSimulations[z])!=-1) {\n var whatWallPlace_5 = $('#board td[data-pos='+wallSimulations[z]+']').attr('class'); \n if (whatWallPlace_5==\"wallPlacementHoriz\") {\n var test_wall_1_z = wallSimulations[z];\n var test_wall_2_z = $('#board td[data-pos='+(test_wall_1_z)+']').next().next().attr('data-pos'); \n }\n else if (whatWallPlace_5==\"wallPlacementVert\") { \n var test_wall_1_z = wallSimulations[z];\n var nvf = parseInt(test_wall_1_z.substr(0,test_wall_1_z.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1_z.substr(test_wall_1_z.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2_z = nvf+\"-\"+nvs; \n }\n var checkLegal_5 = pathToEndExists(test_wall_1+\",\"+test_wall_2+\",\"+test_wall_1_1+\",\"+test_wall_2_2+\",\"+test_wall_1_z+\",\"+test_wall_2_z,null,null); \n if (!checkLegal_5) { \n wallPreventTrap = wallSimulations[z]; \n var actuallyLegal = pathToEndExists(wallPreventTrap+\",\"+test_wall_2_z,null,null);\n if (!actuallyLegal) { wallPreventTrap = null; }\n else { wallPreventTrap = \"tempfake\"; } \n } \n }\n }\n // find two walls computer can place to make it all illegal\n for (var b=finalLocToCheck-90;b<finalLocToCheck+10;b++) { \n if (wallPreventTrap==null && test_wall_1!=wallSimulations[b] && test_wall_2!=wallSimulations[b] && \n test_wall_1_1!=wallSimulations[b] && test_wall_2_2!=wallSimulations[b] && typeof wallSimulations[b]!='undefined') { \n var whatWallPlace_3 = $('#board td[data-pos='+wallSimulations[b]+']').attr('class'); \n if (whatWallPlace_3==\"wallPlacementHoriz\") { \n var test_wall_1_b = wallSimulations[b];\n var test_wall_2_b = $('#board td[data-pos='+(test_wall_1_b)+']').next().next().attr('data-pos'); \n var checkLegal_3 = placeHorizWall_COMPUTE(test_wall_1_b,checkLegal_2[0].join(\",\").split(\",\"),checkLegal_2[1]+\",\"+test_wall_1_1+\",\"+test_wall_2_2,10,10,playerLoc,oppLoc,'c');\n } else if (whatWallPlace_3==\"wallPlacementVert\") { \n var test_wall_1_b = wallSimulations[b];\n var nvf = parseInt(test_wall_1_b.substr(0,test_wall_1_b.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1_b.substr(test_wall_1_b.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2_b = nvf+\"-\"+nvs; \n var checkLegal_3 = placeVertWall_COMPUTE(test_wall_1_b,checkLegal_2[0].join(\",\").split(\",\"),checkLegal_2[1]+\",\"+test_wall_1_1+\",\"+test_wall_2_2,10,10,playerLoc,oppLoc,'c'); \n }\n if (checkLegal_3!='illegal' && typeof checkLegal_3!='undefined') { \n for (var c=finalLocToCheck-90;c<finalLocToCheck+10;c++) { \n if (wallPreventTrap==null && test_wall_1!=wallSimulations[c] && test_wall_2!=wallSimulations[c] && \n test_wall_1_1!=wallSimulations[c] && test_wall_2_2!=wallSimulations[c] && test_wall_1_b!=wallSimulations[c] &&\n test_wall_2_b!=wallSimulations[c] && typeof wallSimulations[c]!='undefined' \n && checkLegal_3[0].toString().indexOf(wallSimulations[c])!=-1) {\n var whatWallPlace_4 = $('#board td[data-pos='+wallSimulations[c]+']').attr('class'); \n if (whatWallPlace_4==\"wallPlacementHoriz\") {\n var test_wall_1_c = wallSimulations[c];\n var test_wall_2_c = $('#board td[data-pos='+(test_wall_1_c)+']').next().next().attr('data-pos'); \n }\n else if (whatWallPlace_4==\"wallPlacementVert\") { \n var test_wall_1_c = wallSimulations[c];\n var nvf = parseInt(test_wall_1_c.substr(0,test_wall_1_c.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1_c.substr(test_wall_1_c.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2_c = nvf+\"-\"+nvs; \n }\n var checkLegal_4 = pathToEndExists(test_wall_1+\",\"+test_wall_2+\",\"+test_wall_1_1+\",\"+test_wall_2_2+\",\"+test_wall_1_b+\",\"+test_wall_2_b+\",\"+test_wall_1_c+\",\"+test_wall_2_c,null,null); \n if (!checkLegal_4) { \n wallPreventTrap = wallSimulations[b]; \n var actuallyLegal = pathToEndExists(test_wall_1_b+\",\"+test_wall_2_b+\",\"+test_wall_1_c+\",\"+test_wall_2_c,null,null); \n if (!actuallyLegal) { wallPreventTrap = null; } \n console.log(test_wall_1+\",\"+test_wall_2+\",\"+test_wall_1_1+\",\"+test_wall_2_2+\",\"+test_wall_1_b+\",\"+test_wall_2_b+\",\"+test_wall_1_c+\",\"+test_wall_2_c); \n //countD++; if (countD>5000) { wallPreventTrap='tempfake'; } \n console.log(\"DOUBLE TRAP\");\n } \n }\n }\n } \n }\n } \n } \n } \n }\n } \n } \n }\n }\n } \n if (wallPreventTrap=='tempfake') { wallPreventTrap=null; } \n // determine SINGLE wall that slows player \n for (var k=0;k<arrShortestMoves_a.length;k++) { \n if (arrShortestMoves_a[k][0]>=high_change_player) { \n bestWall_sp=k; \n high_change_player = arrShortestMoves_a[k][0]; \n } \n } \n // play N=2 moves into future and see if SINGLE wall should wait (only if player has no walls) \n var pMoves = possibleMoves($('.piecePlayer').parent().attr('data-pos'),true,$('.pieceComputer').parent().attr('data-pos'),null);\n if (parseInt($('#showPlayerPieces').children().next().text())==0 && parseInt($('#showCompPieces').children().next().text())>0 && \n pMoves[1].indexOf(0)==-1 && pMoves[1].indexOf(1)==-1 && pMoves[1].indexOf(2)==-1 && pMoves[1].indexOf(3)==-1 &&\n pMoves[1].indexOf(4)==-1 && pMoves[1].indexOf(5)==-1 && pMoves[1].indexOf(6)==-1 && pMoves[1].indexOf(7)==-1 && pMoves[1].indexOf(8)==-1) {\n var playerMoves_1 = possibleMoves($('.piecePlayer').parent().attr('data-pos'),true,$('.pieceComputer').parent().attr('data-pos'),null); \n var move_sp = 100;\n var tempLoc_1 = null;\n for (var p=0;p<playerMoves_1[1].length;p++) { \n var temp_sp = shortestPath(null,null,playerMoves_1[1][p]);\n if (temp_sp[0]<move_sp) {\n move_sp = temp_sp[0]; \n tempLoc_1 = p; \n }\n }\n var playerMoves_2 = possibleMoves(playerMoves_1[1][tempLoc_1],true,$('.pieceComputer').parent().attr('data-pos'),null); \n var move_sp = 100;\n var tempLoc_2 = null;\n for (var p=0;p<playerMoves_2[1].length;p++) { \n var temp_sp = shortestPath(null,null,playerMoves_2[1][p]);\n if (temp_sp[0]<move_sp) {\n move_sp = temp_sp[0]; \n tempLoc_2 = p; \n }\n }\n var walls_f = $(\"#walls\").val(); \n var noWalls_f = $(\"#nowalls\").val().split(',');\n for (var p=0;p<wallSimulations.length;p++) { \n if (wallSimulations[p]!='') { \n var whatWallPlace = $('#board td[data-pos='+wallSimulations[p]+']').attr('class');\n if (whatWallPlace==\"wallPlacementHoriz\") { \n var wallDown_1 = placeHorizWall_COMPUTE(wallSimulations[p],noWalls_f,walls_f,playerWallsLeft,compWallsLeft,playerMoves_1[1][tempLoc_1],oppLoc,'c'); \n if (wallDown_1!='illegal') { \n var passW_1 = wallDown_1[1].split(\",\").join(\",\"); \n var sp_a_1 = shortestPath(passW_1,null,playerMoves_1[1][tempLoc_1]);\n } \n var wallDown_2 = placeHorizWall_COMPUTE(wallSimulations[p],noWalls_f,walls_f,playerWallsLeft,compWallsLeft,playerMoves_2[1][tempLoc_2],oppLoc,'c'); \n if (wallDown_2!='illegal') { \n var passW_2 = wallDown_2[1].split(\",\").join(\",\"); \n var sp_a_2 = shortestPath(passW_2,null,playerMoves_2[1][tempLoc_2]);\n } \n } \n else if (whatWallPlace==\"wallPlacementVert\") { \n var wallDown_1 = placeVertWall_COMPUTE(wallSimulations[p],noWalls_f,walls_f,playerWallsLeft,compWallsLeft,playerMoves_1[1][tempLoc_1],oppLoc,'c'); \n if (wallDown_1!='illegal') { \n var passW_1 = wallDown_1[1].split(\",\").join(\",\"); \n var sp_a_1 = shortestPath(passW_1,null,playerMoves_1[1][tempLoc_1]);\n } \n var wallDown_2 = placeVertWall_COMPUTE(wallSimulations[p],noWalls_f,walls_f,playerWallsLeft,compWallsLeft,playerMoves_2[1][tempLoc_2],oppLoc,'c'); \n if (wallDown_2!='illegal') { \n var passW_2 = wallDown_2[1].split(\",\").join(\",\"); \n var sp_a_2 = shortestPath(passW_2,null,playerMoves_2[1][tempLoc_2]);\n } \n } \n if (wallDown_1!='illegal') { \n if (sp_a_1[0]>high_change_player) {\n futureWall = true;\n console.log(\"WALL WILL BE BETTER IN THE FUTURE\"); \n }\n }\n if (wallDown_2!='illegal') {\n if (sp_a_2[0]>high_change_player) {\n futureWall = true;\n console.log(\"WALL WILL BE BETTER IN THE FUTURE\"); \n }\n }\n } \n } \n }\n var playerLoc = parseInt($('.piecePlayer').parent().attr('data-pos'));\n var compWallsLeft = $('#showCompPieces').children().next().text();\n var finalLocToCheck = null;\n var fromLoc = wallSimulations.indexOf(playerLoc-1+\"-\"+playerLoc); \n if (fromLoc==-1) {\n var nextLoc = wallSimulations.indexOf(playerLoc+\"-\"+playerLoc+1);\n if (nextLoc==-1) {\n nextLoc = wallSimulations.indexOf(playerLoc-9+\"-\"+playerLoc); \n if (nextLoc==-1) { \n nextLoc = wallSimulations.indexOf(playerLoc+\"-\"+playerLoc+9);\n if (nextLoc==-1) {\n finalLocToCheck = null; \n console.log(\"CANT ATTEMPT DOUBLE WALL\"); \n } \n } else { finalLocToCheck = nextLoc; } \n } else { finalLocToCheck = nextLoc; }\n } else { finalLocToCheck = fromLoc; } \n var walls_d = $(\"#walls\").val(); \n var noWalls_d = $(\"#nowalls\").val().split(',');\n // determine DOUBLE wall that slows player if computer is behind at least 2 spaces (takes ~ 4 seconds)\n if (finalLocToCheck!=null) {\n for (var t=finalLocToCheck-25;t<finalLocToCheck+25;t++) { \n if (doublePlaceWall==null && compWallsLeft>1 && typeof wallSimulations[t] != 'undefined' && playerWallsLeft-compWallsLeft<4 && \n arrShortestMoves_b[1]-arrShortestMoves_b[0]>=2) { \n var whatWallPlace = $('#board td[data-pos='+wallSimulations[t]+']').attr('class'); \n if (whatWallPlace==\"wallPlacementHoriz\") { \n var test_wall_1 = wallSimulations[t];\n var test_wall_2 = $('#board td[data-pos='+(test_wall_1)+']').next().next().attr('data-pos');\n var checkLegal = placeHorizWall_COMPUTE(test_wall_1,noWalls_d,walls_d,10,10,playerLoc,oppLoc,'c'); \n } else if (whatWallPlace==\"wallPlacementVert\") { \n var test_wall_1 = wallSimulations[t];\n var nvf = parseInt(test_wall_1.substr(0,test_wall_1.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1.substr(test_wall_1.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2 = nvf+\"-\"+nvs; \n var checkLegal = placeVertWall_COMPUTE(test_wall_1,noWalls_d,walls_d,10,10,playerLoc,oppLoc,'c'); \n }\n if (checkLegal!='illegal') { \n for (var a=finalLocToCheck-25;a<finalLocToCheck+25;a++) { \n if (checkLegal[0].indexOf(wallSimulations[a])!=-1) {\n var whatWallPlace_2 = $('#board td[data-pos='+wallSimulations[a]+']').attr('class'); \n if (whatWallPlace_2==\"wallPlacementHoriz\") {\n var test_wall_1_1 = wallSimulations[a];\n var test_wall_2_2 = $('#board td[data-pos='+(test_wall_1_1)+']').next().next().attr('data-pos'); \n }\n else if (whatWallPlace_2==\"wallPlacementVert\") { \n var test_wall_1_1 = wallSimulations[a];\n var nvf = parseInt(test_wall_1_1.substr(0,test_wall_1_1.indexOf(\"-\"))) + boardWidth;\n var nvs = parseInt(test_wall_1_1.substr(test_wall_1_1.indexOf(\"-\")+1)) + boardWidth;\n var test_wall_2_2 = nvf+\"-\"+nvs; \n }\n var checkLegal_2 = pathToEndExists(test_wall_1+\",\"+test_wall_2+\",\"+test_wall_1_1+\",\"+test_wall_2_2,null,null);\n if (checkLegal_2) { \n // if placing both walls are legal and both walls together slow player down\n var checkSP2walls = shortestPath($(\"#walls\").val()+\",\"+test_wall_1+\",\"+test_wall_2+\",\"+test_wall_1_1+\",\"+test_wall_2_2,null,null);\n if (checkSP2walls[0]>high_change_player/*+1*/ && checkSP2walls[1]<=low_change_computer+1) { \n doublePlaceWall = a; \n doubleWallPathLen = checkSP2walls[0];\n break; \n } \n } \n }\n }\n } \n } \n }\n }\n // find best move with shortest path\n var fm_pos = 0;\n var fastestMove = 100; \n for (var p=0;p<moveSimulations.length;p++) { \n var fm = shortestPath(null,moveSimulations[p]);\n if (fm[1]<fastestMove) { \n fastestMove = fm[1]; \n fm_pos = p; \n }\n } \n \n console.log(\"---------------------------\");\n var ranWallMove = Math.random(); \n var bestWall = wallSimulations[bestWall_sp]; \n var bestMove = moveSimulations[fm_pos]; \n if (typeof arrShortestMoves_a[bestWall_sp]!='undefined' && arrShortestMoves_a[bestWall_sp]!='' && arrShortestMoves_a[bestWall_sp]!=' ' &&\n typeof bestWall!='undefined' && bestWall!='' && bestWall!=' ') { \n console.log(\"WALL \"+wallSimulations[bestWall_sp] + \" slows player from \" +arrShortestMoves_b[0]+ \" to \" +high_change_player); \n console.log(\"WALL \"+wallSimulations[bestWall_sp]+ \" slows computer from \" +arrShortestMoves_b[1]+ \" to \" + arrShortestMoves_a[bestWall_sp][1]); \n }\n console.log(\"BEST WALL: \"+bestWall); \n console.log(\"BEST MOVE: \"+bestMove);\n console.log(\"SHORTEST PATHS: \"+arrShortestMoves_b); \n \n // split board up - heuristic-ish for stopping long paths\n if (ranWallMove<0.3 && (wallSimulations.indexOf(\"21-22\")!=-1 && wallSimulations.indexOf(\"22-23\")!=-1 && \n wallSimulations.indexOf(\"39-40\")!=-1 && wallSimulations.indexOf(\"40-41\")!=-1)) { \n var r = Math.random();\n if (r<0.25) { var p = \"21-22\"; } \n else if (r<0.5) { var p =\"22-23\"; } \n else if (r<0.75) { var p = \"39-40\"; } \n else { var p = \"40-41\"; } \n placeVertWall(p); \n }\n // decide what move to make out of best options \n else if (doublePlaceWall!=null && typeof wallSimulations[doublePlaceWall]!='undefined' && wallPreventTrap==null && \n high_change_player-arrShortestMoves_b[0]<7 && !futureWall) {\n console.log(\"DOUBLE PLACE WALL: \"+wallSimulations[doublePlaceWall]); \n var whatWallPlace = $('#board td[data-pos='+(wallSimulations[doublePlaceWall])+']').attr('class'); \n if (whatWallPlace==\"wallPlacementHoriz\") { var wall = placeHorizWall(wallSimulations[doublePlaceWall]); }\n else if (whatWallPlace==\"wallPlacementVert\") { var wall = placeVertWall(wallSimulations[doublePlaceWall]); } \n }\n // only check for traps if computer is losing by at most 4 spaces and if winning at all\n else if (wallPreventTrap!=null && arrShortestMoves_b[1]-arrShortestMoves_b[0]<=2 && high_change_player-arrShortestMoves_b[0]<6 && playerWallsLeft-compWallsLeft<3) {\n console.log(\"COMPUTER TRAP WALL: \"+wallPreventTrap); \n var whatWallPlace = $('#board td[data-pos='+(wallPreventTrap)+']').attr('class'); \n if (whatWallPlace==\"wallPlacementHoriz\") { var wall = placeHorizWall(wallPreventTrap); }\n else if (whatWallPlace==\"wallPlacementVert\") { var wall = placeVertWall(wallPreventTrap); } \n } \n else if ((typeof bestWall!='undefined' && bestWall!='' && bestWall!=' ' && !futureWall) && \n (high_change_player-arrShortestMoves_b[0]>=3 || \n (arrShortestMoves_b[0]<8 && ranWallMove<0.3) ||\n (arrShortestMoves_b[0]<7 && compMoves[0]>8 && ranWallMove<0.6) ||\n (arrShortestMoves_b[0]<6 && compMoves[0]>8)) && \n high_change_player-arrShortestMoves_b[0]>0 && \n (playerWallsLeft-compWallsLeft<3 || arrShortestMoves_b[0]<4 || high_change_player-arrShortestMoves_b[0]>=4)) { \n \n // if losing dont slow down computer only player\n var getDiff = high_change_player-arrShortestMoves_b[0]; \n if (arrShortestMoves_b[1]-arrShortestMoves_b[0]>=3 && arrShortestMoves_a[bestWall_sp][1]-arrShortestMoves_b[1]<=getDiff) {\n console.log(\"WALL IS OK FOR COMPUTER (LOSING)\");\n var whatWallPlace = $('#board td[data-pos='+(bestWall)+']').attr('class'); \n if (whatWallPlace==\"wallPlacementHoriz\") { var wall = placeHorizWall(bestWall); }\n else if (whatWallPlace==\"wallPlacementVert\") { var wall = placeVertWall(bestWall); } \n } else if (arrShortestMoves_b[1]-arrShortestMoves_b[0]<3) {\n console.log(\"WALL IS OK FOR COMPUTER (NOT LOSING)\")\n var whatWallPlace = $('#board td[data-pos='+(bestWall)+']').attr('class'); \n if (whatWallPlace==\"wallPlacementHoriz\") { var wall = placeHorizWall(bestWall); }\n else if (whatWallPlace==\"wallPlacementVert\") { var wall = placeVertWall(bestWall); } \n } else {\n console.log(\"WALL NOT HELPFUL FOR COMPUTER\");\n movePiece(compMoves[0],bestMove); \n }\n \n } \n else { \n movePiece(compMoves[0],bestMove);\n } \n } \n}", "function showTeamSolutions(round) {\r\n if (round > FIRST_ACTUAL_ROUND) {\r\n for (var i = 1; i <= numPlayers+forceBots; i++) {\r\n if (i != myid) {\r\n if ((showTeamModulo > 0) && ((gameRound) % showTeamModulo == 0)) {\r\n if (i <= numPlayers) {\r\n drawTeamSolution(i, round-1, 0, tPaper[i], false);\r\n } else {\r\n drawForceBotSolution(i, round-1, 0, tPaper[i], false);\r\n }\r\n $('#solution_'+i).show();\r\n } else {\r\n if (showScoreWhenNotMap) {\r\n if (i <= numPlayers) {\r\n drawTeamSolution(i, round-1, 0, tPaper[i], true);\r\n } else {\r\n drawForceBotSolution(i, round-1, 0, tPaper[i], true);\r\n } \r\n $('#solution_'+i).show();\r\n } else {\r\n $('#solution_'+i).hide();\r\n }\r\n }\r\n }\r\n }\r\n if (showMe || showBest) {\r\n drawTeamSolution(myid, round-1, 0, tPaper[myid], false);\r\n $('#solution_'+myid).show();\r\n } else {\r\n $('#solution_'+myid).hide(); \r\n }\r\n \r\n if (showOptimal) { // this is the programatic optimal solution, not another player's\r\n doDrawTeamSolution(optimal_id, round-1, 0, tPaper[optimal_id], '<solution map=\"'+getMapIndex(round-1)+'\" dist=\"'+map[getMapIndex(round-1)][2][0]+'\">'+map[getMapIndex(round-1)][1]+'</solution>',false);\r\n $('#solution_'+optimal_id).show();\r\n } else {\r\n $('#solution_'+optimal_id).hide(); \r\n }\r\n }\r\n}", "function mainGameLoopSlow() {\r\n\t\r\n\tif (gameData.autoStartSimulation)\r\n\t\tstartSimulation()\r\n\t\r\n\tif (gameData.autoStartTask) \r\n\t\tdiseaseControlTask()\r\n\t\r\n\tif (gameData.autoCheckSimulation)\r\n\t\tcheckResults()\r\n\t\r\n\tif (gameData.autoAdvertiseBroker)\r\n\t{\r\n\t\tif (gameData.currencyApplicantSpeed > gameData.autoAdvertiseSpeedValue || (gameData.smarterAdvertisingManagerBroker && gameData.currencyApplicantTransferAmount < gameData.autoAdvertiseAmountValue))\r\n\t\t{\r\n\t\t\tadvertise()\r\n\t\t}\r\n\t}\r\n\r\n\tif(gameData.numberOfTiles >= 17)\r\n\t{\r\n\t\ttabs('mapTile-4-0', 'inline-block')\r\n\t}\r\n\tif(gameData.numberOfTiles >= 18)\r\n\t{\r\n\t\ttabs('mapTile-4-1', 'inline-block')\r\n\t}\r\n\tif(gameData.numberOfTiles >= 19)\r\n\t{\r\n\t\ttabs('mapTile-4-2', 'inline-block')\r\n\t}\r\n\tif(gameData.numberOfTiles >= 20)\r\n\t{\r\n\t\ttabs('mapTile-4-3', 'inline-block')\r\n\t}\r\n\tif(gameData.numberOfTiles >= 21)\r\n\t{\r\n\t\tgameData.numberOfTiles = 20\r\n\t}\r\n\r\n\tstartCurrentTask(gameData.currentTask)\t\r\n\tstartCurrentTask(gameData.currentTask2)\t\r\n\r\n\t\r\n\tif(gameData.currentSkill !== 'none')\r\n\t\tbarStartGranularSkillBasic(gameData.currentSkill)\r\n\r\n\t\t\r\n\tif(gameData.bachelorsDegreeFinance)\r\n\t{\r\n\t\tif(beckyRandom(2) == 1 && gameData.alphaCoinsExchangeRate < 200)\r\n\t\t\tgameData.alphaCoinsExchangeRate += 1\r\n\t\telse if (gameData.alphaCoinsExchangeRate > 50)\r\n\t\t\tgameData.alphaCoinsExchangeRate -= 1\r\n\t}\r\n\t\r\n\tgameData.achievementBar = 0\r\n for (i = 1; i < 7; i++) {\r\n\t\t\r\n\t\tif (gameData['achievement' + i]) {\r\n\t\t\tgameData.achievementBar += 100 / 7\r\n\t\t}\r\n\t}\r\n\t\r\n\tgameData.lastSaveTime = Date.now()\r\n\t\r\n\tmoveBar('achievement')\r\n\tupdateMapTileAesthetic()\r\n\tsetTimeout(mainGameLoopSlow, 500)\r\n}", "function solve_puzzle(){\n\n\tvar empty_tile = find_empty_tile();\n\tvar no_of_placed_tiles = calculate_placed_tiles();\n\tvar used_states = [];\n\tvar no_of_moves = 0;\n\tvar old_move = -1;\n\n\tvar best_move = \"\";\n\tvar current_state = find_current_state();\n\tvar previous_state = find_current_state();\n\n\twhile (no_of_placed_tiles != 9) {\n\n\t\tvar prev_placed_tiles = 0;\n\t\tvar counter = 0 ;\n\n\t\tvar placed_tiles_per_check = [];\n\t\tvar dup_moves = [];\n\n\t\tempty_tile = find_empty_tile();\n\t\tvar possible_moves = find_possible_moves(empty_tile);\n\t\tvar length = possible_moves.length;\n\t\twhile (possible_moves.length) {\n\n\t\t\tif (possible_moves[0] == old_move){\n\t\t\t\tpossible_moves.shift();\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdo_possible_moves(possible_moves, empty_tile);\n\n\t\t\tif (search_state( find_current_state(), used_states)) {\n\t\t\t\tpossible_moves.shift();\n\t\t\t\t// set_puzzle(previous_state);\n\t\t\t\tcounter ++;\n\t\t\t\tif (counter == length) {\n\t\t\t\t\tbest_move = find_current_state();\n\t\t\t\t\tset_puzzle(best_move);\n\t\t\t\t\tused_states = [];\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\tset_puzzle(previous_state);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar move = possible_moves.shift();\n\t\t\tvar current_placed_tiles = calculate_placed_tiles();\n\n\t\t\tif (current_placed_tiles >= prev_placed_tiles) {\n\t\t\t\tplaced_tiles_per_check.push(current_placed_tiles);\n\t\t\t\tdup_moves.push(move);\n\t\t\t\tvar top = placed_tiles_per_check[(placed_tiles_per_check.length) - 1];\n\t\t\t\tif (placed_tiles_per_check.length > 1) top = placed_tiles_per_check[(placed_tiles_per_check.length) - 2];\n\n\t\t\t\tif (current_placed_tiles != top) {\n\t\t\t\t\tplaced_tiles_per_check = [];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (current_placed_tiles >= prev_placed_tiles) {\n\t\t\t\tprev_placed_tiles = current_placed_tiles ;\n\t\t\t\tbest_move = find_current_state();\n\t\t\t}\n\n\t\t\tset_puzzle(previous_state);\n\t\t\tempty_tile = find_empty_tile();\n\t\t}\n\n\t\told_move = find_empty_tile();\n\t\tif (placed_tiles_per_check.length > 1) {\n\t\t\tvar states = [];\n\t\t\tvar present_state = find_current_state();\n\t\t\tfor (var i = 0; i < dup_moves.length; i++) {\n\t\t\t\tvar move = [dup_moves[i]];\n\t\t\t\tvar empty = find_empty_tile();\n\t\t\t\tdo_possible_moves(move,empty);\n\t\t\t\tstates.push(find_current_state())\n\t\t\t\tset_puzzle(present_state);\n\t\t\t}\n\n\t\t\tvar prev_ans = -1;\n\n\t\t\tfor (var i = 0; i < states.length; i++) {\n\t\t\t\tif (prev_ans > -1) break;\n\t\t\t\tset_puzzle(states[i]);\n\t\t\t\tvar current_ans = find_best();\n\n\t\t\t\tif (current_ans === false)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (current_ans >= prev_ans) {\n\t\t\t\t\tbest_move = states[i];\n\t\t\t\t\tprev_ans = current_ans;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (prev_ans > 0) {\n\t\t\t\tno_of_moves += prev_ans;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// else used_states = [];\n\t\t}\n\n\t\tused_states.push(best_move);\n\t\tset_puzzle(best_move);\n\n\t\tprevious_state = best_move;\n\t\tno_of_placed_tiles = calculate_placed_tiles();\n\t\tno_of_moves ++ ;\n\n\t\tif (no_of_moves == 100){\n\t\t\treturn false;\n\t\t\talert(\"Fail...\")\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn no_of_moves;\n}", "function journey() {\n tmp = result[destination];\n loc = destination;\n value = destination;\n Interval = setInterval(path, speed);\n Interval1 = setInterval(retrack, track);\n if (count == 5) {\n walls();\n \n \n count = 0;\n }\n count++;\n}", "function deviantBot(playerId, numSwaps, round) {\r\n // Note, setting the Math.seedrandom() will make consistent results\r\n \r\n // this is the optimal solution\r\n var optimal = map[getMapIndex(round)][1];\r\n \r\n // copy it into the solution\r\n var solution = new Array();\r\n for (var i = 0; i < numCities; i++) {\r\n solution[i] = optimal[i];\r\n }\r\n\r\n// alert(\"dbot:\"+playerId+\" r:\"+round);\r\n // swap some values \r\n Math.seedrandom(playerId+round*100);\r\n for (var i = 0; i < numSwaps; i++) {\r\n var swapMe = Math.floor(Math.random()*(numCities-1))\r\n var temp = solution[swapMe];\r\n solution[swapMe] = solution[swapMe+1];\r\n solution[swapMe+1]=temp;\r\n }\r\n return solution;\r\n}", "function generateStupidRoute(exit) {\n if (exit === true) {\n newDistance = directionQueryResponse.routes[0].legs[0].distance;\n\n setTimeout(function () {\n\n alert(\"Hello there!\\n\" +\n \"Originally you will have to travel for \" + shortestRouteDistance.text + \"\\n\" +\n\n \"With our advanced algorithm you'll have to travel for just \" + newDistance.text + \"\\n\" +\n\n \"We saved you \" + ((shortestRouteDistance.value - newDistance.value) / 1000) + \" km\" + \"\\n\" +\n \"This shit is impressive, isn't it?\"\n );\n }, 1000);\n return;\n }\n\n //Generate random waypoints\n var waypoints = [];\n for (var i = 0; i < placesToRandom; i++) {\n randomLocation();\n waypoints.push({\n location: combineLocation(currentLocation, Locationize(rand_lat, rand_lng)),\n stopover: false\n });\n }\n\n //Pass generateStupidRoute as a callback so if route generation failed, it will re-random and try to find new one\n calcRoute(currentLocation, loc2, waypoints, true, generateStupidRoute);\n}", "function SLS(matrix, route)\r\n{\r\n\tvar procede = true;\r\n\tvar counter = 0;\r\n\tvar minDist = Infinity;\r\n\tvar newRouting = route;\r\n\tvar tryRoute = route;\r\n\tvar len = route.length;\r\n\tvar ttlDistance = 0;\r\n\tvar averageDistance;\r\n\t//loop until stopping criteria is met\r\n\twhile (procede)\r\n\t{\r\n\t\tvar i = Math.floor(Math.random() * (len-2) + 0);\r\n var k = Math.floor((Math.random() * (len-i-2) + (2+i)));\r\n\t\t//newRouting - new order of city, distances not updated\r\n\t\tnewRouting = twoOptSwap(newRouting, i, k);\r\n\t\t//console.log(\"SLS nR: \",newRouting);\r\n\t\t//tryRoute - new order with updated distances\r\n\t\tvar tryRoute = findDistances(matrix, newRouting);\r\n\t\t//total distance of tour\r\n\t\tvar sumDistance = totalDistance(tryRoute);\r\n\t\t//Update minRoute if new dist < minimum distance\r\n\t\tif (sumDistance < minDist)\r\n\t\t{\r\n\t\t\tminDist = sumDistance;\r\n\t\t\tminRoute = tryRoute;\r\n\t\t}\r\n\t\t//Find average of all minimum distances\r\n\t ttlDistance += minDist;\r\n\t\taverageDistance = ttlDistance/(counter+1);\r\n\t\t//Stopping Criteria\r\n\t\t//Both - minimum must be 98.5% of average of minimums\r\n\t\t// - gives minimum time to stop changing\r\n\t\t// - converging on an appropriate answer\r\n\t\t//And - must run at least 40*(number of cities) times\r\n\t\t// - with testing, this turned out to be a decent\r\n\t\t// - number to avoid quitting to soon\r\n\t\tif ((minDist/averageDistance > 0.985) && (counter > (40*len)))\r\n\t\t{\r\n\t\t\tprocede = false;\r\n\t\t}\r\n\t\tcounter++;\r\n\t}\r\n\tconsole.log(\"COUNTER: \", counter);\r\n\tconsole.log(\"AVERAGE DISTANCE: \", averageDistance);\r\n\treturn minRoute;\r\n}", "function solution(board, limit) {\n if (typeof(limit) == 'undefined') limit = Infinity;\n return solvefast(board, limit).solution;\n}", "function solution(board, limit) {\n if (typeof(limit) == 'undefined') limit = Infinity;\n return solvefast(board, limit).solution;\n}", "function animateSolution () {\n let x = 0\n solutionPlaying = true\n let theMove = setInterval(() => {\n playMove(theButtons[solution[x] - 1])\n x++\n if (x >= solution.length) {\n clearInterval(theMove)\n solutionPlaying = false\n }\n }, timeout)\n}", "move(steps){\r\n let newX = this.x;\r\n let newY = this.y;\r\n let xStep = (this.direction == 90) ? 1 :\r\n (this.direction == 270) ? -1 : 0;\r\n let yStep = (this.direction == 0) ? -1 :\r\n (this.direction == 180) ? 1 : 0;\r\n\r\n if (steps < 0){\r\n xStep *= -1;\r\n yStep *= -1;\r\n steps *= -1;\r\n }\r\n\r\n let delay = 0;\r\n\r\n for(let step = 0; step < steps; step++){\r\n let nextTile = this.field.getTile(newX + xStep, newY + yStep);\r\n if (nextTile && nextTile.walkable()){\r\n // Check if the new position even exists\r\n newX += xStep;\r\n newY += yStep;\r\n if(!combatController.simulating){\r\n // If not simulating, have 100ms between each step\r\n setTimeout(this.teleportTo.bind(this,newX,newY),delay);\r\n delay += 100;\r\n }\r\n else this.teleportTo(newX,newY)\r\n }\r\n }\r\n }", "function GoWay(){\n\t\tif(nowTaskGo != null && PlayerUtil.isMine(GetComponent(PlayerStatus).instanceID)){\n\t\t\tif(navMA.enabled){\n\t\t\t\tvar boolNV : boolean = false;\n\t\t\t\tFindWayGoOn = true;\n\t\t\t\tAllManage.timeDJStatic = AllManage.timeDJStatic;\n\t\t\t\tfor(var i=0; i<player.nowTask.length; i++){\n\t\t\t\t\tif(player.nowTask[i] != null){\t\t\t\t\n\t\t\t\t\t\tif(FindWayID == player.nowTask[i].id){\n\t\t\t\t\t\t\tif(player.nowTask[i].jindu == 1){\n\t\t\t\t\t\t\t\tif(player.nowTask[i].task.doneType.Length > 2){\n//\t\t\t\t\t\t\t\t\tUseDaoHangMap = player.nowTask[i].task.doneType.Substring(4,3);\n\t\t\t\t\t\t\t\tif(AllManage.mtwStatic.GetTaskLevel( player.nowTask[i].task.doneType ) == 5){\n\t\t\t\t\t\t\t\t\tUseDaoHangMap = player.nowTask[i].task.doneType.Substring(4,2) + \"1\";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tUseDaoHangMap = player.nowTask[i].task.doneType.Substring(4,3);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(UseDaoHangMap != Application.loadedLevelName.Substring(3,3)){\n\t\t\t\t\t\t\t\t\t\tif(!AllManage.InvclStatic.isBagFull()){\n\t\t\t\t\t\t\t\t\t\t\tboolNV = true;\n\t\t\t\t\t\t\t\t\t\t\tAllManage.timeDJStatic.Show(gameObject , \"YesDaoHang\" , \"NoDaoHang\" , 3 , \"messages031\" , \"messages032\" , \"messages033\" , false);\n\t\t\t\t\t\t\t\t\t\t\tMainTW.setnowMenBool(true);\n\t\t\t\t\t\t\t\t\t\t}else{\n//\t\t\t\t\t\t\t\t\t\t\tAllManage.qrStatic.ShowQueRen(gameObject,\"\",\"\",\"info885\");\n\t\t\t\t\t\t\t\t\t\t\tAllManage.tsStatic.Show1(AllManage.AllMge.Loc.Get(\"info885\"));\n\t\t\t\t\t\t\t\t\t\t\treturn;\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}else\n\t\t\t\t\t\t\tif(player.nowTask[i].jindu == 2){\n\t\t\t\t\t\t\t\tUseDaoHangMap = player.nowTask[i].task.mainNPC.map;\n\t\t\t\t\t\t\t\tif(UseDaoHangMap != Application.loadedLevelName.Substring(3,3)){\n\t\t\t\t\t\t\t\t\tif(!AllManage.InvclStatic.isBagFull()){\n\t\t\t\t\t\t\t\t\t\tboolNV = true;\n\t\t\t\t\t\t\t\t\t\tAllManage.timeDJStatic.Show(gameObject , \"YesDaoHang\" , \"NoDaoHang\" , 3 , \"messages031\" , \"messages032\" , \"messages033\" , false);\n\t\t\t\t\t\t\t\t\t\tMainTW.setnowMenBool(true);\n\t\t\t\t\t\t\t\t\t}else{\n//\t\t\t\t\t\t\t\t\t\tAllManage.qrStatic.ShowQueRen(gameObject,\"\",\"\",\"info885\");\n\t\t\t\t\t\t\t\t\t\tAllManage.tsStatic.Show1(AllManage.AllMge.Loc.Get(\"info885\"));\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif( !boolNV){\n\t\t\t\t\ttry{\t\t\t\t\t\n\t\t\t\t\t\tMainTW.OpenChuanSongMen(player , 0);\t\t\t\t\n\t\t\t\t\t}catch(e){\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tyield;\n\t\t\t\tyield;\n\t\t\t\tyield;\n\t\t\t\tMainTW.OpenChuanSongMen(player , 0);\n\t\t\t}\n\t\t}\n\t}", "function startAttackNFinish(a2b_doc, vi, ATask, antiFarm, a2bVname, a2bPName) {\n\ttry {\n\t\t//flag ( \"startAttackNFinish():: Started! village: \" + vi );\n\t\t// if response is rally point page, then analyze rally point and update troop counts.\n\t\tvar h1name = document.evaluate('//h1', a2b_doc, null, XPFirst, null).singleNodeValue;\n\t\tif ( h1name != null && h1name.innerHTML.indexOf(aLangAllBuildWithId[16]) != -1 )\n\t\t\tanalyzeRallyPoint(a2b_doc,vi,false);\n\n\t\tif ( antiFarm == \"\" ) { // when not in anti-farm mode...\n\t\t\tif (ATask[3] == \"0\") {\n\t\t\t\tdeleteTaskFromCookie(vi, ATask);\n\t\t\t} \n\t\t\telse {\n\t\t\t\t//var newTask = new Array(); // |2_241654_3_0_1248014400000_0_0,0,0,0,0,5,0,0,0,0,0_0_0\n\t\t\t\tvar newTask = ATask.slice(0); // clone the array ATask.\n\t\t\t\tvar nowt=new Date();\n\t\t\t\ttemp = Number(ATask[3]) - 1\n\t\t\t\tnewTask[3] = temp.toString();\n\t\t\t\t// if attack strict order is disabled, set increment attack time by repeat interval\n\t\t\t\tif ( GM_getValue ( myacc() + \"_attackStrictOrder\", \"0\" ) == \"0\" ) {\n\t\t\t\t\tif (ATask[5] == \"0\") { // if repeat is set to 0, increment by 1 day +/- random 5 mins\n\t\t\t\t\t\t// delay by 24 hrs +/- random ( 5 )\n\t\t\t\t\t\ttemp2 = getRandomizedTime ( 24*60*60*1000, 2 * 5*60*1000, 1 );\n\t\t\t\t\t}\n\t\t\t\t\telse if ( Number(ATask[5]) > 5*60*1000 ) { // else if repeat interval > 5 mins increment by repeat interval +/- random (repeat-interval/2)\n\t\t\t\t\t\t// delay by repeat interval +/- random ( repeat-interval / 2 )\n\t\t\t\t\t\ttemp2 = getRandomizedTime ( Number(ATask[5]), Number(ATask[5]), 1 );\n\t\t\t\t\t}\n\t\t\t\t\telse { // else if repeat interval < 5 mins just increment by repeat interval\n\t\t\t\t\t\ttemp2 = nowt.getTime() + Number(ATask[5]);\n\t\t\t\t\t}\n\t\t\t\t\tnewTask[4] = temp2.toString();\n\t\t\t\t}\n\t\t\t\tnewTask[12] = a2bPName.toString();\n\t\t\t\tnewTask[13] = a2bVname.toString();\n\t\t\t\tdeleteTaskFromCookie(vi, ATask, newTask);\n\t\t\t}\n\t\t\tvar xCoord = getXfromCoord(ATask[1]);\n\t\t\tvar yCoord = getYfromCoord(ATask[1]);\n\t\t\tvar targetcoord = \"(\" + xCoord + \"|\" + yCoord + \")\";\n\t\t\tvar villageUrl = \"\";\n\t\t\tswitch ( aTravianVersion ) {\n\t\t\t\tcase \"3.6\":\n\t\t\t\t\tvillageUrl = \"<a class='spantooltip' style='color: PaleVioletRed' href='\" +\n\t\t\t\t\t\tmyhost + \"/karte.php?newdid=\" + vi + \"&z=\" + ATask[1] + \"'>\" + targetcoord + \"</a>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"4.0\":\n\t\t\t\t\tvillageUrl = \"<a class='spantooltip' style='color: PaleVioletRed' href='\" +\n\t\t\t\t\t\tmyhost + \"/karte.php?newdid=\" + vi + \"&x=\" + xCoord + \"&y=\" + yCoord + \"'>\" + targetcoord + \"</a>\" +\"<b> \"+ a2bPName +\" : </b>\"+ a2bVname;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrowLogicError ( \"startAttackNFinish():: Travian Version not set!!\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar msg1 = getvillagefromdid(vi) + \" &lrm;(\" + vi + \")&lrm;: \" + aLangTaskOfText[31].fontcolor('#9400D3') + \" to \" + villageUrl;\n\t\t\tvar msg2 = getvillagefromdid(vi) + \" &lrm;(\" + vi + \")&lrm;: \" + aLangTaskOfText[31] + \" to \" + targetcoord;\n\t\t\tprintMSG ( msg1 );\n\t\t\tflag ( \"startAttackNFinish():: \" + msg2 );\n\t\t\tcalldoing1();\n\t\t\tshowTaskList();\n\t\t}\n\t\telse { // when in anti-form mode...\n\n\t\t\tvar foundCallBackUrl = getAntiFarmCallBackUrls(a2b_doc, vi, antiFarm);\n\t\t\tif ( foundCallBackUrl == false ) {\n\t\t\t\t// &k for complete incoming troops in rally point, &j is for all outgoing troops\n\t\t\t\t/*var callBackUrl = myhost + \"/build.php?gid=16&newdid=\"+vi+\"&j\"; // no need to analyze rally point here as &j is used and not &k\n\t\t\t\tTS_getRequest ( callBackUrl, getAntiFarmCallBackUrls, vi, antiFarm );*/\n\t\t\t\tgetAntiFarmCallBackUrls2(vi, antiFarm);\n\t\t\t}\n\t\t}\n\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>startAttackNFinish():: Something went wrong, error: \" + err.name + \" :: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tprintErrorMSG(msg);\n\t\tthrow err;\n\t}\n}", "function solve(sudoku) {\n\tvar saved = new Array();\n\tvar savedSudoku = new Array();\n\tvar i=0;\n\tvar nextMove;\n\tvar whatToTry;\n\tvar attempt;\n\twhile (!isSolvedSudoku(sudoku)) {\n\t\ti++;\n\t\tnextMove = scanSudokuForUnique(sudoku);\n\t\tif (nextMove == false) {\n\t\t\tnextMove = saved.pop();\n\t\t\tsudoku = savedSudoku.pop();\n\t\t}\n\t\twhatToTry = nextRandom(nextMove);\n\t\tattempt = determineRandomPossibleValue(nextMove,whatToTry);\n\t\tif (nextMove[whatToTry].length>1) {\n\t\t\tnextMove[whatToTry] = removeAttempt(nextMove[whatToTry],attempt);\n\t\t\tsaved.push(nextMove.slice());\n\t\t\tsavedSudoku.push(sudoku.slice());\n\t\t}\n\t\tsudoku[whatToTry] = attempt;\n\t}\n\tconst pos = getRandomPositions();\n\tshowSudoku(sudoku,pos);\n}", "function solvePuzzle(){\n\tdisplay.disabled = true;\n\tlet solD = display.solutionDisplay;\n\tlet correct = true;\n\tlet txt = \"<br>\"\n\tif (guess.time == underground.selected.puzzle.time){\n\t\ttxt += \"You said it is \" + guess.time +\".\";\n\t\ttxt += \" <em> You were right. </em><br>\";\n\t} else {\n\t\ttxt += \"You said it is \" + guess.time +\".\";\n\t\ttxt += \" <em> You were wrong. </em><br>\";\n\t\tcorrect = false;\n\t} \n\tif (guess.first == underground.selected.puzzle.person1_type){\n\t\ttxt += \"You said the first inhabitant is a \" + guess.first + \"-knight. <em>This was correct.</em><br>\";\n\t} else {\n\t\t\ttxt += \"You said the first inhabitant is a \" + guess.first + \"-knight. <em>This was not correct. </em>\";\n\t\t\ttxt += \"She is a \" + underground.selected.puzzle.person1_type +\"-knight.<br>\"\n\t\tcorrect = false;\n\t} \n\tif (guess.second == underground.selected.puzzle.person2_type){\n\t\ttxt += \"You said the second inhabitant is a \" + guess.second + \"-knight. <em>This was correct.</em><br>\";\n\t} else {\n\t\t\ttxt += \"You said the second inhabitant is a \" + guess.second + \"-knight. <em>This was not correct. </em>\";\n\t\t\ttxt += \"She is a \" + underground.selected.puzzle.person2_type +\"-knight.<br>\"\n\t\tcorrect = false;\n\t}\n\ttxt +=\"<br>\";\n\tif (correct) {\n\t\ttxt += \"<strong> You solved the puzzle!</strong>\"\n\t} else {\n\t\ttxt += \"<strong> Unfortunately, you did not solve the puzzle. </strong>\"\n\t}\n\n\tsolD.innerHTML = txt;\n}", "function main() {\r\n\r\n\tFM_log(3,\"main() called\");\r\n\r\n\tsuffixGlobal = server + '_' + getPlayerId();\r\n\r\n\tsuffixLocal = suffixGlobal + '_' + getActiveVillageId();\r\n\r\n\t\r\n\r\n\tFM_log(3,\"suffixGlobal is: \"+suffixGlobal);\r\n\r\n\tFM_log(3,\"suffixLocal is: \"+suffixLocal);\r\n\r\n\t\r\n\r\n\t//define Travian 3.5 Version\r\n\r\n\tgetT35version();\r\n\r\n\t\r\n\r\n\tFM_log(5,document.URL);\r\n\r\n\tvar html = document.body.innerHTML; // In case 'Unable to load site' is showed, try to Refresh the page.\r\n\r\n\tif (html.indexOf(\" <!-- ERROR ITEM CONTAINER\") != -1) {\r\n\r\n\t\twindow.location.replace(rootPath + \"a2b.php\"); \r\n\r\n\t}\r\n\r\n\t\t\r\n\r\n\tif (GM_getValue(\"Active_\" + suffixGlobal, -1) > -1 && GM_getValue(\"ReadRep_\" + suffixGlobal, -1)==1 )\r\n\r\n\t{\r\n\r\n\t\tnewreport = document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i1\\\"')+document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i3\\\"');\r\n\r\n\t\tif ( newreport != -2) \r\n\r\n\t\t{\r\n\r\n\t\t\tif(document.URL.indexOf(\"berichte.php\") == -1) {\r\n\r\n\t\t\t\twindow.open(\"/berichte.php\", \"_self\");\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcheckreports();\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// start countdown and forward to rallypoint if FM is active\r\n\t\r\n\t// this is not working because FM script not runs on all the Travian pages\r\n\t// could be working if @includes get changed, but this probably leads to a slow browser\r\n\t\r\n\r\n\t/*\r\n\r\n\tif (GM_getValue(\"Active_\" + suffixGlobal, -1) > -1)\r\n\r\n\t{\r\n\r\n\t\t//alert(\"waiting\");\r\n\r\n\t\tsetTimeout(function(){window.open(\"/a2b.php\",\"_self\");}, 60000); //wait 1 minute then go back to rally point\r\n\r\n\t}\r\n\r\n\t*/\r\n\r\n\t\t\r\n\r\n\t// get variable for random farming\r\n\r\n\trandom = GM_getValue(\"RandomFarming_\" + suffixGlobal, 0);\r\n\r\n\t\r\n\r\n\tFM_log(3,\"Setting language, images & style\");\r\n\r\n\tsetLanguage();\r\n\r\n\tloadImage();\r\n\r\n\tloadStyle();\r\n\r\n\tvar url = document.URL;\r\n\r\n\turl = url.substring(url.lastIndexOf(\"/\") + 1);\r\n\r\n\tuser_race = GM_getValue('Tribe_' + suffixGlobal, -1);\r\n\r\n\tif (user_race != -1) {\r\n\r\n\t\tuser_race = GM_getValue('Tribe_' + suffixGlobal, 0);\r\n\r\n\t\tuser_race = parseInt(user_race);\r\n\r\n\t} else {\r\n\r\n\t\tif (url.indexOf(\"a2b.php\") != -1) {\r\n\r\n\t\t\tuser_race = 1 + 10 * getPlayerTribe();\r\n\r\n\t\t\tGM_setValue('Tribe_' + suffixGlobal, user_race);\r\n\r\n\t\t\talert(T('SCRIPT_NAME') + \" Installation complete\\n\"\r\n\r\n\t\t\t\t\t+ T('INSTALL_M1') + \"\\n\" + T('INSTALL_M2') + \" \\n-ScratchZ\");\r\n\r\n\t\t\twindow.location.replace(rootPath + \"build.php?id=39\");//ToDo: reload\r\n\r\n\t\t} else {\r\n\r\n\t\t\twindow.location.replace(rootPath + \"a2b.php\");//ToDo: reload\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// Set default values if not defined yet\r\n\r\n\tif (GM_getValue(\"Maximize_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"Maximize_\" + suffixGlobal, 1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"MaximizeSettings_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"MaximizeSettings_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"StartIndex_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"StartIndex_\" + suffixLocal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"EndIndex_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"EndIndex_\" + suffixLocal, -1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"Skipcounter_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"Skipcounter_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t//Settings\r\n\tif (GM_getValue(\"RandomFarming_\" + suffixGlobal, false) == false) {\r\n\t\tGM_setValue(\"RandomFarming_\" + suffixGlobal, 0);\r\n\t}\r\n\r\n\tif (GM_getValue(\"farmMarking_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"farmMarking_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"VillageSkipping_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"VillageSkipping_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"DelTList_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"DelTList_\" + suffixLocal, 1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"ReadRep_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"ReadRep_\" + suffixLocal, 0);\r\n\r\n\t}\t\r\n\r\n\t\r\n\r\n\t// Setting Travian Version\r\n\r\n\tif (GM_getValue(\"TravianVersion_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"TravianVersion_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t//insert village selector\r\n\r\n\trp_villageSelector();\r\n\r\n\t//alert (url);\r\n\r\n\tif (url.indexOf(\"build.php?\") > -1 && (url.indexOf(\"gid=16\") > -1 || url.indexOf(\"id=39\") > -1)) {\r\n\r\n\t\tif (isReallyRallyPoint()) {\r\n\r\n\t\t\trp_mainPage();\r\n\r\n\t\t}\r\n\r\n\t\tactiveMain();\r\n\r\n\t} else if (url.indexOf(\"a2b.php\") > -1) {\r\n\r\n\t\tactiveMain();\r\n\r\n\t} else if (url.indexOf(\"karte.php?\") > -1 && url.indexOf(\"d=\") > -1\r\n\r\n\t\t\t&& url.indexOf(\"c=\") > -1) { //if user profile page\r\n\r\n\t\tfoundNewFarm();\r\n\r\n\t} else if (url.indexOf(\"berichte.php\") > -1) {\r\n\r\n\t\t// if no messages there, return to rally point\r\n\r\n\t\tnewreport = document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i1\\\"')+document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i3\\\"');\r\n\r\n\t\tif ( newreport == -2 && GM_getValue(\"Active_\" + suffixGlobal, -1) > -1) \r\n\r\n\t\t{\r\n\r\n\t\t\twindow.open(\"/build.php?id=39\", \"_self\");\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// farm marking in the map\r\n\r\n\tif (url.indexOf('karte.php')>-1 && url.indexOf('karte.php?d=')==-1 && GM_getValue(\"farmMarking_\" + suffixGlobal, 0)==1)\r\n\r\n\t{\r\n\r\n\t\t\t\t//get center village\r\n\r\n\t\t\t\tvar mapX = dom.get('x').textContent;\r\n\r\n\t\t\t\tvar mapY = dom.get('y').textContent;\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tFM_log(4,\"CenterCoords=\"+mapX+\",\"+mapY);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tGM_setValue(\"MapCenter_\"+suffixGlobal,mapX+\",\"+mapY);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\t// look for arrow buttons\r\n\r\n\t\t\t\tvar ex = \"//area[contains(@id,'ma_n')]\";\r\n\r\n\t\t\t\ttag = document.evaluate(ex,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tFM_log(4,\"adding eventListener\");\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tfor(var i=1; i<=tag.snapshotLength;i++)\r\n\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tvar arrowButton = tag.snapshotItem(i-1);\r\n\r\n\t\t\t\t\t// call function to check again after listener was activated\r\n\r\n\t\t\t\t\tFM_log(4,\"arrowId=\"+arrowButton.id);\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tarrowButton.addEventListener(\"click\", function (e){\r\n\r\n\t\t\t\t\t\tvar evt = e || event;\r\n\r\n\t\t\t\t\t\tvar ele = evt.target || evt.srcElement;\r\n\r\n\t\t\t\t\t\tsetTimeout(function(){getXYtoFarms(ele.id);},500);\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t}, true); // so that it will check again when scrolling.\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgetXYtoFarms(\"\")\r\n\r\n\t}\r\n\r\n}", "function bang()\n{\n\tpost(\"bang \\n\");\n\tfindTrans();\n\tfindBounds(); \n\toverdrive(); \n\tfindFilter();\n\tlineTime(); \n\tdelay(); \n\t// repeat(); \n}", "function go() {\n\n\t// var testScore = score([5,15,7,11,10,3,6,1,16,12,9,14,8,4,2,13]);\n\t// log(\"Testing: \" + testScore);\n\t// if (testScore != 860) {\n\t// \tlog(\"ERROR: \" + testScore + \" should be 860\");\n\t// \treturn;\n\t// }\n\n\tvar input;\n\n\tinput = generateRandomInput();\n\t// input = [1,9,7,11,10,3,6,14,5,15,12,8,13,2,4,16];\n\tlog(\"Input: \", input.join(\",\"));\n\t// var validIndex = generateValidIndex();\n\t// var validTwoIndex = generateValidTwoIndex();\n\t// var processed = 0;\n\t// var start = new Date().getTime();\n\n\tlog(\"GCD:\", findGCD(16, 8, true));\n\t// return;\n\n\tvar best = input;\n\tvar bestScore = score(best);\n\n\tlog(\"Starting: \" + bestScore, format(best));\n\tfs.appendFileSync('low' + n + '.txt', '\\nStarting\\n' + bestScore + '\\n' + format(best));\n\n\twhile (true) {\n\t\tvar result = findBest(input, bestScore);\n\t\tif (result.bestScore < bestScore)\n\t\t{\n\t\t\tbestScore = result.bestScore;\n\t\t\tbest = result.best;\n\t\t}\n\t\tinput = generateRandomInput();\n\t}\n\n\t// log(\"Took: \" + (new Date().getTime() - start) + \" ms\");\n\n\t// log(score(a, true));\n}", "function timer() {\n\t\t// console.log(steps);\n\t\t// console.log(totalSteps);\n\t\t// console.log(stepsCounter);\n\n\t\tlet index = totalSteps - stepsCounter;\n\t\tlet instruction = steps[index][0];\n\t\tlet copyData = [...data]\n\t\t// let copyDataBottom = [...dataBottom]\n\n\t\tif (instruction == 's') {\n\t\t\t// Switch:\n\t\t\t// [\"instruction\", index1, index2]\n\t\t\t// Switch what is at index1 with index2\n\t\t\tlet a = steps[index][1];\n\t\t\tlet b = steps[index][2];\n\n\t\t\tlet tmp = copyData[a];\n\t\t\tcopyData[a] = copyData[b];\n\t\t\tcopyData[b] = tmp;\n\t\t\t\n\t\t\tsetLightUp([a, b]);\n\t\t} else if (instruction == 'p') {\n\t\t\t// Put:\n\t\t\t// [\"instruction\", index, toPut]\n\t\t\t// Put what is toPut at index, replacing old element\n\t\t\tlet location = steps[index][1];\n\t\t\tlet toPut = steps[index][2];\n\n\t\t\tcopyData[location] = toPut;\n\n\t\t\tsetLightUp([location]);\n\t\t} else if (instruction == 'p2') {\n\t\t\t// Put Bottom:\n\t\t\t// [\"instruction\", index, toPut]\n\t\t\t// Put what is toPut at second graph's index, replacing old element\n\t\t\tlet location = steps[index][1];\n\t\t\tlet toPut = steps[index][2];\n\n\t\t\t// copyDataBottom[location] = toPut;\n\t\t\t// setLightUpBottom([location]);\n\t\t} else if (instruction == 'pa') {\n\t\t\t// Put Array:\n\t\t\t// [\"instruction\", index, toPut[]]\n\t\t\t// Put what is toPut[] at index, replacing old elements\n\t\t\tlet location = steps[index][1];\n\t\t\tlet toPut = steps[index][2];\n\n\t\t\tcopyData = [\n\t\t\t\t...copyData.slice(0,location),\n\t\t\t\t...toPut,\n\t\t\t\t...copyData.slice(location + toPut.length)\n\t\t\t];\n\t\t\t\n\t\t\t// generate an array from starting location with length identical to toPut\n\t\t\tlet toLightUp = Array(toPut.length).fill(location).map((x, y) => x + y);\n\t\t\tsetLightUp(toLightUp);\n\t\t} else if (instruction == 'pa2') {\n\t\t\t// Put Bottom Array:\n\t\t\t// [\"instruction\", index, toPut[]]\n\t\t\t// Put what is toPut[] at second graph's index, replacing old elements\n\t\t\tlet location = steps[index][1];\n\t\t\tlet toPut = steps[index][2];\n\n\t\t\t// copyDataBottom = [\n\t\t\t// \t...copyDataBottom.slice(0,location),\n\t\t\t// \t...toPut,\n\t\t\t// \t...copyDataBottom.slice(location + toPut.length)\n\t\t\t// ];\n\t\t\t\n\t\t\tlet toLightUp = Array(toPut.length).fill(location).map((x, y) => x + y);\n\t\t\t// setLightUpBottom(toLightUp);\n\t\t} else if (instruction == 'sp') {\n\t\t\t// Splice Bottom Array:\n\t\t\t// [\"instruction\", index, toSplice]\n\t\t\t// Splice what is toSplice at index, shifting existing elements\n\t\t\tlet location = steps[index][1];\n\t\t\tlet toSplice = steps[index][2];\n\n\t\t\tcopyData.splice(location, 0, toSplice);\n\t\t\t\n\t\t\t// setLightUpBottom(toLightUp);\n\t\t}\n\n\t\t// console.log(copyData);\n\t\tsetData(copyData);\n\t\t// setDataBottom(copyDataBottom);\n\t\tsetStepsCounter(stepsCounter - 1);\n\t}", "function fleshTraning ( vi, tTask ) {\n\ttry {\n\t\t//printErrorMSG ( \"fleshTraning\" );\n\n\t\tflag ( \"fleshTraning():: Started! vi: \" + vi );\n\t\t//TS_debug(\"come into fleshTraning in \" + getvillagefromdid(vi) + \"; to \" + getvillagefromdid(tTask[2]));\n //var urlSuffix = GM_getValue ( currentServer() + \"_\" + getuid() + \"_\" + vi + \"_marketExists\", \"&gid=17\");\n\t\tvar urlSuffix = (analyzeBuildingData(17, \"id\", vi)) ? \"&id=\"+analyzeBuildingData(17, \"id\", vi) :\"&gid=17\";\n\t\tvar turl = myhost + \"/build.php?newdid=\" + vi + urlSuffix + \"&t=5\";\n\n\t\tfunction callback() {};\n\n\t\tvar getDelayTime = new XMLHttpRequest();\n\t\t\n\t\tgetDelayTime.open('GET', turl, false);\n\t\t//getDelayTime.setRequestHeader(\"Content-Encoding\", \"gzip\");\n\t\tgetDelayTime.onreadystatechange = callback;\n\t\t//try {\n\t\t\tgetDelayTime.send(null);\n\t\t/*} catch(err) {\n\t\t\tTS_debug(\"FleshTrainig Request failed: \" + err);\n\t\t}*/\n\t\tfunction callback() {\n\t\t\tif (getDelayTime.readyState == 4) {\n\t\t\t\tif (getDelayTime.status == 200) {\n\t\t\t\t\tTS_debug(\"transporting flesh Require callback here\");\n\n\t\t\t\t\t//v_kir 2010.01.24\n\n\t\t\t\t\tvar aDoc = document/*.implementation.createDocument(\"\", \"\", null)*/;\n\t\t\t\t\tvar aElem = document.createElement('DIV');\n\t\t\t\t\taElem.innerHTML = getDelayTime.responseText;\n\t\t\t\t\t//aDoc.appendChild(aElem);\n\t\t\t\t\tif ( gatherStats(aElem.innerHTML) ) {\n\t\t\t\t\t\t// attempt reloading page, captcha ll be found there too and script will stop.\n\t\t\t\t\t\twindow.location.replace(myhost + \"/spieler.php\");\n\t\t\t\t\t\treturn 60*60*1000;\n\t\t\t\t\t}\n\n\t\t\t\t\t//delete value since we are processing it. Market analysis will set it again if requried.\n\t\t\t\t\tGM_deleteValue(myacc() + \"_\" + vi + \"_to_\" + tTask[2] + \"_TraningTime\");\n\n\t\t\t\t\trefreshPageInfo(aElem);\n\t\t\t\t\tvar Transtime = GM_getValue(myacc() + \"_\" + vi + \"_to_\" + tTask[2] + \"_TraningTime\");\n\t\t\t\t\tvar t = getIncomingResources ( tTask[2] );\n\t\t\t\t\t//TS_debug(\"Resource Transporting: \" + t);\n\n\t\t\t\t\t//update target resource since our merchant just arrive in target village.\n\t\t\t\t\tgetTargetResource(tTask[2]);\n\t\t\t\t\treturn Transtime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn callback();\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tprintErrorMSG(msg);\n\t\tvar msg = \"<b>fleshTraning():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tthrow err;\n\t}\n}", "submitSolution(selection, salt) {\n const contractInstance = rpsGameContract.at(this.state.currentGameAddress);\n contractInstance.solve(\n selection,\n salt,\n {\n from: web3.eth.accounts[0],\n gas: GAS_LIMIT,\n },function(error, transactionHash) {\n if (!error) {\n this.listenForHash(transactionHash);\n this.setState({\n pendingTxHash: transactionHash\n });\n }\n }.bind(this)\n )\n }", "function letMeSolveIt() {\n cbtn = document.getElementById(\"cap_info\");\n cbtn.scrollIntoView();\n cbtn.click();\n nWait = nWait + DONOTDISTURB;\n}", "function executarLooping() {\n moverFundo()\n moverHelicopteroInimigo()\n moverCaminhao()\n moverJogador()\n moverAliado()\n detectarColisoes()\n mostrarPlacar()\n atualizarEnergia()\n}", "function runQueenScramblingStrategy() {\n // Still need to orient ourselves.\n if (unobstructed) {\n\tif (foodTotal > 0) {\n\t return (runQueenScramblingEatingTactic()); // fast path\n\t} else if (myFood >= THRESHOLDC) {\n\t // Create the navigator on a laterally adjacent cell,\n\t // initiating the lightspeed phase whilst trying not to run\n\t // back along the trail that got us here.\n\t for (var i = 0; i < TOTAL_NBRS; i+=2) {\n\t\tif ((view[CCW[i]].color == LCL_TRAIL) ||\n\t\t (view[CCW[i+1]].color == LCL_TRAIL)) {\n\t\t return {cell:CCW[i+1], type:ANT_NAVIGATOR};\n\t\t}\n\t }\n\t // choose a random one if someone else has obliterated the trail\n\t return {cell:1, type:ANT_NAVIGATOR};\n\t} else if (myColor != LCL_TRAIL) {\n\t if ((myColor == LCL_CLEAR) ||\n\t\t(specNbrs[LCL_CLEAR] >= TOTAL_NBRS - 1)) {\n\t\t// extend trail by the cell we're standing on, fast\n\t\treturn {cell:POS_CENTER, color:LCL_TRAIL};\n\t } else {\n\t\t// check our surroundings more carefully\n\t\treturn (runQueenScramblingTrailCheckTactic());\n\t }\n\t \n\t} else if ((specNbrs[LCL_CLEAR] >= 4) &&\n\t\t (specNbrs[LCL_TRAIL] == 1)) {\n\t // Continue trail, fast. Still need to orient ourselves.\n\t // There's one trail cell in view; aim diagonally away from it.\n\t for (var i = 0; i < TOTAL_NBRS; i+=2) {\n\t\tif ((view[CCW[i]].color == LCL_TRAIL) ||\n\t\t (view[CCW[i+1]].color == LCL_TRAIL)) {\n\t\t return {cell:CCW[i+4]};\n\t\t}\n\t }\n\t} else if (specNbrs[LCL_CLEAR] == TOTAL_NBRS) {\n\t // Everything's white (trail start, or lost it).\n\t // Any diagonal direction is as good as any other.\n\t return {cell:0};\n\t} else { // slow path: no food, confusing colors\n\t return (runQueenScramblingAroundTactic());\n\t}\n } else {\n\t// Obstructed. There should not exist any friends (yet).\n\tif ((foodTotal > 0) && (foesTotal > 0) &&\n\t (foesTotal == adjFoes[ANT_QUEEN])) {\n\t // No unfriendly workers in view and there's food we can\n\t // snatch before the other queen gets it. Have at it.\n\t return (runQueenScramblingSnatchingTactic());\n\t} else {\n\t return (runQueenScramblingEvasionTactic());\n\t}\n }\n return CELL_NOP; // notreached\n}", "function solve(board) {\n const solution = new game.GameAI(board);\n const printSteps = false;\n return solution.singlePointAlgorithm(printSteps);\n}", "function execute(strategy) {\n strategy.solve();\n}", "function submitBotSolution(playerId) {\r\n if (currentRound < FIRST_ACTUAL_ROUND) {\r\n// alert('auto_submit');\r\n // survey questions, instructions etc\r\n submitBot(playerId, currentRound, 'auto_submit'); \r\n } else {\r\n // TODO: use botType\r\n var botSolution = XMLizeBotSolution(calculateBotSolution(playerId, currentRound));\r\n submitBot(playerId, currentRound, botSolution); \r\n }\r\n}", "function solve() {\r\n // some code here...\r\n // some more code here...\r\n}", "function go() {\n startTime = new Date();\n halt = false;\n docHeight = $(document).height();\n practiceMode = $('#practice').is(':checked');\n $('#practice').attr(\"disabled\", true);\n $('#stop').attr('disabled', false);\n $('#go').attr('disabled', true);\n $('#go').blur();\n if(!practiceMode) {\n parseSolution();\n\t\tcurrentProgress = 0;\n\t\tprogressInc = 100 / solution.length;\n }\n\n // Infinte loop for game play\n (function animloop() {\n if(halt) { return; }\n requestAnimFrame(animloop);\n if(paused) { return; }\n render();\n })();\n\n}", "function runEnclosingArrayCycle(fractionInformation) {\n // recursive function. Terminates when end of array is met\n let fractionCounter = 0;\n \n function runOneCycle() {\n fractionalControlSystemLocal.solenoid.setState(true);\n setTimeout(endOpenValve, 500);\n };\n \n function endOpenValve() {\n fractionalControlSystemLocal.solenoid.setState(false);\n setTimeout(waitUntilNextCycle, fractionInformation.closeTime);\n };\n\n \n \n function waitUntilNextCycle() {\n fractionCounter++;\n serverRunOverviewLocal.currentClickCountInBeaker=fractionCounter;\n \n // Breakpoint for cycles within one beaker\n if (fractionCounter < fractionInformation.cycleCount) {\n runOneCycle();\n } else {\n // move to next beaker in overall array \n positionInOverallArray++;\n console.log(`moving to next beaker ${positionInOverallArray}`);\n // updateBeakerEndTimes();\n // if the current beaker has a next function, run it. Currently used to move actuator arm\n if (fractionInformation.nextFunction) {\n // run end of fraction function; currently only used to move actuator arm\n fractionInformation.nextFunction();\n console.log(`moved actuator arm`);\n } \n // if there's another beaker in array, run its cycle\n if (positionInOverallArray<overallRunArray.length) {\n serverRunOverviewLocal.currentBeaker = positionInOverallArray;\n serverRunOverviewLocal.totalClickCountInBeaker = overallRunArray[positionInOverallArray].cycleCount;\n serverRunOverviewLocal.message = overallRunArray[positionInOverallArray].overallFraction;\n serverRunOverviewLocal.timeToCompleteBeaker = overallRunArray[positionInOverallArray].cycleCount * (0.5 + overallRunArray[positionInOverallArray].closeTime) / 1000;\n // move to next line in overall array\n runEnclosingArrayCycle(overallRunArray[positionInOverallArray]);\n } else {\n // end the run\n console.log(`Last beaker reached, moving to run termination`);\n serverRunOverview.message = `Last beaker completed, emptying the still`;\n endFractionalRun();\n serverRunOverviewLocal.running = false;\n }\n }\n };\n serverRunOverview.timeCurrentBeakerStarted = Date.now();\n runOneCycle(); // one cycle opens solenoid for 500 ms; closes for beaker's close time\n }", "function main() {\n var T = parseInt(readLine());\n \n for(var a0 = 0; a0 < T; a0++){\n \n \n var n = parseInt(readLine());\n q = readLine().split(' ');\n q = q.map(Number);\n \n \n q = [0].concat(q);\n \n var working =[0];\n \n var pending =[];\n \n for(var i =1;i<=n;i++){\n working.push(i);\n }\n \n var solution =0;\n \n //console.log('\\n',q,'\\n');\n \n for(var i=1;i<=n;i++){\n \n //console.log('ITERATION::',i)\n \n //console.log(working);\n\n \n //console.log('Q: ',q[i],' WORKING: ',working[i]);\n \n if(q[i]!= working[i] ){\n \n var index = working.indexOf(q[i]);\n \n var target =i;\n \n //console.log('TARGET: ',target,'INDEX: ',index);\n \n if( (index - target) > 2 || (target>index) ){\n pending.push({index:index,target:target,element:q[i]})\n }\n else{\n \n var element = working.splice(index,1);\n \n var rest = working.splice(target);\n \n var working = working.concat(element,rest);\n \n solution += index-target;\n }\n \n //console.log('SOLUTION: ',solution);\n \n }\n \n //console.log(working);\n\n \n var stopCondition =true;\n \n for(var j=1;j<n;j++){\n if(q[j]!== working[j]){\n stopCondition =false;\n break;\n }\n }\n \n if(stopCondition){\n console.log(solution);\n break;\n }\n \n }\n \n \n if(pending.length>0){\n console.log('Too chaotic')\n }\n \n \n \n \n }\n\n}", "function timeoutRedirect()\n\t\t{\n \t\t$location.path(\"/merchants/\" + merchantId + \"/thankyou\");\n\t\t}", "function attemptSolve(sourceElement, teamNumber) {\n if (!sourceElement.classList.contains(\"control-button-active\")) {\n return\n }\n sourceElement.classList.remove(\"control-button-active\");\n document.getElementsByClassName(\"correct-button\")[teamNumber-1].classList.add(\"control-button-active\");\n document.getElementsByClassName(\"incorrect-button\")[teamNumber-1].classList.add(\"control-button-active\");\n //Stop the clock if it's running\n if (countdownTimer !== null) {\n clearInterval(countdownTimer);\n }\n document.getElementById(\"reset-timer-button\").classList.remove(\"control-button-active\"); \n document.querySelectorAll(\".attempt-solve-button\").forEach(function(button) {\n button.classList.remove(\"control-button-active\");\n });\n postMessageToDisplay({\"message\":\"attemptingSolve\", \"team\":teamNumber});\n if (activeRoundNumber == 4) {\n switchActiveTeamTo(teamNumber);\n }\n}", "async function playAI() {\n var x = target[0];\n var y = target[1];\n console.log(\"Starting AI\");\n\n while (true) {\n var sea = solve();\n // Solving the path from snake head to apple\n if (!sea) break;\n var solved = sea[0];\n\n // x,y is the corrdinate of the current head\n x = solved[0][0];\n y = solved[0][1];\n var i = 1;\n var end = false;\n // game[target[0]][target[1]] = 2;\n // var found = sea[1] === true ? true : false;\n while (!(x === target[0] && y === target[1])) {\n if (pause === true) {\n await dopause();\n if (exit) break;\n continue;\n }\n // 0 Up, 1 Down, 2 Left, 3 Right\n if (exit) break;\n // for pausing the game\n tempDirection = getAiDirection(x, y, snake[0][0], snake[0][1]);\n snake = [[x, y], ...snake];\n // black - 0, white - 1, yellow - 2, red - 3\n // game[x][y] = 3;\n // game[snake[1][0]][snake[1][1]] = 1;\n\n // adds x,y as the new head to the snake\n\n changeColorAt(x, y, red);\n changeColorAt(snake[1][0], snake[1][1], white);\n var t = snake.pop();\n // game[t[0]][t[1]] = 0;\n // removes the tail\n changeColorAt(t[0], t[1], black);\n // snake = snake\n // assigns the new snake\n if (solved.length === 0) {\n sea = solve();\n if (!sea) {\n end = true;\n break;\n }\n solved = sea[0];\n }\n\n // get the next coordinate to move on,, in the solved path array\n var popp = solved.shift();\n x = popp[0];\n y = popp[1];\n\n // ------------ Used for collecting data for model training -----------\n // collectNNDataSeeingAsSnake(snake, target);\n\n // Update the frame with a delay of \"speed\"\n totalsteps += 1;\n await sleep(speed);\n i += 1;\n }\n\n if (exit) break;\n\n if (end)\n // End of game\n break;\n\n // Else the snake has eaten the apple\n tempDirection = getAiDirection(x, y, snake[0][0], snake[0][1]);\n snake = [[x, y], ...snake];\n\n changeColorAt(x, y, red);\n changeColorAt(snake[1][0], snake[1][1], white);\n\n // For Collecting data for training Neural Network Model\n // var t = snake.pop();\n // changeColorAt(t[0], t[1], black);\n // collectNNDataSeeingAsSnake(snake, target);\n\n generateTarget(snake);\n setScore();\n totalsteps += 1;\n // Generate a new target(apple) after eating the apple\n }\n}", "function solution(a) {\n let jump = 0;\n for (let i = 0; i < a.length; i +=a[i]) {\n if (jump > a.length * 100) return -1;\n if (i < 0) return jump;\n jump++;\n }\n return jump;\n}", "function quickestWayUp(ladders, snakes) {\n const START_POSITION = 1, END_POSITION = 100, MAX_STEPS = 6;\n let ladderMap = new Map(), snakeMap = new Map();\n for (let i = 0; i < ladders.length; i++)\n ladderMap.set(ladders[i][0], ladders[i][1]);\n for (let i = 0; i < snakes.length; i++)\n snakeMap.set(snakes[i][0], snakes[i][1]);\n\n function findNextChoices(prev, ladderMap, snakeMap) {\n let choices = [], prevPosition = prev.position;\n if (prevPosition >= END_POSITION || prevPosition < START_POSITION)\n throw Error(`Shouldn't happen when plan the game step by step, prevPosition: ${prevPosition}`);\n\n let normalCaseProcessed = false, snakeCases = 0;\n for (let nextPosition = Math.min(END_POSITION, prevPosition + MAX_STEPS); nextPosition > prevPosition; nextPosition--) {\n if (ladderMap.has(nextPosition)) {\n choices.push({ position: ladderMap.get(nextPosition), steps: prev.steps + 1 });\n }\n else if (snakeMap.has(nextPosition)) {\n choices.push({ position: snakeMap.get(nextPosition), steps: prev.steps + 1 });\n snakeCases++;\n }\n else if (normalCaseProcessed === false) {\n // only add [normal next position] once, which means no snake and no ladder\n choices.push({ position: nextPosition, steps: prev.steps + 1 });\n normalCaseProcessed = true;\n }\n\n }\n\n if (snakeCases >= MAX_STEPS)\n return; // therefore -1 will be returned;\n else\n return choices;\n }\n\n // use BFS way to push all choices when try to find the next position\n let queue = [{ position: START_POSITION, steps: 0 }];\n while (queue.length > 0) {\n let prev = queue.shift();\n let choices = findNextChoices(prev, ladderMap, snakeMap);\n if (choices === undefined || choices.length === 0)\n return -1;\n else {\n for (let i = 0; i < choices.length; i++) {\n let nextChoice = choices[i];\n if (nextChoice.position === END_POSITION)\n return prev.steps + 1;\n queue.push(nextChoice);\n }\n }\n }\n\n return -1;\n}", "function OnSolveButton (event)\n{\n if (errorsExist)\n {\n var originalMsg = document.getElementById ('Info').innerHTML;\n document.getElementById ('Info').innerHTML = 'Cannot solve since errors exist!!!' \n + '<br><br>' \n + originalMsg;\n return;\n }\n\n var puzzle = [];\n\n // read in puzzle...\n for (var i = 1; i <= 9; i++)\n {\n var row = [];\n for (var j = 1; j <= 9; j++)\n {\n var value = document.getElementById ('b' + i + j).innerText;\n if (value == '' || value == ' ')\n row.push (0);\n else\n row.push (+value);\n }\n puzzle.push (row);\n }\n\n const t0 = performance.now();\n SolvePuzzle (puzzle); \n const t1 = performance.now();\n\n for (var i = 0; i < 9; i++)\n {\n for (var j = 0; j < 9; j++)\n {\n var cell = document.getElementById ('b' + (i+1) + (j+1));\n cell.innerText = puzzle[i][j];\n if (cell.getAttribute ('CellState') == 'given')\n cell.style.color = givenColour;\n else\n cell.style.color = solvedColour;\n }\n }\n\n document.getElementById ('Info').innerHTML = 'Time to Solve: <br>' + \n (t1 - t0).toFixed(3) + ' milliseconds' +\n '<br><br>' +\n 'Number of Iterations: <br>' +\n FunctionCallCount;\n}", "function tctRedirect(url, timeout) {\n try {\n tctInitProgress();\n if (undefined == timeout) {\n timeout = 3000;\n }\n setTimeout(function() {\n window.location = (url);\n }, timeout);\n } catch (ex) {\n alert(ex.message);\n }\n}", "test(){\r\n\r\n const __quickSolver = (sudoku) =>{\r\n while(sudoku.simpleDeletion().status){}\r\n for(let i=1; i<=9; i++){\r\n for(let j=1; j<=9; j++){\r\n if(sudoku.getNumber(i, j)==0){\r\n if(sudoku.hasContradiction(false).status==true){\r\n return sudoku;\r\n }\r\n const candidates = sudoku.getCandidateInArray(i, j);\r\n if(candidates.length==0){\r\n sudoku.__hasContradiction = 1;\r\n return sudoku;\r\n }\r\n let count_contradiction = 0;\r\n let count_solved = 0;\r\n let n_copy;\r\n let solved_sudoku;\r\n for(const candidate of candidates){\r\n // 試しに代入して解く\r\n const sudoku_clone = sudoku.clone();\r\n sudoku_clone.setNumber(i, j, candidate);\r\n const result = __quickSolver(sudoku_clone);\r\n \r\n if(result.no_unique_solution==true){\r\n return result;\r\n }\r\n\r\n if(result.isSolved()==true){\r\n return result;\r\n }\r\n\r\n if(result.hasContradiction(false).status==true){\r\n sudoku.deleteCandidate(i, j, candidate)\r\n count_contradiction ++;\r\n continue;\r\n }\r\n }\r\n\r\n if(count_solved==1){\r\n sudoku.setNumber(i, j, n_copy);\r\n continue;\r\n }\r\n \r\n if(count_contradiction==candidates.length){\r\n sudoku.no_solution = true;\r\n sudoku.__hasContradiction = 1;\r\n return sudoku;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return sudoku;\r\n };\r\n \r\n return __quickSolver(this.clone());\r\n }", "function solve(board){\n for(let y = 0; y < 9; y++){\n for(let x = 0; x < 9; x++){\n if (board[y][x] == 0){\n for(let number = 1; number < 10; number++){\n if (checkRulesAtPoint(x, y, number, board)){\n board[y][x] = number;\n // console.log(board);\n // console.log('\\n');\n solve(board);\n board[y][x] = 0;\n }\n }\n return;\n }\n }\n }\n for(let x = 0; x < 9; x++){\n for(let y = 0; y < 9; y++){\n returnedInformation[y][x] = board[y][x];\n }\n }\n}", "function solveNetwork(){\n\n\t//Reset tanks output \n\tTanks.forEach(function(tank){tank.value=null});\n\n\t//solve all easy cases: only 1 output\n\t(function(){\n\t\t//1. troba els nodes que tenen només un output: flow=value\n\t\tfor(var i in Connections) {\n\t\t\tvar from=Connections[i].from;\n\t\t\tif(getOutputs(from).length==1)\n\t\t\t{\n\t\t\t\tif(Connections[i].flow==null)\n\t\t\t\t{\n\t\t\t\t\tvar flow=getNodeByName(from).value;\n\t\t\t\t\tif(flow!=null) Connections[i].flow=flow;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})();\n\n\tvar notCalcItems=Infinity;//initial value that we have to get to 0\n\n\t//infinte loop for solving network\n\tvar iteracio=1;\n\n\twhile(true) {\n\t\tconsole.log(\"[+] new solver iteration (\"+iteracio+\")\");\n\n\t\t//calc connection flows\n\t\tConnections.forEach(function(con){\n\t\t\tisConCalculable(con);\n\t\t})\n\n\t\t//calc tank outputs\n\t\tTanks.forEach(function(tank){\n\t\t\tisCalculable(tank.name);\n\t\t})\n\n\t\t//check if we are solving new nodes\n\t\tvar nci=getNotCalcNodes()+getNotCalcCons();\n\t\tconsole.log(\"items no calculats:\"+nci)\n\t\tif(nci==0) {\n\t\t\tconsole.log(\"\\nSUCCESS! ALL ITEMS CALCULATED\");\n\t\t\treturn;\n\t\t}\n\t\tif(nci==notCalcItems) {\n\t\t\talert(\"ERROR! We are not solving new items (nodes and links). System is undetermined or is already calculated\");\n\t\t\treturn;\n\t\t}\n\t\tnotCalcItems=nci;//update nonCalcNodes\n\n\t\titeracio++;\n\t}\n}", "function solution()\n{\n\t// initialize correct-piece counter\n\tvar wincounter = piecenumber;\t\n\t\n\t// check each puzzle piece row by row\n\tfor (i = 0; i < piecerows; i++)\n\t{\n\t\tfor (j = 0; j < piececols; j++)\n\t\t{\n\t\t\t// get current position\n\t\t\tvar xcurr = $(\"#piece\" + i + j).position().left;\n\t\t\tvar ycurr = $(\"#piece\" + i + j).position().top;\n\t\t\t\n\t\t\t// get desired position\n\t\t\tvar ywin = i * piecesize;\n\t\t\tvar xwin = j * piecesize;\n\t\t\t\n\t\t\t// compare and score\n\t\t\tif ((Math.abs(xcurr - xwin) <= 10) && (Math.abs(ycurr - ywin) <= 10))\n\t\t\t\twincounter--;\n\t\t}\n\t}\n\t\n\t// debug\n\t// alert(\"Incorrect Pieces Remaining: \" + wincounter);\n\n\t// you win! maybe.\n\tif (wincounter == 0)\n\t{\n\t\t// freeze pieces\n\t\t$(\".piece\").draggable({disabled: true});\n\n\t\t// freeze solution checking\n\t\t$(\".piece\").unbind(\"mouseup\");\n\t\t\n\t\t// alert user\n\t\tyouwin();\n\t}\n\n}", "function runQueenScramblingStrategy() {\n // Still need to orient ourselves.\n if (unobstructed) {\n\tif (foodTotal > 0) {\n\t return (runQueenScramblingEatingTactic()); // fast path\n\t} else if (myFood >= THRESHOLDC) {\n\t // Create the secretary/navigator on a laterally adjacent cell,\n\t // initiating the lightspeed phase whilst trying not to run\n\t // back along the trail that got us here.\n\t for (var i = 0; i < TOTAL_NBRS; i+=2) {\n\t\tif ((view[CCW[i]].color == LCL_TRAIL) ||\n\t\t (view[CCW[i+1]].color == LCL_TRAIL)) {\n\t\t return {cell:CCW[i+1], type:ANT_STAFF};\n\t\t}\n\t }\n\t // choose a random one if someone else has obliterated the trail\n\t return {cell:1, type:ANT_STAFF};\n\t} else if (myColor != LCL_TRAIL) {\n\t if ((myColor == LCL_CLEAR) ||\n\t\t(specNbrs[LCL_CLEAR] >= TOTAL_NBRS - 1)) {\n\t\t// extend trail by the cell we're standing on, fast\n\t\treturn {cell:POS_CENTER, color:LCL_TRAIL};\n\t } else {\n\t\t// check our surroundings more carefully\n\t\treturn (runQueenScramblingTrailCheckTactic());\n\t }\n\t \n\t} else if ((specNbrs[LCL_CLEAR] >= 4) &&\n\t\t (specNbrs[LCL_TRAIL] == 1)) {\n\t // Continue trail, fast. Still need to orient ourselves.\n\t // There's one trail cell in view; aim diagonally away from it.\n\t for (var i = 0; i < TOTAL_NBRS; i+=2) {\n\t\tif ((view[CCW[i]].color == LCL_TRAIL) ||\n\t\t (view[CCW[i+1]].color == LCL_TRAIL)) {\n\t\t return {cell:CCW[i+4]};\n\t\t}\n\t }\n\t} else if (specNbrs[LCL_CLEAR] == TOTAL_NBRS) {\n\t // Everything's white (trail start, or lost it).\n\t // Any diagonal direction is as good as any other.\n\t return {cell:0};\n\t} else { // slow path: no food, confusing colors\n\t return (runQueenScramblingAroundTactic());\n\t}\n } else {\n\t// Obstructed. There should not exist any friends (yet).\n\tif ((foodTotal > 0) && (foesTotal > 0) &&\n\t (foesTotal == adjFoes[ANT_QUEEN])) {\n\t // No unfriendly workers in view and there's food we can\n\t // snatch before the other queen gets it. Have at it.\n\t return (runQueenScramblingSnatchingTactic());\n\t} else {\n\t return (runQueenScramblingEvasionTactic());\n\t}\n }\n return CELL_NOP; // notreached\n}" ]
[ "0.5905619", "0.5905619", "0.5762027", "0.55624634", "0.5552511", "0.5515747", "0.5423148", "0.53984857", "0.53957987", "0.5395104", "0.5333132", "0.5246411", "0.5198886", "0.5194895", "0.51609963", "0.51185673", "0.51114535", "0.5090567", "0.5082154", "0.5080496", "0.50766724", "0.5071302", "0.50516665", "0.50474334", "0.5047304", "0.5043423", "0.503645", "0.5035437", "0.50263727", "0.5022535", "0.50148064", "0.5011125", "0.4999241", "0.49888164", "0.49816412", "0.4974634", "0.49711072", "0.49703908", "0.4961949", "0.49545744", "0.49515632", "0.49503452", "0.49450174", "0.49298564", "0.4922828", "0.49140072", "0.4912866", "0.4899982", "0.4899044", "0.4890221", "0.4884239", "0.48722312", "0.48498467", "0.4846005", "0.48445112", "0.48438263", "0.48418948", "0.4838628", "0.48345795", "0.4832808", "0.48323417", "0.4829079", "0.48271266", "0.4826843", "0.4825499", "0.4825499", "0.48228347", "0.48172465", "0.48156548", "0.48046193", "0.47887492", "0.4788747", "0.47849905", "0.47845694", "0.4780313", "0.4779787", "0.47793558", "0.47733265", "0.47667736", "0.47584754", "0.4756509", "0.47531882", "0.47514263", "0.47475162", "0.4742306", "0.47414127", "0.4739711", "0.4735699", "0.47327137", "0.47276965", "0.47160277", "0.47124252", "0.47064856", "0.47024193", "0.46973383", "0.46957788", "0.46924403", "0.4686332", "0.46861166", "0.46836838" ]
0.75672466
0
Gets array of objects and builds gets tree using mged's tree command and parses it into json
function getModelTree(objectsArray, filePath) { const tree = {}; const treeCommand = part => `mged -c ${filePath} tree -a -i 2 ${part} 2>&1`; for (const obj of objectsArray) { const currentObject = (tree[ obj[obj.length - 1] === "/" ? obj.substring(0, obj.length - 1) : obj ] = {}); if (obj[obj.length - 1] === "/") { let lines = execSync(treeCommand(obj.substring(0, obj.length - 1)), { encoding: "UTF-8" }); lines = lines.split("\n"); let prevIndent = 0; let road = [currentObject]; // eslint-disable-line for (const line of lines) { const args = line.split(/ +/); if (args[1] === "@") { road[road.length - 1][args[2]] = args[3]; } if (args[1] === "u" && trimR(args[2]) !== args[2]) { const indent = /^ +/.exec(line); let indentLength = 0; if (indent) { indentLength = indent[0].length; } const indentChange = indentLength - prevIndent; if (indentChange < 0) { road.pop(); if (road[road.length - 1] === {}) { delete road[road.length - 1]; } for (let i = indentChange; i < 0; i += 2) { road.pop(); } road.push((road[road.length - 1][trimR(args[2])] = {})); } else if (indentChange > 0) { road.push((road[road.length - 1][trimR(args[2])] = {})); } else if (indentChange === 0) { road.pop(); road.push((road[road.length - 1][trimR(args[2])] = {})); } prevIndent = indentLength; } } } } return tree; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildingObjectTree(array, obj = {}) {\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i].parent === null) {\r\n obj[array[i].id] = {};\r\n array.slice(i, 1);\r\n break;\r\n }\r\n }\r\n for (let i = 0; i < array.length; i++) {\r\n tree(array[i], obj);\r\n }\r\n return obj;\r\n}", "function buildTree(jsonData, arrayTitles) {\n // current date and time to display on front end\n const date = new Date().toLocaleString('en-GB', {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: 'numeric',\n minute: 'numeric'\n });\n\n // the initialisation of the object\n let outputData = {\n name: 'Financial Services',\n lastModified: date,\n children: []\n };\n\n // loops through each row of data\n jsonData.forEach(function(data) {\n // initialise the levels\n let l1, l2, l3, l4, l5;\n for (var i = 0; i < arrayTitles.length; i++) {\n // initialise new object\n let newObject;\n\n // checks to see if it's the final object, if it is then returns all data otherwise just returns name and child\n if (i === arrayTitles.length - 1) {\n newObject = {\n name: data[arrayTitles[i]],\n size: 1,\n workforceType: data['Workforce Type'],\n newClientName: data['NEW CLIENT NAME'],\n smartAccountGroupName: data['Smart Account Group Name'],\n jobRoleSpecialty: data['Job Role/Specialty'],\n bandLow: data['Band Low'],\n bandHigh: data['Band High'],\n startDate: data['Start Date'],\n candidatesInPlay: data['Has Candidates in Play'],\n additionalComments: data['Additional Comments'],\n contractStatus: data['Contract Status'],\n csaID: data['CSA Request ID'],\n endDate: data['End Date'],\n jrsService: data['JR/S Service'],\n jrsPractice: data['JR/S Practice'],\n skillsToHave: data['Nice to Have Skills'],\n opportunityOwnerNotesId: data['Opportunity Owner Notes ID'],\n opportunityName: data['Opportunity Name'],\n ownerNotesId: data['Owner Notes ID'],\n planTotalRequiredPositions: data['Plan Total Required Positions'],\n positionDescription: data['Position Description'],\n projectDescription: data['Project Description'],\n roadmapStatus: data['New Roadmap Status'],\n projectName: data['Project Name'],\n projectContactEmail: data['Project Contact Email Address'],\n requiredSkills: data['Required Skills'],\n createdDate: data['Created Date'],\n hoursPerWeek: data['Hours Per Week'],\n workLocationCity: data['Work Location City'],\n metroHiringRequestId: data['Metro Hiring Request ID'],\n priorityRankingNumber: data['Priority Ranking Number'],\n urgentFlag: data['Urgent Flag'],\n urgentReason: data['Urgent Reason'],\n winOdds: data['Roadmap Status'],\n positionId: data['Position ID'],\n seatContractorCandidates: data['Seat Contractor Candidates'],\n seatIBMCandidates: data['Seat IBM Regular Candidates'],\n seatCandidatesNotSelected: data['Seat Candidates Not Selected'],\n seatCandidatesWithdrawn: data['Seat Candidates Withdrawn'],\n seatCandidatesProposed: data['Seat Candidates Proposed'],\n seatCandidatesSelected: data['Seat Candidates Selected']\n };\n } else {\n newObject = {\n name: data[arrayTitles[i]],\n children: []\n };\n }\n\n // checks which level to push the object to\n if (i === 0) {\n if (!checkExists(data[arrayTitles[i]], outputData.children)) {\n outputData.children.push(newObject);\n }\n } else if (i === 1) {\n l1 = findIndex(data[arrayTitles[i - 1]], outputData.children);\n if (\n !checkExists(data[arrayTitles[i]], outputData.children[l1].children)\n ) {\n outputData.children[l1].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[\n findIndex(data[arrayTitles[i]], outputData.children[l1].children)\n ].size++;\n }\n }\n } else if (i === 2) {\n l2 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children\n )\n ) {\n outputData.children[l1].children[l2].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children\n )\n ].size++;\n }\n }\n } else if (i === 3) {\n l3 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children[l2].children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children\n )\n ) {\n outputData.children[l1].children[l2].children[l3].children.push(\n newObject\n );\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[l3].children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children\n )\n ].size++;\n }\n }\n } else if (i === 4) {\n l4 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children[l2].children[l3].children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children\n )\n ) {\n outputData.children[l1].children[l2].children[l3].children[\n l4\n ].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children\n )\n ].size++;\n }\n }\n } else if (i === 5) {\n l5 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[l5].children\n )\n ) {\n outputData.children[l1].children[l2].children[l3].children[\n l4\n ].children[l5].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[l5].children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[l5].children\n )\n ].size++;\n }\n }\n }\n }\n });\n\n // returns the value back to where the function is called from\n return outputData;\n}", "makeTree() {\n\t\tif (this.length === 0)\n\t\t\treturn [];\n\t\tlet base = this.data;\n\t\tlet dataTree = [];\n\t\tconst mappedWFItems = new Map();\n\t\tbase.forEach(wfItem => mappedWFItems.set(wfItem.id, {...wfItem}));\n\t\tbase.forEach(wfItem => {\n\t\t\tif (wfItem.parentID) {\n\t\t\t\tlet mfwItem = mappedWFItems.get(wfItem.parentID);\n\t\t\t\tif (!mfwItem.children)\n\t\t\t\t\tmfwItem.children = [];\n\t\t\t\tmfwItem.children.push(mappedWFItems.get(wfItem.id));\n\t\t\t}\n\t\t\telse dataTree.push(mappedWFItems.get(wfItem.id));\n\t\t});\n\t\t//Sort children via order prop!\n\t\tdataTree.forEach(twfItem => {\n\t\t\tif(twfItem.children && twfItem.children.length > 0){\n\t\t\t\ttwfItem.children = sortChildren(twfItem.children); \n\t\t\t}\n\t\t});\n\t\tthis.tree = dataTree;\n\t\tthis._mappedWFs = mappedWFItems;\n\t\treturn dataTree;\n\t}", "function assembleTree(data) {\n var t = [];\n var list = data.map(function (i) {\n return {\n id: i.id,\n icon: i.icon,\n label: i.name,\n action: i.url,\n parentId: i.parentId\n };\n });\n\n function findChild(i) {\n var c = list.filter(function (c) {\n return c.parentId == i.id;\n });\n if (c && c.length) {\n i.terminal = false;\n var f = false;\n c.forEach(function (ci) {\n var cf = findChild(ci);\n if (cf) f = true;\n });\n i.children = c;\n i.ismenu = f;\n return true;\n }\n i.terminal = true;\n return false;\n }\n\n list.forEach(function (i) {\n if (!i.parentId) {\n findChild(i);\n t.push(i);\n }\n });\n return t;\n }", "function getTree(){ \n //var stime = new Date();\n $.getJSON('/ajax/phytree',function(data){\nalert('phytree')\n phytree = new dTree('phytree'); //参数tree,表示生成的html代码中id的标记,不影响功能\n phytree.add(0,-1,'物理视图','../physical','','content','','','','menu_phy'); \n $.each(data,function(entryIndex,entry){\n phytree.add(entry['id'], entry['pid'], entry['name'],'../'+entry['url'],'','content','/media/dtree/img/base.gif','/media/dtree/img/base.gif','',entry['menu']);\n });\n $(\"#phyDiv\").html(phytree.toString());\n });\n }", "function createTreeJson(jsonObj, campaignNodes, coaNodes, etNodes, incidentNodes, indiNodes, obsNodes, taNodes, ttpNodes) {\n var reportChildren = [];\n var topLevelChild = null;\n\n topLevelChild = createStixChildren(campaignNodes, STIXGroupings.ca);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n topLevelChild = createStixChildren(coaNodes, STIXGroupings.coa);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n topLevelChild = createStixChildren(etNodes, STIXGroupings.et);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n topLevelChild = createStixChildren(incidentNodes, STIXGroupings.incident);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n topLevelChild = createStixChildren(indiNodes, STIXGroupings.indi);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n topLevelChild = createStixChildren(obsNodes, STIXGroupings.obs);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n } \n topLevelChild = createStixChildren(taNodes, STIXGroupings.ta);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n topLevelChild = createStixChildren(ttpNodes, STIXGroupings.ttp);\n if (topLevelChild != null) {\n reportChildren.push(topLevelChild);\n }\n\n jsonObj['children'] = reportChildren;\n return jsonObj;\n}", "getTree() {\n\n return [\n 'apply',\n this.address.getTree(),\n this.args.map(arg => arg.getTree()),\n this.block\n ];\n }", "function buildTree(dataRef, id, index){\n $.getJSON(dataRef + \"?format=json&callback=?\", function(data){\n var childUrl = data.EntityDescriptionMsg.entityDescription.namedEntity.children;\n\n $.getJSON(childUrl + \"?format=json&callback=?\", function(childData){\n var childList = childData.EntityDirectory.entry;\n var html= \"<ul id=\\\"level2\\\" data-li_index='\" + index + \"' class=\\\"tree\\\" >\";\n for (var i in childList) {\n var name = childList[i].knownEntityDescription[0].designation;\n var ref = childList[i].knownEntityDescription[0].href;\n html= html + \"<li><a id=\\\"level2\\\" data-cts2ref='\" + ref +\n \"' label-default=\\\"\\\" >\"\n + name + \"</a></li>\";\n }\n var select = \"a[id=\" + id + \"][data-index=\" + index + \"]\";\n $(select).append(html + \"</ul>\");\n\n });\n });\n}", "function buildTree(json,lcclass){\n\t// thanks http://www.jstree.com/\n\t\n\tvar treediv = document.getElementById(\"treediv\");\n\t// clear it\n\t treediv.innerHTML=\"\";\n \t// insert spaces back into lcclass\n \tlcclass = lcclass.replace(/%20/g, ' ');\n \t// get the json\n\tvar classarray = JSON.parse(json);\n\t // ------ get children \n \n\tvar i,li, kid, kidRawName,kidItemCount,childs = new Array; \n // -- build the trunk that shows all the parent classes - top line of the list\n var trunk = document.createElement(\"p\"); // create the parent il\n trunk.setAttribute(\"class\",\"parentitem\");\n trunk.setAttribute(\"id\",\"listparent\");// add the root button\n treediv.appendChild(trunk); // append item \n // Create the root button that will show the very top level\n var rootbtn = document.createElement(\"span\"); // buttonizeSubjectClassString(\"root\",'NONE');\n rootbtn.setAttribute(\"title\",\"Root of all subject classes\");\n var rootimg = document.createElement(\"img\");\n rootimg.setAttribute(\"src\",\"images/up.png\");\n rootbtn.appendChild(rootimg);\n // rootbtn.setAttribute(\"onclick\",\"fetchAndCheckChildClasses('NONE','')\");\n rootbtn.setAttribute(\"onclick\",\"fetchChildren('')\");\n trunk.appendChild(rootbtn);\n // linkify the string\n if (lcclass != \"\"){\n var linkspan = document.createElement(\"span\");\n var lcclassWithoutTail = removeTail(lcclass); // do no link the final element\n if (lcclassWithoutTail != lcclass){\n \t\tarrayclasswithouttail = [lcclassWithoutTail]; // buttonize expects array\n \t\tlinkspan.appendChild(buttonizeSubjectClassString(arrayclasswithouttail, 'NONE'));\n }\n // create final member: doesn't get children but can get leaves\n var unlinkedspan = document.createElement(\"span\");\n textnode = document.createTextNode(lastBranchOnly(lcclass));\n unlinkedspan.appendChild(textnode);\n unlinkedspan.setAttribute(\"class\",\"lastelement\");\n // embed the leaves icon into this final element\n var unlinkedleavesimg = document.createElement(\"img\");\n unlinkedleavesimg.setAttribute(\"src\",\"images/graphbtn2-small.png\");\n var unlinkedleavesspan = document.createElement(\"span\");\n var anames = createNames(lcclass);\n unlinkedleavesspan.setAttribute(\"title\",\"Display the items directly under this class\");\n unlinkedleavesspan.setAttribute(\"onclick\",\"fetchGraphData('\" + anames['php'] +\"')\");\n unlinkedleavesspan.appendChild(unlinkedleavesimg);\n unlinkedspan.appendChild(unlinkedleavesspan);\n \n if (unlinkedspan.innerHTML != lcclass){\n \tlinkspan.appendChild(unlinkedspan);\n }\n trunk.appendChild(linkspan);\n }\n \n var branchesdiv = document.createElement(\"div\"); // ul for the children\n trunk.appendChild(branchesdiv); // append the children's ul \n\t\n\t// -- make each child into a div\n\tvar displaychildname=\"\", kidClass=\"\",kidItemCount=0;\n\tfor (i=0; i < classarray.length; i++){\n\t\tkid = classarray[i]; // get one entry\n\t\tkidClass = kid[\"class\"];\n\t\tvar names = createNames(kidClass);\n\t\tkidItemCount = kid[\"bookcount\"];\n\t\tbranch = document.createElement(\"div\");\n\t\tbranch.setAttribute(\"id\",\"treelist\" + i);\n\t\tbranch.setAttribute(\"class\",\"branch\");\n\t\tvar displaychildnameraw = lastBranchOnly(kidClass);\n\t\t//var displaychildname = displaychildnameraw.replace(/'/g, \"&#39;\");\n\t\t//displaychildname = displaychildname.replace(/\"/g, \"&#34;\");\n\t\t//if (displaychildname.length > 30){\n\t\t//\tdisplaychildname = displaychildname.substr(0,30) + \"...\";\n\t\t//\t}\n\t\tdisplaychildname = names[\"displayPathShortest\"]; // 30 character abbreviation of full path\n\t\t// link the subj class so that it gets its children\n\t\tlinkspan = document.createElement(\"span\");\n \t\tlinkspan.setAttribute(\"class\",\"arrow_box\");\n \t\tvar escapedkidclass = kidClass.replace(/'/g, \"&#39;\");\n \t\tescapedkidclass = escapedkidclass.replace(/\"/g, \"&#34;\");\n \t\tif (lcclass != \"\"){\n \t\t\tvar kidslcclass = lcclass + \" -- \" + escapedkidclass; // add the child to the subj\n \t\t}\n \t\telse {\n \t\t\tvar kidslcclass = escapedkidclass; // add the child to the subj\n \t\t}\n \t\t//var fetchrel = \"fetchAndCheckChildClasses('\" + (\"treelist\" + i) + \"','\" + names[\"raw\"] + \"')\";\n\t\tvar fetchrel = \"fetchChildren(\" + \"'\" + names['php'] + \"')\";\n\t\tlinkspan.setAttribute(\"onclick\",fetchrel);\n\t\tlinkspan.setAttribute(\"title\",names[\"html\"]); // hover\n\t\tlinkspan.innerHTML = names[\"lastNameHtml\"];\n\t\n\t\ttreediv.appendChild(branch); // attach it\n\t\t\t\t\n\t\t// attach book button (were leaves)\n\t\tshowEmpties = true;\n\t\tif ((showEmpties == true) || (kidItemCount > 0)){\n\t\t\tvar bookspan = createChartButton(names[\"raw\"],kidItemCount );\n\t\t\t// create container span so that clicks work for both lcclass and book icon\n\t\t\tvar contspan = document.createElement(\"span\");\n\t\t\n\t\t\tbranch.appendChild(linkspan);\n\t\t\tbranch.appendChild(bookspan);\n\t\t\t// append to the li\n\t\t\t//branch.appendChild(contspan);\n\t\t\ttreediv.appendChild(branch); // attach it\n\t\t\t\t\n\t \t}\n }\n}", "function buildTree(arr) {\r\n\t \r\n\tlet findNestedObj = function (obj, parent, id) {\r\n\r\n\t\tif(Object.keys(obj).map(Number).indexOf(parent) != -1) {\r\n\t\t\treturn obj[parent][id]={};\r\n\t\t}\r\n\r\n\t\tfor (let i in obj) {\r\n\t\t\t\r\n\t\t\tif (Object.keys(obj[i]).length > 0) {\r\n\t\t\t\t findNestedObj(obj[i], parent, id);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tlet tree = arr.reduce(function (t, el){\r\n\r\n\t\t\t\t\tif(el.parent == null) t[el.id] = {};\r\n\t\t\t\t\telse findNestedObj (t, el.parent, el.id);\r\n\r\n\t\t\t\treturn t;\r\n\t\t\t\t\r\n\t\t\t},{});\r\n\r\n\treturn tree;\r\n\t\r\n}", "function getTrees() {\n let trees = [];\n for (let i = 1; i <= 5; i++) {\n let trunkElm = $(`#trunk-${i}`);\n let leavesElm = $(`#leaves-${i}`);\n let startPathTrunk = trunkElm.getAttribute(\"d\");\n let startPathLeaves = leavesElm.getAttribute(\"d\");\n let endPathTrunk = _getEndPath(startPathTrunk);\n let endPathLeaves = _getEndPath(startPathLeaves);\n let obj = {\n leaves: { elm: leavesElm, paths: [startPathLeaves, ...endPathLeaves] },\n trunk: { elm: trunkElm, paths: [startPathTrunk, ...endPathTrunk] },\n tilt: i <= 3 ? \"right\" : \"left\"\n };\n trees.push(obj);\n }\n return trees;\n}", "static fromJson(js) {\n function recursive(jsnode, name, parent) {\n let node = new NodeTree_1.default(name, parent);\n if (jsnode !== null) {\n for (let key in jsnode) {\n node.childs.push(recursive(jsnode[key], key, node));\n }\n }\n return node;\n }\n let tree = new Tree();\n if (js !== null && Object.keys(js).length != 0) {\n let rootName = Object.keys(js)[0];\n tree.root = recursive(js[rootName], rootName, null);\n }\n return tree;\n }", "function genTree(data, leafIds) {\n var compare = function (a, b) {\n return a.level - b.level;\n }\n\n //1.records to tree array\n var tree = [];\n for (var i = 0; i < data.length; i++) {\n data[i].folder = false;\n data[i].level = tool.countChar(data[i].path, '/');\n data[i].image_num = 0;\n data[i].is_leaf = false;\n data[i].leaf_descendant = [];\n data[i].children = [];\n tree.push(data[i]);\n }\n tree.sort(compare);\n\n //2.scan to form the map\n var map = {};\n for (i = 0; i < tree.length; i++) {\n map[tree[i].id] = i;\n }\n\n //3.leafIds\n for (i = 0; i < leafIds.length; i++) {\n tree[map[leafIds[i].ID]].image_num = leafIds[i].NUM;\n tree[map[leafIds[i].ID]].is_leaf = true;\n }\n\n //4.insert from the tail to head in tree\n for (i = tree.length - 1; i >= 0; i--) {\n var p_idx = map[tree[i].parent_id];\n if (tree[i].parent_id == -1)\n continue;\n\n tree[p_idx]['children'].push(tree[i]);\n tree[p_idx]['image_num'] += tree[i].image_num;\n if (tree[i].is_leaf) {\n tree[p_idx]['leaf_descendant'].push(tree[i].id);\n } else {\n for (var j = 0; j < tree[i]['leaf_descendant'].length; j++) {\n tree[p_idx]['leaf_descendant'].push(tree[i]['leaf_descendant'][j]);\n }\n }\n tree[p_idx].folder = true;\n tree.pop();\n }\n return tree;\n}", "getTree() {\n\n return ['array'].concat(this.elements.map(elem => elem.getTree()));\n }", "function generateTreeJson(inputFiles) {\n\tvar campaignObjs = [];\n\tvar coaObjs = [];\n\tvar etObjs = [];\n\tvar incidentObjs = [];\n\tvar indiObjs = [];\n\tvar obsObjs = [];\n\tvar taObjs = [];\n\tvar ttpObjs = [];\n\n\tvar campaignNodes = [];\n\tvar coaNodes = [];\n\tvar etNodes = [];\n\tvar incidentNodes = [];\n\tvar indiNodes = [];\n\tvar obsNodes = [];\n\tvar taNodes = [];\n\tvar ttpNodes = [];\n\t\n\tvar campaignBottomUpInfo = {};\n\tvar coaBottomUpInfo = {};\n\tvar etBottomUpInfo = {};\n\tvar incidentBottomUpInfo = {};\n\tvar indiBottomUpInfo = {};\n\tvar obsBottomUpInfo = {};\n\tvar taBottomUpInfo = {};\n\tvar ttpBottomUpInfo = {};\n\t\n\tvar numFiles = 0;\n\tvar topNodeName = \"\";\n\n\t$(inputFiles).each(function (index, f) {\n var xml = null;\n var reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n \t// top node name in tree is list of filenames\n \t\t\t\tif (numFiles == 0) {\n \t\t\t\t\ttopNodeName = f.name;\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\ttopNodeName = topNodeName + \"\\n\" + f.name;\n \t\t\t\t}\n xml = new DOMParser().parseFromString(this.result, \"text/xml\"); \n addXmlDoc(theFile.name,xml); // adds the new XML file to the drop down menu in the UI\n // global copy of xml to use for searching via xpFind\n doc = xml;\n \n // first collect top level components from all files\n // ets are in stixCommon, observables are in cybox, other top level objs are in stix\n $.merge(campaignObjs, xpFind('//stix:Campaigns/stix:Campaign', xml));\n $.merge(coaObjs, xpFind('//stix:Courses_Of_Action/stix:Course_Of_Action', xml));\n $.merge(etObjs, xpFind('//stix:Exploit_Targets/stixCommon:Exploit_Target', xml));\n $.merge(incidentObjs, xpFind('//stix:Incidents/stix:Incident', xml));\n $.merge(indiObjs, xpFind('//stix:Indicators/stix:Indicator', xml));\n $.merge(obsObjs, xpFind('//stix:Observables/cybox:Observable', xml));\n $.merge(taObjs, xpFind('//stix:Threat_Actors/stix:Threat_Actor', xml));\n $.merge(ttpObjs, xpFind('//stix:TTPs/stix:TTP', xml));\n numFiles++;\n \n // done collecting from files, start processing objects\n if (numFiles == inputFiles.length) { // finished last file\n \tjsonObj[\"name\"] = topNodeName;\n campaignNodes = processCampaignObjs(campaignObjs, incidentBottomUpInfo, indiBottomUpInfo, taBottomUpInfo, ttpBottomUpInfo);\n coaNodes = processCoaObjs(coaObjs);\n etNodes = processETObjs(etObjs, coaBottomUpInfo);\n incidentNodes = processIncidentObjs(incidentObjs, coaBottomUpInfo, indiBottomUpInfo, obsBottomUpInfo, taBottomUpInfo, ttpBottomUpInfo);\n indiNodes = processIndicatorObjs(indiObjs, coaBottomUpInfo, indiBottomUpInfo, obsBottomUpInfo, ttpBottomUpInfo);\n obsNodes = processObservableObjs(obsObjs);\n taNodes = processThreatActorObjs(taObjs, campaignBottomUpInfo, ttpBottomUpInfo);\n ttpNodes = processTTPObjs(ttpObjs, etBottomUpInfo);\n\n // after processing object, add children collected from idRefs\n addBottomUpInfoForNodes(campaignNodes, campaignBottomUpInfo);\n addBottomUpInfoForNodes(coaNodes, coaBottomUpInfo);\n addBottomUpInfoForNodes(etNodes, etBottomUpInfo);\n addBottomUpInfoForNodes(incidentNodes, incidentBottomUpInfo);\n addBottomUpInfoForNodes(obsNodes, obsBottomUpInfo);\n addBottomUpInfoForNodes(taNodes, taBottomUpInfo);\n addBottomUpInfoForNodes(ttpNodes, ttpBottomUpInfo);\n \n // create the json for the tree\n jsonObj = createTreeJson(jsonObj, campaignNodes, coaNodes, etNodes, incidentNodes, indiNodes, obsNodes, taNodes, ttpNodes);\n // displays Json to web page for debugging\n //$('#jsonOutput').text(JSON.stringify(jsonObj, null, 2)); \n \n // display the tree\n displayTree(JSON.stringify(jsonObj, null, 2));\n }\n };\n }) (f);\n reader.readAsText(f);\n\t });\n}", "function MakeTree(currFolder){\n\t\t// the beginning of current folder\n\t\tjsonText+=\"{\"+JSON.stringify(\"name\")+\":\"+JSON.stringify(currFolder.name);\n\t\tjsonText+=\",\"+JSON.stringify(\"fid\")+\":\"+JSON.stringify(currFolder.fid);\n\t\t\n\t\t// the end of current folder\n\t\tif(currFolder.fileChildren.length==0 && currFolder.folderChildren.length==0)\n\t\t\tjsonText+=\"}\";\n\t\t\t\n\t\t// if current folder has children\n\t\tif(currFolder.fileChildren.length>0 || currFolder.folderChildren.length>0)\n\t\t\tjsonText+=\",\"+JSON.stringify(\"children\")+\": [\";\n\t\t\t\n\t\t// extracts data from file children array\n\t\tfor (var i=0; i<currFolder.fileChildren.length; i++){\n\t\t\tjsonText+=JSON.stringify({\n\t\t\t\tname: currFolder.fileChildren[i].name, \n\t\t\t\tsize: currFolder.fileChildren[i].size, \n\t\t\t\ttype: currFolder.fileChildren[i].type,\n\t\t\t\tfid: currFolder.fileChildren[i].fid\n\t\t\t});\n\t\t\t\n\t\t\t// if current folder has more than one file child\n\t\t\tif(i!=currFolder.fileChildren.length-1)\n\t\t\t\tjsonText+=\",\";\n\t\t}\n\t\t\n\t\t// if current folder has any file or folder child\n\t\tif(currFolder.folderChildren.length>0 && currFolder.fileChildren.length>0){\n\t\t\tjsonText+=\",\";\n\t\t}\n\t\t\n\t\t// extracts data from folder children array\n\t\tfor (var i=0; i<currFolder.folderChildren.length; i++){\n\t\t\n\t\t\t\t// calls MakeTree on folder children\n\t\t\t\tMakeTree(currFolder.folderChildren[i]);\n\t\t\t\t\n\t\t\t\t// if current folder has more than one folder child\n\t\t\t\tif(i!=currFolder.folderChildren.length-1)\n\t\t\t\t\tjsonText+=\",\";\n\t\t}\n\t\t\n\t\t// the end of file/folder children array\n\t\tif(currFolder.fileChildren.length>0 || currFolder.folderChildren.length>0)\n\t\t\tjsonText+=\"]}\";\n\n\t}", "get_treeDataObjects() {\n return this.treeDataObjects;\n }", "function populateTree() {\n\tlet dateArray = [];\n\tlet childArray = [];\n\tfor (let y = 0; y < Object.size(dateObject); y++) {\n\t\tlet object_z = dateObject[Object.keys(dateObject)[y]];\n\t\tfor (let x = 0; x < Object.size(object_z); x++) {\n\t\t\t//Sort the inner date object first.\n\t\t\tlet innerArr = object_z[Object.keys(object_z)[x]];\n\t\t\tlet sorted2 = innerArr.map(item => {\n\t\t\t\tlet s2 = item.split(' ');\n\t\t\t\tlet d2 = s2.splice(-4);\n\t\t\t\tlet date2 = moment(d2.join(' '), 'MMMM do, YYYY h:mm').toDate();\n\t\t\t\tlet text2 = s2.join(' ');\n\t\t\t\treturn { item, text2, date2 };\n\t\t\t})\n\t\t\t.sort((a, b) => a.text2.localeCompare(b.text2) || (a.date2 - b.date2))\n\t\t\t.map(item => item.item);\n\t\t\tobject_z[Object.keys(object_z)[x]] = sorted2;\n\t\t\tlet totalString = \"\";\n\t\t\tlet i = 0;\n\t\t\twhile ( i < innerArr.length) {\n\t\t\t\tif (!totalString.includes(messagesArray[innerArr[i]])) {\n\t\t\t\t\ttotalString = totalString + messagesArray[innerArr[i]];\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tlet tempArr = innerArr[0].split(\" \");\n\t\t\ttempArr.pop();\n\t\t\tlet innerText = tempArr.join(' ');\n\t\t\tfinalObject[innerText] = totalString;\n\n\n\t\t\t//Add nodes to jstree.\n\t\t\tlet existingIDs = [];\n\t\t\tfor (let i = 0; i < Object.size(innerArr); i++) {\n\t\t\t\tlet tempArr = innerArr[0].split(\" \");\n\t\t\t\ttempArr.pop();\n\t\t\t\tlet date = tempArr.slice(-3).join(\" \");\n\t\t\t\tif (!dateArray.contains(date)) {\n\t\t\t\t\t$('#jstree').jstree().create_node('#' , { \"id\" : date, \"text\" : date } );\n\t\t\t\t\tdateArray.push(date);\n\t\t\t\t}\n\t\t\t\tlet newTextArr = innerArr[i].split(\" \");\n\t\t\t\tnewTextArr.pop();\n\t\t\t\tlet newTextStr = newTextArr.join(\" \").trim();\n\t\t\t\tif (existingIDs.indexOf(newTextStr) <= -1) {\n\t\t\t\t\texistingIDs.push(newTextStr);\n\t\t\t\t\tlet childTextArr = innerArr[i].split(\" \");\n\t\t\t\t\tchildTextArr.pop();\n\t\t\t\t\tlet childTextStr = childTextArr.join(\" \");\n\t\t\t\t\t$('#jstree').jstree().create_node(date , { \"id\" : innerArr[i], \"text\" : childTextStr });\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n}", "function d3_tree(selected_tree) {\n d3.json(\"/arborapi/projmgr/project/\" + project + \"/PhyloTree/\" + selected_tree, function (error, collection) {\n root = tangelo.data.tree({\n data: collection,\n id: {field: \"_id.$oid\"},\n idChild: {field: \"$oid\"},\n children: {field: \"clades\"}\n });\n\n d3_vis.update({data: root});\n });\n}", "getTree() {\n //return this.http.get('/rest/Tree');\n return this.randomServerAnswer(SampleTreeList, SampleError);\n }", "function makeTree(data){\r\n\t// *********** Convert flat data into a nice tree ***************\r\n\t// create a name: node map\r\n\tvar dataMap = data.reduce(function(map, node) {\r\n\t\tmap[node.name] = node;\r\n\t\treturn map;\r\n\t}, {});\r\n\t\r\n\tthis.dataMap = dataMap;\r\n\r\n\t// create the tree array\r\n\tvar treeData = [];\r\n\tdata.forEach(function(node) {\r\n\t\t// add to parent\r\n\t\tvar parent = dataMap[node.parent];\r\n\t\tif (parent) {\r\n\t\t\t// create child array if it doesn't exist\r\n\t\t\t(parent.children || (parent.children = []))\r\n\t\t\t\t// add node to child array\r\n\t\t\t\t.push(node);\r\n\t\t} else {\r\n\t\t\t// parent is null or missing\r\n\t\t\ttreeData.push(node);\r\n\t\t}\r\n\t});\r\n\tthis.treeData = treeData;\r\n\treturn treeData;\r\n\t\r\n}", "function getChildrenFromObjArray(data, root, defaultName ){\n\n var types = [];\n var names = [];\n \n for (var name in data){\n types.push( getType(data[name]));\n names.push(name);\n }\n\n var curr_root = root;\n // this object accumulates integers and children to be added to the last node\n var acc = {name: undefined, size: 0 , children : []}\n\n if (names.length <= 0){\n console.log(\"why the hell this obj does not have properties?!\");\n return;\n }\n for (var n = names.length -1; n >= 0 ; n-- ){\n if(types[n] == 'string'){\n // finds if this node exists \n var name = data[names[n]];\n var node = getObjNode(name, curr_root);\n // next item will be inserted at the level of the current node\n curr_root = node;\n acc.name = name;\n }\n else if (types[n] == 'number')\n {\n acc.size += data[names[n]];\n }\n else {\n node= { name : names[n], children : [] };\n acc.children.push(node)\n getChildren(data[names[n]], node, names[n]);\n }\n }\n // if there were no strings\n if (acc.name == undefined ){\n console.log(\"node does not have a name, defaulting to \", defaultName);\n acc.name = defaultName;\n }\n if (acc.size == 0){\n console.log(\"node does not have a size, defaulting to \", 1);\n acc.size = 1;\n }\n //gets the last node and sets the new children and the accumulated counter\n var last_node = getObjNode(acc.name, curr_root);\n if(acc.children.length){\n last_node['children'] = acc.children; \n }\n last_node.size = acc.size;\n}", "function objFromSaveFormat(objectInArray) {\n var objectInTree = {id: objectInArray.id, name: objectInArray.name};\n if (objectInArray.type == \"folder\") {\n objectInTree.children = [];\n } else if (objectInArray.content != undefined) {\n objectInTree.content = objectInArray.content;\n }\n return objectInTree;\n }", "async function walk (oid) {\n visited.add(oid);\n let { type, object } = await GitObjectManager.read({ fs, gitdir, oid });\n if (type === 'commit') {\n let commit = GitCommit.from(object);\n let tree = commit.headers().tree;\n await walk(tree);\n } else if (type === 'tree') {\n let tree = GitTree.from(object);\n for (let entry of tree) {\n visited.add(entry.oid);\n // only recurse for trees\n if (entry.type === 'tree') {\n await walk(entry.oid);\n }\n }\n }\n }", "getTree() {\n\n return [\n 'procedure',\n this.params,\n this.body ? this.body.getTree() : null,\n this.isService\n ];\n }", "tree(key, trees, { force = false } = {}) {\n this.stopProgress();\n //\n if (this.isSilent && !force) {\n return;\n }\n const output = ({ name, children, hint, color }, titlePrefix, childrenPrefix) => {\n const formatter = this.format;\n const out = (0, (_treeHelper || _load_treeHelper()).getFormattedOutput)({\n prefix: titlePrefix,\n hint,\n color,\n name,\n formatter\n });\n this.stdout.write(out);\n\n if (children && children.length) {\n (0, (_treeHelper || _load_treeHelper()).recurseTree)((0, (_treeHelper || _load_treeHelper()).sortTrees)(children), childrenPrefix, output);\n }\n };\n (0, (_treeHelper || _load_treeHelper()).recurseTree)((0, (_treeHelper || _load_treeHelper()).sortTrees)(trees), '', output);\n }", "function _buildFromJson(data, container, options, isBase) {\n if (data.nodes.length == 0 && data.elements.length == 0) {\n container.append('<ul><li class=\"ui-nd\">no data</li></ul>');\n return;\n }\n var ul = $('<ul class=\"ui-tree\"/>');\n\n $.each(data.nodes, function(i,val) {\n var v = val.node;\n ul.append(_renderRoot(v.id, v.name, options, isBase));\n });\n\n $.each(data.elements, function(i,val) {\n var v = val.element;\n ul.append(_renderLeaf(v.id, v.name));\n });\n\n container.append(ul);\n var lis = ul.children('li');\n lis.children('span.ui-tree-leaf').click(options.clickLeaf);\n lis.children('span.ui-tree-root').click(function() {_nodeClickHandler(options, $(this).attr('id'), $(this))});\n }", "function buildTreeInit(genURL){\n $.getJSON(genURL + \"?format=json&callback=?\", function(data){\n var rootName = data.EntityDescriptionMsg.entityDescription.namedEntity.designation[0].value;\n var childUrl = data.EntityDescriptionMsg.entityDescription.namedEntity.children;\n populateRoot(rootName);\n $.when(addChildData(childUrl,\"a#label-root\")).then(buildLevelOne());\n });\n}", "function createTree() {\n\ttreeData = {\n\t\t\"roles\": document.getElementById(\"txtBoxActors\").value,\n\t\t\"qualities\": document.getElementById(\"txtBoxQualities\").value,\n\t\t\"hearts\": document.getElementById(\"txtBoxLikes\").value,\n\t\t\"spades\": document.getElementById(\"txtBoxDislikes\").value,\n\t\t\"children\": [],\n\t\t\"name\": document.getElementById(\"txtBoxGoal\").value\n\t};\n\tvar subGoals = document.getElementById(\"txtBoxSubGoals\").value.split(\",\");\n\tfor (var i = 0; i < subGoals.length; i++) {\n\t\tmyObj = {\n\t\t\t\"roles\": \"\",\n\t\t\t\"qualities\": \"\",\n\t\t\t\"hearts\": \"\",\n\t\t\t\"spades\": \"\",\n\t\t\t\"children\": [],\n\t\t\t\"name\": subGoals[i]\n\t\t};\n\t\tif (myObj.name != \"\") {\n\t\t\ttreeData[\"children\"].push(myObj);\n\t\t}\n\t}\n\troot = d3.hierarchy(treeData);\n\tupdate(root);\n}", "function deserialize(treeArray) {\n function createTree() {\n let current = treeArray.shift();\n if(current == null) {\n return null;\n }\n let node = new Node(current);\n node.left = createTree();\n node.right = createTree();\n\n return node;\n }\n return createTree();\n}", "function addTreeOne() {\n\nvar loader = new THREE.JSONLoader();\nvar treeModelOne;\nloader.load(\"3D_json/treeOne.json\", callTree);\n\n}", "function getChildrenFromOb(data, root ){\n for (var name in data){\n switch(getType(data[name])){\n case 'string':\n root.children.push({ name : data[name], size : 1});\n break;\n case 'number':\n root.children.push({ name : name, size : data[name]});\n break;\n default:\n node= { name : name, children : [] };\n root.children.push(node)\n getChildren(data[name], node, name);\n }\n }\n}", "buildHierarchy(obj) {\n var that = this;\n var csv = obj;\n // obj = _.clone(obj);\n csv = _.filter(obj, (obje) => {\n return obje[0].split(\">\").length < 13;\n });\n var root = {\"name\": \"root\", \"children\": []};\n for (var i = 1; i < csv.length - 1; i++) {\n var sequence = csv[i][0];\n var size = +csv[i][1];\n var conType = csv[i][2];\n //console.log(csv[i])\n if (isNaN(size)) {\n break;\n }\n var parts = sequence.split(\">\");\n parts = _.map(parts, _.trim);\n parts = _.map(parts, function (a) {\n return that.resolveStepName(a);\n });\n var currentNode = root;\n for (var j = 0; j < parts.length; j++) {\n var children = currentNode[\"children\"];\n var nodeName = parts[j];\n var childNode;\n if (j + 1 < parts.length) {\n // Not yet at the end of the sequence; move down the tree.\n var foundChild = false;\n for (var k = 0; k < children.length; k++) {\n if (children[k][\"name\"] == nodeName) {\n childNode = children[k];\n foundChild = true;\n break;\n }\n }\n // If we don't already have a child node for this branch, create it.\n if (!foundChild) {\n childNode = {\"name\": nodeName, \"children\": []};\n children.push(childNode);\n }\n currentNode = childNode;\n }\n else {\n // Reached the end of the sequence; create a leaf node.\n childNode = {\"name\": nodeName, \"children\": [], \"size\": size, conversion_type: conType};\n children.push(childNode);\n }\n }\n }\n\n\n return root;\n }", "function generateTree(){\n //empty the tree section\n try{\n $('#treeDiv').html(\"\");\n $('#tree').jstree().destroy();\n } catch(e){}\n //call the tree builder\n sakura.apis.operator.get_file_tree().then(print_file_tree);\n}", "createMyList(data,_pre){\n var _this=this,cLen=0;\n data.map(function(i){\n cLen=0;\n i.child.map(function(data){\n if(data.folderName){\n cLen++;\n }\n });\n _this.state.displayList.push({child:cLen,folder:i.folderName,level:i.level, _on:i._on, editable:i.editable,rel:_pre+'/'+i.folderName,type:i.type});\n if(_this.state.exAll){\n i._on =true;\n }\n if(_this.state.colAll){\n i._on =false;\n }\n if(i._on){\n _this.createMyList(i.child,_pre+'/'+i.folderName); // recursive call to iterate over the nested data structure\n }\n });\n }", "static build(data) { return buildTree(data); }", "function createStixChildren(objNodes, parentName) {\n var allObjJson = [];\n var topChildJson = null;\n $(objNodes).each(function (index, objJson) {\n\t allObjJson.push(objJson);\n\t});\n if (allObjJson.length > 0) {\n \ttopChildJson = {\"type\":parentName, \"children\":allObjJson, \"linkType\":\"topDown\"};\n }\n return topChildJson;\n}", "function treeify(bundle) {\n var tree = {};\n bundle.forEach(function(file) {\n var path = file.path;\n if (file.packageName)\n path = 'node_modules/meteor/' + file.packageName + '/' + path;\n\n var dirs = path.split('/');\n var filename = dirs.pop();\n\n var sub = getSub(tree, dirs);\n var requires = extractRequires(file.data);\n\n sub[filename] = requires.concat(\n '__OF__' + file.data + '__CF__');\n });\n return tree;\n}", "function serializeTree() {\n var result = {};\n\n $('#proofTreeContainer .proofTreeNest').each(function() {\n var treeLocation = $(this).attr('id');\n var lineLeft = $('#' + treeLocation + ' > .proofTreeLine > .proofTreeLineLeft').text();\n var lineRight = $('#' + treeLocation + ' > .proofTreeLine > .proofTreeLineRight').text();\n var lineCondition = $('#' + treeLocation + ' .proofTreeLine > .proofTreeLineCondition').text();\n var lineLabel = $('#' + treeLocation + ' > .proofTreeLabel > .proofTreeDropdownLabel').val();\n var lineSideCondition = $('#' + treeLocation + ' > .proofTreeSideCondition').val();\n\n result[treeLocation] = {};\n result[treeLocation]['left'] = $.trim(lineLeft);\n result[treeLocation]['middle'] = $.trim(lineRight);\n result[treeLocation]['right'] = $.trim(lineCondition);\n result[treeLocation]['label'] = $.trim(lineLabel);\n result[treeLocation]['sideCondition'] = $.trim(lineSideCondition);\n });\n\n var keypress = jQuery.Event('input');\n $('#serializedTree').val(JSON.stringify(result));\n $('#serializedTree').click().trigger(keypress).blur();\n\n return result;\n }", "function TNodes_doCopyBranchToJson(source){\n \n var mysplit={};\n var splitnodecollection=new Array();\n var nodeAttr=new TComAttr();\n var boxnodeAttr=new TComAttr();\n var tmpnds=new TNodes('tempNodes',source.Owner,source.Owner.Ident);\n var e=0;\n var maxlevel=-1;\n var list=[]; // array for json-bifork-objects\n var myitemlist={}; // subelementlist container or sticker\n var myitemnds={}; // Nodes in subelement\n var partlist={}; // return-receiver for recursive callings \n var curindex=0;\n var mybuildorder='noinfo';\n\n switch (source.Type){\n case 'node':\n var mysourcends=source.Owner;\n var myzeronode=null;\n var zeronodeflag=false; \n break;\n \n case 'nodes':\n var myzeronode=new TNode();\n myzeronode.doAssign(source.Item[0]);\n var mysourcends=source;\n source=mysourcends.Item[0];\n var zeronodeflag=true; \n break;\n\n case 'container':\n var mysourcends=source.Nodes;\n source=mysourcends.Item[0];\n tmpnds.Item[0]=source; \n break;\n /* STICKER_mp\n case 'sticker':\n var mysourcends=source.Nodes;\n \n break;*/\n default:\n return null;\n } \n \n /* ====================================\n * Node with childs == bifork-structure\n * ==================================== \n */ \n \n if (source.HasChild==true){\n \n mybuildorder='child';\n \n // set the startlevel\n var minlevel=source.Child.Level;\n\n // get all objects with ident from this branch\n // load it into the tmpnds\n for (var i=source.Child.AbsoluteIndex;i<=mysourcends.Count;i++){\n \n mysplit=mysourcends.Item[i];\n if (i>source.Child.AbsoluteIndex && mysplit.Level<=source.Child.Level){\n break;\n }\n tmpnds.Item[i] = new TSplit();\n tmpnds.Item[i].doAssign(mysplit);\n tmpnds.Item[i].ParentIndex=mysplit.Parent.Parent.AbsoluteIndex;\n if (mysplit.Level>maxlevel){\n maxlevel=mysplit.Level;\n }\n \n // show copy-result\n doPrint('copy to node -> ' + i + ' type:' + mysplit.Type);\n doPrint('copy-target -> ' + i + ' type:' + tmpnds.Item[i].Type);\n \n // + ' ident: ' + myobjectlist[e].Ident + ' ->' , myobjectlist[e]);\n \n }\n \n // initialize the two-dimensional horizontal array\n var levellist = new Array(maxlevel-minlevel+1);\n for (var L=minlevel;L<=maxlevel;L++){\n levellist[L] = new Array();\n }\n \n // sort the elements of tmpnds in levellist[level, absoluteindex]\n for (var S in tmpnds.Item){\n mysplit=tmpnds.Item[S];\n levellist[mysplit.Level][S]=tmpnds.Item[S];\n }\n\n if (zeronodeflag){\n curindex=list.length;\n list[list.length]=myzeronode.doDBTreeDataobject();\n list[curindex].buildorder='zeronode'; \n }\n \n for (L=minlevel;L<=maxlevel;L++){ \n for (S in levellist[L]){\n \n mysplit=levellist[L][S];\n \n curindex=list.length;\n list[curindex]=mysplit.UpNode.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder; //'U'+mysplit.AbsoluteIndex;\n curindex=list.length;\n list[curindex]=mysplit.DownNode.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder; //'D'+mysplit.AbsoluteIndex;\n\n // scanning the sub-elements\n\n // the two nodes in a mini-array for dry-code\n // UpNode\n splitnodecollection[1]=mysplit.UpNode;\n // DownNode\n splitnodecollection[2]=mysplit.DownNode;\n \n // container and splits \n // seq. up- and downnode => 1, then 2\n for (var i=1;i<=2;i++){\n // t iterats 1 and 2 for container und splits to keep the code dry \n for (var t=1;t<=2;t++){ \n \n switch (t){\n case 1: myitemlist=splitnodecollection[i].ContainerList;\n break;\n case 2: myitemlist=splitnodecollection[i].StickerList;\n break;\n }\n \n for (var j=1;j<=myitemlist.Count;j++){\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n curindex=list.length;\n list[curindex]=partlist[e];\n list[curindex].buildorder=mybuildorder;\n }\n // mark last element\n curindex=list.length-1;\n list[curindex].buildorder='lastelement';\n \n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n \n }//if != undefined\n }// for itemlist\n\n }// for t container and sticker\n }// for i, up und down\n }//for levellist\n }// for levellist\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype\n + ' buildorder: ' + list[e].buildorder\n + ' ->' , list[e]);\n }\n\n delete levellist;\n\n }// end node-child\n\n\n /* ======================================\n * Zeronode without children in container\n * ====================================== \n */ \n\n if (source.HasChild==false && source.ZeroNodeType=='container'){\n mybuildorder='nochild';\n curindex=list.length;\n list[curindex]=source.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n \n }\n\n /* ======================================\n * Zeronode without children in sticker\n * ====================================== \n */ \n/* STICKER_mp\n if (source.HasChild==false && source.ZeroNodeType=='sticker'){\n mybuildorder='nochild';\n curindex=list.length;\n list[curindex]=source.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n \n }*/\n\n /* ====================================\n * Node with containerlist\n * ==================================== \n */ \n\n if (source.ContainerList.Count>0){\n mybuildorder='container';\n myitemlist=source.ContainerList;\n\n for (var j=1;j<=myitemlist.Count;j++){\n\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n /* STICKER_mpif (myitemlist.Owner.ZeroNodeType=='sticker'){\n list[curindex].buildorder='sticker'; \n }*/\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n \n list[list.length]=partlist[e];\n }\n\n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n }//----\n \n }\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n\n\n }// end node-container\n\n\n /* ====================================\n * Node with stickerlist\n * ==================================== \n */ \n/* STICKER_mp\n if (source.StickerList.Count>0){\n mybuildorder='sticker';\n myitemlist=source.StickerList;\n\n for (var j=1;j<=myitemlist.Count;j++){\n\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n \n list[list.length]=partlist[e];\n }\n\n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n }//----\n \n }\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n\n\n }// end node-sticker */\n\n delete tmpnds;\n \n return list;\n\n }", "function buildRelations(treeArray) {\n return;\n}", "function makeHierarchy(array)\n{\n\n\n var i = array.length - 1;\n var j = 0;\n\n for(i; i > -1; i--)\n {\n \n if (array[i].parent == -1) \n {\n \n return array;\n }\n if(array[i].children)\n {\n \n\n for(j = 0;j < array[array[i].parent].children.length; j++)\n {\n \n if (array[array[i].parent].children[j].name == array[i].name) \n {\n \n array[array[i].parent].children[j].children = array[i].children;\n }\n }\n }\n }\n\n}", "function getTree () {\n function insert(children = [], [head, ...tail]) {\n let child = children.find(child => child.text === head);\n if (!child) children.push(child = {text: head, nodes: []});\n if (tail.length > 0) insert(child.nodes, tail);\n return children;\n }\n\n let filesArray = window.exampleFiles\n .map(path => path.split('/'))\n .reduce((children, path) => insert(children, path), [])\n .map(current => {\n current.icon = \"far fa-file-code\";\n return current;\n });\n\n return filesArray;\n}", "function obj2Arr(data) {\n var temp;\n\n if (!data.hasOwnProperty('folder')) {\n \tdata.folder = [];\n }\n\n // folder\n if (data.folder.constructor == Object) {\n temp = data.folder;\n delete data.folder;\n data.folder = [temp];\n }\n\n for (h = 0; h < data.folder.length; h++) {\n // file\n if (data.folder[h].file.constructor == Object) {\n temp = data.folder[h].file;\n delete data.folder[h].file;\n data.folder[h].file = [temp];\n }\n }\n\n // tag_list\n if (data.hasOwnProperty(\"tag_list\")) {\n if (data.tag_list.i.constructor == Object) {\n temp = data.tag_list.i;\n delete data.tag_list.i;\n data.tag_list.i = [temp];\n }\n }\n\n // object info\n if (data.entity.hasOwnProperty(\"obj_info\")){\n if (data.entity.obj_info.constructor === Object) {\n temp = data.entity.obj_info;\n delete data.entity.obj_info;\n data.entity.obj_info = [temp];\n }\n }\n\n // animation\n if (data.entity.animation.constructor == Object) {\n temp = data.entity.animation;\n delete data.entity.animation;\n data.entity.animation = [temp];\n }\n\n if (data.entity.hasOwnProperty(\"var_defs\")) {\n if (data.entity.var_defs.i.constructor == Object) {\n temp = data.entity.var_defs.i;\n delete data.entity.var_defs.i;\n data.entity.var_defs.i = [temp];\n } \n }\n\n // meta\n for (var i = 0; i < data.entity.animation.length; i++){\n \n // varline\n if (data.entity.animation[i].hasOwnProperty(\"meta\")){\n if (data.entity.animation[i].meta.hasOwnProperty(\"varline\")) {\n if (data.entity.animation[i].meta.varline.constructor == Object) {\n temp = data.entity.animation[i].meta.varline;\n delete data.entity.animation[i].meta.varline;\n data.entity.animation[i].meta.varline = [temp];\n }\n for (var j = 0; j < data.entity.animation[i].meta.varline.length; j++) {\n if (data.entity.animation[i].meta.varline[j].key.constructor == Object) {\n temp = data.entity.animation[i].meta.varline[j].key;\n delete data.entity.animation[i].meta.varline[j].key;\n data.entity.animation[i].meta.varline[j].key = [temp];\n }\n }\n }\n\n // tagline\n if (data.entity.animation[i].meta.hasOwnProperty(\"tagline\")) {\n if (data.entity.animation[i].meta.tagline.key.constructor == Object) {\n temp = data.entity.animation[i].meta.tagline.key;\n delete data.entity.animation[i].meta.tagline.key;\n data.entity.animation[i].meta.tagline.key = [temp];\n }\n for (var j = 0; j < data.entity.animation[i].meta.tagline.key.length; j++) {\n if (data.entity.animation[i].meta.tagline.key[j].tag) {\n if (data.entity.animation[i].meta.tagline.key[j].tag.constructor == Object) {\n temp = data.entity.animation[i].meta.tagline.key[j].tag;\n delete data.entity.animation[i].meta.tagline.key[j].tag;\n data.entity.animation[i].meta.tagline.key[j].tag = [temp];\n }\n }\n }\n }\n }\n }\n\n for (var i = 0; i < data.entity.animation.length; i++){\n\n // mainline.key\n if (data.entity.animation[i].mainline.key.constructor == Object) {\n temp = data.entity.animation[i].mainline.key;\n delete data.entity.animation[i].mainline.key;\n data.entity.animation[i].mainline.key = [temp];\n }\n\n for (var j = 0; j < data.entity.animation[i].mainline.key.length; j++) {\n\n // mainline.key[].bone_ref\n if (data.entity.animation[i].mainline.key[j].hasOwnProperty('bone_ref')) {\n if (data.entity.animation[i].mainline.key[j].bone_ref.constructor == Object) {\n temp = data.entity.animation[i].mainline.key[j].bone_ref;\n delete data.entity.animation[i].mainline.key[j].bone_ref;\n data.entity.animation[i].mainline.key[j].bone_ref = [temp];\n }\n }\n \n\n // mainline.key[].object_ref\n if (data.entity.animation[i].mainline.key[j].hasOwnProperty('object_ref')) {\n if (data.entity.animation[i].mainline.key[j].object_ref.constructor == Object) {\n temp = data.entity.animation[i].mainline.key[j].object_ref;\n delete data.entity.animation[i].mainline.key[j].object_ref;\n data.entity.animation[i].mainline.key[j].object_ref = [temp];\n }\n }\n }\n \n // timeline\n if (!data.entity.animation[i].hasOwnProperty('timeline')) {\n \tdata.entity.animation[i].timeline = [];\n }\n\n if (data.entity.animation[i].timeline.constructor == Object) {\n temp = data.entity.animation[i].timeline;\n delete data.entity.animation[i].timeline;\n data.entity.animation[i].timeline = [temp];\n }\n\n for (var k = 0; k < data.entity.animation[i].timeline.length; k++) {\n\n // timeline[].key\n if (data.entity.animation[i].timeline[k].key.constructor == Object) {\n temp = data.entity.animation[i].timeline[k].key;\n delete data.entity.animation[i].timeline[k].key;\n data.entity.animation[i].timeline[k].key = [temp];\n }\n if (data.entity.animation[i].timeline[k].hasOwnProperty('meta')) {\n if (data.entity.animation[i].timeline[k].meta.hasOwnProperty('tagline')) {\n if (data.entity.animation[i].timeline[k].meta.tagline.key.constructor == Object) {\n temp = data.entity.animation[i].timeline[k].meta.tagline.key;\n delete data.entity.animation[i].timeline[k].meta.tagline.key;\n data.entity.animation[i].timeline[k].meta.tagline.key = [temp];\n }\n \n for (var l = 0; l < data.entity.animation[i].timeline[k].meta.tagline.key.length; l++) {\n if (!data.entity.animation[i].timeline[k].meta.tagline.key[l].tag) {\n data.entity.animation[i].timeline[k].meta.tagline.key[l].tag = [];\n }\n if (data.entity.animation[i].timeline[k].meta.tagline.key[l].tag.constructor == Object) {\n temp = data.entity.animation[i].timeline[k].meta.tagline.key[l].tag;\n delete data.entity.animation[i].timeline[k].meta.tagline.key[l].tag;\n data.entity.animation[i].timeline[k].meta.tagline.key[l].tag = [temp];\n }\n }\n }\n else if (data.entity.animation[i].timeline[k].meta.hasOwnProperty('varline')) {\n if (!data.entity.animation[i].timeline[k].meta.varline) {\n data.entity.animation[i].timeline[k].meta.varline = [];\n }\n \tif (data.entity.animation[i].timeline[k].meta.varline.constructor == Object) {\n \t\ttemp = data.entity.animation[i].timeline[k].meta.varline;\n \t\tdelete data.entity.animation[i].timeline[k].meta.varline;\n \t\tdata.entity.animation[i].timeline[k].meta.varline = [temp];\n \t}\n\n\n \tfor (var m = 0; m < data.entity.animation[i].timeline[k].meta.varline.length; m++) {\n \t\tif (data.entity.animation[i].timeline[k].meta.varline[m].key.constructor == Object) {\n \t\t\ttemp = data.entity.animation[i].timeline[k].meta.varline[m].key;\n \t\t\tdelete data.entity.animation[i].timeline[k].meta.varline[m].key\n \t\t\tdata.entity.animation[i].timeline[k].meta.varline[m].key = [temp];\n \t\t}\n \t}\n }\n }\n }\n }\n\n if (data.hasOwnProperty('obj_info')) {\n \tfor (var i = 0; i < data.entity.obj_info.length; i++) {\n\t \tif (data.entity.obj_info[i].hasOwnProperty('var_defs')) {\n\t \t\tif (data.entity.obj_info[i].var_defs.i.constructor == Object) {\n\t \t\t\ttemp = data.entity.obj_info[i].var_defs.i;\n\t \t\t\tdelete data.entity.obj_info[i].var_defs.i;\n\t \t\t\tdata.entity.obj_info[i].var_defs.i = [temp];\n\t \t\t}\n\t \t}\n\t }\n }\n \n\n // atlas\n if (data.hasOwnProperty(\"atlas\")) {\n if(data.atlas.i.constructor == Object) {\n temp = data.atlas.i;\n delete data.atlas.i;\n data.atlas.i = [temp];\n }\n }\n}", "function buildTreeFromPathArray(paths){\n\n\t// needs to be called on the input string array\n\t//paths = paths.map(function(d) { return d.split('/'); });\n\n\tvar items = [];\n\tfor(var i = 0, l = paths.length; i < l; i++) {\n\t\tvar path = paths[i];\n\t\tvar name = path[0];\n\t\tvar rest = path.slice(1);\n\t\tvar item = null;\n\t\tfor(var j = 0, m = items.length; j < m; j++) {\n\t\t\tif(items[j].name === name) {\n\t\t\t\titem = items[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(item === null) {\n\t\t\titem = {name: name, children: []};\n\t\t\titems.push(item);\n\t\t}\n\t\tif(rest.length > 0) {\n\t\t\titem.children.push(rest);\n\t\t}\n\t}\n\n\n\tfor(var i = 0, l = items.length; i < l; i++) {\n\t\titem = items[i];\n\t\titem.children = buildTreeFromPathArray(item.children);\n\t}\n\n\treturn items;\n}", "function avlTree() {\n \n}", "function Trees() {\n}", "function Trees() {\n}", "function tree(list) {\n var mapped = {};\n for (var i = 0, item; i < list.length; i++) {\n item = list[i];\n if (!item || !item.id) continue;\n mapped[item.id] = item;\n }\n var result = [];\n for (var ii = 0; ii < list.length; ii++) {\n item = list[ii];\n if (!item) continue;\n /* jshint -W041 */\n if (item.pid == undefined && item.parentId == undefined) {\n result.push(item);\n continue;\n }\n var parent = mapped[item.pid] || mapped[item.parentId];\n if (!parent) continue;\n if (!parent.children) parent.children = [];\n parent.children.push(item);\n }\n return result;\n }", "function addTreeTwo() {\n\nvar loader = new THREE.JSONLoader();\nvar treeModelTne;\nloader.load(\"3D_json/treeTwo.json\", callTreeTwo);\n\n}", "function getTrees(numberTrees) {\n\tvar trees = [];\n\tvar type;\n\tvar quantity;\n\n\tfor(var i=0;i<numberTrees;i++) {\n\t\ttype = document.getElementById(\"tree\"+i+\"type\").value;\n\t\tquantity = document.getElementById(\"tree\"+i+\"num\").value;\n\t\tif(type!=null && quantity!=null) {\n\t\t\ttrees[i] = {};\n\t\t\ttrees[i]['type'] = type;\n\t\t\ttrees[i]['quantity'] = parseInt(quantity);\n\t\t}\n\t}\n\n\treturn trees;\n}", "function getTree(req, res) {\n // variables defined in the Swagger document can be referenced using req.swagger.params.{parameter_name}\n var setId = req.swagger.params.setId.value;\n var treeId = req.swagger.params.treeId.value;\n var filter = req.swagger.params.filter.value || '';\n var subtree = req.swagger.params.subtree.value || 0;\n\n // get the url for the solr instance with setId trees\n var url = 'http://localhost:8983/solr/'+setId+'/query?rows=10000&q=';\n // build a query for the given tree\n var solrQuery = 'treeId:'+treeId;\n // possibly apply filters and subtree\n if (filter) {\n solrQuery = '{!graph from=nodeId to=parentId}' + solrQuery + ' AND ' + filter;\n }\n if (subtree) {\n solrQuery += ' AND {!graph from=parentId to=nodeId}nodeId:'+subtree;\n }\n // run the query\n console.error(url + solrQuery);\n request(url + solrQuery, function(err, response, body) {\n if (err) {\n res.json({error: err});\n }\n // assemble the tree from the matching solr docs\n // send the tree\n // cache the response - handled by middleware\n var nodes = JSON.parse(body).response.docs;\n nodes.forEach(function(n) {\n if (n.interpro_x) {\n n.interpro = JSON.parse(n.interpro_x);\n delete n.interpro_x;\n }\n });\n if (subtree && !filter) {\n // remove the parentId on the subtree root node so flatToNested works\n nodes.forEach(function(n) {\n if (n.nodeId === subtree) {\n delete n.parentId;\n }\n });\n }\n var tree = flatToNested.convert(nodes);\n if (subtree && filter) {\n // skip over ancestors of the subtree root\n while (tree.nodeId !== subtree) {\n tree = tree.children[0];\n }\n }\n res.json(tree);\n });\n}", "function walkObjectProcess()\n\t\t{\n\t\t\t// the function to process the children\n\t\t\t\tfunction process(element, index, depth)\n\t\t\t\t{\n\t\t\t\t\ttrace (indent(depth) + '/' + element.name);\n\t\t\t\t}\n\n\t\t\t// the function to identify the children\n\t\t\t\tfunction getContents(element)\n\t\t\t\t{\n\t\t\t\t\treturn element instanceof Folder ? element.contents : null;\n\t\t\t\t}\n\n\t\t\t// start processing\n\t\t\t\tvar folder = new Folder('{user}');\n\t\t\t\tUtils.walk (folder, process, getContents)\n\t\t}", "depthFirstSearch(array) {\n // Write your code here.\n\t\t// console.log(array), array = []\n\t\tarray.push(this.name);\n\t\t// console.log(array)\n\t\tfor (const child of this.children) {\n\t\t\tchild.depthFirstSearch(array);\n\t\t\t// console.log(child)\n\t\t}\n\t\treturn array;\n }", "function getChildren(dataRef){\n $.getJSON(dataRef + \"?format=json&callback=?\", function(childData){\n var childList = childData.EntityDirectory.entry;\n var html = \"<ul id=\\\"level1\\\" >\";\n for (var i in childList) {\n var name = childList[i].knownEntityDescription[0].designation;\n var ref = childList[i].knownEntityDescription[0].href;\n var icon = \"<span>\" +\n \"<i class=\\\"glyphicon glyphicon-plus-sign\\\"></i></span>\";\n html = html +\"<li>\" +\n \"<a id=\\\"level1\\\" data-index='\" + i + \"' data-cts2ref='\" + ref +\n \"' label-default=\\\"\\\" class=\\\"tree-toggle nav-header\\\" >\" + icon\n + name + \"</a></li>\";\n }\n $(\"li#root\").append(html + \"</ul>\");\n\n });\n}", "toJSON() {\n return {\n id: this.id,\n type: this.type,\n data: this.data,\n children: this.hasChildren() ? this._children.map(child => {\n return child.toJSON();\n }) : []\n };\n }", "toJson() {\n // todo: convert to `iife` with arrow functions\n function recursive(node, jsnode) {\n jsnode[node.name] = {};\n if (node.childs.length != 0) {\n for (let child of node.childs) {\n recursive(child, jsnode[node.name]);\n }\n }\n else {\n jsnode[node.name] = null;\n }\n }\n let js = {};\n recursive(this.root, js);\n return js;\n }", "function getProjectTree() { \n\tvar projectTree = httpGetJSON(projectRegistryUrl);\n\tif (projectTree instanceof Object) {\n\t\tconsole.log(\"Project tree loaded as object.\"); \n\t} else {\n\t\tconsole.log(\"Project tree loaded as string.\");\n\t\tprojectTree = $.parseJSON(projectTree);\n\t} \t\n\treturn projectTree[0];\n}", "function processFilesJSON(data, basePath, depth = 20, relativePath = \"\", outList = []) {\n relativePath = FtpFile.appendSlash(relativePath);\n\n if (depth == 0) {\n console.log(\"Maximum file depth reached, exiting\", relativePath);\n return;\n }\n for (let file of data) {\n if (file.type == FTP_TYPE_FILE) {\n console.log(relativePath + file.name);\n let fileObj = new FtpFile(basePath, relativePath, file);\n outList.push(fileObj);\n } else if (file.type == FTP_TYPE_DIRECTORY) {\n if (typeof file.children == 'object') {\n const newPath = relativePath + file.name;\n processFilesJSON(file.children, basePath, depth - 1, newPath, outList);\n }\n }\n }\n\n return outList;\n}", "setupTrees() {\n const trees = [];\n const treeOne = new Tree();\n treeOne.position.set(-100.0, 0, this.terrain.terrainHeight / 2 - 55.0);\n this.add(treeOne);\n trees.push(treeOne);\n\n const treeTwo = new Tree();\n treeTwo.position.set(100.0, 0, 0);\n this.add(treeTwo);\n trees.push(treeTwo);\n\n const treeThree = new Tree();\n treeThree.position.set(\n -100.0,\n 0,\n -(this.terrain.terrainHeight / 2) + 55.0\n );\n this.add(treeThree);\n trees.push(treeThree);\n\n const mass = 0;\n trees.forEach((tree) => {\n const shape = new Box(new Vec3(1, 4, 1));\n\n const body = new Body({ mass: mass, shape: shape });\n body.position.set(tree.position.x, 0, tree.position.z);\n this.world.addBody(body);\n });\n }", "async function walk(oid) {\n if (visited.has(oid)) return\n visited.add(oid);\n const { type, object } = await _readObject({ fs, cache, gitdir, oid });\n if (type === 'tag') {\n const tag = GitAnnotatedTag.from(object);\n const obj = tag.headers().object;\n await walk(obj);\n } else if (type === 'commit') {\n const commit = GitCommit.from(object);\n const tree = commit.headers().tree;\n await walk(tree);\n } else if (type === 'tree') {\n const tree = GitTree.from(object);\n for (const entry of tree) {\n // add blobs to the set\n // skip over submodules whose type is 'commit'\n if (entry.type === 'blob') {\n visited.add(entry.oid);\n }\n // recurse for trees\n if (entry.type === 'tree') {\n await walk(entry.oid);\n }\n }\n }\n }", "function tree(list) {\n\t var mapped = {}\n\t for (var i = 0, item; i < list.length; i++) {\n\t item = list[i]\n\t if (!item || !item.id) continue\n\t mapped[item.id] = item\n\t }\n\n\t var result = []\n\t for (var ii = 0; ii < list.length; ii++) {\n\t item = list[ii]\n\n\t if (!item) continue\n\t /* jshint -W041 */\n\t if (item.pid == undefined && item.parentId == undefined) {\n\t result.push(item)\n\t continue\n\t }\n\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t if (!parent) continue\n\t if (!parent.children) parent.children = []\n\t parent.children.push(item)\n\t }\n\t return result\n\t}", "function createTree(arr){\n let treeArr = [];\n arr.forEach(function (e) {\n treeArr.push(new TreeNode({data: e}));\n });\n let root;\n treeArr.forEach(function (tree) {\n if(!root) {\n root = tree;\n } else {\n createSubTree(root, tree);\n }\n\n })\n\n return root;\n}", "function objectTree(obj) {\n var res;\n switch(obj.termType) {\n case 'symbol':\n var anchor = myDocument.createElement('a')\n anchor.setAttribute('href', obj.uri)\n anchor.addEventListener('click', tabulator.panes.utils.openHrefInOutlineMode, true);\n anchor.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\n return anchor;\n \n case 'literal':\n\n if (!obj.datatype || !obj.datatype.uri) {\n res = myDocument.createElement('div');\n res.setAttribute('style', 'white-space: pre-wrap;');\n res.textContent = obj.value;\n return res\n } else if (obj.datatype.uri == 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') {\n res = myDocument.createElement('div');\n res.setAttribute('class', 'embeddedXHTML');\n res.innerHTML = obj.value; // Try that @@@ beware embedded dangerous code\n return res;\n };\n return myDocument.createTextNode(obj.value); // placeholder - could be smarter, \n \n case 'bnode':\n if (obj.toNT() in doneBnodes) { // Break infinite recursion\n referencedBnodes[(obj.toNT())] = true;\n var anchor = myDocument.createElement('a')\n anchor.setAttribute('href', '#'+obj.toNT().slice(2))\n anchor.setAttribute('class','bnodeRef')\n anchor.textContent = '*'+obj.toNT().slice(3);\n return anchor; \n }\n doneBnodes[obj.toNT()] = true; // Flag to prevent infinite recusruion in propertyTree\n var newTable = propertyTree(obj);\n doneBnodes[obj.toNT()] = newTable; // Track where we mentioned it first\n if (tabulator.Util.ancestor(newTable, 'TABLE') && tabulator.Util.ancestor(newTable, 'TABLE').style.backgroundColor=='white') {\n newTable.style.backgroundColor='#eee'\n } else {\n newTable.style.backgroundColor='white'\n }\n return newTable;\n \n case 'collection':\n var res = myDocument.createElement('table')\n res.setAttribute('class', 'collectionAsTables')\n for (var i=0; i<obj.elements.length; i++) {\n var tr = myDocument.createElement('tr');\n res.appendChild(tr);\n tr.appendChild(objectTree(obj.elements[i]));\n }\n return res;\n case 'formula':\n var res = tabulator.panes.dataContentPane.statementsAsTables(obj.statements, myDocument);\n res.setAttribute('class', 'nestedFormula')\n return res;\n case 'variable':\n var res = myDocument.createTextNode('?' + obj.uri);\n return res;\n \n }\n throw \"Unhandled node type: \"+obj.termType\n }", "function makeTree(object) {\n console.clear();\n console.log(\n `your number was ${object.lines}, and the character was ${object.character}`\n );\n for (i = 0; i <= object.lines; i++) {\n let treeString = \"\";\n for (j = 0; j < object.lines - i; j++) {\n treeString += \" \";\n }\n for (k = 0; k < i * 2 - 1; k++) {\n treeString += `${object.character}`;\n }\n console.log(treeString);\n }\n}", "function MakeTree() {\n (0,flarum_forum_extend__WEBPACK_IMPORTED_MODULE_0__.extend)((flarum_forum_components_Post__WEBPACK_IMPORTED_MODULE_1___default().prototype), 'view', function (vdom) {\n var id = this.attrs.post.id();\n\n if (!app.cache.trees) {\n app.cache.trees = {};\n app.cache.pushTree = {};\n }\n\n if (!app.cache.trees[id]) {\n app.cache.trees[id] = [];\n app.cache.pushTree[id] = 0;\n } // cevap a yapilan yorumlarin ust katmanini yukler container\n\n\n if (app.cache.trees[id].length > 0) {\n var count = this.attrs.post.data.attributes.replyCount;\n vdom.children.push(m(\"div\", {\n className: \"CommentTree topreply\",\n id: id\n }, m(\"h4\", {\n className: \"postcommentstitle\"\n }, flarum_forum_helpers_icon__WEBPACK_IMPORTED_MODULE_2___default()('fas fa-comments'), \" \", app.translator.trans('kilicselcuk-postcomments.forum.post.show_' + (count > 1 ? 'replies' : 'reply'), {\n count: count\n })), app.cache.trees[id].filter(function (thing, index, self) {\n return self.findIndex(function (t) {\n return t.id() === thing.id();\n }) === index;\n }).sort(function (a, b) {\n return a.createdAt() - b.createdAt();\n }).map(function (post) {\n //console.dir(post);\n return _component_CommentPostCopy__WEBPACK_IMPORTED_MODULE_3__[\"default\"].component({\n post: post\n });\n })));\n }\n\n if (this.attrs.post.data.attributes.replyCount > app.cache.trees[id].length - app.cache.pushTree[id] || app.cache.trees[id].length === 0 && this.attrs.post.data.attributes.replyCount) {\n app.store.find('trees', id).then(function (response) {\n delete response.payload;\n [].push.apply(app.cache.trees[id], response);\n m.redraw();\n });\n }\n });\n}", "function buildHierarchy(obj) {\n\tdebugObject(\"buildHierarchy() obj=\", obj);\n\t// Add children.\n\tif ((obj.objType == QUESTIONNAIRE_OBJECT) || (obj.objType == GROUP_OBJECT)) {\n\t\tvar hierarchy = persistentState.hierarchy[obj.id];\n\t\thierarchy.children = obj.items;\n\t\tfor (var i = 0; i < obj.items.length; i++) {\n\t\t\tvar childID = obj.items[i];\n\t\t\tvar childHierarchy = persistentState.hierarchy[childID];\n\t\t\tvar child = temporaryState.items[childID];\n\t\t\tif (isDebug()) {\n\t\t\t\tdebug(\"buildHierarchy() childID=\" + childID + \" childHierarchy=\"\n\t\t\t\t\t\t+ objectToString(childHierarchy) + \" child=\" + objectToString(child));\n\t\t\t}\n\t\t\tif (!isNull(child)) {\n\t\t\t\tpersistentState.hierarchy[childID] =\n\t\t\t\t\t\tnew HierarchyObject(obj.id, i, (hierarchy.level + 1), false);\n\t\t\t\tbuildHierarchy(child);\n\t\t\t}\n\t\t\telse if (isNull(childHierarchy)) {\n\t\t\t\tpersistentState.hierarchy[childID] =\n\t\t\t\t\t\tnew HierarchyObject(obj.id, i, (hierarchy.level + 1), true);\n\t\t\t}\n\t\t}\n\t}\n}", "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "function dataToHierarchy(data){\n\n var root= {name: \"root\", children:[]};\n getChildren(data, root);\n console.log(root);\n return root;\n}", "function buildForceGraphJSON (data) {\n // build json for d3.js force directed tree aph\n // root node is always central 'Search Results'\n const d3JSON = {\n name: 'Search Results',\n parent: true,\n size: data.length,\n children: addChildren(data['courses'], data['sections'])\n }\n\n\n\n \n\n\n \n console.log(d3JSON)\n graphForceTree(d3JSON)\n}", "function getTreeData() {\n\tnew Promise((resolve, reject) => {\n\t\t\tutil.getData(srcPath, resolve, reject, 1, rules)\n\t\t})\n\t\t.then(arr => start(arr))\n\t\t.catch(err => console.error(err))\n}", "function generateTree(dataset){\n getNode(dataset);\n\n //setLevel, setID, and add to nodes Array\n var levelArray = new Array();\n\n var data = dataset;\n var level = 0;\n levelArray.push(data);\n while(levelArray.length > 0){\n var levelArrayNext = new Array();\n for(var i = 0; i < levelArray.length; i ++){//traverse a level\n levelArray[i].node.setLevel(level);\n levelArray[i].node.setPosition(DISX);//initial node's position: node.y = 0\n levelArray[i].node.setID(Nodes.length);\n Nodes.push(levelArray[i].node);\n nodeNames.push(levelArray[i].node.name);\n\n if(levelArray[i].hasOwnProperty('children')){\n for(var j = 0; j < levelArray[i].children.length; j ++){\n levelArrayNext.push(levelArray[i].children[j]);\n }\n }\n }\n level ++;\n levelArray = levelArrayNext;//update current level\n }\n\n //convert children of node in 'nodes' to childID\n for(var i = 0; i < Nodes.length; i++){\n for(var j = 0; j < Nodes[i].children.length; j++){\n Nodes[i].children[j] = nodeNames.indexOf(Nodes[i].children[j].name);\n }\n }\n}", "function tree(trunks) {\n this.trunks = trunks;\n this.branches = trunks * 10;\n this.twigs = trunks * 100;\n this.leaves = trunks * 1000;\n}", "function generateDatabaseJSON(a_list,order){\n\tif(a_list.length == 0 || order < 0 || order > 2)\n\t\treturn null;\n\t\n\tvar json = null;\n\tvar orders = [((order+0)%3) + 1,((order+1)%3) + 1,((order+2)%3) + 1]\n\tjson = '{' +\n '\"name\": \"top level\",' +\n '\"parent\": \"null\",' +\n '\"fake\": true,' + \n '\"children\": [';\n\t\n\tvar list = a_list.sort(function(a, b){\n\t\tvar a_storage = [s_dict[a[1]].split(\" \")[s_dict[a[1]].split(\" \").length-1],p_dict[a[2]].split(\" \")[p_dict[a[2]].split(\" \").length-1],c_dict[a[3]].split(\"\\t\")[0].split(\":\")[1]];\n\t\tvar b_storage = [s_dict[b[1]].split(\" \")[s_dict[b[1]].split(\" \").length-1],p_dict[b[2]].split(\" \")[p_dict[b[2]].split(\" \").length-1],c_dict[b[3]].split(\"\\t\")[0].split(\":\")[1]];\n\t\tif(a_storage[orders[0]-1].localeCompare(b_storage[orders[0]-1]) != 0)\n\t\t\treturn a_storage[orders[0]-1].localeCompare(b_storage[orders[0]-1]);\n\t\tif(a_storage[orders[1]-1].localeCompare(b_storage[orders[1]-1]) != 0)\n\t\t\treturn a_storage[orders[1]-1].localeCompare(b_storage[orders[1]-1]);\n\t\treturn a_storage[orders[2]-1].localeCompare(b_storage[orders[2]-1]);\n\t\t});\n\t\n\tvar partitions = [];\n\tif(order == 0){\n\t\tvar temp = [];\n\t\tvar char = \"A\";\n\t\tfor(let i = 0; i < list.length; i++){\n\t\t\tif(s_dict[list[i][1]].split(\" \")[s_dict[list[i][1]].split(\" \").length-1].substring(0,1) === char)\n\t\t\t\ttemp.push(list[i]);\n\t\t\telse{\n\t\t\t\tpartitions.push(temp);\n\t\t\t\ttemp = [];\n\t\t\t\tchar = String.fromCharCode(char.charCodeAt(0) + 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tpartitions.push(temp);\n\t}\n\telse if(order == 1){\n\t\tvar temp = [];\n\t\tvar char = \"A\";\n\t\tfor(let i = 0; i < list.length; i++){\n\t\t\tif(p_dict[list[i][2]].split(\" \")[p_dict[list[i][2]].split(\" \").length-1].substring(0,1) === char)\n\t\t\t\ttemp.push(list[i]);\n\t\t\telse{\n\t\t\t\tpartitions.push(temp);\n\t\t\t\ttemp = [];\n\t\t\t\tchar = String.fromCharCode(char.charCodeAt(0) + 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tpartitions.push(temp);\n\t}\n\telse{\n\t\tvar temp = [];\n\t\tvar char = \"1\";\n\t\tfor(let i = 0; i < list.length; i++){\n\t\t\tif(c_dict[list[i][3]].split(\"\\t\")[0].split(\":\")[1].substring(0,1) === char)\n\t\t\t\ttemp.push(list[i]);\n\t\t\telse{\n\t\t\t\tpartitions.push(temp);\n\t\t\t\ttemp = [];\n\t\t\t\tchar = String.fromCharCode(char.charCodeAt(0) + 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tpartitions.push(temp);\n\t}\n\t console.log(partitions);\n\t\n\tvar combined_partitions = [];\n\tvar temp = [];\n\tfor(let i = 0; i < partitions.length; i++){\n\t\tif(partitions[i].length <= 25)\n\t\t\ttemp = temp.concat(partitions[i]);\n\t\telse{\n\t\t\tfor(let j = 0; j < partitions[i].length/25; j++){\n\t\t\t\tcombined_partitions.push(partitions[i].slice(25*j,25*(j+1)));\n\t\t\t}\n\t\t}\n\t\tif(temp.length >= 10 || (temp.length >= 5 && i != partitions.length-1 && partitions[i+1].length >= 15)){\n\t\t\tcombined_partitions.push(temp);\n\t\t\ttemp = [];\n\t\t}\n\t}\n\tif(temp.length != 0)\n\t\tcombined_partitions.push(temp);\n\tif(order == 2){\n\t\tcombined_partitions = partitions.slice();\n\t\t/*\n\t\tcombined_partitions = [];\n\t\tfor(let i = 0; i < partitions.length; i++){\n\t\t\tif(partitions[i].length <= 25)\n\t\t\t\tcombined_partitions.push(partitions[i]);\n\t\t\telse{\n\t\t\t\tfor(let j = 0; j < partitions[i].length/25; j++){\n\t\t\t\t\tcombined_partitions.push(partitions[i].slice(25*j,25*(j+1)));\n\t\t\t\t\tif(j == partitions[i].length/25 - 1)\n\t\t\t\t\t\tcombined_partitions.push(partitions[i].slice(25*(j+1),partitions[i].length));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t*/\n\t}\n\t\n\t// console.log(combined_partitions);\n\t\n\tvar partition_name = \"\";\n\tif(order == 0)\n\t\tpartition_name = s_dict[combined_partitions[0][0][1]].split(\" \")[s_dict[combined_partitions[0][0][1]].split(\" \").length-1].substring(0,1) + \"-\" \n\t\t\t+ s_dict[combined_partitions[0][combined_partitions[0].length-1][1]].split(\" \")[s_dict[combined_partitions[0][combined_partitions[0].length-1][1]].split(\" \").length-1].substring(0,1);\n\telse if(order == 1)\n\t\tpartition_name = p_dict[combined_partitions[0][0][2]].split(\" \")[p_dict[combined_partitions[0][0][2]].split(\" \").length-1].substring(0,1) + \"-\" \n\t\t\t+ p_dict[combined_partitions[0][combined_partitions[0].length-1][2]].split(\" \")[p_dict[combined_partitions[0][combined_partitions[0].length-1][2]].split(\" \").length-1].substring(0,1);\n\telse\n\t\tpartition_name = c_dict[combined_partitions[0][0][3]].split(\"\\t\")[0].split(\":\")[1].substring(0,1)\n\t\t\t+ \"00-Level\";\n\tjson += '{' +\n '\"name\": \"' + partition_name + '\",' +\n '\"parent\": \"top level\",' +\n '\"fake\": false,' +\n '\"children\": [{' +\n\t\t '\"name\": \"' + combined_partitions[0][0][orders[0]] + '\",' +\n\t\t '\"parent\": \"' + partition_name + '\",' +\n\t\t '\"fake\": false,' +\n\t\t '\"children\": [{' +\n\t\t \t\t'\"name\": \"' + combined_partitions[0][0][orders[1]] + '\",' +\n\t\t '\"parent\": \"' + combined_partitions[0][0][orders[0]] + '\",' +\n\t\t '\"fake\": false,' +\n\t\t '\"children\": [{' +\n\t\t '\"name\": \"' + combined_partitions[0][0][orders[2]] + '\",' +\n\t\t '\"parent\": \"' + combined_partitions[0][0][orders[1]] + '\",' +\n\t\t '\"fake\": false' +\n '}';\n\tfor(let i = 0; i < combined_partitions.length; i++){\n\t\tfor(let j = 1; j < combined_partitions[i].length; j++){\n\t\t\tif(combined_partitions[i][j][orders[0]] == combined_partitions[i][j-1][orders[0]] \n\t\t\t&& combined_partitions[i][j][orders[1]] == combined_partitions[i][j-1][orders[1]])\n\t\t\t\tjson += ',{' +\n\t '\"name\": \"' + combined_partitions[i][j][orders[2]] + '\",' +\n\t '\"parent\": \"' + combined_partitions[i][j][orders[1]] + '\",' +\n\t '\"fake\": false' +\n\t '}';\n\t\t\telse if(combined_partitions[i][j][orders[0]] == combined_partitions[i][j-1][orders[0]])\n\t\t\t\tjson += ']' +\n\t\t\t '},' +\n\t\t\t '{' +\n\t\t\t '\"name\": \"' + combined_partitions[i][j][orders[1]] + '\",' +\n\t\t\t '\"parent\": \"' + combined_partitions[i][j][orders[0]] + '\",' +\n\t\t\t '\"fake\": false,' +\n\t\t\t '\"children\": [{' +\n\t\t\t '\"name\": \"' + combined_partitions[i][j][orders[2]] + '\",' +\n\t\t\t '\"parent\": \"' + combined_partitions[i][j][orders[1]] + '\",' +\n\t\t\t '\"fake\": false' +\n\t\t\t '}';\n\t\t\telse{\n\t\t\t\tjson += ']' +\n\t\t '}' +\n\t\t ']' +\n\t\t '}' +\n\t\t ',{' +\n\t\t\t '\"name\": \"' + combined_partitions[i][j][orders[0]] + '\",' +\n\t\t\t '\"parent\": \"' + partition_name + '\",' +\n\t\t\t '\"children\": [{' +\n\t\t\t '\"name\": \"' + combined_partitions[i][j][orders[1]] + '\",' +\n\t\t\t '\"parent\": \"' + combined_partitions[i][j][orders[0]] + '\",' +\n\t\t\t '\"fake\": false,' +\n\t\t\t '\"children\": [{' +\n\t\t\t '\"name\": \"' + combined_partitions[i][j][orders[2]] + '\",' +\n\t\t\t '\"parent\": \"' + combined_partitions[i][j][orders[1]] + '\",' +\n\t\t\t '\"fake\": false' +\n\t\t\t '}';\n\t\t\t}\n\t\t}\n\t\tif(i == combined_partitions.length - 1)\n\t\t\tbreak;\n\t\tpartition_name = \"\";\n\t\tif(order == 0)\n\t\t\tpartition_name = s_dict[combined_partitions[i+1][0][1]].split(\" \")[s_dict[combined_partitions[i+1][0][1]].split(\" \").length-1].substring(0,1) + \"-\" \n\t\t\t\t+ s_dict[combined_partitions[i+1][combined_partitions[i+1].length-1][1]].split(\" \")[s_dict[combined_partitions[i+1][combined_partitions[i+1].length-1][1]].split(\" \").length-1].substring(0,1);\n\t\telse if(order == 1)\n\t\t\tpartition_name = p_dict[combined_partitions[i+1][0][2]].split(\" \")[p_dict[combined_partitions[i+1][0][2]].split(\" \").length-1].substring(0,1) + \"-\" \n\t\t\t\t+ p_dict[combined_partitions[i+1][combined_partitions[i+1].length-1][2]].split(\" \")[p_dict[combined_partitions[i+1][combined_partitions[i+1].length-1][2]].split(\" \").length-1].substring(0,1);\n\t\telse\n\t\t\tpartition_name = c_dict[combined_partitions[i+1][0][3]].split(\"\\t\")[0].split(\":\")[1].substring(0,1)\n\t\t\t\t+ \"00-Level\";\n\t\tjson += ']' +\n\t '}' +\n\t ']' +\n\t '}' +\n\t ']}'\n\t\tjson += ',{' +\n\t '\"name\": \"' + partition_name + '\",' +\n\t '\"parent\": \"top level\",' +\n\t '\"fake\": false,' +\n\t '\"children\": [{' +\n\t\t\t '\"name\": \"' + combined_partitions[i+1][0][orders[0]] + '\",' +\n\t\t\t '\"parent\": \"' + partition_name + '\",' +\n\t\t\t '\"fake\": false,' +\n\t\t\t '\"children\": [{' +\n\t\t\t \t\t'\"name\": \"' + combined_partitions[i+1][0][orders[1]] + '\",' +\n\t\t\t '\"parent\": \"' + combined_partitions[i+1][0][orders[0]] + '\",' +\n\t\t\t '\"fake\": false,' +\n\t\t\t '\"children\": [{' +\n\t\t\t '\"name\": \"' + combined_partitions[i+1][0][orders[2]] + '\",' +\n\t\t\t '\"parent\": \"' + combined_partitions[i+1][0][orders[1]] + '\",' +\n\t\t\t '\"fake\": false' +\n\t '}';\n\t}\n\tjson += ']' +\n\t '}' +\n\t ']' +\n\t'}]' +\n\t'}]}';\n\t\n\treturn JSON.parse(json);\n}", "function childrenObjectToArray (tree){\n\tif(tree.children === null || tree.children === undefined){\n\t\treturn;\n\t}\n\n\tif(typeof tree.children == \"object\"){\n\t\t// convert to array\n\t\tvar children = [];\n\t\tfor(var child in tree.children){\n\t\t\tvar childTree = tree.children[child];\n\t\t\tchildrenObjectToArray(childTree);\n\t\t\tchildren.push(childTree);\n\t\t}\n if(children.length === 0){\n tree.children = null;\n } else {\n tree.children = children;\n }\n\t\t\n\t}\n}", "function ls(cb) {\n\n var json = [];\n\n var filesArray = readDir.readSync('build/audio/', ['**.ogg', '**.mp3']);\n _.each(filesArray, (file) => {\n var parsed = path.parse(file);\n var dirs = parsed.dir.split('/');\n\n var objs = [];\n var previousObj;\n var filePath;\n var dir\n var fileArray;\n for (var i = 0; i < dirs.length; i++) {\n var dirName = dirs[i];\n if (dirs[i + 1]) {\n if (previousObj) {\n previousObj.files = previousObj.files || [];\n filePath[dirName] = filePath[dirName];\n console.log(filePath);\n if(filePath.files.indexOf(filePath) < 0){\n previousObj.files.push(filePath);\n }\n } else {\n previousObj = json[dirName] = json[dirName] || {};\n previousObj.files = previousObj.files || [];\n previousObj.dirName = dirName;\n if(json.indexOf(previousObj) < 0){\n json.push(previousObj);\n }\n }\n } else {\n fileArray = previousObj.files= previousObj.files || [];\n }\n }\n fileArray.push(path.join(paths.dist, file));\n });\n fs.writeFile(JSON_OUTPUT, JSON.stringify(json, null, 4), function(err) {\n if (err) {\n console.error(err);\n }\n cb();\n });\n}", "function convertTrees() {\n setDefault(\"treeClass\",\"mktree\");\n setDefault(\"nodeClosedClass\",\"liClosed\");\n setDefault(\"nodeOpenClass\",\"liOpen\");\n setDefault(\"nodeBulletClass\",\"liBullet\");\n setDefault(\"nodeLinkClass\",\"bullet\");\n setDefault(\"preProcessTrees\",true);\n if (preProcessTrees) {\n if (!document.createElement) { return; } // Without createElement, we can't do anything\n var uls = document.getElementsByTagName(\"ul\");\n if (uls==null) { return; }\n var uls_length = uls.length;\n //added\n $$('input[type=checkbox]').addEvent('click',markBox);\n for (var uli=0;uli<uls_length;uli++) {\n var ul=uls[uli];\n if (ul.nodeName==\"UL\" && $(ul).hasClass(treeClass)) {\n processList(ul);\n }\n }\n }\n}", "createTreeVisualizer(obj) {\n const geom = new THREE.Geometry();\n function traverse(o) {\n const p0 = o.getWorldPosition(new THREE.Vector3());\n o.children.forEach(c => {\n if (c.type === \"Bone\" && o.type === \"Bone\") {\n const p1 = c.getWorldPosition(new THREE.Vector3());\n geom.vertices.push(p0);\n geom.vertices.push(p1);\n }\n traverse(c);\n });\n }\n traverse(obj);\n const mat = new THREE.LineBasicMaterial({ color: \"red\" });\n mat.depthTest = false;\n return new THREE.LineSegments(geom, mat);\n }", "function traverseTree(treeNode) {\n function loop(node, result) {\n if (node.url) {\n result.push(node);\n } else if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n var item = node.children[i];\n loop(item, result);\n }\n }\n return result;\n }\n\n return loop(treeNode, []);\n}", "depthFirstSearch(array) {\n array.push(this.name);\n for (let child of this.children) {\n child.depthFirstSearch(array);\n }\n return array;\n }", "function makeTreeObject() {\n treeObject.lines = document.getElementById(\"lines\").value;\n treeObject.character = document.getElementById(\"character\").value;\n}", "function populateObjects(system){\n objects.push(system.mesh); \n for (var i = 0; i < system.children.length; i++){\n populateObjects(system.children[i]);\n }\n}", "function getDataArray(json){\n var nodeDataArray = [];\n var linkDataArray = [];\n var nodeDataArrayLocal = [{\"key\": \"Root\", color: \"#e2343d\" }];\n for(var key in json){\n if(!nodeDataArray.find(v => v[\"key\"] === key)) {\n if(json[key].isAppLayer) {\n nodeDataArrayLocal.push({\"key\": key, color: \"#87b62b\", parent: \"Root\"});\n nodeDataArray.push({\"key\": key, color: \"#87b62b\" });\n } else {\n nodeDataArrayLocal.push({\"key\": key, color: \"#f3ae29\"});\n nodeDataArray.push({\"key\": key, color: \"#f3ae29\" });\n }\n }\n var dependencies = json[key].dependencies;\n if(dependencies){\n dependencies.forEach(function(value, index){\n var artifactId = value.artifactId;\n if(!nodeDataArray.find(v => v[\"key\"] === artifactId)){\n if(jsonKeys.includes(artifactId)) {\n nodeDataArrayLocal.push({\"key\": key, color: \"#f3ae29\", parent: key});\n nodeDataArray.push({\"key\": artifactId, color: \"#f3ae29\"});\n } else {\n nodeDataArrayLocal.push({\"key\": key, color: \"#1067cf\", parent: key});\n nodeDataArray.push({\"key\": artifactId, color: \"#1067cf\"});\n }\n\n }\n linkDataArray.push({ from: key, to: artifactId });\n });\n }\n }\n return {\n nodeDataArray: nodeDataArray,\n linkDataArray: linkDataArray,\n nodeDataArrayLocal: nodeDataArrayLocal\n }\n}", "list() {\n // list all stored objects by reading the file system\n return mkderp(dir)\n .then(() => readDir(dir))\n .then(files =>\n Promise.all(files.filter(f => f.substr(-5) === '.json').map(loadFile))\n );\n }", "sync() {\n return fetch('/api/tree').then((res) => {\n return res.json();\n }).then((json) => {\n this.root = json.data.root;\n });\n }", "buildTree() {\n // note: in this function you will assign positions and levels by making calls to assignPosition() and assignLevel()\n let rootNode = this.nodeList.find(theRootNode => theRootNode.parentName === \"root\");\n this.assignLevel(rootNode, 0);\n this.assignPosition(rootNode, 0);\n }", "function getTree(topName) {\n arrayTree.push(topName);//adding to array\n\n if (findChildren(topName, parents, children).length >= 1) {\n var djeca = findChildren(topName, parents, children);\n for (var k in djeca) {\n if (findChildren(djeca[k], parents, children).length == 0) {\n break;\n }\n getTree(djeca[k]);//recursion\n }\n } else\n return arrayTree;\n\n return arrayTree;\n}", "setFromJSON(jsnmphtgt) {\n//----------\nthis.fourCCName = FourCC.fourCCInt(jsnmphtgt.morphTargetName);\nreturn this.vertices = jsnmphtgt.morphSets.map(MorphVertex.fromJSON);\n}", "function print_file_tree(entries)\n{\n (debug?console.log(\"\\n________________________________________\\n\\tgenerateTree\\n\"):null);\n // entries obtained with sakura.apis.operator.get_file_tree()\n // are either:\n // - a directory: { 'name': <dirname>,\n // 'is_dir': true,\n // 'dir_entries': [ <entry>, <entry>, <entry>, ... ]\n // }\n // - a regular file: { 'name': <filename>,\n // 'is_dir': false\n // }\n // recursively, directory entries follow the same format.\n\n // treeHtmlString contains the lines of the tree\n var treeHtmlString = [];\n treeHtmlString.push(\"<div id='tree' class='tree'><ul>\");\n treeHtmlString.push(\"<li data-type='dir' data-path='/' data-jstree=\\\"{ 'opened' : true }\\\">/<ul>\");\n //call the recursive function\n print_dir(entries, treeHtmlString);\n treeHtmlString.push(\"</ul></li>\");\n treeHtmlString.push(\"</ul></li></div>\");\n var str = \"\";\n for(var i = 0 ; i < treeHtmlString.length ; i++) {\n str += treeHtmlString[i];\n }\n (debug?console.log(str):null);\n $(\"#treeDiv\").append(str);\n\n //Creates the jstree using #tree element, sorts alphabetically with folders on top\n setJsTree();\n\n $('#tree').bind('ready.jstree', function() {\n $('#tree').jstree(\"open_all\");\n });\n (debug?console.log(\"________________________________________\\n\"):null);\n}", "function classes(root){\n\tvar classes = []; //存储结果的数组 \n /* \n * 自定义递归函数\n * 第二个参数指传入的json对象 \n */ \n function recurse(name, node) { \n if (node.children) //如果有孩子结点 (这里的children不是自带的,是json里面有的) \n { \n node.children.forEach(function(child) { //将孩子结点中的每条数据 \n recurse(node.name, child); \n })\n } \n else {\n \t//如果自身是孩子结点的,将内容压入数组\n \tclasses.push({ name: node.name, value: node.size,props:node.props})\n }; \n } \n recurse(null, root); \n return {children: classes};\n}", "function drawTree() {\n\n // draw tree using prepared data and config variables\n // \n var t1 = new Date();\n //oTree.clearChart();\n \n updateHandler();\n\n setTimeout(function(){\n oTree.draw(oTreeData, oTreeOptions);\n\n setPopularWords();\n }, 1);\n \n }", "depthFirstSearch(array) {\n // Write your code here.\n\n // Step3: Push the first name property of this node object\n array.push(this.name);\n // console.log(`Array has this nodes name: ${array}`);\n\n //Step4: Loop through the nested Node objects and recursively call depth first search, with a specific node. Each recursive call will push the name of each childNode from left to right.\n for (let index in this.children) {\n console.log(`childNode: ${JSON.stringify(this.children[index])}`);\n const childNode = this.children[index];\n childNode.depthFirstSearch(array);\n }\n console.log(`Array Final: ${array}`);\n return array;\n }", "function tree (a_items, a_template) {\n this.n_tid = trees.length;\n trees[this.n_tid] = this;\n \n this.a_tpl = a_template;\n this.a_config = a_items;\n this.o_root = this;\n this.a_index = [];\n this.a_selected = [];\n this.a_deleted = [];\n this.b_selected = false;\n this.n_depth = -1;\n this.select_all = select_all;\n this.select_none= select_none;\n this.upstatus = function() {};//nothing\n this.o_parent = null;\n this.a_custom_menus = [];\n this.a_custom_menu_ids = [];\n this.n_items = 0;\n this.b_cache_children = true;\n this.get_item = function(id) { return this.a_index[id]; };\n this.item_count = function() { return this.n_items; };\n this.get_first_item = get_first_item;\n this.get_next_item = get_next_item;\n this.deleteAllChildren = deleteAllChildren;\n this.action = null;\n this.border = null;\n this.a_columns= null;\n this.a_columnWidths = null;\n this.add_tree_column = add_tree_column;\n this.timeoutId = 0; \n\n var o_icone = new Image();\n var o_iconl = new Image();\n o_icone.src = a_template['icon_e'];\n o_iconl.src = a_template['icon_l'];\n a_template['im_e'] = o_icone;\n a_template['im_l'] = o_iconl;\n\n for (var i = 0; i < 64; i++)\n if (a_template['icon_' + i]) \n {\n var o_icon = new Image();\n a_template['im_' + i] = o_icon;\n o_icon.src = a_template['icon_' + i];\n }\n \n this.expand = item_expand;\n this.toggle = toggle;\n this.select = function (n_id, e, treeid) { return this.get_item(n_id).select(e, treeid); };\n this.mover = mouse_over_item;\n this.mout = mouse_left_item;\n this.oncontextmenu = function (n_id, e, treeid) { return this.get_item(n_id).oncontextmenu(e, treeid) };\n this.show_context_menu = show_context_menu;\n this.handle_command = handle_command;\n this.on_sel_changed = null;\n this.on_expanding = null;\n this.on_context_menu= null;\n this.on_command = null;\n \n this.get_custom_menu = function(menu_name) {\n var index = this.a_custom_menu_ids[menu_name];\n return (index != undefined) ? this.a_custom_menus[index] : null;\n }\n this.add_custom_menu = function(menu_name, a_menu) { \n if (!this.get_custom_menu(menu_name))\n {\n var index = this.a_custom_menus.length;\n this.a_custom_menus[index] = a_menu;\n this.a_custom_menu_ids[menu_name] = index;\n }\n return index;\n }\n \n this.a_children = [];\n for (var i = 0; i < a_items.length; i++)\n new tree_item(this, i, this.a_config[i + (this.n_depth + 1 ? 2 : 0)]);\n\n var n_children = this.a_children.length;\n if (n_children) {\n var div = document.getElementById('tree_' + this.n_tid);\n var a_html = [];\n for (var i=0; i<n_children; i++) {\n var child = this.a_children[i];\n a_html[i] = child.init();\n child.expand();\n }\n div.innerHTML = a_html.join('');\n }\n}", "function reconstructJsTreeData(data, id) {\n var jsTreeNode;\n if (data[id].original) {\n jsTreeNode = data[id].original;\n jsTreeNode.children = [];\n }\n else {\n jsTreeNode = new _constants_jstree__WEBPACK_IMPORTED_MODULE_4__[\"JsTreeNode\"](data[id].text, data[id].id);\n }\n if (data[id].children) {\n jsTreeNode.children = data[id].children.map(function (child) { return reconstructJsTreeData(data, child); });\n }\n return jsTreeNode;\n}", "function getChildrenArray(data, root, defaultName ){\n switch(getType(data)){\n // cases number and string are the same as \n case \"number\":\n root.children.push({ name : defaultName, size : data});\n break;\n case \"string\":\n root.children.push({ name : data, size : 1});\n break;\n case \"object\":\n for (var name in data ){\n // here it will try to create an hierarchy\n getChildrenFromObjArray(data, root, name);\n }\n break;\n default:\n node= { name : defaultName, children : [] };\n root.children.push(node)\n getChildren(data, node, defaultName);\n break;\n }\n}", "depthFirstSearch(array) {\n array.push(this.name);\n for (const child of this.children) {\n child.depthFirstSearch(array);\n }\n\n return array;\n }", "function treeMap(obj, callback, path = '') {\n if (Array.isArray(obj)) return obj.map((el, i) => {\n return treeMap(el, callback, `${path}/${i}`);\n });\n\n // We only want to map leaf properties of data objects\n if (obj.toString() === '[object Object]') {\n obj = Object.assign({}, obj);\n Object.keys(obj).forEach(key => {\n obj[key] = treeMap(obj[key], callback, `${path}/${key}`);\n });\n return obj;\n }\n return callback(obj, path);\n}", "function drawTree(options) {\n var json = options[0],\n selector = options[1];\n\n if (typeof selector === \"undefined\") {\n selector = \"body\";\n }\n\n if (typeof json === \"undefined\") {\n throw(new Error(\"drawTree(), no json provided\"));\n }\n\n var diameter = 800;\n\n var tree = d3.layout.tree()\n .size([180, diameter / 4 ])\n .separation(function(a, b) { return (a.parent === b.parent ? 1 : 2) / a.depth; });\n\n var diagonal = d3.svg.diagonal.radial()\n .projection(function(d) { return [d.y, d.x / 180 * Math.PI]; });\n\n var svg = d3.select(selector).append(\"svg\")\n .attr(\"width\", diameter / 2)\n .attr(\"height\", diameter)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + 50 + \",\" + diameter / 8 * 3 + \")\");\n\n\n d3.json(json, function(error, root) {\n var nodes = tree.nodes(root),\n links = tree.links(nodes);\n\n var link = svg.selectAll(\".link\")\n .data(links)\n .enter().append(\"path\")\n .attr(\"class\", function (d) { return \"depth-\" + d.source.depth + \" link\"; })\n .attr(\"d\", diagonal);\n\n var node = svg.selectAll(\".node\")\n .data(nodes)\n .enter().append(\"g\")\n .attr(\"class\", function (d) { return \"depth-\" + d.depth + \" node\"; })\n .attr(\"id\", function (d) { return d.name; })\n .attr(\"transform\", function(d) { return \"rotate(\" + (d.x - 90) + \")translate(\" + d.y + \")\"; });\n\n\n node.append(\"circle\")\n .attr(\"r\", 4.5);\n\n node.append(\"text\")\n .attr(\"text-anchor\", function(d) { return d.x < 180 ? \"start\" : \"end\"; })\n .attr(\"transform\", function(d) { return d.x < 180 ? \"translate(8)\" : \"rotate(180)translate(-8)\"; })\n .text(function(d) { return d.name; });\n });\n\n d3.select(self.frameElement).style(\"height\", diameter - 150 + \"px\");\n\n}", "buildHierarchy () {\n for (var i = this.layers.length - 1; i >= 0; i--) {\n for (var j = 0; j < this.layers[i].length; j++) {\n for (var k = 0; k < this.layers[i][j].length; k++) {\n if (this.layers[i][j][k] === null) {\n continue\n }\n if (this.layers[i][j][k].parents.length < 1) {\n this.roots.push(this.layers[i][j][k].findChildren(this, this.numChildren))\n }\n }\n }\n }\n }", "function restoreObj(json, par) {\n var childArr = [];\n if (json) {\n for (var i = 0; i < json.length; ++i) {\n window.ASUHeaderMakerJSON.count++;\n var newObj = Object.create(MenuItem);\n newObj.id = 'asu-header-item-' + window.ASUHeaderMakerJSON.count;;\n// newObj.id = json[i].id;\n newObj.title = json[i].title;\n newObj.url = json[i].url;\n newObj.buildDomItem();\n newObj.parent = par || window.ASUHeaderMakerJSON;\n newObj.children = restoreObj(json[i].children, newObj);\n newObj.updateDomChildren();\n newObj.index = childArr.push(newObj) - 1;\n }\n }\n return childArr;\n }" ]
[ "0.66164774", "0.63485175", "0.6272255", "0.6148201", "0.6096477", "0.60741055", "0.60169566", "0.60018885", "0.5953875", "0.59260213", "0.59231323", "0.58904654", "0.5888925", "0.5878588", "0.58692616", "0.5834775", "0.5818594", "0.58049834", "0.5775699", "0.5741763", "0.573952", "0.5736806", "0.5700513", "0.568275", "0.56565475", "0.5626264", "0.55964637", "0.559418", "0.5579439", "0.55656743", "0.5543172", "0.55255914", "0.5509365", "0.5505149", "0.54856133", "0.54839975", "0.5461297", "0.54608035", "0.54594606", "0.5458978", "0.5433785", "0.5432881", "0.54237473", "0.5423568", "0.5420732", "0.5394077", "0.5374892", "0.5374892", "0.53681695", "0.53607917", "0.53607506", "0.53566945", "0.5355335", "0.5354464", "0.5348438", "0.53238577", "0.532305", "0.5314941", "0.530977", "0.5305302", "0.52919203", "0.52914953", "0.52863705", "0.5284745", "0.52752084", "0.52723235", "0.52713317", "0.52684057", "0.5266205", "0.52654165", "0.52601606", "0.5250596", "0.5249421", "0.52487016", "0.52420497", "0.524111", "0.52405435", "0.52366686", "0.52315086", "0.52280277", "0.52200854", "0.52122104", "0.52076185", "0.5200014", "0.5196228", "0.5195177", "0.5192723", "0.5183747", "0.5167087", "0.5156138", "0.51553345", "0.51540446", "0.5150907", "0.514909", "0.51489794", "0.5147621", "0.51470256", "0.51453793", "0.51414025", "0.51362634" ]
0.73752075
0
Trims R/ from the end of the string
function trimR(s) { if (s[s.length - 1] === "R" && s[s.length - 2] === "/") { s = s.substring(0, s.length - 2); } if (s[s.length - 1] === "/") { s = s.substring(0, s.length - 1); } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rtrim(path) {\n\t\treturn _.str.rtrim(path, \"/\");\n\t}", "function stripTrailingSlash(str) {\n\t if(str.substr(-1) == '/') {\n\t return str.substr(0, str.length - 1);\n\t }\n\t return str;\n\t }", "function trimOut(inp)\r\n{\r\n\tlet temp=inp.substring(inp.lastIndexOf(\"/\")+1,inp.length);\r\n\treturn temp.trim();\r\n}", "trailingSlash(s) {\n return s[s.length - 1] === \"/\" ? \"\" : \"/\";\n }", "function StringRTrim(str, symbol){\n while(str.endsWith(symbol)) str = str.substr(0, str.length - 1);\n return str\n}", "static clean(string) {\n if (typeof string === 'string') {\n return string.trim().replace(/\\/$/, '');\n }\n return string;\n }", "function rtrim(str) \r\n{\r\n var chars = \"\\\\s\";\r\n return str.replace(new RegExp(\"[\" + chars + \"]+$\", \"g\"), \"\");\r\n}", "function rtrim(str, char=\" \") {\r\n // If both the charcter and string are not\r\n // string, then no need to proceed.\r\n if (typeof(str) != 'string' || typeof(char) != 'string') {\r\n return;\r\n }\r\n var pattern = new RegExp(char + '+$', 'g');\r\n return str.replace(pattern, '');\r\n }", "function collapseLeadingSlashes(str){for(var i=0;i<str.length;i++){if(str[i]!=='/'){break;}}return i>1?'/'+str.substr(i):str;}", "function removeTrailingSlash(path) {\n return path.replace(/[/\\\\]+$/, '');\n}", "function stripLastChar(myString) {\n return myString.substring(0, myString.length - 1).trim();\n }", "function rtrim()\n{\n return this.replace( /\\s+$/g,'');\n}", "function eliminateARM(str) {\n\tvar newStr=\"\";\n\tfor(let i=0; i<str.length; ++i) {\n\t\tif((str[i]!=\"a\")&&(str[i]!=\"r\")&&(str[i]!=\"m\")) newStr=newStr+str[i];\n\t}\n\treturn newStr;\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function trimRight(text, ending) {\n while (text.length >= ending.length && text.lastIndexOf(ending) === text.length - ending.length) {\n text = text.substring(0, text.length - ending.length);\n }\n \n return text;\n }", "function collapseLeadingSlashes(str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes(str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f\n /* / */\n ) {\n break;\n }\n }\n\n return i > 1 ? '/' + str.substr(i) : str;\n}", "function addendslash(value)\r\n{\r\n\tvar lastChar = value.substring(value.length - 1);\r\n\t\r\n\tif(value != '' && lastChar != '/')\r\n\t{\r\n\t\tvalue += '/';\r\n\t}\r\n\t\r\n\treturn value;\r\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function rtrim(str) {\n return str.replace(/\\s+$/, \"\");\n}", "function RZright( str, noChars )\n{\n\tif (!str) return '';\n\tvar len = str.length;\n\tif (len == 0) return \"\";\n\n\tif (noChars > len) noChars = len;\n\treturn str.substring(len-noChars);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function RemoveRougeChar(convertString, separa){\r\n\tif(convertString.substring(0,1) == separa){\r\n\t\treturn convertString.substring(1, convertString.length) \r\n\t\t}\r\n\treturn convertString;\r\n}", "function rtrim(str)\n{\n var whitespace = new String(\" \\t\\n\\r\");\n var s = new String(str);\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\n var i = s.length - 1; // Get length of string\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\n i--;\n s = s.substring(0, i+1);\n }\n return s;\n}", "function clean(c) {\n return c === '-' ? '+' : '/';\n }", "function FFString_trimRight( value ){\n\tif(value==null || value==\"\") return \"\";\n\n\tvar length = value.length;\n\n\tvar i;\n\tfor(i=length-1;i>=0;i--){\n\t\tif(value.charAt(i) != \" \") break;\t\t\t\n\t}\n\treturn value.substring(0,i+1);\t\n}", "function strip(str) {\n return str.replace(/^[\\/]+|[\\/]+$/g, '');\n}", "function removeSlash(pathName, position = 'lead') {\n if (pathName.trim().length < 1) {\n return ''\n }\n\n if (position === 'trail' || position === 'both') {\n if (pathName.slice(-1) === '/') {\n pathName = pathName.slice(0, -1);\n }\n }\n\n if (position === 'lead' || position === 'both') {\n if (pathName[0] === '/') {\n pathName = pathName.slice(1);\n }\n }\n\n return pathName\n }", "function rtrim(s) {\n return s.replace(/\\s+$/, '');\n}", "function rtrim(str, chars) {\n\t str = toString(str);\n\t chars = chars || WHITE_SPACES;\n\n\t var end = str.length - 1,\n\t charLen = chars.length,\n\t found = true,\n\t i, c;\n\n\t while (found && end >= 0) {\n\t found = false;\n\t i = -1;\n\t c = str.charAt(end);\n\n\t while (++i < charLen) {\n\t if (c === chars[i]) {\n\t found = true;\n\t end--;\n\t break;\n\t }\n\t }\n\t }\n\n\t return (end >= 0) ? str.substring(0, end + 1) : '';\n\t }", "function RTrim( value ) {\r\n\r\n var re = /((\\s*\\S+)*)\\s*/;\r\n return value.replace(re, \"$1\");\r\n\r\n}", "function rtrim(str, c, invert) {\n var l = str.length;\n\n if (l === 0) {\n return '';\n } // Length of suffix matching the invert condition.\n\n\n var suffLen = 0; // Step left until we fail to match the invert condition.\n\n while (suffLen < l) {\n var currChar = str.charAt(l - suffLen - 1);\n\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, l - suffLen);\n }", "if (this._endsWithWord || str.charCodeAt(0) === charCodes.slash && this.endsWith(charCodes.slash)) {\n this._space();\n }", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n}", "removeLeadingSlash(text) {\n if (text.startsWith('/') || text.startsWith('\\\\')) {\n return text.substring(1);\n }\n else {\n return text;\n }\n }", "function ensureEndSlash(p) {\n return p.match(/\\/$/) ? p : `${p}/`;\n}", "function untrail (str) {\n const sep = require('path').sep\n\n if (str.substr(str.length - 1) === sep) {\n return str.substr(0, str.length - 1)\n } else {\n return str\n }\n}", "function rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, l - suffLen);\n }", "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, str.length - suffLen);\n }", "function rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, l - suffLen);\n}", "function rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, l - suffLen);\n}", "function clearSlash (text) {\n let newMessage = [];\n for (var i = 0; i < text.length; i++) {\n if (text[i] === '/') {\n newMessage.push('');\n } else {\n newMessage.push(text[i]);\n }\n }\n return newMessage.join('');\n}", "function removeSlashes (str) {\n return str.replace(/^\\/|\\/$/g, '')\n}", "_stripLeadingSlash(path) {\n if (path[0] === '/') {\n return path.slice(1);\n }\n return path;\n }", "function deleteLastCRLF(str){\n\tvar rv=str;\t\n\tvar imax=rv.length;\n\tif(rv[imax-1] == \"\\n\")\n\t\trv = rv.slice(0,imax-1);\n\timax=rv.length;\n\tif(rv[imax-1] == \"\\r\")\n\t\trv = rv.slice(0,imax-1);\t\t\n\treturn rv;\t\n}", "function removeSlash(path) {\n if (path.indexOf('/') === 0) {\n path = path.slice(1);\n }\n return path;\n }", "function removeSlash(path) {\n if (path.indexOf('/') === 0) {\n path = path.slice(1);\n }\n return path;\n }", "function RTrim(str)\n/*\n PURPOSE: Remove trailing blanks from our string.\n IN: str - the string we want to RTrim\n\n*/\n{\n // We don't want to trip JUST spaces, but also tabs,\n // line feeds, etc. Add anything else you want to\n // \"trim\" here in Whitespace\n var whitespace = new String(\" \\t\\n\\r\");\n\n var s = new String(str);\n\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\n // We have a string with trailing blank(s)...\n\n var i = s.length - 1; // Get length of string\n\n // Iterate from the far right of string until we\n // don't have any more whitespace...\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\n i--;\n\n\n // Get the substring from the front of the string to\n // where the last non-whitespace character is...\n s = s.substring(0, i+1);\n }\n\n return s;\n}", "function RTrim(str)\n/*\n PURPOSE: Remove trailing blanks from our string.\n IN: str - the string we want to RTrim\n\n*/\n{\n // We don't want to trip JUST spaces, but also tabs,\n // line feeds, etc. Add anything else you want to\n // \"trim\" here in Whitespace\n var whitespace = new String(\" \\t\\n\\r\");\n\n var s = new String(str);\n\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\n // We have a string with trailing blank(s)...\n\n var i = s.length - 1; // Get length of string\n\n // Iterate from the far right of string until we\n // don't have any more whitespace...\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\n i--;\n\n\n // Get the substring from the front of the string to\n // where the last non-whitespace character is...\n s = s.substring(0, i+1);\n }\n\n return s;\n}", "function RTrim(str)\r\n/*\r\n PURPOSE: Remove trailing blanks from our string.\r\n IN: str - the string we want to RTrim\r\n\r\n*/\r\n{\r\n // We don't want to trip JUST spaces, but also tabs,\r\n // line feeds, etc. Add anything else you want to\r\n // \"trim\" here in Whitespace\r\n var whitespace = new String(\" \\t\\n\\r\");\r\n\r\n var s = new String(str);\r\n\r\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\r\n // We have a string with trailing blank(s)...\r\n\r\n var i = s.length - 1; // Get length of string\r\n\r\n // Iterate from the far right of string until we\r\n // don't have any more whitespace...\r\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\r\n i--;\r\n\r\n\r\n // Get the substring from the front of the string to\r\n // where the last non-whitespace character is...\r\n s = s.substring(0, i+1);\r\n }\r\n\r\n return s;\r\n}", "function stripTrailingSlash(url) {\n var match = url.match(/#|\\?|$/);\n var pathEndIdx = match && match.index || url.length;\n var droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n }", "function undoubleEnding (str) {\n if (str.substr(-2) === 'kk' || str.substr(-2) === 'tt' || str.substr(-2) === 'dd') {\n return str.substr(0, str.length - 1)\n } else {\n return str\n }\n}", "function trimSlashes(path) {\n\tconst from = path[0] === \"/\" ? 1 : undefined;\n\tconst to = path[path.length - 1] === \"/\" ? -1 : undefined;\n\n\treturn path.slice(from, to);\n}", "function righttrim(value)\n{\n\twhile( value.length != 0 )\n\t{\n\t\tmychar=value.substring(value.length-1);\n\t\tif( mychar == \"\\u0020\" )\n\t\t{\n\t\t\tvalue=value.substr(0,value.length-1);\n\t\t}\n\t\telse\n\t\t\tbreak;\n\t\t\n\t}\n\treturn value;\n}", "function rtrim(strInput){\n var result = strInput.replace(/\\s+$/, \"\");\n return result;\n}", "function rtrim(str, chars) {\n str = toString(str);\n chars = chars || WHITE_SPACES;\n\n var end = str.length - 1,\n charLen = chars.length,\n found = true,\n i, c;\n\n while (found && end >= 0) {\n found = false;\n i = -1;\n c = str.charAt(end);\n\n while (++i < charLen) {\n if (c === chars[i]) {\n found = true;\n end--;\n break;\n }\n }\n }\n\n return (end >= 0) ? str.substring(0, end + 1) : '';\n }", "function rtrim(str) {\n return str.replace(/[\\s\\uFEFF\\xA0]+$/g, \"\");\n}", "function rtrim(str, chars) {\r\n\tchars = chars || \"\\\\s\";\r\n\treturn str.replace(new RegExp(\"[\" + chars + \"]+$\", \"g\"), \"\");\r\n}", "function removeTrailingDirectorySeparator(path) {\n if (path.charAt(path.length - 1) === ts.directorySeparator) {\n return path.substr(0, path.length - 1);\n }\n return path;\n }", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}", "function removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}" ]
[ "0.7328511", "0.7195182", "0.6699478", "0.6567531", "0.6526202", "0.6466382", "0.63819236", "0.63811404", "0.636192", "0.6310996", "0.625045", "0.6234766", "0.6231134", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.62180465", "0.6200562", "0.61999714", "0.6197996", "0.61948574", "0.61870337", "0.61870337", "0.6176455", "0.61726284", "0.6156033", "0.6156033", "0.6156033", "0.6156033", "0.6156033", "0.6156033", "0.6143292", "0.61324674", "0.61250067", "0.6117947", "0.6103521", "0.6101678", "0.6072663", "0.60598385", "0.6053923", "0.6047126", "0.60340726", "0.60248536", "0.60248536", "0.60248536", "0.60248536", "0.60248536", "0.60248536", "0.60248536", "0.60219043", "0.6019636", "0.6013209", "0.60104877", "0.5987476", "0.5978006", "0.5978006", "0.59757465", "0.59513414", "0.59489894", "0.5939049", "0.5929296", "0.5929296", "0.59290045", "0.59290045", "0.592751", "0.59206355", "0.59128726", "0.5909772", "0.5909497", "0.5898675", "0.5894333", "0.5871478", "0.58673424", "0.58537567", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117", "0.5850117" ]
0.8536636
0
const app = require('../../app'); ADMIN
async function deckEdit(req, res) { const { userName } = req.app.locals.username; const userId = await User.findOne({ name: userName })._id; // const obj = { // id: 123, // title: 'Test', // dataArr: [{q:'test',a:'test'},{q:'test',a:'test'},{q:'test',a:'test'},{q:'test',a:'test'}], // }; const obj = req.body; let idD; let cardArr; let title = `${obj.title.trim()}`; let key = `${title.toLowerCase()}`; if (obj.id === '' || obj.id === undefined || obj.id === null) { const deck = await Deck.findOne({ title }).lean();// , userid: userId if (deck) { // eslint-disable-next-line no-sequences key = `${title.toLowerCase()}*`; title = `${title}*`; } idD = await Deck.create({ key, title, userid: userId, }); } else { idD = await Deck.findOneAndUpdate({ _id: obj.id }, { $set: { title } }, { useFindAndModify: false, new: true }).exec(); // await Card.deleteMany({ deckid: idD._id }); } if (idD) { cardArr = await obj.dataArr.map(async (el) => { const cardN = await Card.create({ level: el.level, question: el.q, answer: el.a, answerArr: el.AllAnswer, deckid: idD._id, }); return cardN; }); } if (idD && cardArr) res.json('Ok'); else res.json('Err'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CrearApp() {\n this.app = express();\n }", "function router(app) {\n\n}", "function learnModules() {\n const sth=require('./app.js').something;\n \n console.log(sth);\n \n }", "constructor() {\n this.path = '/admin';\n this.router = express.Router();\n this.init();\n }", "function get_app() {\n return app;\n}", "function main() {\n const app = express();\n const port = process.env.PORT || 5000;\n\n // var http = require('http').createServer(app);\n // var io = require('socket.io')(http);\n\n // app.use(cors({\n // origin: ['http://localhost:3000'],\n // methods: ['GET', 'POST', 'DELETE', 'PUT'],\n // credentials: true // enable set cookie\n // }));\n // app.use(cors())\n app.use(express.json());\n\n\n app.get('/admin', (req, res) => {\n const user =\n {\n name: 'Aniket Sharma',\n username: 'Draqula',\n email: '[email protected]'\n }\n\n res.json(user)\n })\n\n // const uri = process.env.ATLAS_URI;\n // mongoose.connect(uri, { useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true }\n // );\n // const connection = mongoose.connection;\n // connection.once('open', () => {\n // console.log(\"MongoDB database connection established successfully\");\n // })\n\n // app.use('/users', Users);\n // const Todo = require('./routes/todoList.js');\n // app.use('/Todo', Todo);\n\n app.use(express.static(\"client/build\"));\n app.get(\"*\", (req, res) => {\n res.sendFile(path.resolve(__dirname, \"client\", \"build\", \"index.html\"));\n });\n app.listen(port, () => {\n console.log(`Server is running on port: ${port}`);\n });\n}", "function main () {\n let app = express(); // Export app for other routes to use\n let handlers = new HandlerGenerator();\n const port = process.env.PORT || 8000;\n app.use(bodyParser.urlencoded({ // Middleware\n extended: true\n }));\n app.use(bodyParser.json());\n // Routes & Handlers\n app.post('/login', handlers.login);\n app.get('/', middleware.checkToken, handlers.index);\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\n}", "routes() {\n this.app.use('/api/usuarios', require('../routes/usuarios'));\n }", "routes() {\n this.app.use('/api/usuarios', require('../routes/usuarios'));\n }", "getApp() {\n return admin.app();\n }", "constructor() {\n this.app = express();\n this.config();\n }", "function middleware(app) {\n app.use(express.static(__dirname + '/public'));\n}", "setup() {\n this.app.use(express.json());\n\n this.app.get('/', (req, res) => {\n res.send(\"Hello World!\")\n });\n }", "function runApp(app_name){\n app.mount(app_name);\n}", "before(app) {\n apiMocker(app, path.resolve(__dirname, '../public/mock.js'));\n }", "static init(app) {\n /* Initialize DB */\n\n MongoClient.connect(url, { useUnifiedTopology: true }, function (err, database) {\n if (err) throw err;\n console.log(\"Database created!\");\n db = database.db('mydb')\n });\n\n const router = express.Router();\n\n // Install bodyParser parameters\n router.use(bodyParser.urlencoded({\n extended: true\n }));\n router.use(bodyParser.json());\n\n app.use(bodyParser.urlencoded({ extended: true }))\n app.use(bodyParser.json())\n app.use(express.static('public'))\n app.use('/user', router);\n\n // LIST All REST Endpoints \n router.get('/getUsers', UserController.getAllUsers);\n router.post('/user', UserController.addNewUser);\n router.put('/user', UserController.updateUser);\n router.delete('/user', UserController.deleteUser);\n }", "async function main() {\n const mysql = require('mysql2/promise');\n const pool = mysql.createPool({\n host: process.env.MYSQL_HOST || 'localhost', \n database: process.env.MYSQL_DB || 'test',\n user: process.env.MYSQL_USER || 'root', \n password: process.env.MYSQL_PASSWORD\n });\n\n app.use('/api/user/', require('./routes/user')(pool))\n app.use('/api/sessions', require('./routes/sessions')(pool))\n app.use('/api/campaigns', require('./routes/campaigns')(pool))\n app.use('/api/top', require('./routes/top')(pool))\n app.use('/api/', require('./routes/misc')(pool))\n \n app.get('*',(req,res) => {\n res.status(404).json({error:'PageNotFound'})\n })\n}", "function loadExpress(app) {\n // Middleware for accepting request from everywere\n app.use(cors());\n\n // Securise my Api with a magic line\n app.use(helmet());\n\n // Permet de lire la partie body d'une requette http en json\n app.use(bodyParser.json());\n\n // Permet de lire les variable envoyer directment depuis un formulaire\n app.use(bodyParser.urlencoded({ extended: true }));\n\n // Definition des routes avec un Prefix\n app.use(config.api.prefix, loadApiRoutes());\n\n\n // Intercept les requete 404 NOT FOUND\n // Cad (quand le mec met un route erronee)\n app.use((req, res, next) => {\n const { originalUrl } = req;\n const err = {\n message: `Not Found ${originalUrl}`,\n status: 404,\n };\n next(err);\n });\n\n // Gloabl error handler\n app.use((err, req, res, next) => {\n // Format the Error response.\n res.status(err.status || 500);\n res.json({\n error: {\n status: err.status,\n message: err.message,\n },\n });\n });\n}", "function makeApp(InjectedDB)\n{\n\n const DB = InjectedDB;\n\n\n const corsOptions = {\n exposedHeaders: 'Authorization',\n };\n //----------------------middleware------------------------\n app.use(cors(corsOptions));\n app.use(express.urlencoded({extended: true}));\n app.use(express.json());\n app.use(express.static(path.join(__dirname, 'public')));\n\n\n //-------make the routes with passed in DB ----------//\n const UserRoute = makeUserRoute(DB);\n const TaskRoute = makeTaskRoute(DB);\n const ProjectRoute = makeProjectRoute(DB);\n //const NodeRoute = makeNodeRoute(DB);\n //const GraphRoute = makeGraphRoute(DB);\n\n //----------- router setup ------------------------//\n app.use('/project', ProjectRoute);\n app.use('/user', UserRoute);\n //app.use('/node', NodeRoute);\n app.use('/task', TaskRoute);\n //app.use('/graph',GraphRoute);\n\n //default /GET\n app.use('/', Home);\n //Handling Errors?\n app.use((req, res, next) => {\n const newError = new Error(`Not found. ${req.url}`);\n newError.status = 404;\n next(newError);\n\n });\n\n //Serve Error\n app.use((error, req, res, next) => {\n res.status(error.status || 500);\n res.json({\n error: error.message,\n type: error.type,\n loc: error.prototype,\n stack: error.stack,\n url: req.url\n\n });\n });\n\n return app;\n\n\n}", "function loadAppRoutes(app){\n\t//To support JSON-encoded bodies\n\tapp.use(bodyParser.json());\n\n\t//To support URL-encoded bodies\n\t//app.use(bodyParser.urlencoded({extended:true}));\n\n\t//Load routes which require no authorization (publicly available)\n\tapp.use(\"/public\", publicRoutes);\n\n\t//Load routes which require authorization (secured access)\n\tapp.use(\"/secure\", securedRoutes);\n\n\t//TEST route for checking successful deployment\n\tapp.get(\"/\", function(req,res){\n\t\tres.send(\"Hello! You have reached the index.\");\n\t});\n}", "app() {\r\n this.fs.copy(\r\n this.templatePath('src/app.js'),\r\n this.destinationPath('src/app.js')\r\n );\r\n this.fs.copyTpl(\r\n this.templatePath('src/app/controllers/_index.js'),\r\n this.destinationPath('src/app/controllers/index.js'),\r\n this.opts\r\n );\r\n this.fs.copy(\r\n this.templatePath('src/app/controllers/extras.js'),\r\n this.destinationPath('src/app/controllers/extras.js')\r\n );\r\n this.directory(\r\n this.templatePath('src/app/models'),\r\n this.destinationPath('src/app/models')\r\n );\r\n this.directory(\r\n this.templatePath('src/app/views'),\r\n this.destinationPath('src/app/views')\r\n );\r\n }", "routes() {\n // this.app.use( this.paths.auth, require('../routes/auth'));\n }", "function fun(app) {\n debug('Loading route modules...');\n\n let files = walkSyncJS(rpath);\n files.forEach((file) => {\n let mod = file.substr(0, file.length-3).replace(rpath+path.sep, '');\n if(config.exclude && config.exclude.indexOf(mod) > -1) {\n return;\n }\n\n app.use(require(file));\n debug('Loading server' + file.replace(__dirname, ''));\n });\n\n debug('Route modules loaded');\n}", "function App() {\n\n return (\n <div className=\"App\">\n <Router>\n <Home path=\"/\"/>\n <Main path=\"/admin\"/>\n {/* <AdminHome path=\"/login/hi\"/> */}\n <BuyTicket path=\"/tickets/:id\"/>\n <BuyersList path=\"/admin/info\"/>\n <MoviesAdmin path=\"/admin/movies\"/>\n </Router>\n </div>\n );\n}", "boostrap() {\n\n const self = this;\n\n this.app.get(\"/\", (request, response) => {\n\n // code here\n\n });\n\n return this.app;\n }", "function main() {\n\t\n\tdbconnection();\n var app = express(); // Export app for other routes to use\n \n var port = process.env.PORT || 8000;\n app.use(bodyParser.urlencoded({\n extended: true\n }));\n app.use(bodyParser.json());\n // Routes & Handlers\n app.post('/login', Auth);\n\tapp.get('/getCategory/',middleware.checkToken,Category);\n\tapp.get('/deleteCategory/:id',middleware.checkToken,Category);\n\tapp.get('/getParentcategory/:id',middleware.checkToken,Category);\n\tapp.post('/addCategory',middleware.checkToken,Category);\n\t\n\n app.listen(port, function () { return console.log(\"Server is listening on port: \" + port); });\n}", "constructor() {\n this.app = express_1.default();\n this.config();\n this.routes();\n }", "function runApp() {\n const app = express()\n app.use(bodyParser.json())\n app.use(\n bodyParser.urlencoded({\n extended: false\n })\n )\n app.use(cors())\n\n app.use('/api', snapshotAPI)\n app.use('/api', diffAPI)\n app.use('/api', queryAPI)\n\n const port = process.env.APP_PORT || 4000\n\n app.listen(port, () => {\n logger.info('Trace Differ running on port: ' + port)\n })\n\n app.use((req, res, next) => {\n return res.status(404).send({ message: 'Route' + req.url + ' Not found.' })\n })\n\n app.use((err, req, res, next) => {\n logger.error(err.message)\n if (!err.statusCode) err.statusCode = 500\n res.status(err.statusCode).send(err.message)\n })\n\n scheduler.startScheduler()\n}", "llamarRutasAPI(){\n this.app.use('/', rutas);\n }", "function App() {\n \t\n return (\n\t <>\n\t <img src=\"./logo.png\" alt=\"Welcome\"/>\n\t <LoginButton />\t \n\t <Profile />\n\t </>\n\t\t// <Admin dataProvider={restProvider('http://localhost:3000')} >\t\t\t\n\t\t// \t<Resource name=\"users\" list={UserList} create={UserCreate} edit={UserEdit}/>\n\t\t// </Admin>\n );\n}", "function getApp() {\n app.get('/', util.asyncErrHandlerWrapper(async (req, res, next) => {\n console.log('Processing for URI /');\n // TYPICALLY, we wil have a await call here. e.g.: call db\n return res.send('ExpressJS is in the house. Now with async wrapper.');\n }));\n\n return app\n}", "function setup(app) {\n app.get('/', function(req, res) {\n res.render('index.html');\n });\n\n app.post('/account', function(req, res) {\n res.redirect('/success');\n });\n\n app.get('/success', function(req, res) {\n res.render('created.html');\n });\n\n app.post('/join_alpha', function(req, res) {\n if (req.body.email) {\n db.storeAlphaEmail(req.body.email, function(err) {\n res.render('joined.html');\n });\n } else {\n res.redirect('/');\n }\n });\n\n app.get('/download', function(req, res) {\n res.locals({\n agent: 'chrome',\n agentName: 'Chrome',\n installUrl: 'https://chrome.google.com/webstore/detail/gombot-alpha/maeopofifamhhcdbejkfolecghncglll'\n });\n res.render('download.html');\n });\n\n app.get('/downloads/latest', function(req, res) {\n latest(function(err, sha) {\n if (err) console.log(err);\n res.redirect('/downloads/gombot-' + sha + '.crx');\n });\n });\n\n app.get('/downloads/updates.xml', function(req, res) {\n latest(function(err, sha, ver) {\n if (err) console.log(err);\n res.locals({\n sha: sha,\n version: ver,\n appid: appid\n });\n res.render('updates.xml');\n });\n });\n}", "_createApp () {\n return new Promise(resolve => {\n this.app = Express()\n\n if (datadog.key === 'none') this.app.use((req, res) => res.json({ success: true }))\n else LoadRoutes(this, this.app, __dirname, './routes')\n\n this.app.listen(statsPort, () => {\n resolve()\n })\n })\n }", "middlewares() {\n //directorio publico\n this.app.use(express.static('public'));\n\n //convertir los datos que llegan en json\n this.app.use(express.json());\n }", "function configApp(app) {\r\n\tapp.use(cookieParser())\r\n\tapp.use(\r\n\t\tsession({\r\n\t\t\tstore: MongoStore.create({\r\n\t\t\t\tmongoUrl: MONGO_URI,\r\n\t\t\t\tmongoOptions: {\r\n\t\t\t\t\tuseNewUrlParser: true,\r\n\t\t\t\t\tuseUnifiedTopology: true,\r\n\t\t\t\t},\r\n\t\t\t}),\r\n\t\t\tsecret: 'clavesecreta',\r\n\t\t\tresave: false,\r\n\t\t\tsaveUninitialized: false,\r\n\t\t\trolling: true,\r\n\t\t\tcookie: { maxAge: 600 * 1000 },\r\n\t\t})\r\n\t);\r\n\r\n\tapp.use(express.json());\r\n\tapp.use(express.urlencoded({ extended: true }));\r\n\tapp.use(express.static('public'));\r\n\r\n\tapp.use('/', frontRoutes);\r\n\tapp.use('/api/productos', prodRoutes);\r\n\tapp.use('/api/mensajes', mensRoutes);\r\n\tapp.get('*', function (req, res) { res.render('404'); });\r\n\r\n\tapp.engine('hbs', handlebars({\r\n\t\textname: 'hbs',\r\n\t\tdefaultLayout: 'layout.hbs'\r\n\t}));\r\n\tapp.set(\"views\", \"./views\");\r\n\tapp.set('view engine', 'hbs');\r\n\r\n\tapp.use(passport.initialize());\r\n\tapp.use(passport.session());\r\n}", "function initExpressApp() {\n\n const port = process.env.PORT || 3001;\n\n if (isDev()) {\n dotenv.config();\n }\n\n const app = express();\n app.use(cors());\n app.use(bodyParser.json());\n\n app.listen(port, () => {\n console.log(`listening on port ${port}`);\n });\n\n return app;\n}", "function start(app) {\n ACS.init('OAUTH_KEY', 'OAUTH_SECRET_KEY', 'API_ENTRY_POINT(optional)');\n logger.setLevel('DEBUG');\n \n //use connect.session\n app.use(express.cookieParser());\n app.use(express.session({ key: 'node.acs', secret: \"my secret\" }));\n \n //set favicon\n app.use(express.favicon(__dirname + '/public/images/favicon.ico'));\n\n //set to use express-partial for view\n app.use(partials());\n\n //Request body parsing middleware supporting JSON, urlencoded, and multipart\n app.use(express.bodyParser());\n}", "config() {\n this.app.set('port', process.env.PORT || 3000); // si hay port set toma ese, si no va al 3000\n this.app.use(morgan_1.default('dev'));\n this.app.use(cors_1.default());\n this.app.use(express_1.default.json()); // met para poder aceptar json de apps clientes (antes body parser)\n this.app.use(express_1.default.urlencoded({ extended: false })); // por si queremos enviar desde html form \n }", "routes() {\n let router = express.Router();\n //palceholder route handler\n router.get('/', (req, res, next) => {\n res.json({\n message: 'Hello World!'\n });\n });\n this.express.use('/', router);\n }", "mount(app, moduleDirectory){\n debug ('mounting ', moduleDirectory)\n if (moduleDirectory){\n let modules = this.findModules(moduleDirectory)\n debug('module directory from user ', moduleDirectory, modules)\n debug('Current path ', moduleDirectory + '/' + module)\n modules.forEach((module) => {\n if (fs.existsSync(moduleDirectory + '/' + module + '/api.json')){\n debug('Module ' + module + ' found api.json' )\n let api = require(path.resolve(moduleDirectory, module, 'api.json'))\n this.mountAPI(app, api, module, moduleDirectory)\n }\n else if (fs.existsSync( moduleDirectory + '/' + module + '/swagger.yaml')){\n debug('Module found swagger ' + module)\n let api = YAML.load(path.resolve(moduleDirectory, module, 'swagger.yaml'))\n this.mountSwagger(app, api, module, moduleDirectory)\n }\n else {\n debug('No API Spec for ', module)\n }\n })\n }\n else {\n // find all modules\n let modules = this.findModules('./modules')\n modules.forEach((module) => {\n // load the api.json or the swagger.yaml\n if (fs.existsSync(__dirname + '/../modules/' + module + '/api.json')){\n let api = require('../modules/' + module + '/api.json')\n this.mountAPI(app, api, module, __dirname + '/../modules')\n }\n else if (fs.existsSync(__dirname + '/../modules/' + module + '/swagger.yaml')) {\n let api = YAML.load(__dirname + '/../modules/' + module + '/swagger.yaml')\n this.mountSwagger(app, api, module, __dirname + '/../modules')\n }\n else {\n debug('NO DEFINITION OF API for the module ' + module)\n }\n })\n }\n }", "function setupRoutes(app, passport) {\n var loginWithLinkedIn = require('./routes/login/login-linkedin');\n var loginWithLGoogle = require('./routes/login/login-google');\n var loginWithLMicrosoft = require('./routes/login/login-microsoft');\n var loginWithPassword = require('./routes/login/login-with-password');\n var getCurrentUser = require('./routes/get-current-user');\n app.use('/login/linkedin', loginWithLinkedIn);\n app.use('/login/google', loginWithLGoogle);\n app.use('/login/microsoft', loginWithLMicrosoft);\n app.use('/technician/login', loginWithPassword);\n app.use('/getCurrentUser', getCurrentUser);\n /* router.get('/', function(req, res, next) {\n res.send('respond with a resource');\n }); */\n\n\n}", "constructor() {\n this.app = express();\n this.setupControllers();\n this.middleware();\n }", "function createApp() {\n const app = new Koa();\n const router = new Router();\n /* \n Middlewares\n */\n\tapp.use(helmet());\n\tapp.use( async (ctx, next) => {\n\t\tconst reqOrigin = ctx.header.origin;\n\t\tregisterName.forEach(origin => {\n\t\t\tif (origin === reqOrigin) ctx.set(\"Access-Control-Allow-Origin\", reqOrigin);\n\t\t});\n\t\tctx.set(\"Access-Control-Allow-Methods\", \"GET, POST\");\n\t\tctx.set(\"Access-Control-Allow-Credentials\", true);\n\t\tctx.set(\"Access-Control-Allow-Headers\", [\n\t\t\t'Origin', 'Content-Type', 'Accept', 'Authorization', 'Access-token', 'Refresh-token'\n\t\t]);\n\t\tctx.set(\"X-Powered-By\", \"PHP 4.2.0\");\n\t\tctx.set(\"X-XSS-Protection\", \"1; mode=block; report=/report-xss-violation\");\n\t\tawait next();\n\t});\n app.use(uid);\n /*\n Connect all routes\n */\n router.use('/api/v1/auth', authRouter.routes());\n router.use('/api/v1/global', refreshRouter.routes());\n\n app.use(router.allowedMethods());\n app.use(router.routes());\n return app;\n}", "bindSPA() {\r\n if (process.env.NODE_ENV !== 'production') return;\r\n const indexPath = path.join(__dirname, '../../public/index.html');\r\n const publicPath = path.join(__dirname, '../../public');\r\n const index = fs.readFileSync(indexPath);\r\n this.app.use(koaStatic(publicPath));\r\n this.app.use(async (ctx) => {\r\n ctx.body = index.toString();\r\n });\r\n }", "constructor() {\n this.express = express(); //THE APP\n this.middleware();\n this.routes();\n }", "constructor() {\n this.express = express(); //THE APP\n this.middleware();\n this.routes();\n }", "setup(app) {\n app.use('/assets', express.static(__dirname + '/assets'))\n }", "config() {\n this.app.set(\"PORT\", process.env.PORT || 3000);\n this.app.use(morgan_1.default(\"dev\")); //Miraremos las peticiones en modo desarrollador.\n this.app.use(cors_1.default()); //Permitira que clientes haga peticiones\n this.app.use(express_1.default.json()); //La app entendera json gracias a esto\n this.app.use(express_1.default.urlencoded({ extended: false })); //Permite peticiones por HTML\n }", "function startServer(port){\n const expressSwagger = require('express-swagger-generator')(app);\n require('./routes')(app);\n \n let options = {\n swaggerDefinition: {\n info: {\n description: 'Test for Backend Developer role.',\n title: 'Lobby Wars',\n version: '0.0.1',\n },\n host: 'localhost:'+port,\n basePath: '/v1',\n produces: [\n \"application/json\",\n \"application/xml\"\n ],\n schemes: ['http'], \n },\n basedir: __dirname, //app absolute path\n files: ['./routes/**/*.js'] //Path to the API handle folder\n };\n expressSwagger(options)\n\n let server = app.listen(port); \n console.log(\"Listening on port: \"+port);\n return server;\n}", "function App() {\n this.express = express();\n this.middleware();\n this.routes();\n }", "function Config(app) {\n morgan.token('time', (req, res) => new Date().toISOString());\n app.use(morgan('[:time] :remote-addr :method :url :status :res[content-length] :response-time ms'));\n\n app.use(bodyParser.urlencoded({ extended: true }));\n app.use(bodyParser.json());\n app.use(require('./api/v1'));\n\n app.use(function(req, res, next) {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'X-Requested-With');\n res.header('Access-Control-Allow-Headers', 'Content-Type');\n res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');\n next();\n });\n \n app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));\n}", "_configureRouter(app) {\n let router = new NamedRouter();\n router.extendExpress(app);\n router.registerAppHelpers(app);\n }", "function App() {\n return (\n <Router>\n <div>\n <Route path=\"/admin/content/create\" component={CreateContent} />\n </div>\n </Router>\n );\n}", "function App() {\n return (\n // <Admin dataProvider={springRestProvider('http://localhost:8080')} authProvider={authProvider}>\n <Admin dataProvider={springRestProvider('http://localhost:8080')}>\n <Resource name='posts' list={PostList} create={PostCreate} edit={PostEdit} />\n {/* <Resource name='users' list={UserList} create={UserCreate} edit={UserEdit} /> */}\n </Admin>\n );\n}", "function AppModule() {\n }", "function AppModule() {\n }", "function AppModule() {\n }", "function AppModule() {\n }", "function AppModule() {\n }", "function AppModule() {\n }", "config() {\n // Native Express configuration\n let bodyParser = require('body-parser');\n let busboy = require('connect-busboy');\n this.app.use(busboy());\n this.app.use(bodyParser.urlencoded({ extended: true }));\n this.app.use(bodyParser.json());\n this.app.use(express.static(path.join(__dirname, \"/public\"), { maxAge: 31557600000 }));\n this.app.use('/scripts', express.static(path.join(__dirname, \"/scripts\"), { maxAge: 31557600000 }));\n this.app.use('/styles', express.static(path.join(__dirname, \"/styles\"), { maxAge: 31557600000 }));\n this.app.set(\"views\", path.join(__dirname, \"views\"));\n this.app.set(\"view engine\", \"pug\");\n this.app.use(cors());\n this.app.use(session({ secret: \"ssshhhhh\" }));\n this.app.all(\"/*\", function (req, res, next) {\n return next();\n });\n }", "config() {\n this.app.set('port', 3000);\n this.app.use(morgan_1.default('dev'));\n this.app.use(cors_1.default());\n this.app.use(express_1.default.json());\n this.app.use(express_1.default.urlencoded({ extended: false }));\n }", "function app() {\n\n // load some scripts (uses promises :D)\n //loader.load(\n {\n url: \"./bower_components/jquery/dist/jquery.min.js\"\n }; {\n url: \"./bower_components/lodash/dist/lodash.min.js\"\n }; {\n url: \"./bower_components/pathjs/path.min.js\"\n };then(function() {\n _.templateSettings.interpolate = /{([\\s\\S]+?)}/g;\n\n var options = {\n api_key: \"ab2ph0vvjrfql5ppli3pucmw\"\n }\n // start app?\n var client = new EtsyClient(options);\n\n\n })\n\n}", "constructor(app = null) {\n this.app = app;\n }", "routes() {\n const publicPath = path.join(__dirname, '..', 'tmp', 'frontend', 'build');\n this.server.use('/v1/api', routes);\n this.server.use('/', express.static(publicPath));\n this.server.use('/users/*', express.static(publicPath));\n }", "function adminRoutes(){\n\t\n\t// url map to POST login details\n\tapp.post('/api/login/' ,passport.authenticate('local-login'),\n\t\t function (req, res) {\n\t\t res.json( {message: 'OK'} );\n\t\t });\n\t\n\t// logging-out\n\tapp.get('/api/logout/', isLoggedIn,\n\t\tfunction (req, res){\n\t\t req.logout();\n\t\t res.json({message : 'OK'});\n\t\t});\n\t\n\t// url map to GET admin page(list of admins)\n\tapp.get('/api/admin/', isLoggedIn,\n\t\tfunction (req, res) {\n\t\t User.find(\n\t\t\tfunction (err, admins) {\n\t\t\t if (err)\n\t\t\t\tres.send(err);\n\t\t\t\t \n\t\t\t var adminList = {};\n\t\t\t for (var i in admins)\n\t\t\t\tadminList[admins[i][\"id\"]] = admins[i][\"local\"][\"email\"]; \n\t\t\t\t \n\t\t\t res.json(adminList);\n\t\t\t});\t\t \n\t\t});\n\t// url map to add a new admin\n\tapp.post('/api/admin/',isLoggedIn,\n\t\t passport.authenticate('local-signup'),\n\t\t function (req, res) {\n\t\t res.json( {message: 'OK'} );\n\t\t });\n\t \t\t\n\t// url map to DELETE a admin\n\tapp.delete('/api/admin/:user_id', isLoggedIn,\n\t\t function (req, res) {\n\t\t User.remove({_id : req.params.user_id},\n\t\t\t\t function (err, user) {\n\t\t\t\t if (err)\n\t\t\t\t\t res.send(err);\n\t\t\t\t res.json({message : 'OK'});\n\t\t\t\t });\n\t\t });\n\t\n }", "function requiresAdmin() {\n return true;\n}", "function requiresAdmin() {\n return true;\n}", "function exp() {\n\tconst express = require('express');\n\tconst app = express();\n\tconst port = 3000;\n\n\tapp.get('/', (req, res) => res.send('Started The bot.'));\n\tapp.listen(port, () =>\n\t\tconsole.log(`Your App is listening at https.//localhost:${port}`)\n\t);\n}", "use (middleware) {\n this.app.use(middleware)\n }", "function run_database(){\n return require('./database/db.service')\n .set(app);\n}", "function startApp() {\n server.use(handler).listen(PORT, err => {\n if (err) throw err;\n console.log(`> Ready on ${PORT}`);\n });\n }", "function App() {\n return (\n //creating router components using <Route> element:\n //If we go to the URL with with path, it will get different routes and show different parts of the database (helps to map different url path)\n <Router>\n <div className=\"container\">\n <Navbar />\n <br />\n <Route path=\"/\" exact component={ExercisesList} />\n <Route path=\"/edit/:id\" component={EditExercise} />\n <Route path=\"/create\" component={CreateExercise} />\n <Route path=\"/user\" component={CreateUser} />\n </div>\n </Router>\n );\n}", "function route(req, res, module, app, next) {\n\n // Add dev tools view \n res.menu.admin.addMenuItem({name:'Development',path:'admin/dev',url:'#',description:'Dev tools ...',security:[]});\n res.menu.admin.addMenuItem({name:'Calipso Events',path:'admin/dev/events',url:'/admin/dev/events',description:'View events and event listeners ...',security:[]});\n \n // Router\n module.router.route(req, res, next);\n\n}", "_declareExpressUses(express) {\n this.expApp.use('/', express.static(__dirname + '/../web'));\n this.expApp.use('/materialize', express.static('./node_modules/materialize-css/dist'));\n this.expApp.use('/blockui', express.static('./node_modules/blockui-npm'));\n this.expApp.use('/materialize-autocomplete', express.static('./node_modules/materialize-autocomplete'));\n this.expApp.use('/jquery', express.static('./node_modules/jquery/dist'));\n }", "async function main(args = null) {\n\n let app = express();\n\n await middleware(app, process.env);\n\n app.use('/api', routes);\n\n app.use((req, res) => {\n res.status('404').send();\n });\n\n app.listen(app.get('port'), () => {\n console.log('Express server listening on port: ', app.get('port'));\n });\n\n return app;\n}", "function hc(app) {\n app.get(\"/public/hc\", (req, res) => {\n res.end(\"OK\");\n });\n}", "routes() {\n this.app.use('/images', express.static('uploads'));\n this.app.use('/users/', userRoutes);\n this.app.use('/tokens/', tokenRoutes);\n this.app.use('/shop/', shopRoutes);\n this.app.use('/products/', productRoutes);\n this.app.use('/order/', orderRoutes);\n this.app.use('/address/', addressRoutes);\n this.app.use(\"/creditCard/\", creditCardRoutes)\n }", "routing () {\n const notConnected = this.app.session.notConnected.bind(this.app.session)\n const connected = this.app.session.connected.bind(this.app.session)\n const connectedOrBuilder = this.app.session.connectedOrBuilder.bind(this.app.session)\n const admin = this.app.session.admin.bind(this.app.session)\n\n this.app.express.use('/api', express.Router()\n .post('/auth/login', notConnected, this.app.action.auth.login.routes)\n .post('/auth/forgot', notConnected, this.app.action.auth.forgotPassword.routes)\n .put('/auth/reset', notConnected, this.app.action.auth.resetPassword.routes)\n\n .delete('/auth/logout', connected, this.app.action.auth.logout.routes)\n\n .use('/invite', express.Router()\n .post('/', connected, admin, this.app.action.invitation.create.routes)\n )\n .use('/user', express.Router()\n .post('/', notConnected, this.app.action.user.create.routes)\n .get('/:id', connected, this.app.action.user.get.routes)\n .get('/', connected, this.app.action.user.list.routes)\n )\n .use('/manifest', express.Router()\n .post('/', connected, this.app.action.manifest.create.routes)\n .put('/:id', connected, this.app.action.manifest.update.routes)\n .put('/:id/maintainer', connected, admin, this.app.action.manifest.updateMaintainer.routes)\n .get('/:id', connectedOrBuilder, this.app.action.manifest.get.routes)\n .get('/', connected, this.app.action.manifest.list.routes)\n )\n .use('/build', express.Router()\n .post('/', connected, this.app.action.build.create.routes)\n .use('/:id', express.Router({ mergeParams: true })\n .get('/', connected, this.app.action.build.get.routes)\n\n // Middleware to authorize only builder\n .use('/', this.app.action.build.authorization.routes)\n // Empty endpoint for a client to verify his access\n .put('/', (req, res, next) => { res.json({}) })\n .put('/start', this.app.action.build.start.routes)\n .put('/stdout', this.app.action.build.stdout.routes)\n .put('/stderr', this.app.action.build.stderr.routes)\n .put('/end', this.app.action.build.end.routes)\n .put('/packages', this.app.action.build.packages.routes)\n )\n .get('/', connected, this.app.action.build.list.routes)\n )\n )\n\n this.app.express.use(this.errorHandler.bind(this))\n }", "function getRoot(app) {\n app.get('/', function(req, res) {\n res.sendFile(path.join(__dirname, '../public', 'home.html'))\n });\n}", "_adminApiSetup() {\n if ( this.#isConfigured !== true ) {\n this.log.warn('[uibuilder:web.js:_adminApiSetup] Cannot run. Setup has not been called.')\n return\n }\n\n this.adminRouter = express.Router({ mergeParams: true }) // eslint-disable-line new-cap\n\n /** Serve up the v3 admin apis on /<httpAdminRoot>/uibuilder/admin/ */\n this.adminRouterV3 = require('./admin-api-v3')(this.uib, this.log)\n this.adminRouter.use('/admin', this.adminRouterV3)\n this.routers.admin.push( { name: 'Admin API v3', path: `${this.RED.settings.httpAdminRoot}uibuilder/admin`, desc: 'Consolidated admin APIs used by the uibuilder Editor panel', type: 'Router' } )\n\n /** Serve up the package docs folder on /<httpAdminRoot>/uibuilder/techdocs (uses docsify) - also make available on /uibuilder/docs\n * @see https://github.com/TotallyInformation/node-red-contrib-uibuilder/issues/108\n */\n const techDocsPath = path.join(__dirname, '..', '..', 'docs')\n this.adminRouter.use('/docs', express.static( techDocsPath, this.uib.staticOpts ) )\n this.routers.admin.push( { name: 'Documentation', path: `${this.RED.settings.httpAdminRoot}uibuilder/docs`, desc: 'Documentation website powered by Docsify', type: 'Static', folder: techDocsPath } )\n this.adminRouter.use('/techdocs', express.static( techDocsPath, this.uib.staticOpts ) )\n this.routers.admin.push( { name: 'Tech Docs', path: `${this.RED.settings.httpAdminRoot}uibuilder/techdocs`, desc: 'Documentation website powered by Docsify', type: 'Static', folder: techDocsPath } )\n\n // TODO: Move v2 API's to V3\n this.adminRouterV2 = require('./admin-api-v2')(this.uib, this.log)\n this.routers.admin.push( { name: 'Admin API v2', path: `${this.RED.settings.httpAdminRoot}uibuilder/*`, desc: 'Various older admin APIs used by the uibuilder Editor panel', type: 'Router' } )\n\n /** Serve up the admin root for uibuilder on /<httpAdminRoot>/uibuilder/ */\n this.RED.httpAdmin.use('/uibuilder', this.adminRouter, this.adminRouterV2)\n }", "setupApp() {\n this.app = express();\n if (this.config.bodyParserOptions.json) {\n this.app.use(bodyParser.json(this.config.bodyParserOptions.json));\n }\n if (this.config.bodyParserOptions.raw) {\n this.app.use(bodyParser.raw(this.config.bodyParserOptions.raw));\n }\n if (this.config.bodyParserOptions.text) {\n this.app.use(bodyParser.text(this.config.bodyParserOptions.text));\n }\n if (this.config.bodyParserOptions.urlencoded) {\n this.app.use(bodyParser.urlencoded(this.config.bodyParserOptions.urlencoded));\n }\n this.app.use(cookieParser(this.config.cookieParserOptions));\n this.app.use(morgan(this.config.morganOptions));\n this.app.use(compression(this.config.compressionOptions));\n }", "function apps() { \n\t\n\tlet eapp1 = app.get('/', (req, res) => {\n\tfs.readFile('index.html', function(err, data) {\n\t\tres.statusCode = 200\n\t\tres.setHeader('Content-Type','text/html')\n res.write(data);\n\t return res.end();\n\t});\n});\n\n\tlet eapp2 = app.get('/about', (req, res) => {\n\tfs.readFile('about.html', function(err, data) {\n\t\tres.statusCode = 200\n\t\tres.setHeader('Content-Type','text/html')\n res.write(data);\n\t return res.end();\n\t});\n});\n\n\tlet eapp3 = app.get('/contact-me', (req, res) => {\n\tfs.readFile('contact-me.html', function(err, data) {\n\t\tres.statusCode = 200\n\t\tres.setHeader('Content-Type','text/html')\n res.write(data);\n\t return res.end();\n\t});\n};\n\n}", "function App() {\n\n return (\n <Routes/>\n );\n}", "function staticPath(app, npath = \"/../../public\") {\n app.use(\"/\", express.static(path.join(__dirname, npath)));\n}", "function app(req, res){\n\tvar path = url.parse(req.url).pathname;\n\n\tswitch(path){\n\t\tcase '/about':\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tapp.get('/', function(req, res){\n\t\t\t\tres.send(__dirname + '\\public\\index.html');\n\t\t\t});\n\t\t\tbreak;\n\t}\n}", "function index(req, res) {\n \n}", "configure(app) {\n // Main config\n app.use(passport.initialize());\n\n // Config strategies\n configureBasicAuth();\n }", "function App() {\n\n \n return (\n <Routes />\n\n );\n}", "function App(){\n return(\n <Routes />\n\n );\n}", "run() {\n const app = express();\n\n app.use(bodyParser.json());\n app.use(bodyParser.urlencoded({\n extended: true\n }));\n\n // Handle favicon request\n app.get('/favicon.ico', function (req, res) {\n HttpHelpers.write('', 'image/x-icon', res);\n });\n\n // Handle API proxy calls\n\n app.all('/api*', this.handleApiRequest.bind(this));\n\n app.all('*', this.handle.bind(this));\n\n app.listen(this.getPort());\n\n console.log(`Server process ${process.pid} started on port ${this.getPort()}`);\n }", "static prepare(app) {\n app.configure(auth({\n // todo: use custom storage in order to obtain the token either from localStorage or the URL\n storage: window.localStorage,\n }));\n }", "function initController(app) {\n app.use(\n router((_) => {\n _.get('/', indexController.actionIndex);\n _.get('/api/getBooksList', apiController.actionBooksList);\n _.get('/books/list', booksController.actionBooksList);\n _.get('/books/create', booksController.actionBooksCreate);\n // app.use(router.routes()).use(router.allowedMethods());\n })\n );\n}", "function intiApp() {\n app.listen(port, (err) => {\n if (err)\n logger.error(`Unable to lunch the application :: ${err.message}`);\n else {\n logger.info(`Application launch successfully on port ${port}`);\n console.log('application is running on port ' + port);\n }\n })\n}", "function pagesController(app) {\n\n //Express routes\n app.get('/pages/my-page', function(req, res) {\n res.send('Got my-page successfully');\n });\n\n}", "function router(app)\n{\n app.use(bp.json())\n\n app.get('/', page.index)\n\n app.get('/api/authors', api.authors)\n\n app.get('/api/authors/:id', api.authorById)\n\n app.post('/api/authors', api.createAuthor)\n\n app.put('/api/books/:id', api.createBookAddToAuthor)\n\n app.put('/api/authors/:id', api.updateAuthorById)\n\n app.delete('/api/books/:id', api.deleteBookById)\n\n app.delete('/api/authors/:id', api.deleteAuthorById)\n}", "async function main() {\n\n //iniciar el server en un puerto\n await app.listen(app.get('port'));\n console.log('Server iniciado en el puerto: ', app.get('port'))\n\n\n}", "middlewares() {\n this.app.use(express.urlencoded({ extended: true }));\n this.app.use(express.json());\n this.app.use(express.static(resolve(__dirname, 'uploads')));\n this.app.use(cors())\n }", "constructor() {\n\t\tthis.app = express();\n\t\tthis.initExpress();\n\t\tthis.initExpressMiddleWare();\n\t\tthis.initControllers();\n\t\tthis.start();\n\t}", "static appVerify (req,res,next) {\n res.status(200).json({\n role: req.role\n })\n }", "function init() {\n // app.engine(\"html\", require(\"express-art-template\"));\n\n //Use css and javascript file\n app.use(\"/style/\", express.static(\"./style/\"));\n app.use(express.static(__dirname + \"/script\"));\n\n //Launch index.html\n app.get(\"/\", function (request, response) {\n response.sendFile(__dirname + \"/index.html\");\n });\n app.listen(process.env.PORT || 5000, () => console.log(\"Server started\"));\n}" ]
[ "0.67630106", "0.6653704", "0.65146166", "0.649688", "0.6478555", "0.6435572", "0.64141506", "0.64003795", "0.64003795", "0.6344262", "0.63233066", "0.6273064", "0.6266061", "0.62474144", "0.62373084", "0.6226276", "0.6198587", "0.6194034", "0.61845696", "0.61817116", "0.6174702", "0.617224", "0.6156573", "0.6155611", "0.6146681", "0.61448604", "0.613308", "0.612622", "0.61074483", "0.61070305", "0.60635674", "0.6048527", "0.60469764", "0.6040369", "0.6016361", "0.6009157", "0.6009045", "0.6003478", "0.5992784", "0.5974638", "0.5972315", "0.5963458", "0.59611416", "0.59491205", "0.59422606", "0.59422606", "0.5911632", "0.59106773", "0.5896235", "0.58904064", "0.5882413", "0.5875464", "0.5873532", "0.58591163", "0.5854877", "0.5854877", "0.5854877", "0.5854877", "0.5854877", "0.5854877", "0.5824675", "0.581583", "0.5811327", "0.5790305", "0.57890004", "0.57774866", "0.5774363", "0.5774363", "0.574904", "0.5745255", "0.5739212", "0.5738639", "0.57336193", "0.57314616", "0.5728259", "0.5726793", "0.572669", "0.5710419", "0.5707718", "0.5704182", "0.56986076", "0.5694572", "0.56900287", "0.56847465", "0.56750405", "0.56693906", "0.56676805", "0.5667135", "0.56664765", "0.5663958", "0.5662815", "0.5652585", "0.56521803", "0.56346434", "0.5634121", "0.5633161", "0.5630373", "0.5629568", "0.56288326", "0.5617247", "0.56126255" ]
0.0
-1
returns all the accounts depending on the type the user selected
async function handleLoadAccounts(acctType) { try { const accounts = await accountRepo.getAccounts(acctType); document.querySelector('#accounts-table').innerHTML = `<table id="accounts"> <tr> <th>Account No</th> <th>Account Type</th> <th>Balance</th> <th>Action</th> </tr> ${accounts.map(account => accountToHTMLRow(account)).join('')} <table>`; } catch (e) { console.log(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAccountTypes() {\n return await this.contract.methods\n .getAccountTypes()\n .call({ from: this.currentAddress });\n }", "getAccountsList() {\n const params = { type: 'list' };\n return this.apiService.get(`${this.url}/user/find`, { params }).pipe(\n map(res => res.map((account) => this._modifyUserAccountSummary(account)))\n );\n }", "static async getActiveAccounts(req, res) {\n if (req.user.type === 'user') {\n return res.status(403).json({\n status: 403,\n error: 'Only Admin and cashier can view accounts',\n });\n }\n\n const ActiveAccounts = await db.fetchAccountsByStatus(req.query);\n if (!ActiveAccounts.rows[0]) {\n return res.status(404).json({\n status: 404,\n error: 'No account found',\n });\n }\n\n const foundActiveAccounts = [];\n ActiveAccounts.rows.forEach((row) => {\n const active = {\n createdOn: row.createdon,\n accountNumber: row.accountnumber,\n ownerEmail: row.email,\n type: row.type,\n status: row.status,\n balance: row.balance,\n };\n foundActiveAccounts.push(active);\n });\n return res.status(200).json({\n status: 200,\n data: foundActiveAccounts,\n });\n }", "getAccounts() {\n const _this = this;\n if (arguments.length > 1 && arguments.length < 3) {\n return _this.getMultipleAccounts(arguments[0], arguments[1]);\n }\n return _this._getAccounts();\n }", "static async getAccountsForOneUser(req, res) {\n const email = req.params.email.toLowerCase().trim();\n const user = await db.fetchOneUser(req.params);\n\n if (!user.rows[0]) {\n return res.status(404).json({\n status: 404,\n error: 'User with the given email does not exists',\n });\n }\n\n const userAccounts = await db.fetchAccountsForUser(email);\n\n if (!userAccounts.rows[0]) return res.status(404).json({ status: 404, error: 'Account not found' });\n\n if (req.user.type !== 'staff' && req.user.id !== userAccounts.rows[0].owner) {\n return res.status(403).json({\n status: 403,\n error: 'You are not the owner of the account',\n });\n }\n\n const foundAccounts = [];\n userAccounts.rows.forEach((row) => {\n const account = {\n createdOn: row.createdon,\n accountNumber: row.accountnumber,\n type: row.type,\n status: row.status,\n balance: row.balance,\n };\n foundAccounts.push(account);\n });\n\n return res.status(200).json({ status: 200, data: foundAccounts });\n }", "static async getAll() {\n try {\n return await ingWrapper.http\n .get('accounts')\n .toObjectArray(Account);\n } catch (getAccountsErr) {\n if (getAccountsErr.res.statusCode === 404) {\n return [];\n }\n throw getAccountsErr;\n }\n }", "function getMyAccounts(){\n\tvar result = [];\n\tvar db = Ti.Database.open(royaledb);\n\tvar myaccounts = db.execute('SELECT id, accountName, fullName, infoId, username, password FROM myaccounts');\n\twhile(myaccounts.isValidRow()){\n\t\tvar account = {\n\t\t\tId : myaccounts.fieldByName('id'),\n\t\t\tAccountName : myaccounts.fieldByName('accountName'),\n\t\t\tFullName : myaccounts.fieldByName('fullName'),\n\t\t\tInfoId : myaccounts.fieldByName('infoId'),\n\t\t\tUserName : myaccounts.fieldByName('username'),\n\t\t\tPassword : myaccounts.fieldByName('password')\t\n\t\t};\n\t\tresult.push(account);\n\t\tmyaccounts.next();\n\t}\n\tmyaccounts.close();\n\tdb.close();\n\treturn result;\n}", "accounts(filter, limit) {\n\t\treturn this.accountModel.all().then(accounts => {\n\t\t\tlet filteredAccounts = accounts;\n\n\t\t\t// Exclude investment accounts by default\n\t\t\tconst accountFilter = {\n\t\t\t\tname: filter,\n\t\t\t\taccount_type: \"!investment\"\n\t\t\t};\n\n\t\t\t// Filter the primary account from the results (can't transfer to self)\n\t\t\tif (this.transaction.primary_account) {\n\t\t\t\tfilteredAccounts = this.filterFilter(filteredAccounts, {name: `!${this.transaction.primary_account.name}`}, true);\n\t\t\t}\n\n\t\t\t// For security transfers, only include investment accounts\n\t\t\tif (\"SecurityTransfer\" === this.transaction.transaction_type) {\n\t\t\t\taccountFilter.account_type = \"investment\";\n\t\t\t}\n\n\t\t\treturn this.limitToFilter(this.filterFilter(filteredAccounts, accountFilter), limit);\n\t\t});\n\t}", "function loadAccounts() {\n vm.accounts = Accounts.query(function (accounts) {\n if (accounts.length > 0) {\n vm.selectedAccounts = [vm.accounts[0]];\n onAccountChanged();\n }\n });\n }", "async get_user_accounts(uuid) {\n\n var accounts = await this.database.select('settings', {uuid: uuid, mainkey: 'accounts'});\n if (accounts.length == 0) \n return [];\n var result = [];\n accounts.forEach(item => {\n result.push(JSON.parse(item.value));\n })\n return result;\n \n }", "function getAllAccounts() {\r\n console.log(\"[DEBUG] Get details of ALL accounts:\");\r\n var allAccounts = [],\r\n userName = \"UN_SET\";\r\n\r\n var innerDoc = getIFrameInnerDoc(\"#main-iframe\");\r\n if (innerDoc) {\r\n // Extract user's name\r\n userName = getUserName(innerDoc);\r\n \r\n var listAccount = []; // List of account DOMElements - each account DOMElement presents for one account of current user\r\n // Get all the group of accounts DOMElements by class name '.list-vue1' \r\n var listViews = innerDoc.querySelectorAll(\".list-vue1\");\r\n\r\n // From each group of accounts DOMElement, get all the accounts DOMElements\r\n for (i = 0; i < listViews.length; i++) {\r\n var nodeList = listViews[i].querySelectorAll(\".list-vue1 > li\");\r\n for (j = 0; j < nodeList.length; j++) {\r\n // data-key must not be NULL\r\n if (nodeList[j].getAttribute(\"data-key\") !== null) {\r\n // Add the current account DOMELement to the list\r\n listAccount.push(nodeList[j].querySelector(\".compte-favori\"));\r\n }\r\n }\r\n }\r\n // console.log(\"[DEBUG] Nb of account: \" + listAccount.length);\r\n\r\n // For each account DOMElement, extract its information\r\n for (i = 0; i < listAccount.length; i++) {\r\n console.log(\"\\n[DEBUG] ---------- Account Details ----------------\");\r\n var currentAccountData = getDetailsEachAccount(listAccount[i]);\r\n if (currentAccountData) {\r\n // Add the current account data to the list\r\n allAccounts.push(currentAccountData);\r\n }\r\n }\r\n } else {\r\n console.log(\"[ERROR] Cannot find innerDoc.\");\r\n }\r\n\r\n // Check if we have some data to return\r\n if (userName === 'UN_SET' && allAccounts.length === 0){\r\n return null;\r\n }\r\n // Return the data of the current user in JSON format\r\n return {\r\n name: userName,\r\n accounts: allAccounts\r\n };\r\n\r\n}", "function getUsersByType(type, case_insensitive) {\n return getUserByProperty('type', type, false, true, case_insensitive);\n}", "listAccounts() {\n\n }", "function findByUserType(type) {\n return db(\"users\").where({ user_type: type });\n}", "function setAccountTypeData() \n {\n var pageData = GetPageData();\n setPageData(pageData, \"accounttype\", \"mailaccount\",false);\n setPageData(pageData, \"accounttype\", \"newsaccount\", false);\n // Other account type, e.g. Movemail\n setPageData(pageData, \"accounttype\", \"otheraccount\", true);\n }", "static async getUserAccounts(req, res) {\n const getUser = await search.searchUser(req.params.email);\n const getUserAccounts = await con.query(account.userAccounts, [getUser.rows[0].userid]);\n if (getUserAccounts.rowCount !== 0) {\n return res.status(200).json({\n status: 200,\n data: getUserAccounts.rows,\n });\n }\n return res.status(401).json({\n status: 404,\n message: `no account fund for user with email ${req.params.email}`,\n });\n }", "getAll(req, res, next) {\n if (!req.isAuthenticated()) {\n return res.json({ success: false });\n }\n const role = req.session.auth.role;\n if (role < 3) {\n return res.json({ success: false });\n }\n const page = req.query.page || 0;\n const perPage = 5;\n AccountModel\n .find({\n // $or:[{\"role\": 2},{\"role\": 3}]\n \"role\": { $lt: 6 }\n }) // regular users only\n .skip(page * perPage)\n .limit(perPage)\n .select('_id username name email role enabled')\n .sort({ name: 'asc' })\n .lean()\n .exec((err, accounts) => {\n if (err) return next(err);\n res.json({\n success: true,\n accounts: accounts,\n });\n });\n }", "getAllAccounts(knex, user_id) {\n return knex.select('*').from('budget_accounts').where({ user_id })\n }", "function retrieveAllAccountData() {\n\tvar cellName = sessionStorage.selectedcell;\n\tvar totalRecordCount = retrieveAccountRecordCount();\n\tvar baseUrl = getClientStore().baseURL;\n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountMgr = createAccountManager();\n\tvar uri = objAccountMgr.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\"\n\t\t\t+ totalRecordCount;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "function getPublicUsers()\n{\n let users = readUsers();\n let publicUsers = [];\n for (let i = 0; i < users.length; ++i)\n {\n if (users[i].accountType == \"public\")\n {\n publicUsers.push(users[i]);\n }\n }\n return publicUsers;\n}", "getAccounts(): Promise<Array<Account>> {\n return this._member.getAccounts();\n }", "static getAllAccountTypes(query) {\n return async (dispatch, getState) => {\n registerAccessToken(getState().user.tokens.access);\n const [res, data] = await api.accountType.get.allAccountTypes(query);//todo:cahnge\n // const [res, data] = [\n // { status: 200 },\n // [\n // { accountType: \"Branch Manager\", description: \"Branch Manager\" },\n // { accountType: \"Waiter\", description: \"Waiter\" },\n // ],\n // ]; //todo:remove mock\n if (res.status === 200) {\n dispatch(setAccountTypes(data));\n }\n return res;\n };\n }", "static getAccounts() {\n\t\t\t\treturn _accounts;\n\t\t\t}", "async getAllAccounts() {\n if (this.nativeBrokerPlugin) {\n const correlationId = this.cryptoProvider.createNewGuid();\n return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId, correlationId);\n }\n return this.getTokenCache().getAllAccounts();\n }", "function loadAccounts() {\n vm.accounts = Accounts.query(function (accounts) {\n if (accounts.length > 0) {\n vm.account = vm.accounts[0];\n onAccountChanged();\n }\n });\n }", "function queryAccounts() {\n gapi.client.load('analytics', 'v3').then(function() {\n gapi.client.analytics.management.accounts.list().then(handleAccounts);\n });\n}", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "function lsAccts() {\n\t\t$('#user .ls-accts .result').html('');\n \tweb3.eth.getAccounts(function(err, accounts) {\n \t\tfor(var i = 0; i < accounts.length; i++) {\n \t\t\t(function(i) {\n \t\t\t\tvar address = accounts[i];\n \t\t\t\tvar balance = web3.fromWei(web3.eth.getBalance(accounts[i]));\n \t\t\t\t$('#user .ls-accts .result').append(i + ': <code>' + address + '</code> ' + balance + ' ETH<br />');\n \t\t\t})(i);\n \t\t}\n \t});\n\t}", "function mostrarUsuarios(tipo) {\n const inscriptions = course.inscriptions;\n let lista = null;\n\n users = inscriptions?.map((inscription) => inscription.user);\n const teacher = new Array(course.creator);\n const delegate = new Array(course.delegate);\n\n if (tipo === 'Profesor') {\n lista = <UsersList courseId={courseId} users={teacher} setSelectedUser={(a)=>{console.log(a);}}/>;\n } else if (tipo === 'Delegados') {\n lista = <UsersList courseId={courseId} users={delegate} setSelectedUser={(a)=>{console.log(a);}} />;\n } else {\n lista = <UsersList courseId={courseId} users={users} setSelectedUser={(a)=>{console.log(a);}} />;\n }\n\n return lista;\n }", "function allAccounts() {\n return __awaiter(this, void 0, void 0, function* () {\n var prev_last_id = '0';\n var accounts = [];\n var done = false;\n while (!done) {\n let query = `query {\n accounts(\n where: {id_gt: \"${prev_last_id}\"}\n first: 1000\n ){\n id\n creationTimestamp\n lastSeenTimestamp\n scaledCollateralVolume\n lastTradedTimestamp\n }\n }`;\n yield query_subgraph(query).then((res) => {\n if (res.data.data.accounts.length == 0) {\n done = true;\n return;\n }\n // Join lists of accounts, ignoring duplicates\n accounts = accounts.concat(res.data.data.accounts);\n prev_last_id = res.data.data.accounts.slice(-1)[0].id;\n })\n .catch((error) => {\n console.log(error);\n throw error;\n });\n }\n return accounts;\n });\n}", "async getData() {\n const accountTypes = await this.getAccountTypes().then((_accountTypes) => ({\n isFarmer: _accountTypes[0],\n isDistributor: _accountTypes[1],\n isRetailer: _accountTypes[2],\n isConsumer: _accountTypes[3],\n }));\n const items = await this.getItems();\n return {\n accountTypes,\n items,\n };\n }", "get accounts() {\n return this._accounts;\n }", "function getUsers() {\n\t// Get the list of users from the contract\n\tcontract.getUsers.call((error, result) => {\n\t if(error) {\n\t\t return console.log(error);\n\t }\n\t users = result;\t\t \t\n\t // Mark the book that have been checked out (only using first five instead of users.length)\n\t for (i=0; i < 5; i++) {\t\t\n\t\tif (users[i] !== '0x0000000000000000000000000000000000000000') {\n\t\t\tdocument.getElementById(i).innerHTML = \"Not Available\"\n\t\t\tdocument.getElementById(i).disabled = true;\t \n\t\t}\n\t\tif (users[i] == account) {\t\t\t\t\n\t\t document.getElementById(\"ret\" + i).style.display = \"block\";\n\t }\n\t }\t\t \n\t});\t\n }", "function getAllAccounts(req, res, next) {\n var page = req.query.page || 1;\n var limit = req.query.limit || 10;\n\n\n // Account.find({}, function (err, games) {\n // res.send(games);\n // });\n\n var options = {\n page: page,\n limit: limit,\n lean: true\n };\n\n\n\n Account.paginate({}, options, (err, games) => {\n // console.log(games)\n if (err) return next(err);\n if (!games) return next({\n message: 'No games found.',\n status: 404\n });\n\n var pagination = {\n pageNumber: games.page,\n itemsPerPage: games.limit,\n prev: res.locals.paginate.href(true),\n next: res.locals.paginate.href(),\n };\n\n utils.sendJSONresponse(res, 200, games, false, pagination);\n });\n }", "@action\n loadAvailableAccounts() {\n //console.log('Enumerating accounts', Object.keys(storageAbstraction.storage))\n this.accounts = enumerateStoredAccounts()\n .map(id => loadAccountDataFromBrowserStorage(id))\n .filter(a => !!a)\n .map(a => new Account(a))\n }", "fetchByAccountType(accountType) {\n console.log(\"running fetchByAccountType\");\n return request(createEndpoint('/accounts' + '/?acct_type=' + accountType));\n }", "async getAccount() {\n // need to call getAccount here?\n const cache = this.clientApplication.getTokenCache();\n const currentAccounts = await cache.getAllAccounts();\n\n if (currentAccounts === null) {\n console.log('No accounts detected');\n return null;\n }\n\n if (currentAccounts.length > 1) {\n // Add choose account code here\n console.log('Multiple accounts detected, need to add choose account code.');\n return currentAccounts[0];\n } else if (currentAccounts.length === 1) {\n return currentAccounts[0];\n } else {\n return null;\n }\n }", "primaryAccounts(filter, limit) {\n\t\treturn this.accountModel.all().then(accounts => this.limitToFilter(this.filterFilter(accounts, {name: filter}), limit));\n\t}", "async getAllAccounts() {\n this.logger.trace(\"getAllAccounts called\");\n let cacheContext;\n try {\n if (this.persistence) {\n cacheContext = new msalCommon.TokenCacheContext(this, false);\n await this.persistence.beforeCacheAccess(cacheContext);\n }\n return this.storage.getAllAccounts();\n } finally {\n if (this.persistence && cacheContext) {\n await this.persistence.afterCacheAccess(cacheContext);\n }\n }\n }", "static async getAccountsByStatus(req, res) {\n const accountsStatus = await con.query(account.accountStatus, [req.query.status]);\n if (accountsStatus.rowCount !== 0) {\n return res.status(200).json({\n status: 200,\n data: accountsStatus.rows,\n });\n }\n return res.status(401).json({\n status: 404,\n message: `there is no account with status ${req.query.status}`,\n });\n }", "function getMultipleAccountNames() {\n\tvar elementsLength = document.fAccountTable.elements.length;\n\tvar count = 0;\n\tvar accountName = null;\n\tfor (count = 0; count < elementsLength; count++) {\n\t\tif (document.fAccountTable.elements[count].name == \"case\") {\n\t\t\tif (document.fAccountTable.elements[count].checked) {\n\t\t\t\tvar formAccountName = document.fAccountTable.elements[count].value;\n\t\t\t\tif (accountName == null) {\n\t\t\t\t\taccountName = formAccountName;\n\t\t\t\t} else {\n\t\t\t\t\taccountName = accountName + ',' + formAccountName;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tsessionStorage.AccountNames = accountName;\n}", "function searchUserInfo(thingToSearch, type) {\n for (const currentUser in users){\n if (thingToSearch == users[currentUser][type]){\n return true;\n }\n }\n}", "function getallusers() {\n\n\t}", "function getAccounts(){\n\tlet accountNumber = inputAccountNumber.value;\n\tif(accountNumber < 0){\n\t\tshowMessage(\"Account Number Must Be A Positive Number\");\n\t}else{\n\t\tfetch(\"http://localhost:5050/MaximusBank/bankaccounts\")\n\t\t.then( res => res.json() )\n\t\t.then( accounts => {\n\t\t\tif(accounts.hasOwnProperty(\"message\")){\n\t\t\t\tshowMessage(accounts.message);\n\t\t\t}else{\n\t\t\t\tlet account = accounts.find( a => a.accountNumber == accountNumber );\n\t\t\t\tif(account){\n\t\t\t\t\taccountsTableBody.innerHTML = `\n\t\t\t\t\t\t<tr id=${account.accountNumber}>\n\t\t\t\t\t\t<td>${account.accountNumber}</td>\n\t\t\t\t\t\t<td>${account.balance}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t`\n\t\t\t\t} \t\t\t\t\n\t\t\t}\n\t\t});\t\t\n\t}\n return false;\n}", "function getAllBranchOffice(req, res) {\n console.log(req.user.typeUser)\n if (req.user.typeUser === 'admin') {\n models.BranchOffice.findAll().then(branchOffices => {\n return res.status(200).send({ message: branchOffices })\n }).catch(error => {\n return res.status(500).send({ message: `Error al consultar las sucursales ${error}` })\n })\n }\n}", "accounts () {\n var p = this.withLedgerFile(this.cli).exec(['accounts'])\n return p.then(pro => {\n return pro.invoke('toString', []).split().compact()\n })\n }", "function getUserType(){\n\n // to handle request \n fetch('http://localhost:3800/users/'+emailNode.value+'/users', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n \"Authorization\": localStorage.getItem('Token')\n\n }\n })\n .then(response=>{\n return response.json();\n })\n .then(data => {\n for(var i = 0; i < data.length; i++){\n // to store details of logged user\n localStorage.setItem(\"userType\", data[i].userType);\n localStorage.setItem(\"email\", data[i].email);\n localStorage.setItem(\"userId\", data[i].userId);\n\n // to navigate to corresponding pages for admin and user\n if(data[i].userType == 'admin'){\n window.location.href = 'admin/dashboard.html';\n }else{\n window.location.href = 'dashboard.html'; \n }\n }\n })\n .catch(error => {\n console.log(error);\n });\n }", "function getAccount() {\n var result;\n UserAccount.findOne({ username: req.body.username }).exec();\n return result;\n }", "getAccounts(){\n return this._accounts;\n }", "getAccounts() {\n return privates.get(this).keyring.getAccounts();\n }", "function getAllRegUser(){\n var filter = {};\n $scope.regUsers = [];\n userSvc.getUsers(filter).then(function(data){\n data.forEach(function(item){\n if(item.email)\n $scope.regUsers[$scope.regUsers.length] = item;\n });\n })\n .catch(function(err){\n Modal.alert(\"Error in geting user\");\n })\n }", "function getAccountsByUserId(req, res, next){\n var params = req.params;\n console.log(params.userId)\n Account\n .find( {userId : params.userId})\n \n .exec((err, accounts) => {\n if (err) return next(err);\n if (!accounts) return next({\n message: 'game not found.',\n status: 404\n });\n \n utils.sendJSONresponse(res, 200, accounts);\n });\n }", "function getAccountsLiabilites(banDoc, accountForm) {\r\n\r\n\tvar accountsTable = banDoc.table(\"Accounts\");\r\n\r\n\tvar accountsTableRows = accountsTable.rowCount;\r\n\tfor (var i = 0; i < accountsTableRows; i++) {\r\n\t\t\r\n\t\tvar tRow = accountsTable.row(i);\r\n\t\tvar section = tRow.value(\"Section\");\r\n\t\tvar group = tRow.value(\"Group\");\r\n\t\tvar account = tRow.value(\"Account\");\r\n\t\tvar description = tRow.value(\"Description\");\r\n\t\tvar bclass = tRow.value(\"BClass\");\r\n\t\tvar gr = tRow.value(\"Gr\");\r\n\t\tvar balance = tRow.value(\"Balance\");\r\n\r\n\t\t\r\n\t\tif ( group.substring(0,1) !== \"0\" && (gr.substring(0,1) === \"2\" || group === \"2\") ) {\r\n\r\n\t\t\taccountForm.push({\r\n\t\t\t\t\"Section\" : section,\r\n\t\t\t\t\"Group\" : group,\r\n\t\t\t\t\"Account\" : account,\r\n\t\t\t\t\"Description\" : description,\r\n\t\t\t\t\"BClass\" : bclass,\r\n\t\t\t\t\"Gr\" : gr,\r\n\t\t\t\t\"Balance\" : balance\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\treturn accountForm;\r\n}", "static accountList(accounts) {\n\t\t\t\tlet list = [];\n\n\t\t\t\tif (accounts.length) {\n\t\t\t\t\taccounts.forEach(key => {\n\t\t\t\t\t\tlet accountID = key.id;\n\t\t\t\t\t\tlet accountName = key.toJSON().accountName;\n\t\t\t\t\t\tlet href = `/dashboard/account/${accountID}`;\n\t\t\t\t\t\tlist.push(<li key={key.id}><Link to={href} className=\"account-item\">{accountName}</Link></li>);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn <ul>{list}</ul>;\n\t\t\t}", "allUser() {\n return ['member', 'teamlead', 'admin', 'supervisor', 'manager']\n }", "getAccounts() {\n return Promise.resolve(this.accounts ? this.accounts.slice() : [].slice());\n }", "getAccounts() {\n return Promise.resolve(this.accounts ? this.accounts.slice() : [].slice());\n }", "async show({ auth }) {\n return auth.user.account().fetch()\n }", "function AccountsList({ accounts }) {\n if (accounts && Object.keys(accounts).length > 0) {\n return (\n <>\n {Object.keys(accounts).map((name) => {\n const account = accounts[name].userId;\n\n return (\n <div className=\"card mb-4\" key={name}>\n <div className=\"card-content\">\n <div className=\"content\">\n <h2>\n <AccountBankName name={name} />\n </h2>\n <AccountContext accountName={account} />\n </div>\n </div>\n <footer className=\"card-footer\" style={cardFooter}>\n <AccountFooterButton name={name} />\n </footer>\n </div>\n );\n })}\n </>\n );\n }\n return (\n <>\n <div className=\"card\" style={cardEqualHeight}>\n <div className=\"card-content\">\n <div className=\"content\">\n <h2>Oh no!</h2>\n You do not have any linked accounts.\n </div>\n </div>\n <footer className=\"card-footer\" style={cardFooter}>\n <Link to=\"/accounts/link\" className=\"card-footer-item\">\n Why not take a look at what accounts you can link?\n </Link>\n </footer>\n </div>\n </>\n );\n }", "function findAccountTypes(params, callback) {\n\tparams = params || $H();\n\tvar url = params.url || context + \"/do/searchAccountTypesAjax\";\n\tnew Ajax.Request(url, {\n\t method: 'post',\n\t\tparameters: params.toPlainString ? params.toPlainString() : params,\n\t\tonSuccess: function(request, array) {\n\t\t\tcallback(array);\n\t\t}\n\t});\n}", "function userType(){\n inquirer.prompt([\n {\n type: \"list\",\n message: \"\\nWelcome to Better Broomball Store!\\n\",\n choices: [\"Browse the store\", \"Admin access\"],\n name: \"type\"\n }\n ])\n .then(function(res) {\n // If the inquirerResponse confirms, we displays the inquirerResponse's username and pokemon from the answers.\n if (res.type === \"Browse the store\") {\n browseType = \"User\";\n let customerLogin = customer.getStarted();\n \n }\n else if (res.type === \"Admin access\") {\n browseType = \"Admin\";\n login();\n }\n }); \n }", "getAll() {\n return this.tenants;\n }", "static async getAll() {\n try {\n const result = await db.queryNoParams(\n 'SELECT * FROM accounts ORDER BY id'\n );\n return result.rows;\n } catch (err) {\n return err.code;\n }\n }", "getAllUsers(callback) {\n\t\tlet userInfo_dict = new Array();\n\t\tlet account_list = [];\n\t\twindow.web3.eth.getAccounts((error, accounts) => {\n \t// Do whatever you need to.\n\t if(error) {\n\t \tconsole.error(error);\n\t }\n\n\t account_list = accounts;\n\n\t for(let account in account_list) {\n\t\t\t\tthis.getUser(account, user => {\n\t\t\t\t\tuserInfo_dict[account] = user;\n\t\t\t\t\tconsole.log(userInfo_dict);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// callback\n\t\t\t// return userInfo_dict;\n\t });\n\t}", "function accountData() {\n \"use strict\";\n //Account data\n\n let password = \"\";\n for (var i = 0; i < user.user_password.length; i++) {\n password += '&#8226;';\n }\n\n $($(\".accountModule p\")[0]).text(user.name_first + \" \" + user.name_last);\n $($(\".accountModule p\")[1]).text(user.address);\n $($(\".accountModule p\")[2]).text(user.phone_number);\n $($(\".accountModule p\")[3]).text(user.email);\n $($(\".accountModule p\")[4]).html(password);\n\n requestBookings(function() {\n for (let i = 0; i < bookings_current.length; i++) {\n get_bookings(bookings_current[i], true);\n }\n for (let i = 0; i < bookings_past.length; i++) {\n get_bookings(bookings_past[i], false);\n }\n // Checking if you have bookings\n checkIfBookings();\n });\n}", "function getAllRegistrants() { // retrieve only\n ajaxHelper(registrantsUri, 'GET', self.error).done(function (data) {\n self.registrants(data);\n });\n }", "function getAccounts() {\n var db = connectDB();\n var result = new Array;\n db.transaction(\n function(tx) {\n var accounts = tx.executeSql(\"SELECt * FROM account\");\n for(var acc_count = 0; acc_count < accounts.rows.length; acc_count++) {\n result[0] = accounts.rows.item(acc_count).email;\n result[1] = accounts.rows.item(acc_count).password;\n }\n\n });\n\n if(result.length===0)\n return false;\n mailText.text = \"\";\n passText.text = \"\";\n mailText.text = result[0];\n passText.text = result[1];\n}", "function getAccountSettings() {\n APIUtils.getAllUserAccountProperties()\n .then((settings) => {\n $scope.accountSettings = settings;\n })\n .catch((error) => {\n console.log(JSON.stringify(error));\n $scope.accountSettings = null;\n })\n }", "queryAccount(address) {\n return this.client.rpcClient.abciQuery('custom/acc/account', {\n Address: address,\n });\n }", "getAccountsInfo() {\n let result = this.db.getAccountsStats();\n for (let entry of result) {\n entry.userId = entry.userId.toString('hex');\n entry.deposit = this.fromBigInt(entry.deposit);\n entry.withdrawal = this.fromBigInt(entry.withdrawal);\n entry.pending = this.fromBigInt(entry.pending);\n }\n return result;\n }", "get Accounts() {\n\t\tthis.utils.logger.debug({description: 'Account Action called.', action: new AccountsAction(), func: 'users', obj: 'Grout'});\n\t\treturn new AccountsAction();\n\t}", "function dispatchThirdAccountByType(data){\n\t\t$scope.third_accounts = data;\n\t\tvar third_accounts_own = [];\n\t\tvar third_accounts_others = [];\n\t\tif (typeof $scope.third_accounts != 'undefined'){\n\t\t\t$scope.third_accounts.forEach(function(acc){\n\t\t\t\tif(acc.same_bank){\n\t\t\t\t\tthird_accounts_own.push(acc);\n\t\t\t\t}else{\n\t\t\t\t\tthird_accounts_others.push(acc);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif(third_accounts_own.length > 0){\n\t\t\tfor(var i=0; i < third_accounts_own.length; i++){\n\t\t\t\tvar account_type= third_accounts_own[i].account_type;\n\t\t\t\tif(account_type == \"TDC_T\"){\n\t\t\t\t\tthird_accounts_own[i].account_type_name=\"Tarjeta de Crédito Propia Mismo Banco\";\n\t\t\t\t}else if(account_type == \"DEB_T\"){\n\t\t\t\t\tthird_accounts_own[i].account_type_name=\"Débito Propia Mismo Banco\";\n\t\t\t\t}\n\t\t\t}\n\t\t}//End if validate\n\t\tif(third_accounts_others.length > 0){\n\t\t\tfor(var i=0; i < third_accounts_others.length; i++){\n\t\t\t\tvar account_type = third_accounts_others[i].account_type;\n\t\t\t\tif(account_type == \"DEB_T\") {\n\t\t\t\t\tthird_accounts_others[i].account_type_name=\"Débito Propia Otros Bancos\";\n\t\t\t\t}\n\t\t\t}\n\t\t}//End if validate\n\t\t$scope.third_accounts_own = third_accounts_own;\n\t\t$scope.third_accounts_others = third_accounts_others;\n\t\t$scope.third_accounts_others = $scope.third_accounts;\n\t}", "static async getAll() {\n return await user_model.find({});\n }", "static async displayAccounts(req, res) {\n const allAccounts = await con.query(account.getAllAccount);\n if (!allAccounts.error) {\n return res.status(200).json({\n status: 200,\n data: allAccounts.rows,\n });\n }\n return res.status(401).json({\n status: 500,\n message: 'server error please try again later',\n });\n }", "function getListGeneralUserAuthorized() {\n var ListGeneralUserAuthorized = [];\n var temp;\n var len=0;\n var leng=0;\n var found=false;\n \n // Recuperation de la liste des users Admin\n temp = Get_ADMIN().split(',');\n len = temp.length;\n for(n=1;n<len+1;++n){\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n // Recuperation de la liste des users Admin du Suivi\n temp = Get_ADMIN_SUIVI().split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n // Recuperation de la liste des users de la BU SQLi Entreprise Paris\n temp = (GetManagerBU(BU_ENTREPRISE_PARIS)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n } \n // Recuperation de la liste des users de la BU Compta Fournisseur\n temp = (GetManagerBU(BU_COMPTA_FOURNISSEUR)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n // Recuperation de la liste des users de la BU Assistante\n temp = (GetManagerBU(BU_ASSISTANTE_ENTREPRISE_PARIS)).split(',');\n len = temp.length;\n leng = ListGeneralUserAuthorized.length;\n for(n=1;n<len+1;++n){\n found=false;\n for (m=1;m<leng+1;++m) {\n if (ListGeneralUserAuthorized[m-1] == temp[n-1]) {\n found=true;\n break;\n }\n }\n if (found == false) {\n ListGeneralUserAuthorized.push(temp[n-1]);\n }\n }\n return ListGeneralUserAuthorized;\n}", "fetchAllUsers() {\n let account = JSON.parse(localStorage.getItem(\"cachedAccount\")).id;\n let url = (\"./admin/admin_getusers.php?allusers=\" + account);\n\n\t\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tthis.userList = data;\n\t\t\t})\n\t\t\t.catch((err) => console.error(err));\n }", "getAllIds(req, res, next) {\n if (!req.isAuthenticated()) {\n return res.json({ success: false });\n }\n AccountModel\n .find({\n // $or:[{\"role\": 2},{\"role\": 3}]\n \"role\": { $lt: 3 }\n }) // regular users only\n .select('_id name enabled')\n .sort({ name: 'asc' })\n .lean()\n .exec((err, accounts) => {\n if (err) return next(err);\n res.json({\n success: true,\n accounts,\n });\n });\n }", "function retrieveBFAccounts() {\n bfAccountOptions = [];\n bfAccountOptionsStatus = \"\";\n client.invoke(\"api_bf_account_list\", (error, res) => {\n if (error) {\n log.error(error);\n console.error(error);\n bfAccountOptionsStatus = error;\n } else {\n for (myitem in res) {\n bfAccountOptions[res[myitem]] = res[myitem];\n }\n showDefaultBFAccount();\n }\n });\n return [bfAccountOptions, bfAccountOptionsStatus];\n}", "getAllAccounts(req, res) {\n logger.info('getAllAccountsCalled');\n accountService.getAllAccounts()\n .then((accounts) => {\n res.send(accounts);\n })\n .catch((e) => {\n logger.error(e);\n throw e;\n })\n }", "function loadusers_rp(cb) {\n axios.get(cfg.url+\"user/all\", axopt).then((resp) => {\n var d = resp.data;\n var users = d.content;\n users = users.filter((u) => { return u.accountType == 'LDAP'; });\n debug && console.log(\"LDAP-Users:\", users);\n return cb(null, users);\n }).catch((ex) => {\n console.error(\"Failed loading RP users: \"+ex);\n return cb(ex, null);\n });\n}", "function getAccount(id) {\n for (i = 0; i < accts.length; i++) {\n if (accts[i].acct_id == id) {\n return accts[i].acc_name;\n }\n }\n}", "function getUserList() {\n userService.getUsers()\n .then(function (users) {\n var result = users.filter(function (u) {\n return u.Id !== vm.current.details.ownerId;\n });\n vm.ownerForm.users = result;\n });\n }", "function loadAccounts() {\n accountsCollection.find({\n active: {\n $ne: null\n }\n }, {\n fields: {\n '_id': 1,\n 'a': 1\n }\n }, function(err, cursor) {\n if (err) {\n console.log(err);\n process.exit(1);\n }\n console.log('GETTING ACCOUNTS');\n cursor.each(function(err, doc) {\n if (err) {\n console.log(err);\n process.exit(1);\n }\n if (doc !== null) {\n accounts.push(doc.a);\n } else {\n console.log('FOUND', accounts.length, 'ACCOUNTS');\n loadContent();\n }\n });\n });\n }", "function reportAccountTypes() {\n // Init all count with 0, so that when an account was set up before but\n // removed now, we reset it in telemetry report.\n let report = {\n pop3: 0,\n imap: 0,\n nntp: 0,\n exchange: 0,\n rss: 0,\n im_gtalk: 0,\n im_irc: 0,\n im_jabber: 0,\n im_matrix: 0,\n im_odnoklassniki: 0,\n };\n for (let account of MailServices.accounts.accounts) {\n let type = account.incomingServer.type;\n if (type == \"none\") {\n // Reporting one Local Folders account is not that useful. Skip it.\n continue;\n }\n if (type === \"im\") {\n let protocol =\n account.incomingServer.wrappedJSObject.imAccount.protocol\n .normalizedName;\n type = `im_${protocol}`;\n }\n // It's still possible to report other types not explicitly specified due to\n // account types that used to exist, but no longer -- e.g. im_yahoo.\n if (!report[type]) {\n report[type] = 0;\n }\n report[type]++;\n }\n for (let [type, count] of Object.entries(report)) {\n Services.telemetry.keyedScalarSet(\"tb.account.count\", type, count);\n }\n}", "function fetchAccounts(username, mongoKey) {\n var deferred = Q.defer();\n var conditions = {};\n conditions['twitteruser.' + mongoKey] = username;\n permissionCheck.find(conditions, function (err, list){\n if (err) {\n deferred.reject(err);\n }\n deferred.resolve(list);\n });\n return deferred.promise;\n }", "function UserTypeLoad(page) {\r\n document.getElementById(\"usertypeheading\").innerHTML = activeUser.tipo;\r\n\r\n document.getElementById(\r\n \"usernametxt\"\r\n ).innerText = `${activeUser.nombre} ${activeUser.apellido}`;\r\n\r\n let navitems = [];\r\n\r\n switch (activeUser.tipo) {\r\n case \"operador\":\r\n navitems = document.getElementsByClassName(\"op\");\r\n break;\r\n case \"administrador\":\r\n navitems = document.getElementsByClassName(\"admin\");\r\n break;\r\n case \"superusuario\":\r\n navitems = document.getElementsByClassName(\"su\");\r\n break;\r\n }\r\n\r\n for (let i = 0; i < navitems.length; i++) {\r\n navitems[i].style.display = \"list-item\";\r\n }\r\n\r\n switch (page) {\r\n case \"product\":\r\n LoadProducts();\r\n break;\r\n case \"manage-products\":\r\n LoadEditProducts();\r\n break;\r\n case \"manage-users\":\r\n LoadEditUsers();\r\n break;\r\n case \"reports\":\r\n $(\"#datepicker\").datepicker({ format: \"yyyy-mm-dd\" });\r\n break;\r\n case \"graphs\":\r\n LoadChart();\r\n break;\r\n }\r\n}", "function people(type, res) {\n sync.syncUsersInfo(type, function(err, repeatAfter, diaryEntry) {\n if(err) {\n \n } else {\n locker.diary(diaryEntry);\n locker.at('/getNew/' + type, repeatAfter);\n res.writeHead(200, {'content-type':'application/json'});\n res.end(JSON.stringify({success:\"done fetching \" + type}));\n }\n });\n }", "function getDashBoard() {\n console.log(getTypeUser());\n if (getTypeUser() === '1') {\n return <DashAdmin />;\n } else if (getTypeUser() === '2') {\n return <DashManager />;\n } else {\n return <DashEmployee />;\n }\n}", "static async searchAccount(req, res) {\n const getAccount = await search.searchAccount(req.params.accountNo);\n if (getAccount.rowCount === 0) {\n return res.status(404).json({\n status: 404, message: 'account not found',\n });\n }\n const getOwner = await search.searchUserById(getAccount.rows[0].owner);\n if (getAccount.rowCount !== 0) {\n return res.status(200).json({\n status: 200,\n data: {\n accountId: getAccount.rows[0].accountid,\n accountNo: getAccount.rows[0].accountno,\n createdOn: getAccount.rows[0].createdon,\n ownerEmail: getOwner.rows[0].email,\n type: getAccount.rows[0].type,\n status: getAccount.rows[0].status,\n balance: getAccount.rows[0].balance,\n },\n });\n }\n return res.status(404).json({\n status: 404,\n message: 'account not found',\n });\n }", "static accountWrapper(accounts, user) {\n\t\t\t\tlet accountToDisplay = null;\n\t\t\t\tlet activeAccountID = null;\n\t\t\t\tlet activeAccount = null;\n\t\t\t\tlet accountList = null;\n\t\t\t\tlet accountServers = null;\n\t\t\t\tlet thumbnail = null;\n\n\t\t\t\tif (accounts.length) {\n\t\t\t\t\taccountToDisplay = accounts[0].toJSON().accountName;\n\t\t\t\t\tactiveAccount = accounts[0];\n\t\t\t\t\tactiveAccountID = accounts[0].id;\n\t\t\t\t\taccountList = this.accountList(accounts);\n\t\t\t\t\tthumbnail = accounts[0].toJSON().photo && accounts[0].toJSON().photo.url || null;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\taccounts,\n\t\t\t\t\taccountToDisplay,\n\t\t\t\t\taccountList,\n\t\t\t\t\tactiveAccount,\n\t\t\t\t\tactiveAccountID,\n\t\t\t\t\taccountServers,\n\t\t\t\t\tthumbnail,\n\t\t\t\t\tuser\n\t\t\t\t};\n\t\t\t}", "function getAccount() {\r\n let adr = address.value;\r\n let sanitizedAdr = adr.toUpperCase().replace(/-|\\s/g, \"\");\r\n if (adr == \"\") {\r\n address.focus();\r\n return false;\r\n }\r\n _doGet('/account/get?address=' + sanitizedAdr);\r\n }", "getUserBanks() {\n return this.api.send('GET', 'user/bank_account');\n }", "function getAccount() {\n const config = zxeth.getConf();\n\n return config.accounts[0];\n}", "async function handleLoadAccounts(acctType) {\n //first I need the accounts\n const accounts = await getAccounts(acctType);\n const content = accounts.map(account => changeAccountToHTMLRow(account)).join(\"\")\n\n document.querySelector(\"#accounts-table\")\n .innerHTML = `<table> \n <tr>\n <th>Account Number</th> \n <th>Account Type</th> \n <th>Balance</th> \n </tr>\n ${content} \n </table>`;\n}", "async function showBalance() {\n return findAllInTable(\"account\");\n}", "function showAllAccountOption()\n{\n var select_el = $(\"ul.criteria-container select#account\");\n var allaccounts_el = select_el.children(\"option.all_accounts\");\n allaccounts_el.removeAttr(\"disabled\");\n allaccounts_el.show();\n\n select_el.formSelect();\n}", "function load_accounts(cb) {\n chrome.storage.local.get('accounts', accounts => {\n\n if(accounts.accounts) {\n window.accounts = JSON.parse(accounts.accounts);\n } else {\n window.accounts = {};\n }\n\n var table = document.querySelector('tbody');\n\n Object.keys(window.accounts).forEach(account => {\n var row = document.createElement('tr');\n row.innerHTML = default_account_display_innerHTML;\n\n var first_col = row.children[0];\n\n var edit_buttons = row.querySelectorAll('.fa-pencil');\n var delete_buttons = row.querySelectorAll('.fa-trash');\n\n first_col = row.children[0];\n first_col.textContent = account;\n first_col.dataset.name = account;\n\n\n var edit_buttons = row.querySelectorAll('.fa-pencil');\n var delete_buttons = row.querySelectorAll('.fa-trash');\n\n // register edit actions\n Array.from(edit_buttons).forEach(edit_button => {\n edit_button.addEventListener('click', edit_button_click_handler)\n });\n\n // register delete action\n Array.from(delete_buttons).forEach(delete_button => {\n delete_button.addEventListener('click', delete_button_click_action)\n })\n\n table.appendChild(row);\n });\n\n if(cb) {\n cb();\n }\n })\n}", "async getAllAccounts() {\n try {\n let db = await MongoClient.connect(MongoConn);\n //if we can connect then output to the console that we did\n //console.log(\"Connected to mongoDB\");\n let result = await db\n .db(this.database)\n .collection(Accounts)\n .find({})\n .toArray();\n //console.log(`Returned ${result.length} items`);\n return result;\n db.close();\n } catch (err) {\n let result = err;\n return err;\n db.close();\n }\n }", "function getAllUsers(transactions) {\r\n loggerMessages.logDebug('Getting all users\\' info');\r\n const users = calculateAccounts(transactions);\r\n \r\n loggerMessages.logDebug('Starting to print out users\\' info');\r\n users.forEach(function(value) {\r\n value.logAccount();\r\n });\r\n}", "getUserTabs() {\n const {user} = this.props;\n if (user) {\n const authority_perms = [\n {codename: PERMS.authority.emac, fromAnyTarget: true},\n {codename: PERMS.authority.ef, fromAnyTarget: true}\n ];\n const hasE700perm = userHasPerm(user, {codename: PERMS.authority.e700, fromAnyTarget: true});\n const hasAuthPerm = authority_perms.some(p => userHasPerm(user, p));\n return [\n hasAuthPerm ? {\n name: 'Monitoreo', onClick: (() => history.push(reverse('authorities.home')))\n } : null,\n hasE700perm ? {\n name: 'Gestión E700', onClick: (() => history.push(reverse('e700')))\n } : null,\n hasAuthPerm ? {\n name: 'Mapa de Depósitos',\n onClick: (() => history.push(reverse('authorities.map')))\n } : null,\n hasAuthPerm ? {\n name: 'Alertas e Incidentes',\n onClick: (() => history.push(reverse('authorities.tickets')))\n } : null\n ].filter(tab => tab !== null);\n }\n return [];\n }" ]
[ "0.6889962", "0.6669898", "0.6375879", "0.6374473", "0.6287132", "0.627356", "0.6238821", "0.61558914", "0.6068359", "0.60603017", "0.59961224", "0.597382", "0.59635913", "0.5960709", "0.5956586", "0.5925498", "0.5857158", "0.58500063", "0.5846595", "0.58391464", "0.58181", "0.5817227", "0.5758843", "0.5758337", "0.57576203", "0.57272404", "0.567217", "0.5666875", "0.5649556", "0.5640855", "0.56125444", "0.56074077", "0.5590252", "0.55828124", "0.55774826", "0.5571768", "0.5555717", "0.5554205", "0.5541371", "0.5539007", "0.55330086", "0.5524008", "0.5519285", "0.5517933", "0.5501902", "0.5501415", "0.54916936", "0.5488878", "0.54812896", "0.5473582", "0.54636973", "0.54475564", "0.54344475", "0.5429373", "0.54215044", "0.5407216", "0.5407216", "0.5406427", "0.5405935", "0.5374732", "0.5372351", "0.5359827", "0.5359347", "0.5358749", "0.5348632", "0.53357154", "0.53334105", "0.5328274", "0.53134924", "0.53063786", "0.5293772", "0.5291582", "0.52813375", "0.52803266", "0.5251541", "0.522857", "0.5227806", "0.522747", "0.52129275", "0.5206224", "0.52042055", "0.5188328", "0.51867867", "0.5179507", "0.5177598", "0.5171761", "0.51675075", "0.516169", "0.5161129", "0.51586366", "0.51560485", "0.51552075", "0.51511174", "0.514726", "0.51461846", "0.5135719", "0.5127037", "0.51093066", "0.5099459", "0.5099381" ]
0.53037137
70
this is to make sure that if we internally set
makeIdentity() { this.$obj.idKey = new Ref(this.$obj.entity, this.$obj.name); this.$obj.indexed = this.$obj.identity = this.$obj.identity_ = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "transient final private protected internal function m167() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private protected public internal function m181() {}", "init() {\n this._super(...arguments);\n this.set('_oldDidUpdateAttrsValues', {});\n }", "function adjustObsSetters() {\r\n\r\n }", "__previnit(){}", "transient final private internal function m170() {}", "private public function m246() {}", "__init7() {this._isEnabled = false;}", "set() {}", "transient final private protected public internal function m166() {}", "_initializeProperties(){}// prevent user code in connected from running", "transient private public function m183() {}", "setObjectDataLoaded() {\n this.hasDataLoaded.object = true\n if(this.hasDataLoaded.record === true) {\n this.handleWireDataLoaded();\n }\n }", "function ThreadLocalSet() {\r\n}", "static transient final private internal function m43() {}", "reset() {\n this.modified = false;\n }", "_invalidateProperties() {\n this.__isInvalid = true;\n super._invalidateProperties();\n }", "initInteractionState() {\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }", "get set () {\n\t\treturn this._set;\n\t}", "dirty() {\r\n this._xml = null;\r\n }", "static transient final protected internal function m47() {}", "_forceUnload() {\n this._value = _sentinel;\n }", "forceValidate() {\n this.setValue(this.getValue());\n }", "function setHasChanges() {\n if (!HasChanges)\n HasChanges = true;\n}", "function orderSetProcessed(){\n\ttry{\n\n\t\t\n\t}catch(e){\n\t}\n}", "reset(valueToo) {\n this.target = this.defaultValue;\n if(valueToo) this.o[this.pn] = this.defaultValue;\n }", "_handleChildValueChange() {\n this.stateChanges.next(undefined);\n this._changeDetectorRef.markForCheck();\n }", "_handleChildValueChange() {\n this.stateChanges.next(undefined);\n this._changeDetectorRef.markForCheck();\n }", "clearUsed()\n\t{\n\t\tthis.isUsed = 0;\n\t}", "SetData() {}", "transient final private public function m168() {}", "_storeDefaultValues() {\n\t\tthis.defaultValues = {\n\t\t\tunit: this._getDefaultUnits(),\n\t\t\tslidersLinked: this.slidersLinked,\n\t\t\tvalues: this.getValues()\n\t\t};\n\t}", "static transient final private protected internal function m40() {}", "__init12() {this.error = null}", "_set(key) {\n throw Error(\"Needs implementation\");\n }", "setValue(value) {\n console.assert(false,\n 'setValue() must be implemented by this subclass.');\n }", "getSnapshotBeforeUpdate() {\n //create a backup of the current way things are\n //IMPORTANT: not very common\n }", "get loaded() { return this._value !== _sentinel; }", "prepare() {\n super.prepare()\n }", "function setUnchanged(){\n\tformModified = false;\n}", "static transient final protected public internal function m46() {}", "static private protected internal function m118() {}", "change()\n {\n this.list = new Set();\n }", "resetBoundsCache() {\n // Not actually resetting here, would just be costly to iterate and reset per dependency, instead flagging to\n // force cached value to be updated\n this._resetBoundsCache = true;\n }", "resetBoundsCache() {\n // Not actually resetting here, would just be costly to iterate and reset per dependency, instead flagging to\n // force cached value to be updated\n this._resetBoundsCache = true;\n }", "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 }", "'refresh_internal'() {\n // When values are set in the constructor, using fields, do they get set using data values, like they would otherwise?\n\n var key = this.key;\n var value = this.value;\n // May be better to have a String control for the key.\n // That way it will be easier to make it editable (using the control overrides).\n var content = this.content;\n var key_content = ctrl_key.span;\n //this.set('ctrl_string_key', ctrl_string_key);\n //var key_content = ctrl_key.content.get(1);\n if (key) {\n //console.log('key ' + key);\n //var key_value = key.value();\n //console.log('key_value ' + key_value);\n key_content.add(key);\n var vcon = ctrl_value.content;\n //vcon.set(1, 'hello');\n vcon.clear();\n var ctrl_viewer = this.factory(value, this.context);\n //console.log('ctrl_viewer', ctrl_viewer);\n //console.log('tof ctrl_viewer', tof(ctrl_viewer));\n\n vcon.push(ctrl_viewer);\n }\n }", "isDirty() {\r\n\r\n // resume\r\n return false;\r\n }", "function setbound() { \n\t\t\t\tbound = true; \n\t\t\t\tView.Unbound = View.Unbound.filter(function(v) { return v !== view; }); \n\t\t\t}", "function setbound() { \n\t\t\t\tbound = true; \n\t\t\t\tView.Unbound = View.Unbound.filter(function(v) { return v !== view; }); \n\t\t\t}", "validate() {\n if (this.isDisposed) {\n return;\n }\n this._invalidated = false;\n this._lastArgs = [];\n }", "static postUpdate() {\n return false;\n }", "function _setup () {\n }", "_setValue(value) {\n if (value !== null) {\n // Also allow for \"componentName\" as \"component\" is a MSON keyword and results in compilation\n value = {\n ...value,\n component: value.component ? value.component : value.componentName,\n componentName: undefined,\n };\n }\n\n super._setValue(value);\n }", "constructor() {\n this.set = [];\n }", "static transient private protected internal function m55() {}", "getNotUsedAnymoreUpdateObject() {\n return {\n $set: {\n avaible: true,\n used: false,\n socket: null,\n requeriments: []\n }\n };\n }", "init () {\n this._super()\n this.handleNewValues()\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "_dirtyCheckNativeValue() {\n const newValue = this._elementRef.nativeElement.value;\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }", "_dirtyCheckNativeValue() {\n const newValue = this._elementRef.nativeElement.value;\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }", "async preSave () {\n\t\tawait this.getStream();\n\t\tawait this.getTeam();\n\t\tawait this.checkNameUnique();\n\t\tawait this.checkNameForProvider();\n\t\tawait this.getUsers();\n\t\tawait this.clearUnreads();\n\t\tthis.attributes.modifiedAt = Date.now();\n\t\tawait super.preSave();\n\t}", "function canSet(obj, name) {\n if (obj === void 0 || obj === null) { return false; }\n if (obj[name + '_canSet___'] === obj) { return true; }\n if (obj[name + '_grantSet___'] === obj) {\n fastpathSet(obj, name);\n return true;\n }\n return false;\n }", "_checkForAssignedOptions() {\n this.config.assigned = Object.keys(this.ui.assigned);\n this.ui.assignedCount = this.config.assigned.length;\n this.ui.optionsCount = this.config.options.values.length;\n if (this.ui.assignedCount == this.ui.optionsCount)\n this.ui.optionsCount = 0;\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "function used(value) { }", "cleanup() {\n this.lastRead = {};\n this.defaults = {};\n this.overrides = {};\n }", "Set() {}", "function resetValue() {\n\t\t\t}", "_requestRender() { this._invalidateProperties(); }", "_setInitialValues() {\n const that = this;\n\n that._autoScrollCoefficient = JQX.Utilities.Core.Browser.Firefox ? 4 : JQX.Utilities.Core.Browser.Edge ? 8 : 2;\n that._isMobile = JQX.Utilities.Core.isMobile;\n\n that._manuallyAddedFields = [];\n that._localizeInitialValues();\n that.$.conditionsMenu.dropDownAppendTo = that.$.container;\n that.$.conditionsMenu.dataSource = that._groupOperationDescriptions;\n\n that._valueFlat = [];\n that._lastProcessedItemInCurrentGroup = { parentId: null, id: null, position: null };\n }", "set booking(stuff){\n throw \"sorry you cannot do this\"\n }", "before (callback) {\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.existingValue = this.marker[this.attribute];\n\t\t\tthis.data[this.attribute] = RandomString.generate(10);\n\t\t\tcallback();\n\t\t});\n\t}", "function datasetDangerously () {}", "get used() {\n\t\treturn this.__used;\n\t}", "_storeDefaultValues() {\n\t\tsuper._storeDefaultValues();\n\t\tthis.defaultValues.type = this._getDefaultBorderStyle();\n\t}", "static transient final protected function m44() {}", "afterValidChange() { }", "__init25() {this.forceRenames = new Map()}", "setData() {}", "function isThisSet(node) {\n return (\n types.isCallExpression(node) &&\n types.isMemberExpression(node.callee) &&\n types.isIdentifier(node.callee.property) &&\n ['set', 'setProperties'].includes(node.callee.property.name) &&\n memberExpressionBeginsWithThis(node.callee.object)\n );\n}", "configure () {\n // this can be extended in children classes to avoid using the constructor\n }", "preset () { return false }", "_processHints() {\n this._validateHints();\n this._syncDescribedByIds();\n }", "updateSelfData(ro) {}", "function setIfInstance( obj, key, type ){\n\t\t\tif( obj[key] instanceof type || obj[key] === null ) Settings[key] = obj[key];\n\t\t}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set(data) {\n this.internalData = data;\n }", "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }" ]
[ "0.6541378", "0.6194477", "0.6087722", "0.59868246", "0.59726936", "0.59651196", "0.5944969", "0.5820261", "0.5745353", "0.57140523", "0.5679596", "0.5676883", "0.563382", "0.56282616", "0.5628218", "0.5610903", "0.5583831", "0.55658954", "0.555063", "0.55303544", "0.5504424", "0.5485121", "0.54594916", "0.5438146", "0.5413035", "0.53969675", "0.5377323", "0.5336712", "0.5318175", "0.53156745", "0.5305148", "0.5296652", "0.52422637", "0.52413887", "0.52413887", "0.52401733", "0.5239584", "0.52373934", "0.52194154", "0.520637", "0.52044564", "0.51985025", "0.5197736", "0.5196271", "0.51893866", "0.51801014", "0.516919", "0.51581895", "0.5155605", "0.5150324", "0.5147645", "0.5147645", "0.51427025", "0.51377237", "0.5137066", "0.5127568", "0.5127568", "0.5109262", "0.5102475", "0.5089853", "0.50875837", "0.50827605", "0.5080801", "0.5075558", "0.5072221", "0.50722194", "0.50722194", "0.50722194", "0.50720334", "0.50720334", "0.5071579", "0.50678724", "0.50616914", "0.50605386", "0.5058648", "0.50545037", "0.5052675", "0.50518966", "0.50505733", "0.50505525", "0.5045537", "0.502768", "0.5017727", "0.50174296", "0.5012016", "0.500891", "0.5007251", "0.5003756", "0.49949384", "0.4989492", "0.49865592", "0.49825415", "0.49748287", "0.49738818", "0.49733385", "0.49675888", "0.49675888", "0.49675888", "0.49675888", "0.4966488", "0.496387" ]
0.0
-1
it get fixed object
toObject() { let props = this.$obj; let res = super.toObject(); return JSON.parse(JSON.stringify({ ...res, type: props.type || props.type_, identity: props.identity || props.identity_ , required: props.required || props.required_, indexed: props.indexed || props.indexed_, idKey: props.idKey ? props.idKey.toString() : undefined, relation: props.relation ? props.relation.toObject() : undefined, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get object() {\n\n }", "function makeObject(obj){\n\t// console.log(\"ovj=\",obj);\n\t// console.log();\n\ttry{\n\t\tif(obj!=undefined && obj[10]!=undefined && obj[0]!=\"Delete\"){\n\t\t\tvar newObj={};\n\t\t\tnewObj._key=calculate_key(obj);\n\t\t\tnewObj.name=obj[1];\n\t\t\tnewObj.priority=obj[2];\n\t\t\tnewObj.owner_name=obj[3];\n\t\t\tnewObj.owner_number=obj[4];\n\t\t\tnewObj.contact_person=obj[5];\n\t\t\tnewObj.contact_phone=obj[6];\n\t\t\tnewObj.address=obj[7];\n\t\t\tnewObj.location=obj[8];\n\t\t\tnewObj.description=obj[9];\n\t\t\tnewObj.facebookurl=obj[10];\n\t\t\tnewObj.fbid=calculate_key(obj);\n\t\t\tnewObj.genre=obj[11];\n\t\t\tnewObj.profile_type=\"Party Spot\";\n\t\t\tnewObj.time=obj[13];\n\t\t\tnewObj.price=obj[14];\n\t\t\tnewObj.min=obj[14];\n\t\t\tnewObj.max=obj[14];\n\t\t\tnewObj.more=obj[15];\n\t\t\tnewObj.createdat=new Date().getTime();\n\t\t\tnewObj.rsm= {\n\t\t\t\t\"email\": \"[email protected]\",\n\t\t\t\t\"name\": \"Tarun\",\n\t\t\t\t\"phone\": \"+91 97 1197 1244\"\n\t\t\t};\n\n\n\t\t\treturn newObj;\n\t\t}\n\t\treturn undefined;\n\t}\n\tcatch(err){\n\t\tconsole.log(\"eror=\",err);\n\t\treturn undefined;\n\t}\n\treturn undefined;\n}", "obtain(){}", "function obj(objec){\nreturn objec;\n}", "get objectReferenceValue() {}", "function getobject(obj){\n\tif (document.getElementById)\n\t\treturn document.getElementById(obj);\n\telse if (document.all)\n\t\treturn document.all[obj];\n}", "objd(obj) {\n\n return toObject(obj);\n }", "function FacObject(street, city, zipcode) {\n return{\n street,\n city,\n zipcode\n };\n \n}", "function getObj(name) {\r\n\tif (document.getElementById) {\r\n\t\tthis.obj = document.getElementById(name);\r\n\t} else if (document.all) {\r\n\t\tthis.obj = document.all[name];\r\n\t} else if (document.layers) {\r\n\t\tthis.obj = document.layers[name];\r\n\t}\r\n}", "copy(obj){\n\t\tif (obj == undefined) obj=null;\n\t\tif (obj == null){\n\t\t\treturn this;\n\t\t}\n\t\tvar res = rtl.newInstance(this.getClassName(), (new Vector()));\n\t\tres.assignObject(this);\n\t\tres.setMap(obj);\n\t\tres.initData();\n\t\t/* Return object */\n\t\treturn res;\n\t}", "function newObject(){\n var newFlavor = document.getElementById(\"flavor\").textContent;\n var newGlaze = customizeGlazeToObject();\n var newQuantity = customizeQuantityToObject();\n var newPrice = customizePriceToObject();\n //var newID = customizeIDToObject();\n var newBun = new bun (newFlavor, newGlaze, newQuantity, newPrice);\n return newBun;\n}", "static initialize(obj, fee, burn) { \n obj['fee'] = fee;\n obj['burn'] = burn;\n }", "function xl_GetObj(obj) \n{\n\t// If xl_DOM object not attached to document, then do it: \n\tif(!document.xl_DOM) document.xl_DOM = new xl_oDOMFeats();\n\tvar xl_DOM = document.xl_DOM; \n\tvar ObjID;\n\tif (typeof obj == \"string\") \n\t{\n\t\tif (xl_DOM.isW3C) \n\t\t{\n\t\t\tObjID = document.getElementById(obj);\n\t\t} \n\t\telse if (xl_DOM.isIE4) \n\t\t{\n\t\t\tObjID = document.all(obj);\n\t\t} \n\t\telse if (xl_DOM.isNN4) \n\t\t{\n\t\t\tObjID = xl_SeekLayer(document, obj);\n\t\t}\n\t} \n\telse \n\t\t// pass through object reference\n\treturn obj;\n\t\n\treturn ObjID; \n}", "function getObjById(id){\n\treturn document.getElementById(id);\n}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "get object() {\n\t\treturn this.#object;\n\t}", "function transformToMget(obj) {\n\t return { _id: obj.id, _type: obj.type };\n\t }", "function object(obj) {\n if (this == window && !isundefined(obj) && callable(obj['__object__']))\n return obj.__object__();\n throw 'The wormhole stop here. Please, is just javascript not python :)'; \n }", "getFixtureInfoAsObject() {\n let obj = {fixtureType: \"\", fillColor: 0};\n obj.pixelVectorPositions = this.pixelVectorPositions.map((x) => new createEvanVector(x));\n obj.fillColor = this.fillColor;\n return obj;\n }", "function geto(id){\r\n\t//alert(id);\r\n\tvar obj = document.getElementById(id);\r\n\treturn obj;\r\n\t}", "function getObj(id) {\n\treturn $(id);\n}", "getObject (ix, obj = {}) { // provide the obj for reuse and reduced gc\n for (const key in this.arrays)\n obj[key] = this.getValueAt(ix, key)\n return obj\n }", "function GetObj(name) {\n if (document.getElementById) {\n this.obj = document.getElementById(name);\n this.style = document.getElementById(name).style;\n } else if (document.all) {\n this.obj = document.all[name];\n this.style = document.all[name].style;\n } else if (document.layers) {\n this.obj = document.layers[name];\n this.style = document.layers[name];\n }\n}", "function getSingleObject(objid) {\r\n var foundObject = getObject(objid, true);\r\n return foundObject;\r\n}", "get object() {\n\t\t\treturn this._object;\n\t\t}", "function getObj(oid) \n\t{\n\t if (document.all && !document.getElementById) \n\t {\n\t return document.all(oid)\n\t } \n\t else \n\t {\n\t return document.getElementById(oid)\n\t }\n\t}", "function fakeobj(addr) {\n var a = []\n for (var i = 0; i < 100; i++)\n a.push({})\n var b = a.slice(0, {valueOf: function() { a.length = 0; b = [addr.asDouble()]; return 10; }});\n return b[4];\n}", "objectDefault(x, y, value){\n return {\n position: {\n x: x,\n y: y\n },\n value: value,\n previos: {\n x: x,\n y: y\n }\n }\n }", "function returnObjById( id ) {\n\n if (document.getElementById) \n var returnVar = document.getElementById(id); \n else if (document.all) \n var returnVar = document.all[id]; \n else if (document.layers) \n var returnVar = document.layers[id]; \n return returnVar; \n }", "function get_first_elmt() {\n return obj[0];\n}", "function NXObject() {}", "getFixtureInfoAsObject() {\n let obj = {fixtureType: \"compound\", pixelVectorPositions: [], fillColor: this.fillColor};\n obj.pixelVectorPositions = this.pixelVectorPositions.map((x) => new createEvanVector(x));\n return obj;\n\n }", "function NewObj(){}", "newContractDomElem(obj) {\n return this.gameView.createNewContractDom(obj);\n }", "get() {\n return this._object\n }", "function getObject(param) {\n\n switch (param.type) {\n case \"AS\":\n return \"AS\";\n case \"PM\":\n return \"제조\";\n case \"QC\":\n return \"품질\";\n }\n\n}", "function $Object() {\n\t\treturn Field.apply(this, arguments);\n\t}", "function getObject(){\n\t\tvar formObject = domForm.toObject( 'formAsunto' + aleatorio );\n\t\tif (idOrganoJuris.item != null){\n\t\t\tformObject.idOrganoJuris = idOrganoJuris.item.idOrganoJuris;\n\t\t}\n\t\tif( !formObject.relevante ){\n\t\t\tformObject.relevante = '0';\n\t\t}\n\t\treturn formObject;\n\t}", "function ReferenceToObject(o, r, f) {\n // TODO : seems like I should output the desiredClass information here\n // maybe all references have a name, index, etc. and then the are either undefined\n // what about clobber, can I get an index in an index and then that would not work\n // should the second loop be doing something different?\n var originalRef = r;\n\twhile (r != null) {\n\t\tvar refForm = r.getForm();\n var refClass = r.getDesiredClass();\n var strk = app.typeIDToStringID(refClass);\n if (strk.length == 0) {\n strk = app.typeIDToCharID(refClass);\n }\n\t\tswitch (refForm) {\n\t\t\tcase ReferenceFormType.NAME:\n\t\t\t\to[\"name\"] = r.getName();\n\t\t\t\tbreak;\n\t\t\tcase ReferenceFormType.INDEX:\n\t\t\t\to[\"index\"] = r.getIndex();\n\t\t\t\tbreak;\n\t\t\tcase ReferenceFormType.IDENTIFIER:\n o[\"indentifier\"] = r.getIdentifier();\n break;\n\t\t\tcase ReferenceFormType.OFFSET:\n o[\"offset\"] = r.getOffset();\n break;\n\t\t\tcase ReferenceFormType.ENUMERATED:\n var newT = r.getEnumeratedType();\n var newV = r.getEnumeratedValue();\n o[\"enumerated\"] = new Object();\n o[\"enumerated\"].type = typeIDToCharID(newT);\n o[\"enumerated\"].typeString = typeIDToStringID(newT);\n o[\"enumerated\"].value = typeIDToCharID(newV);\n o[\"enumerated\"].valueString = typeIDToStringID(newV);\n break;\n\t\t\tcase ReferenceFormType.PROPERTY:\n o[\"property\"] = app.typeIDToStringID(r.getProperty());\n if (o[\"property\"].length == 0) {\n o[\"property\"] = app.typeIDToCharID(r.getProperty());\n }\n break;\n\t\t\tcase ReferenceFormType.CLASSTYPE:\n o[\"class\"] = refClass; // i already got that r.getDesiredClass(k);\n break;\n\t\t\tdefault:\n\t\t\t\tmyLogging.LogIt(\"Unsupported type in referenceToObject \" + t);\n\t\t}\n r = r.getContainer();\n try {\n r.getDesiredClass();\n } catch(e) {\n r = null;\n }\n\t}\n\tif (undefined != f) {\n\t\to = f(o);\n\t}\n}", "function Obj() {}", "function Obj()\r\n{\r\n return {\r\n name: 'hamza',\r\n lastName : 'mubeen'\r\n }\r\n}", "generateData() {\n\t\tvar obj = {};\n\t\tobj.pos = this.physics.pos;\n\t\tobj.rpos = this.physics.rpos;\n\t\tobj.id = this.id;\n\t\tobj.solid = this.solid;\n\t\tobj.breakable = this.breakable;\n\t\tobj.breakTime = this.breakTime;\n\t\tobj.name = this.name;\n\t\tobj.textureOffset = this.textureOffset;\n\t\tobj.multiTexture = this.multiTexture;\n\t\tobj.multiTextureId = this.multiTextureId;\n\t\tobj.owner = this.owner;\n\t\tobj.active = this.active;\n\t\treturn obj;\n\t}", "constructor(objeto,view,...parametros){\n let proxy= ProxyFactory.create(objeto, parametros, (model) => view.update(model));\n view.update(proxy);\n //retorna uma instancia no proprio construtor\n return proxy;\n }", "getFixtureInfoAsObject() {\n let obj = {fixtureType: \"\", x: 0, y: 0, radius: 0, fillColor: 0};\n Object.keys(this).forEach((key) => {\n if (key in obj) {\n obj[key] = this[key];\n }\n });\n return obj;\n }", "function fungsiObject() {\n var x = {\n pesan: hallo(),\n }\n console.log(x.pesan);\n}", "static get MAX_OBJ(){\n return 5;\n }", "static get MAX_OBJ(){\n return 5;\n }", "static get MAX_OBJ(){\n return 5;\n }", "static get MAX_OBJ(){\n return 5;\n }", "makeDottomodachiObj() {\n return {dottomodachi: {\n id: this.id,\n name: this.name,\n hunger_meter: this.hungerMeter,\n happiness_meter: this.happinessMeter,\n weight_meter: this.weightMeter,\n total_points: this.totalPoints,\n stage: this.stage,\n evo_type: this.evoType,\n evolution_countdown: this.evolutionCountdown \n }\n }\n }", "getRef() {\n if (this.objectRef) {\n return this.objectRef;\n }\n const featureType = this.object.data.feature_type;\n const featureId = this.object.data.id;\n // e.g. https://ci.kbase.us/#dataview/29768/2?sub=Feature&subid=b0001\n const {\n workspace_id: workspaceId,\n object_id: objectId,\n object_version: version\n } = this.object;\n const objectRef = [workspaceId, objectId, version].join('/');\n const subObjectRef = `${objectRef}?sub=${featureType}&subid=${featureId}`;\n // TODO: fix this\n this.objectRef = {\n workspaceId: this.object.access_group,\n objectId: this.object.obj_id,\n version: this.object.version,\n objectRef: objectRef,\n subObjectRef: subObjectRef,\n featureType: featureType,\n feature: featureId,\n featureId: featureId,\n dataviewId: subObjectRef\n };\n return this.objectRef;\n }", "static select(obj) {\n if (obj[RepositoryManager.get_website()])\n return obj[RepositoryManager.get_website()];\n else if (obj.default)\n return obj.default;\n else\n return null;\n }", "static initialize(obj, mode, raw) { \n obj['mode'] = mode;\n obj['raw'] = raw;\n }", "function _get(obj,path){\n\t \n\t //Split the path into it's seperate components\n\t\tvar _path = path.split(\".\");\n\t\t\n\t\t//Set the object we use to query for this name to be the original object\n\t\tvar subObj = obj;\n\t \n\t\t//Parse the object properties\n\t\tvar c_len = _path.length;\n\t\tfor (var i=0;i<c_len;++i) {\n \n //Skip if we don't have this part of the path\n\t\t\tif( _path[i].length > 0 ) {\n\t\t\t \n\t\t\t //Get the sub object using the path\n\t\t\t\tsubObj = subObj[_path[i]];\n\t\t\t\t\n\t\t\t\t//Break if we don't have this sub object\n\t\t\t\tif(subObj === null || subObj === undefined) break;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return an empty string if we don't have a value\n\t\tif(subObj === null || subObj === undefined) return(\"\");\n\t\t\n\t\treturn(subObj);\n\t}", "function obj() { return this; }", "function manipulationBareObj( value ) {\n\treturn value;\n}", "gameObj(name, val){\n if (val !== undefined) this.memory[name] = val;\n if (this.memory[name]) return Game.getObjectById(this.memory[name]);\n return null;\n }", "resolve(obj) {\n while (true) {\n if (obj instanceof Frame) {\n if (!obj.isanonymous()) return obj;\n let qua = obj.get(this.is);\n if (!qua) return obj;\n obj = qua;\n } else {\n return obj;\n }\n }\n }", "function getObjNN4(obj,name)\r\n{\r\n\tvar x = obj.layers;\r\n\tvar foundLayer;\r\n\tfor (var i=0;i<x.length;i++)\r\n\t{\r\n\t\tif (x[i].id == name)\r\n\t\t \tfoundLayer = x[i];\r\n\t\telse if (x[i].layers.length)\r\n\t\t\tvar tmp = getObjNN4(x[i],name);\r\n\t\tif (tmp) foundLayer = tmp;\r\n\t}\r\n\treturn foundLayer;\r\n}", "function getObjectFromData(value){\n object = \"\";\n foundObject = false;\n getObject(data.options, value);\n foundObject = false;\n}", "getObject(type)\n {\n let next = this.getObjects(type).next();\n return next.done ? undefined : next.value;\n }", "newObj() {\n const newObj = {};\n this.objects[this.count] = {};\n this.objects[this.count].JSobj = newObj; // Store JS object\n this.objects[this.count].DOMelements = {}; // Prepare to store DOM elements\n\n newObj.nodeID = null;\n newObj.id = this.count++;\n newObj.name = \"\";\n newObj.type = \"\";\n newObj.parent = \"null\";\n newObj.children = [];\n newObj.details = [];\n\n newObj.instance = this;\n\n // Remember which node to edit\n this.editNode = newObj.id;\n this.newObject = newObj;\n\n return newObj;\n }", "function getObject(objid, returnSingleObject) {\r\n var foundObject = null;\r\n if (typeof objid == \"string\") {\r\n var result = document.getElementsByName(objid);\r\n if (result.length == 0) {\r\n if (isIE8Mode()) {\r\n foundObject = undefined;\r\n } else {\r\n foundObject = getObjectById(objid);\r\n\r\n if (foundObject == null) {\r\n if (window[objid] && window[objid].isOasisDataIsland) {\r\n foundObject = window[objid];\r\n }\r\n }\r\n\r\n if (foundObject == null) {\r\n foundObject = undefined;\r\n }\r\n }\r\n } else if (result.length == 1 || (returnSingleObject && result.length>1)) {\r\n foundObject = result[0];\r\n } else {\r\n foundObject = result;\r\n }\r\n } else {\r\n foundObject = objid;\r\n }\r\n return foundObject;\r\n}", "function lo(obj) {\n\treturn (JSON.parse(JSON.stringify(obj)));\n}", "getFixtureInfoAsObject() {\n let obj = {fixtureType: \"\", x: 0, y: 0, w: 0, h: 0, angle: 0, fillColor: 0};\n\n Object.keys(this).forEach((key) => {\n if (key in obj) {\n obj[key] = this[key];\n }\n });\n return obj;\n }", "function NewObj() {}", "function $V(obj){\r\n\treturn $F(\"flid_\"+obj);\r\n}", "static get [Symbol.species]() {\n\n //alert(\"get\");\n try {\no4.o11 = o10[1];\n}catch(e){}\n try {\nreturn o2;\n}catch(e){}\n }", "function get_obj(name)\n{\n\tif (document.getElementById)\treturn document.getElementById(name);\n\tif (document.all)\t\treturn document.all[name].style;\n\tif (document.layers)\t\treturn document.layers[name];\n\treturn 0;\n}", "constructor(obj) {\r\n this.id = obj.id;\r\n this.lastModified = obj.lastModified;\r\n this.created = obj.created;\r\n this.favourite = obj.favourite;\r\n this.deleted = obj.deleted;\r\n this.title = obj.title;\r\n this.tags = obj.tags;\r\n this.template = obj.template;\r\n this.content = obj.content;\r\n }", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}", "function getObjectModel()\n{\n return FlowscriptUtils.getObjectModel(cocoon);\n}", "init(data) {\r\n this.object = data.object;\r\n }", "get serializedObject() {}", "static initialize(obj, ref) { \n obj['ref'] = ref;\n }", "function loadObject(obj, defaultScale = 0.2, defaultStick = false) {\n let entity = new CardEntity(resources.textures[obj.card].paperTexture);\n\n let scale = defaultScale;\n if (obj.scale != null) scale = obj.scale;\n if (obj.children != null) {\n for (let i = 0; i < obj.children.length; ++i) {\n entity.addChild(loadObject(obj.children[i], 1, false));\n }\n }\n if (obj.cardAction != null) entity.action = obj.cardAction;\n entity.transform = transformMatMat(\n entity.transform,\n getScaling(new vec3(scale, scale, scale))\n );\n // CAN_BE_REMOVED\n // the random part avoids having cards touch\n let translation = new vec3(0, 0, Math.random() * 0.01);\n if (obj.cardTransform != null)\n entity.transform = transformMatMat(entity.transform, obj.cardTransform);\n if ((obj.stick == null && defaultStick) || (obj.stick && obj.stick != null)) {\n entity = createCardWithStick(entity);\n translation = new vec3(0, -stickHeight);\n }\n if (obj.transform != null) entity.transform = obj.transform;\n if (obj.translation != null) {\n entity.transform = transformMatMat(\n getTranslation(\n new vec3(obj.translation[0], obj.translation[1], obj.translation[2])\n ),\n entity.transform\n );\n }\n entity.transform = transformMatMat(\n getTranslation(translation),\n entity.transform\n );\n if (obj.action != null) entity.action = obj.action;\n entity.id = obj.id;\n return entity;\n}", "function poleObjetosc(szer,dl,wys){\n var pole = szer * dl;\n var Obj = pole * wys;\n var wynik = [pole, Obj];\n return wynik;\n}", "static getDefaultObject() {\n return {\n name : `name_${Math.round(Math.random() * 999999)}`,\n creation_date : `2019-10`,\n location : `location_${Math.round(Math.random() * 999999)}`,\n pvp_type : `pvp_type_${Math.round(Math.random() * 999999)}`,\n world_quest_titles : `world_quest_titles_${Math.round(Math.random() * 999999)}`,\n battleye_status : `battleye_status_${Math.round(Math.random() * 999999)}`,\n transfer_type : 'transfer_type',\n game_world_type : 'game_world_type',\n online_record : {\n players : Math.round(Math.random() * 999999),\n date : {\n date : '2017-12-03 19:10:30.000000',\n timezone_type : 2,\n timezone : 'CET'\n }\n },\n }\n }", "static initialize(obj, id, name) { \n obj['id'] = id;\n obj['name'] = name;\n }", "static initialize(obj, id, name) { \n obj['id'] = id;\n obj['name'] = name;\n }", "function getObject(id) {\n\n for (var i = 0; i < MAR.objects.length; i++) {\n if (MAR.objects[i].id === id) {\n return MAR.objects[i];\n }\n }\n\n return null;\n\n}", "fork( obj){\n\t\tconst newProx= new (AggroProx())( obj, this)\n\t\treturn newProx.proxied\n\t}", "function getCita(obj) {\n let objectCopy = { ...home };\n if (objectCopy.citas > 0 || objectCopy.citas !== undefined) {\n objectCopy.citas.push(obj);\n } else {\n objectCopy.citas = [];\n objectCopy.citas.push(obj);\n }\n // Borrar?\n setHome(objectCopy);\n //\n homeToServer(objectCopy);\n getGlobalObjects();\n }", "static initialize(obj, id, value) { \n obj['id'] = id;\n obj['value'] = value;\n }", "function fin_object(nome){\n this.typ = [\"object\"];\n this.syn = [];\n // points to...\n this.lnkTo = [];\n // is pointed from...\n this.lnkFr = [];\n this.v_0 = [];\n this.v_1 = [];\n this.v_2 = [];\n this.v_3 = [];\n // first synonym is equal to object name (pushed-in by the object constructor)\n this.syn.push(nome.toString()); \n // each generated object is stored in the global array\n ALLOBJECTS.push(this);\n}", "function getObject(theObject, id) {\n var result = null;\n if (theObject instanceof Array) {\n for (var i = 0; i < theObject.length; i++) {\n result = getObject(theObject[i], key);\n if (result) {\n break;\n }\n }\n }\n else {\n for (var prop in theObject) {\n //console.log(prop + ': ' + theObject[prop]);\n if (prop == 'id') {\n if (theObject[prop] == key) {\n return theObject;\n }\n }\n if (theObject[prop] instanceof Object || theObject[prop] instanceof Array) {\n result = getObject(theObject[prop], key);\n if (result) {\n break;\n }\n }\n }\n }\n return result;\n }", "function getDfltObjPrpties(obj, ObjType) {\n\n var objProps = [];\n\n var objRect = jq(obj).get(0).getBoundingClientRect()\n var obHeight = objRect.height;\n var objWidth = objRect.width;\n var objleft = objRect.left;\n var objRight = objRect.right;\n var objTop = objRect.top;\n var objBottom = objRect.bottom;\n\tvar sAddtoTst=false\n\t\n\tif (jq('#spyAddtoTstChkBx').is(':checked')){\n\t\tsAddtoTst=true\n\t}\n\n var props = {\n 'objName':jq('#SpyObjTypeVal').text(),\n\t\t'title': jq(document).find(\"title\").text(),\n\t\t'type': toCamelCase(getObjectType(obj)),\n\t\t'name':jq(obj).attr('name'),\n\t\t'value':jq(obj).val(),\n\t\t'innerText': jq(obj).text(),\n 'objectName': jq(\"#objSpyObjName\").val(),\n 'id': jq(obj).attr('id'),\n 'xPATH': getXpath(obj),\n 'css': getCssSelector(obj),\n 'Class': jq(obj).attr('class'),\n 'height': obHeight.toFixed(2),\n 'width': objWidth.toFixed(2),\n 'x': objleft,\n 'y': objTop,\n 'visible': jq(obj).is(\":visible\"),\n\t\t'addToTest':sAddtoTst,\n\t\t'idProps':'name;value',\n\t\t'href':jq(obj).attr(\"href\"),\n\t\t'frame':checkIfinFrame(obj),\n }\n objProps.push(props);\n\n\t\n return objProps;\n}", "static make( obj= {}, opts){\n\t\tvar p= new Prox( obj, opts)\n\t\treturn p.proxied\n\t}", "static initialize(obj, id, created, code, poolId) { \n obj['id'] = id;\n obj['created'] = created;\n obj['code'] = code;\n obj['poolId'] = poolId;\n }", "function createGameObjectPrototype(){\n var basicObj = {}\n basicObj.relX = getXOffset(); //offset value relative to center\n basicObj.relY = getYOffset(); //offset value relative to center\n return basicObj;\n }", "function Object_alloc(){}", "function fetch_object(idname)\n{\n\tif (document.getElementById)\n\t{\n\t\treturn document.getElementById(idname);\n\t}\n\telse if (document.all)\n\t{\n\t\treturn document.all[idname];\n\t}\n\telse if (document.layers)\n\t{\n\t\treturn document.layers[idname];\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "static create(obj) {\n //spinner(true);\n\n let handle = $(obj).attr(\"referencia\");\n let target = $(obj).attr(\"target\");\n let single = parseInt($(obj).attr(\"single\"));\n\n this.criaModal(handle, target);\n\n if(!(single === 1 && $(obj).find(\".galeria-overlay\").length > 0)){\n this.lista(obj);\n }\n }", "function my(){\t\t\n\t\t\t\t var data = this.data()[0];\n\t\t\t\t \t\n\t\t\t}", "function dereference(obj) {\n\treturn JSON.parse(JSON.stringify(obj));\n}" ]
[ "0.6457381", "0.6347683", "0.6099506", "0.59793913", "0.59340143", "0.59234184", "0.5888046", "0.5862156", "0.57820636", "0.57661873", "0.5734656", "0.572827", "0.57175076", "0.5703546", "0.5618647", "0.5618647", "0.5618647", "0.5618647", "0.5614233", "0.56098473", "0.55989397", "0.55785215", "0.55740404", "0.5560293", "0.5554899", "0.5535431", "0.5532688", "0.5528669", "0.5528214", "0.55275553", "0.55139744", "0.55043364", "0.54911995", "0.54760396", "0.5476013", "0.5471227", "0.54691976", "0.5467921", "0.5457085", "0.54437745", "0.54429203", "0.5440572", "0.54375106", "0.542282", "0.5417385", "0.54072374", "0.5398557", "0.5384576", "0.5376365", "0.5376365", "0.5376365", "0.5376365", "0.537409", "0.5371678", "0.53671855", "0.5359974", "0.53520834", "0.53518623", "0.53327674", "0.533233", "0.5324128", "0.5320146", "0.5316528", "0.53028196", "0.5297905", "0.5288925", "0.52836144", "0.52821887", "0.5277055", "0.52549803", "0.52540296", "0.52510244", "0.5241821", "0.52364427", "0.52364427", "0.52364427", "0.52364427", "0.5235432", "0.5234141", "0.52322805", "0.5230348", "0.52267843", "0.52265644", "0.52210724", "0.5220437", "0.5220437", "0.5220394", "0.5218017", "0.52160805", "0.5205386", "0.519988", "0.5187666", "0.5187196", "0.51850605", "0.5184061", "0.5180063", "0.51791865", "0.5178502", "0.5176404", "0.5173777", "0.51735574" ]
0.0
-1
it get clean object with no default values
toJSON() { let props = this.$obj; let res = super.toJSON(); return JSON.parse(JSON.stringify({ ...res, type: props.type_, identity: props.identity_, required: props.required_, indexed: props.indexed_, relation: props.relation ? props.relation.toJSON() : undefined, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clean() {\n let clone = {};\n Object.assign(clone, this);\n\n for (const i in clone) {\n if (typeof clone[i] === 'undefined') {\n delete clone[i];\n }\n }\n\n return clone;\n }", "function clean(obj) {\n var res = {};\n\n _underscoreWrapper.default.each(obj, function (value, key) {\n if (!_underscoreWrapper.default.isNull(value)) {\n res[key] = value;\n }\n });\n\n return res;\n}", "function clean_userObj() {\n userObj.id = undefined;\n userObj.email = undefined;\n userObj.nick = undefined;\n userObj.name = undefined;\n userObj.role = undefined;\n}", "function manipulationBareObj( value ) {\n\treturn value;\n}", "clean_object(val) {\n if (!this.is_object(val)) return val;\n return this.lower_props(this.trim_values(val));\n }", "function cleanObject(obj) {\n const result = Object.assign(obj)\n for (const propName in result) {\n if (result[propName] === null || result[propName] === undefined) {\n delete result[propName];\n }\n }\n\n return result\n}", "function clean(t) {\n for (const prop in t) {\n if (t[prop] === undefined) {\n delete t[prop];\n }\n }\n return t;\n}", "function cleanObj(obj) {\n return Object.keys(obj).reduce(function (newObj, key) {\n if (typeof obj[key] !== 'undefined') {\n newObj[key] = obj[key];\n }\n\n return newObj;\n }, {});\n}", "static cleanObject(obj) {\n const validObj = (o) =>\n (Object.keys(o).length || (Array.isArray(o) && o.length)) && o;\n const itemToBool = (item) => {\n return typeof item !== 'object' || item === null\n ? item\n : // eslint-disable-next-line no-use-before-define\n validObj(clean(item));\n };\n\n const clean = (o) =>\n validObj(\n Array.isArray(o)\n ? o.map(itemToBool).filter(Boolean)\n : Object.entries(o).reduce((a, [key, val]) => {\n const newVal = itemToBool(val);\n if (\n // Here is the magic check null, undefined and type change (=> undefined recursively)\n newVal !== undefined &&\n newVal !== null &&\n typeof val === typeof newVal\n )\n a[key] = newVal;\n return a;\n }, {})\n );\n\n return clean(obj);\n }", "cleanup() {\n this.lastRead = {};\n this.defaults = {};\n this.overrides = {};\n }", "function clean(obj) {\n for (var propName in obj) { \n if (obj[propName] === null || obj[propName] === undefined || obj[propName] === \"\") {\n delete obj[propName];\n }\n }\n }", "function clean(obj) {\n for (var propName in obj) { \n if (obj[propName] === null || obj[propName] === undefined || obj[propName] === \"\") {\n delete obj[propName];\n }\n }\n }", "function clean_obj(obj) {\n Object.keys(obj).forEach(function(key) {\n if (obj[key].length) obj[key] = obj[key][0];\n });\n}", "function makeEmptyObject() {\n return new Object();\n}", "function clearData(obj) {\n var newObj = {};\n Object.getOwnPropertyNames(obj).forEach(function (name) {\n if (obj[name]) {\n newObj[name] = obj[name];\n }\n });\n return newObj;\n}", "truncateObject(obj) {\n\t\tconst visibleObject = this.copyObject(obj);\n\t\tconst setObject = (obj) => {\n\t\t\tObject.keys(obj).forEach(key => {\n\t\t\t\tif(key.charAt(0) === '_') delete obj[key];\n\t\t\t\tif (typeof obj[key] === 'object' && obj[key] !== null) {\n\t\t\t\t\tsetObject(obj[key]);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tsetObject(visibleObject);\n\t\treturn visibleObject;\n\t}", "function Object$empty() {\n return {};\n }", "function Object$empty() {\n return {};\n }", "function Common_removeEmptyStrings(obj){\n\t switch(typeof obj){\n\t\t case 'object':\n\t\t\t for(let key in obj){\n\t\t\t\t obj[key] = Common_removeEmptyStrings(obj[key]);\n\t\t\t }\n\t\t\tbreak;\n\t\t case 'string':\n\t\t\t if(obj.length <= 0){\n\t\t\t\t obj = null;\n\t\t\t }\n\t\t\tbreak;\n\t }\n\n\t return obj;\n}", "cleanedItem(item) {\n var newItem = JSON.parse(JSON.stringify(item));\n for (var propName in newItem) {\n if (newItem[propName] == null || !newItem[propName] || newItem[propName] == 0 || newItem[propName] == \"\") {\n delete newItem[propName];\n }\n }\n\n return newItem;\n }", "function normalizeToObject(doc, ret) {\n delete ret.__v;\n}", "function ObjectCleanerMangler() {\n\t}", "static itemCleaner(dirtyItem) {\n const baseModel = {\n id: dirtyItem.id,\n title: dirtyItem.title,\n price: {\n currency: dirtyItem.currency_id,\n amount: dirtyItem.price,\n decimals: parseFloat((dirtyItem.price % 1).toFixed(2)), // Precisa y parsea\n },\n picture: dirtyItem.thumbnail,\n condition: dirtyItem.condition,\n free_shipping: dirtyItem.shipping.free_shipping\n };\n\n if (dirtyItem.description !== undefined) baseModel.description = dirtyItem.description;\n if (dirtyItem.pictures !== undefined) baseModel.pictures = dirtyItem.pictures.map(picture => picture.url);\n if (dirtyItem.sold_quantity !== undefined) baseModel.sold_quantity = dirtyItem.sold_quantity;\n\n return baseModel;\n }", "function CleanFields() {\n $scope.Empleados = null;\n $scope.Message = \"\";\n $scope.Empleado = \"\";\n $scope.Empleados = \"\";\n $scope.ClassActive = \"\";\n $scope.SelectedNroDocumento = \"\";\n $scope.SelectedNombre = \"\";\n $scope.SelectedSalarioMensual = \"\";\n $scope.TransaccionesEmpleado = \"\";\n }", "function clean (o) {\n const c = {}\n for (var p in o) {\n if (typeof o[p] !== 'function') {\n c[p] = o[p]\n }\n }\n return c\n}", "function CleanFields() {\n $scope.Message = \"\";\n $scope.TipoIngreso = \"\";\n $scope.TiposIngreso = \"\";\n $scope.ClassActive = \"\";\n $scope.SelectedNombre = \"\";\n $scope.SelectedDependeDeSalario = \"\";\n $scope.SelectedEstado = \"\";\n \n }", "function clezr() {\n\t\t_json = {};\n\t}", "function myFunction(obj) {\n delete obj.country;\n return obj\n}", "function undici () {}", "function cloneCleanedData(obj, noIgnoreResource) {\n if (!angular.isObject(obj) || obj instanceof File) return obj;\n\n var ret;\n if (angular.isArray(obj)) {\n if (!obj.length) return obj;\n ret = [];\n obj.forEach(function(val) {\n if (val === undefined) {\n ret.push(undefined);\n } else {\n val = cloneCleanedData(val);\n if (val !== undefined) ret.push(val);\n }\n });\n // clear out empty arrays\n if (!ret.length) ret = undefined;\n } else {\n if (obj instanceof Date) return obj.toISOString();\n // an Object instance, but is it a resource? Quack!\n if (!noIgnoreResource && obj.$get) return;\n\n ret = {};\n\n angular.forEach(obj, function(val, key) {\n // ignore keys starting with '$'\n if (key[0] === '$') return;\n\n if (val === undefined) {\n ret[key] = undefined;\n } else {\n val = cloneCleanedData(val);\n if (val !== undefined) ret[key] = val;\n }\n });\n }\n\n return ret;\n }", "function emptyDog() {\n return {name: '', imgs: [], age: 0, description: '', gender: '', matchesIds : [], favs : []}\n}", "function obj() {\n return Object.create(null);\n}", "emptyModel() {\n return {\n vnf: \"\",\n version: \"\",\n tenant: {\n name: \"\",\n auth: {\n username: \"\",\n password: \"\",\n url: \"\"\n }\n },\n flavors: [],\n images: [],\n networks: [],\n components: []\n };\n }", "function cleanMeta(obj) {\n delete obj._id;\n delete obj._rev;\n delete obj.docType;\n}", "function removeUndefinedFromObject(obj) {\n return Object.entries(obj).reduce(function (acc, curEntry) {\n var key = curEntry[0],\n val = curEntry[1];\n if (val !== undefined) acc[key] = val;\n return acc;\n }, {});\n }", "function cleanStudent() {\n vm.id = '',\n vm.birthday = '',\n vm.firstName = '',\n vm.secondName = '',\n vm.firstLastName = '',\n vm.secondLastName = '',\n vm.genre = '',\n vm.weight = '',\n vm.height = '',\n vm.nationality = '',\n vm.phone = '',\n vm.email = '',\n vm.attendAcademy = '',\n vm.teacher = '',\n vm.belt = '',\n vm.category = '',\n vm.tournaments = '',\n vm.tournamentsWins = '',\n vm.status = ''\n }", "clean() {\n this.clear();\n }", "cleanFields(obj) {\n\n if (!(this.judgeNotNull(obj) && this.isObj(obj))) {\n return obj\n }\n for (let key in obj) {\n if (this.getType(obj[key]) === 'object') {\n this.cleanFields(obj[key])\n }\n if (!this.judgeNotNull(obj[key])) {\n delete obj[key]\n }\n }\n return obj\n }", "function cleanProperty(value) {\n var type = value.constructor.name;\n if (type === \"Array\") {\n return value.slice(0);\n } else if (type === \"ColorFresnel\") {\n return new ColorFresnel(value.center, value.edge, value.centerBias, value.edgeBias, value.power);\n } else if (type === \"ScalarFresnel\") {\n return new ScalarFresnel(value.center, value.edge, value.centerBias, value.edgeBias, value.power);\n } else {\n // immutable (or unsupported property type)\n return value;\n }\n }", "function remove_falsy_values(obj) {\n var new_obj = {};\n for (var key in obj) {\n if (obj[key]) {\n new_obj[key] = obj[key];\n }\n }\n return new_obj;\n}", "removeEmpty(obj){\n Object.keys(obj).forEach(key => {\n if (obj[key] && typeof obj[key] === 'object'){ \n this.removeEmpty(obj[key]);\n }\n else if (obj[key] == null){\n delete obj[key];\n } \n });\n return obj;\n }", "cleanData () {\n }", "function cleanProfile (){\n self.phoneNumber = null;\n self.email = null;\n self.accountNumber = null;\n self.fullName = null;\n self.typeId = null;\n self.id = null;\n self.typeIdName = null;\n }", "function empty() {\n\treturn Object.create(null);\n}", "function sanitize(o) {\n if (o != null && typeof o === 'object' && !o._sanitized) {\n if (Array.isArray(o)) {\n let a = [];\n Object.defineProperty(a, '_sanitized', { value: true });\n o.forEach(e => a.push(sanitize(e)));\n return a;\n } else if (o.constructor && o.constructor.name === 'model') {\n let s = {};\n Object.defineProperty(s, '_sanitized', { value: true });\n for (const p in o) {\n let v = o[p];\n if (/^\\$/.test(p) || p === 'db' || p === 'opts' || p === 'conn' || p === 'schema' || p === 'collection')\n continue;\n if (typeof v !== 'function')\n s[p] = sanitize(v);\n }\n return s;\n }\n }\n return o;\n}", "function purgeEmptyFields(obj) {\n Object.keys(obj).forEach(key => {\n const val = obj[key];\n if (val === '' || val === false || val === undefined || val === null) {\n delete obj[key];\n }\n });\n return obj;\n}", "function createdefaultObjects() {\n defaultObj = JsonTool.createJsonPath(\"query.bool.filter\");\n defaultObj.from = 0;\n defaultObj.size = ToolsCorpus.pageSize;\n defaultObj.query.bool.filter.bool = JSON.parse(\"{\\\"must\\\":[],\\\"should\\\":[],\\\"must_not\\\":[]}\");\n defaultSmall = JsonTool.cloneJSON(defaultObj);\n}", "function emptyFilters() {\n return {\n stockMin: 0,\n stockMax: Infinity,\n priceMin: 0,\n priceMax: Infinity,\n drink: {\n percentageMin: 0,\n percentageMax: 100\n },\n subCategories: [],\n // Required subcategories\n searches: [],\n organic: false,\n kosher: false,\n notToRefill: false\n };\n}", "removeAll() { this.general = {}; this.timers = {}; this.alarms = {}; this.helpers = {}; this.search = {}; }", "function makeObject(obj){\n\t// console.log(\"ovj=\",obj);\n\t// console.log();\n\ttry{\n\t\tif(obj!=undefined && obj[10]!=undefined && obj[0]!=\"Delete\"){\n\t\t\tvar newObj={};\n\t\t\tnewObj._key=calculate_key(obj);\n\t\t\tnewObj.name=obj[1];\n\t\t\tnewObj.priority=obj[2];\n\t\t\tnewObj.owner_name=obj[3];\n\t\t\tnewObj.owner_number=obj[4];\n\t\t\tnewObj.contact_person=obj[5];\n\t\t\tnewObj.contact_phone=obj[6];\n\t\t\tnewObj.address=obj[7];\n\t\t\tnewObj.location=obj[8];\n\t\t\tnewObj.description=obj[9];\n\t\t\tnewObj.facebookurl=obj[10];\n\t\t\tnewObj.fbid=calculate_key(obj);\n\t\t\tnewObj.genre=obj[11];\n\t\t\tnewObj.profile_type=\"Party Spot\";\n\t\t\tnewObj.time=obj[13];\n\t\t\tnewObj.price=obj[14];\n\t\t\tnewObj.min=obj[14];\n\t\t\tnewObj.max=obj[14];\n\t\t\tnewObj.more=obj[15];\n\t\t\tnewObj.createdat=new Date().getTime();\n\t\t\tnewObj.rsm= {\n\t\t\t\t\"email\": \"[email protected]\",\n\t\t\t\t\"name\": \"Tarun\",\n\t\t\t\t\"phone\": \"+91 97 1197 1244\"\n\t\t\t};\n\n\n\t\t\treturn newObj;\n\t\t}\n\t\treturn undefined;\n\t}\n\tcatch(err){\n\t\tconsole.log(\"eror=\",err);\n\t\treturn undefined;\n\t}\n\treturn undefined;\n}", "function clean(obj,refs = []) {\n if(!obj) { return obj; }\n if(Immutable.isImmutable(obj)) { return obj; }\n if(typeof obj === \"function\") {\n return \"[Function]\";\n }\n if(typeof obj === \"object\") {\n if(_.includes(refs,obj)) {\n return \"[Circular]\";\n }\n refs = refs.concat([obj]);\n\n if(_.isArray(obj)) {\n return obj.map((item,i)=>{\n return clean(item,refs);\n })\n }\n\n var cleaned = {};\n _.forEach(obj,(val,key)=>{\n cleaned[key] = clean(val,refs);\n });\n return cleaned;\n }\n\n return obj;\n}", "function makeFilter(obj) {\n\tobj.prog = null;\n\tobj.init = filterInit;\n\tobj.destroy = filterDestroy;\n\tobj.render = filterRender;\n\treturn obj;\n}", "function ConfigPessoa(obj){\n\tobj.mutacao = new Array();\n\tobj.qualidade=null;\n\tobj.aptidao=null;\n\tobj.soma=null;\n\tobj.stexto=null;\n\tobj.nivel=Nivel;\n\treturn obj;\n}", "function Negocio(nombre,direccion,latitud,longitud) {\n \tvar obj = {};\n\tobj.nombre = nombre;\n\tobj.direccion = direccion;\n\tobj.latitud = latitud;\n\tobj.longitud = longitud;\n\treturn obj;\n}", "function cleanObject(obj) {\n Object.keys(obj).forEach(function (key) {\n delete obj[key];\n });\n }", "function clean(data) {\n var rt\n if (utilx.isObject(data)) {\n rt = {}\n Object.keys(data).forEach(function(k) {\n var n = data[k]\n var stats = n.__stats\n if (stats === STATS.LEFT || stats === STATS.DEFINE) {\n if (n.__origin) {\n data[k] = n.__origin\n } else {\n return\n }\n }\n innerClean(data, k, rt)\n })\n return rt\n }\n\n if (utilx.isArray(data)) {\n rt = []\n data.forEach(function(n, k) {\n innerClean(data, k, rt)\n })\n return rt\n }\n}", "static filter(data) {\n const copy = { ...data };\n copy.a = copy.newA;\n delete copy['newA'];\n return copy;\n }", "function toEmptyObject() {\n return function () {\n return {};\n };\n}", "makeEmptyCategory() {\n return {\n parent_id: 1,\n is_visible: false,\n name: '',\n description: '',\n picture_filename: '',\n ordering: 0,\n };\n }", "function Object$zero() {\n return {};\n }", "function Object$zero() {\n return {};\n }", "function cleanCopy(t) {\n const r = { ...t };\n return clean(r);\n}", "function cleanJson(obj) {\n return JSON.parse(angular.toJson(obj));\n }", "emptyCategory() {\n this.valuesObj.primaryCategoryValue = '';\n this.valuesObj.primaryCategoryName = '';\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n this.secondaryCategoryOptions = [];\n this.primaryCategoryOptions = [];\n this.tertiaryCategoryOptions = [];\n this.isSecondaryCategoryDisabled = true;\n this.isPrimaryCategoryDisabled = true;\n this.isTertiaryCategoryDisabled = true;\n this.isSpinnerShow = false;\n }", "static stripUndefinedProperties(options) {\n return Object.keys(options).reduce((object, key) => {\n if (options[key] !== undefined) {\n object[key] = options[key];\n }\n return object;\n }, {});\n }", "clear() {\n this._objects = {};\n }", "destroy() {\n this.fontSizeIn = undefined;\n this.boldIn = undefined;\n this.italicIn = undefined;\n this.fontFamilyIn = undefined;\n this.fontColorIn = undefined;\n this.underlineIn = undefined;\n this.strikeThroughIn = undefined;\n this.baselineAlignmentIn = undefined;\n this.highlightColorIn = undefined;\n this.selection = undefined;\n this.styleName = undefined;\n this.bidi = undefined;\n this.bdo = undefined;\n this.boldBidi = undefined;\n this.italicBidi = undefined;\n this.fontFamilyBidi = undefined;\n this.fontSizeBidi = undefined;\n }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "trim_values(obj, filter = null) {\n return this.walk_values(obj, filter, function(val) {\n return typeof(val) === \"string\" ? val.replace(/^\\s+|\\s+$/g, '') : val;\n }); \n }", "function cleanAcademy() {\n vm.name = '',\n vm.address = '',\n vm.manager = '',\n vm.competitors = '',\n vm.phone = '',\n vm.email = ''\n }", "clearValues(){\n\t\t\tthis.addedName = '';\n\t\t\tthis.addedPrice = 0;\n\t\t\tthis.commission = 0;\n\t\t\tthis.totalContractValue = 0;\n\t\t\t\n\t\t}", "function clean()\t{\n\tmyName = null;\n\tmyType = null;\n\tmyMin = null;\n\tmyMax = null;\n\twhile (items.length > 0)\t{\n\t\tthis.patcher.remove(items.shift());\n\t}\n}", "function Settings(){this.values=Object.create(null);}", "function myFunction(obj) {\n let ret = {};\n Object.keys(obj).forEach( key => {\n if (obj[key] === '' || obj[key] === ' ' ) {\n console.log(obj[key]);\n ret[key] = null;\n } else {\n ret[key] = obj[key];\n }\n })\n return ret\n}", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "static get sanitize() {\n return {}\n }", "function initTodoObj() {\n return {\n \"message\":\"\",\n \"complete\":false\n };\n }", "static getEmptyCfgObj() {\n return new CfgObject();\n }", "function Clean(){\n\n}", "reset() {\n this.data = {};\n this.type = null;\n }", "_cleanAndSetData() {\n const propertySearchLocationPath = 'page.attributes.propertySearchLocation';\n const propertySearchLocation = get(this.digitalData, propertySearchLocationPath);\n if (propertySearchLocation === undefined) {\n this._set(propertySearchLocationPath, '');\n }\n\n const propertySearchDateInfoPath = 'page.attributes.propertySearchDateInfo';\n const propertySearchDateInfo = get(this.digitalData, propertySearchDateInfoPath);\n if (propertySearchDateInfo === undefined) {\n this._set(propertySearchDateInfoPath, '00:00:00:00');\n }\n\n const productIDPath = 'product[0].productInfo.productID';\n const productID = get(this.digitalData, productIDPath);\n if (productID === undefined) {\n this._set('product', [{ productInfo: { productId: '' } }]);\n }\n\n window.digitalData = this.digitalData;\n }", "function instantiatePlainObject() {\n return {};\n }", "function MakeDictionary(obj) {\n\t obj.__ = undefined;\n\t delete obj.__;\n\t return obj;\n\t }", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function getFilters() {\n let filters = {};\n filters['marca'] = document.getElementById('marca').value;\n filters['year'] = document.getElementById('year').value;\n filters['minimo'] = document.getElementById('minimo').value;\n filters['maximo'] = document.getElementById('maximo').value;\n filters['portas'] = document.getElementById('portas').value;\n filters['transmissao'] = document.getElementById('transmissao').value;\n filters['cor'] = document.getElementById('cor').value;\n\n for(filter in filters) {\n if ( filters[filter] == '') {\n delete filters[filter];\n }\n }\n\n return filters;\n}", "static getDefaultObject() {\n return {\n name : `name_${Math.round(Math.random() * 999999)}`,\n creation_date : `2019-10`,\n location : `location_${Math.round(Math.random() * 999999)}`,\n pvp_type : `pvp_type_${Math.round(Math.random() * 999999)}`,\n world_quest_titles : `world_quest_titles_${Math.round(Math.random() * 999999)}`,\n battleye_status : `battleye_status_${Math.round(Math.random() * 999999)}`,\n transfer_type : 'transfer_type',\n game_world_type : 'game_world_type',\n online_record : {\n players : Math.round(Math.random() * 999999),\n date : {\n date : '2017-12-03 19:10:30.000000',\n timezone_type : 2,\n timezone : 'CET'\n }\n },\n }\n }", "value(obj){\n return obj == null ? null : obj.name || obj.full_name || obj;\n }", "function fillIn(obj, var_defaults){\n\t forEach(slice(arguments, 1), function(base){\n\t forOwn(base, function(val, key){\n\t if (obj[key] == null) {\n\t obj[key] = val;\n\t }\n\t });\n\t });\n\t return obj;\n\t }", "function constructFilter(data) {\n var f = angular.copy(data);\n var ret = angular.copy(f);\n angular.forEach(Object.keys(f), function (key, value) {\n //deletes null value fields \n if (ret[key] == null || ret[key] == undefined || ret[key] == '') {\n delete ret[key];\n }\n //if from date and fromdate != null apply stringify policy by timezone\n if (key == 'FromDate' && ret[key] != undefined) {\n var addHours = -1 * new Date().getTimezoneOffset() / 60;\n var zax = moment(ret[key]).startOf('hour').add(addHours, 'hours');\n ret[key] = zax.toISOString();\n }\n })\n return ret;\n }", "function getCleansedConfig() {\n\t\tvar clonedSite = $.extend(true, {}, site);\n\t\trecurse(clonedSite, deleteBlacklistedProperties);\n\t\treturn clonedSite;\n\t}", "function clean() {\n return del(\n CLEAN\n );\n}", "function filterNullInObject(object) {\n let newObject = {};\n\n let keys = Object.keys(object);\n\n for (var key of keys) {\n if (object[key] || object[key] == false) {\n newObject[key] = object[key];\n }\n }\n\n return newObject;\n}", "function MakeDictionary(obj) {\r\n obj.__ = undefined;\r\n delete obj.__;\r\n return obj;\r\n }", "async function removeEmptyKeys(obj) {\n\tObject.keys(obj).forEach((key) => {\n\t\tif (obj[key].length === 0) {\n\t\t\tdelete obj[key];\n\t\t}\n\t\tif (obj === 'Falso') {\n\t\t\tdelete obj[key];\n\t\t}\n\t});\n\treturn obj;\n}" ]
[ "0.69558144", "0.6689635", "0.646938", "0.62628704", "0.6232172", "0.61731505", "0.61313593", "0.6113121", "0.6072644", "0.6006736", "0.59840065", "0.59840065", "0.59661084", "0.59422296", "0.59016067", "0.58741903", "0.58706516", "0.58706516", "0.5860293", "0.5838698", "0.58355033", "0.5825728", "0.5818295", "0.581611", "0.57995135", "0.5737337", "0.57268214", "0.56944233", "0.5693835", "0.5677311", "0.5671658", "0.5665327", "0.56528383", "0.5652356", "0.56267637", "0.5624254", "0.5620287", "0.56136894", "0.5610881", "0.55996776", "0.5598597", "0.5595491", "0.55930537", "0.5591885", "0.55778223", "0.5573017", "0.5555658", "0.5543422", "0.5536382", "0.5534721", "0.55330604", "0.5524634", "0.55197555", "0.5512379", "0.5511319", "0.5510328", "0.55094874", "0.5503784", "0.54892915", "0.5480419", "0.5480419", "0.5479891", "0.5474334", "0.5472195", "0.5470004", "0.5468628", "0.54553837", "0.5441227", "0.5441227", "0.5441227", "0.54361886", "0.54287034", "0.54280937", "0.54242474", "0.5418022", "0.5415373", "0.54121333", "0.5411762", "0.5409515", "0.53943354", "0.5385976", "0.537897", "0.5366012", "0.5362047", "0.53608656", "0.5349328", "0.5349328", "0.5349328", "0.5349328", "0.5349328", "0.5349328", "0.533439", "0.5329546", "0.53230673", "0.53063923", "0.53055537", "0.53002554", "0.52997714", "0.52932936", "0.5285876", "0.5284172" ]
0.0
-1
extends alert functionality. Also sets global is_submit to false.
function inform( title, message, focusId ){ std_dlg .dialog( "option", "width", "400px" ) .dialog( "option", "title", title ) .dialog( "option", "buttons",[ { text: prompts.close, click: function(){ $(this).dialog("close"); is_submit = false; if(focusId) $("#"+focusId).focus(); } } ]) .html( message ) .dialog("open"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitAlert() {\n alert('Thank you. The form information has been received.')\n}", "function alert( title, message, type, tag, unescaped ) {\n var element = $( \"#alert\" ).clone();\n\n element.prop( \"id\", \"\" );\n if ( unescaped ) {\n element.find( \".error-title\" ).html( title );\n element.find( \".error-text\" ).html( message );\n } else {\n element.find( \".error-title\" ).text( title );\n element.find( \".error-text\" ).text( message );\n }\n\n if ( typeof( tag ) !== \"undefined\" ) element.addClass( tag );\n element.addClass( \"alert-\" + type );\n element.removeClass( \"hidden\" );\n $( \"#alert\" ).before( element );\n }", "confirmationAlert(title, message, positiveText, negativeText, positiveOnPress, negativeOnPress, cancelableFlag){\n Alert.alert(\n title,\n message,\n [\n {text: negativeText, onPress: negativeOnPress, style: 'cancel',},\n {text: positiveText, onPress: positiveOnPress, style : 'default'},\n ],\n {cancelable: cancelableFlag},\n ); \n }", "alert(title, message, positiveText, positiveOnPress, cancelableFlag){\n Alert.alert(title, message,[{text: positiveText, onPress: positiveOnPress},], {cancelable: cancelableFlag}); \n }", "function bsAlert(){return _callWithEmphasis(this, oj.div, 'alert', 'info', arguments)}", "function consume_alert() { //to override normal alert behavior\n if (_alert) return;\n var _alert = window.alert;\n window.alert = function(message) {\n $.pnotify({\n text: message\n });\n };\n}", "function lb_alert(type, message) {\n bs_alert(\".featherlight .alert-box\", type, message)\n}", "function posterror() { alert( \"There was an error. TODO: Prompt to resubmit here.\" ); }", "function dt_alert(type, message) {\n bs_alert(\".top-alert-box\", type, message)\n}", "function customAlert(title, content) {\n $.alert({\n title: title,\n content: content,\n theme: 'black',\n animation: 'left',\n closeAnimation: 'right',\n icon: 'fa fa-warning',\n keyboardEnabled: true,\n confirm: function() {\n // $.alert('Confirmed!'); // shorthand.\n }\n });\n\n}", "function setAlert(){\n if (comprobarFormulario()) {\n $('<form>')\n .addClass('pre-form')\n .append(createInput(INTIT, 'text', 'Titulo del boton'))\n .append(createInput(INCONT, 'text', 'Contenido del alert'))\n .append(inputBotones(click))\n .appendTo('body');\n }\n\n /**\n * Funcion que realiza la craeción del alert.\n * @param {Event} e Evento que ha disparado esta accion.\n */\n function click(e) {\n e.preventDefault();\n var contenido = $('#'+INCONT).val();\n var titulo = $('#'+INTIT).val();\n if (titulo && contenido) {\n divDraggable()\n .append(\n $('<button>')\n .html(titulo)\n .data('data', contenido)\n .on('click', (e)=>{\n alert($(e.target).data('data'));\n })\n )\n .append(botonEliminar())\n .appendTo('.principal');\n $(e.target).parents('form').remove();\n } else {\n alert('Rellene el campo de \"Titulo\" y \"Contenido\" o pulse \"Cancelar\" para salir.');\n }\n }\n}", "function alerting(){\n alert('ERROR: Please overwrite existing text before saving!');\n location.reload();\n }", "function wl_alert( obj, message, mode ) {\n\n\t\tmode = (mode) ? mode : 'show';\n\t\tif( mode == 'show' ) {\n\n\t\t\tif( obj.next().hasClass('wpcf7-not-valid-tip') === false ) {\n\t\t\t\tobj.after( '<span role=\"alert\" class=\"wpcf7-not-valid-tip\" style=\"display:none\">' + message + '</span>' );\n\t\t\t\tobj.next().fadeIn('slow');\n\t\t\t} else {\n\t\t\t\tif( obj.parent().find('.wpcf7-not-valid-tip').length > 0 ) {\n\t\t\t\t\tobj.parent().find('.wpcf7-not-valid-tip').remove();\n\t\t\t\t\tobj.after( '<span role=\"alert\" class=\"wpcf7-not-valid-tip\" style=\"display:none\">' + message + '</span>' );\n\t\t\t\t\tobj.next().fadeIn('slow');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif( obj.parent().find('.wpcf7-not-valid-tip').length > 0 ) {\n\t\t\t\tobj.parent().find('.wpcf7-not-valid-tip').fadeOut('slow');\n\t\t\t}\n\t\t}\n\t}", "function alertInit(alertType, alertTxt) {\n alertTxt = (typeof alertTxt === 'undefined') ? '...' : alertTxt;\n $(\"#formAlert\").html(''); //clear\n\n var txtAlert = '<div class=\"alert alert-dismissible\" role=\"alert\" >' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<span aria-hidden=\"true\">&times;</span>' +\n '</button>' +\n '<span class=\"txtAlert\"></span>' +\n '</div>';\n $(\"#formAlert\").html(txtAlert);\n\n if (alertType === 'success') {\n $(\"#formAlert .alert\").addClass(\"alert-success\");\n }\n else if (alertType === 'warning') {\n $(\"#formAlert .alert\").addClass(\"alert-warning\");\n }\n else if (alertType === 'info') {\n $(\"#formAlert .alert\").addClass(\"alert-info\");\n }\n else if (alertType === 'danger') {\n $(\"#formAlert .alert\").addClass(\"alert-danger\");\n }\n\n $(\"#formAlert span.txtAlert\").html(alertTxt);\n\n }", "submit(e) {\n e.preventDefault()\n confirmAlert({\n title: 'Confirm to update',\n message: 'Are you sure you want to update this dish?',\n buttons: [\n {\n label: 'Yes',\n onClick: () => this.update()\n },\n {\n label: 'No'\n }\n ]\n })\n }", "confirmationAlert(title, message, positiveText, negativeText, positiveOnPress, cancelableFlag){\n confirmationAlert(title, message, positiveText, negativeText, positiveOnPress, () =>{console.log('Negative Pressed')}, cancelableFlag)\n }", "alert(title, message, positiveText){\n alert(title, message, positiveText, () =>{console.log('Possitive Pressed')}, true); \n }", "function confirmationAlertYesOrNo(id_alert, message, id_form, fonction_execution) {\n\n // -- Annuler le time out actuel -- //\n clearTimeout(function_setTimeout);\n\n // -- Mise à jour de id_element -- //\n id_alert = (!id_alert) ? 'appAlert'\n : id_alert;\n\n // -- Initialisation de la réponse -- //\n $Confirmation_message_box = false;\n\n // -- Afficher l'alert -- //\n $('#' + id_alert).html(\n\n '<div id=\"appAlert_id\" class=\"mmalert alert alert-secondary alert-dismissible fade show\" role=\"alert\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<span aria-hidden=\"true\">&times;</span>' +\n '</button>' +\n '<div class=\"row\">' +\n '<div class=\"col-lg-12\">' +\n '<div class=\"float-left\">' +\n '<b>Information</b><br/>' +\n ((!message) ? 'Confirm action'\n : message) +\n '</div>' +\n '<div class=\"float-right\">' +\n '<button id=\"alert_message_question_bouton_non\" type=\"button\" class=\"btn btn-sm btn-default bg-white\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<i class=\"fa fa-remove\"></i> ' + 'No' +\n '</button>' +\n '<button id=\"alert_message_question_bouton_oui\" type=\"button\" class=\"btn btn-sm btn-success\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<i class=\"fa fa-check\"></i> ' + 'Yes' +\n '</button>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>'\n );\n\n // -- Annuler tous les evenement précédement chargé -- //\n $('#alert_message_question_bouton_oui').off('click');\n $('#alert_message_question_bouton_non').off('click');\n $('#appAlert_id').off('closed.bs.alert');\n\n // -- Définir les nouveaux evenements -- //\n // -- Comportement du bouton Oui -- //\n $(\"#alert_message_question_bouton_oui\").on('click',\n function () {\n // -- Fermer le message box -- //\n $('#appAlert_id').alert('close');\n // -- Mise à jour de la réponse -- //\n $Confirmation_message_box = true;\n }\n );\n // -- Comportement du bouton Non -- //\n $(\"#alert_message_question_bouton_non\").on('click',\n function () {\n // -- Fermer le message box -- //\n $('#appAlert_id').alert('close');\n // -- Mise à jour de la réponse -- //\n $Confirmation_message_box = false;\n }\n );\n // -- Méthode quand le message box se fermer -- //\n $('#appAlert_id').on('closed.bs.alert',\n function () {\n // -- Activer/Desactiver formulaire -- //\n enableOrDisableForm(id_form, false);\n\n // -- Si la réponse est non -- //\n if (!$Confirmation_message_box) {\n return false;\n }\n\n // -- Si l'id est passé -- //\n if (id_form) {\n $(\"#\" + id_form).submit();\n }\n // -- Executer la fonction -- //\n else {\n fonction_execution();\n }\n\n // -- Initialisation de la réponse -- //\n $Confirmation_message_box = false;\n }\n );\n\n // -- Activer/Desactiver formulaire -- //\n enableOrDisableForm(id_form, true);\n\n // -- Ne pas fermer si la valeur est -1 -- //\n if ($DureeVisibiliteMessageBox > 0) {\n // -- Supprimer l'alert après un temps défini -- //\n function_setTimeout =\n setTimeout(\n function () {\n // -- Fermer l'alert -- //\n $('#appAlert_id').alert('close');\n },\n $DureeVisibiliteMessageBox\n );\n }\n\n}", "submitSave() {\n confirmAlert({\n title: 'Confirm To Save',\n message: 'Are you sure you want to do this?',\n buttons: [\n {\n label: 'Yes',\n onClick: () => this.saveData()\n },\n {\n label: 'No',\n onClick: () => { }\n }\n ],\n closeOnEscape: true,\n closeOnClickOutside: true\n });\n }", "function resALert() {\n alert(\"The form has been reset. Please try again.\");\n}", "confirmationAlert(title, message, positiveOnPress, cancelableFlag){\n confirmationAlert(title, message, \"OK\", \"Cancel\", positiveOnPress, () =>{console.log('Negative Pressed')}, cancelableFlag)\n }", "function set_alertbtn() {\r\n\r\n j$('.alert_del_btn').click(function () {\r\n\r\n\r\n j$(this).parents('div[class^=\"alert\"]').fadeOut(500);\r\n\r\n });\r\n\r\n j$('.woocommerce-error:before').click(function () {\r\n\r\n\r\n j$(this).parents('.woocommerce-error').fadeOut(500);\r\n\r\n });\r\n\r\n}", "function ShowAlertMsg(msgString, returnAction, winURL, modalFormat, newWinFormat, bArr, PickerVals, cGif)\n{\n\tgeneralErrorCallType = \"alert\";\n\tif (isPostBack && isPostBack== true){\n\t\tsetVars(msgString, returnAction, winURL, modalFormat, newWinFormat, bArr, PickerVals, cGif);\n\t\tTurnOnStyle(\"eTag\");\n\t\tisPostBack = false;\n\t}else{\n\t\tvar currentVars = getVars();\n\t\tif (currentVars){\n\t\t\tif(typeof(msgString) == \"undefined\")\n\n\t\t\t{\n\t\t\t\tmsgString = currentVars[0];\n\t\t\t\treturnAction = currentVars[1];\n\t\t\t\twinURL = currentVars[2];\n\t\t\t\tmodalFormat = currentVars[3],\n\t\t\t\tnewWinFormat = currentVars[4],\n\t\t\t\tbArr = currentVars[5];\n\t\t\t\tPickerVals = currentVars[6];\n\t\t\t\tcGif = currentVars[7];\n\t\t\t}\t\t\n\t\t}\n\t\tcurrentVars = null;\n\t\tconfObj = new UserMsgObject(msgString, returnAction, winURL, modalFormat, newWinFormat, bArr, PickerVals, cGif);\n\t\tconfObj.OpenModalWin(false);\n\t}\t\t\n\t}", "function okAlertDialog () {\n\terrorspan\n\t}", "function onAlertDismiss() {\r\n\t\t\t// do nothing\r\n\t\t}", "_dismissMessage($alert) {\n $alert.addClass('dismissed');\n $alert.one('trend', () => {\n $alert.remove();\n });\n }", "function alertDismissed() {\n // do something\n }", "function create_alert(query) {\n var email = get_cookie('dd-email');\n if(!email) {\n show_login_register(query);\n }\n else {\n add_alert(email, query);\n }\n }", "function _alert(type, mesg){\n var pop = \n $(\"<div class='alert alert-dismissible alert-\"+type+\" fade in' role='alert'>\"+\n \"<button type='button' class='close' data-dismiss='alert'>&times;</button>\"+\n mesg +\n \"</div>\");\n $(document.body).append(pop);\n pop.alert();\n if(type==='success'){\n window.setTimeout(function(){\n pop.alert('close');\n }, 1500);\n }\n }", "function modernAlert(e=\"\",t={},n){let o=document.getElementById(\"_modernAlert\");o&&0!=o.length&&o.remove();const r=\"div\",d={minHeight:\"80px\",minWidth:\"100px\",maxHeight:\"500px\",maxWidth:\"500px\",margin:\"-207px 0 0 -57px\",padding:\"10px\",backgroundColor:\"#f9f9f9\",borderRadius:\"5px\",boxShadow:\"1px 1px 2px 1px rgba(0, 0, 0, 0.4), -1px -1px 2px 1px rgba(0, 0, 0, 0.4)\",fontFamily:\"Tahoma\",fontSize:\"12pt\",textAlign:\"center\",position:\"fixed\",top:\"50%\",left:\"50%\",zIndex:\"99999\"},i=\"button\",a={minHeight:\"30px\",minWidth:\"60px\",padding:\"5px\",fontFamily:\"Tahoma\",fontSize:\"9pt\",textAlign:\"center\"},l=\"div\",p={height:\"100%\",width:\"100%\",margin:\"0\",padding:\"0\",backgroundColor:\"rgba(0, 0, 0, 0.2)\",position:\"fixed\",top:\"0\",left:\"0\",zIndex:\"99998\"};let m=document.createElement(l);Object.assign(m.style,p),document.body.appendChild(m).id=\"_modernAlertShadowScreen\";let u=document.getElementById(\"_modernAlertShadowScreen\"),c=document.createElement(r);c.innerHTML=`<p>${e}</p>`,Object.assign(c.style,d),document.body.appendChild(c).id=\"_modernAlert\";let s=document.getElementById(\"_modernAlert\"),x=[];if([\"ok\",\"yesNo\",\"custom\"].includes(t.buttonsLayout)||!t.buttonsLayout)switch(t.buttonsLayout){case\"custom\":t.buttonsStructure.forEach(e=>{x.push({label:e.label,return:e.return})});break;case\"yesNo\":x.push({label:\"Yes\",return:!0}),x.push({label:\"No\",return:!1});break;case\"ok\":default:x.push({label:\"Ok\",return:\"lol\"})}let h={},b=[];x.forEach(e=>{h=document.createElement(i),Object.assign(h.style,a),h.id=\"x\",h.innerHTML=e.label,s.appendChild(h),b.push(new Promise(function(t,n){h.addEventListener(\"click\",function(){u.remove(),s.remove(),t(e.return)})}))}),Promise.race(b).then(e=>{n(e)}),s.style.margin=`-207px 0 0 -${s.offsetWidth/2}px`}", "function SubmitClicked_Exception()\n{\n\tTimeCard.Status = 1;\n\tUpdateClicked_Exception(\"Submitted\");\n}", "function alertHandler(reqres,message,from,token){ //reqres is boolean, message is string, true means response required\n \n\n if (typeof(reqres) !== \"boolean\" || message===\"\"){ //reqres is only true when response is required.\n console.log('alerthandler error! request-response not clear, or message is empty!')\n }\n else{\n if(reqres===true){ \n return callAlert(1,message,token);\n }\n else{\n callAlert(0,message);\n }\n }\n\n function callAlert(type,message,token){ //typeof(type) = number, 0 for show-info, 1 for alert with input\n \n let justAlert = `<div id=\"show-info\">\n <p id=\"info-p\">${message}</p>\n <button id=\"okay-and-nothing\">Okay</button>\n </div>`\n let notJustAlert=`<div id=\"alert-with-input\">\n <p id=\"info-input-p\">${message}</p>\n <button id=\"cancel\" name=\"cancel\" class=\"do-this\">Cancel</button>\n <button id=\"okay\" name = \"okay\"class=\"do-this\">Okay</button>\n </div>` \n if (type === 0 ){ //\n document.querySelector('.back-drop').style.display=\"block\";//className = ('back-drop visibility');\n console.log(document.querySelector('.back-drop').className)\n contentTag.insertAdjacentHTML('afterbegin',justAlert)\n document.getElementById(\"okay-and-nothing\").addEventListener('click',(e)=>{\n document.getElementById('show-info').remove();\n document.querySelector('.back-drop').style.display=\"none\"//className = ('back-drop');\n });\n } \n else{\n var code = token;\n var sender = from;\n document.querySelector('.back-drop').className = ('back-drop visibility');\n \n contentTag.insertAdjacentHTML('afterbegin',notJustAlert);\n document.querySelectorAll('.do-this').forEach(element => { \n element.addEventListener('click', (e)=>{\n var result = e.target.getAttribute('name');\n window[sender](undefined,result,token);\n document.getElementById('alert-with-input').remove();\n document.querySelector('.back-drop').className = ('back-drop')\n \n })\n \n })\n \n } \n } \n\n}", "function removeAlert() {\n $.uikitNotify.remove($alert);\n }", "function registerAlertTips(status, msg) {\n var tips = $(\"#register-tips\");\n\n if (status == 0) {\n tips.removeClass(\"alert-danger\");\n tips.addClass(\"alert-success\");\n }\n else {\n tips.removeClass(\"alert-success\");\n tips.addClass(\"alert-danger\");\n }\n //<button type=\"button\" class=\"close\" data-dismiss=\"alert\">x</button>'\n tips.html(msg);\n\n tips.alert();\n tips.fadeTo(3000, 500).slideUp(500);\n}", "function alertErrorHide(){\r\n\t\terrorAlert.hide();\r\n\t\tworkingAlert.hide();\r\n\t}", "function wgm_alert(msg, status) {\n\t$('body').append(alert_html);\n\tdiv = '.wg_alert';\n\t$(div).find('.wg_alert-msg').addClass(status);\n\t$(div).find('.wg_alert-msg').html(msg);\n\t$(div).modal('show');\n\t$(div).on('hidden', function () {\n\t\t$(div).remove();\n });\n}", "function alertDismissed() {\n\t\t\t// do something\n\t\t}", "function catchSubmit(){\n\t\t\t// ensure that the submit button is enabled (if the page was refreshed when the button was disabled, some browsers remember it's disabled state)\n\t\t\tobjForm.find('input[type=submit]').removeAttr('disabled');\n\n\t\t\t// check if we are validating/submutting the form via ajax\n\t\t\tif((typeof formValidate == 'boolean') && (formValidate === true) && (typeof strFormID == 'string') && $.isArray(ruleList) && (ruleList.length > 0)){\n\t\t\t\t// we need to carry out Javascript form validation\n\n\t\t\t\t/**\n\t\t\t\t * Catch the submission of the form\n\t\t\t\t */\n\t\t\t\tobjForm.off('submit');\t// remove the current onsubmit event (if one exists)\n\t\t\t\tobjForm.on('submit', function(){\n\t\t\t\t\tvar errorList = {};\t// contains a list of errors\n\n\t\t\t\t\tif(hasErrorBox){\n\t\t\t\t\t\terrorBox.empty();\n\t\t\t\t\t}\n\t\t\t\t\tobjForm.find('input, textarea, select').removeClass(errorClass);\n\n\t\t\t\t\t// loop through the validation rules and check the input fields\n\t\t\t\t\t$.each(ruleList, function(i, e){\n\t\t\t\t\t\tvar objInput = objForm.find('input[name=' + e.field + '], textarea[name=' + e.field + '], select[name=' + e.field + ']'),\n\t\t\t\t\t\t\tbolIsSet = ((objInput.length > 0) && ($.trim(objInput.val()) != ''));\n\n\t\t\t\t\t\t$.each(e.rules.split('|'), function(i, rule){\n\t\t\t\t\t\t\trule = rule.toLowerCase();\n\t\t\t\t\t\t\tswitch(rule){\n\t\t\t\t\t\t\t\tcase 'required':\n\t\t\t\t\t\t\t\t\tif(!bolIsSet){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_required', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'valid_email':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isEmail(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_email', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'valid_emails':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isEmails(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_email', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'alpha':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isAlpha(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_alpha', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'alpha_numeric':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isAlphaNumeric(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_alpha_numeric', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'alpha_dash':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isAlphaDash(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_alpha_dash', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'numeric':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isNumeric(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_numeric', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isInt(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_integer', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'valid_ip':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isIP(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_ip', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tvar matches = null;\n\t\t\t\t\t\t\t\t\tif((matches = rule.match(new RegExp(/^(min|max|exact)_length\\[([\\d]+)\\]$/))) !== null){\n\t\t\t\t\t\t\t\t\t\tif(bolIsSet && (((matches[1] == 'min') && (objInput.val().length < matches[2])) || ((matches[1] == 'max') && (objInput.val().length > matches[2])) || ((matches[1] == 'exact') && (objInput.val().length != matches[2])))){\n\t\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_length', e.label, ((matches[1] == 'min') ? 'more than' : ((matches[1] == 'max') ? 'less than' : 'equal too')), matches[2]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else if((matches = rule.match(new RegExp(/^(greater|less)_than\\[([\\d]+)\\]$/))) !== null){\n\t\t\t\t\t\t\t\t\t\tif(bolIsSet && (!validation.isNumeric(objInput.val()) || (((matches[1] == 'greater') && (parseInt(objInput.val()) < matches[2])) || ((matches[1] == 'less') && (parseInt(objInput.val()) > matches[2]))))){\n\t\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_numeric_value', e.label, ((matches[1] == 'greater') ? 'greater than' : 'less than'), matches[2]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else if((matches = rule.match(new RegExp(/^matches\\[([^\\]]+)\\]$/))) !== null){\n\t\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isSame(objInput.val(), objForm.find('input[name=' + matches[1] + '], textarea[name=' + matches[1] + '], select[name=' + matches[1] + ']').val())){\n\t\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_match', e.label, matches[1]);\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\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tif($.isEmptyObject(errorList)){\n\t\t\t\t\t\treturn (formCatch === true) ? submitForm() : true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar arrErrors = [];\n\t\t\t\t\t\t$.each(errorList, function(field, error){\n\t\t\t\t\t\t\tobjForm.find('input[name=' + field + '], textarea[name=' + field + '], select[name=' + field + ']').addClass(errorClass);\n\t\t\t\t\t\t\tarrErrors[arrErrors.length] = error;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdisplayErrors(arrErrors);\n\n\t\t\t\t\t\treloadCaptcha();\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}else if((typeof formCatch == 'boolean') && (formCatch === true) && (typeof strFormID == 'string')){\n\t\t\t\t// no form validation, but we are submitting the form via ajax\n\t\t\t\t$('#' + strFormID).on('submit', function(){\n\t\t\t\t\treturn submitForm();\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function CustomAlert() {\n this.render = function (dialog) {\n var winW = window.innerWidth;\n var winH = window.innerHeight;\n var dialogoverlay = document.getElementById('dialogoverlay');\n var dialogbox = document.getElementById('dialogbox');\n dialogoverlay.style.display = \"block\";\n dialogoverlay.style.height = winH + \"px\";\n dialogbox.style.left = (winW / 2) - (550 * .5) + \"px\";\n dialogbox.style.top = \"100px\";\n dialogbox.style.display = \"block\";\n document.getElementById('dialogboxhead').innerHTML = \" Alert !\";\n document.getElementById('dialogboxbody').innerHTML = dialog;\n document.getElementById('dialogboxfoot').innerHTML = '<input type=\"button\" class=\"btn btn-danger\" onclick=\"Alert.ok()\" value=\"OK\"/>';\n }\n this.ok = function () {\n document.getElementById('dialogbox').style.display = \"none\";\n document.getElementById('dialogoverlay').style.display = \"none\";\n }\n}", "function showSuccessAlert(ev) {\n customSetting.color = '#000000';\n customSetting.bgColor = '#90ee90';\n customAlert('This operation was successful!', customSetting);\n}", "function alertDismissed() {\r\n console.log(\"Alert dismissed\");\r\n }", "function toggleAlert(){\n\n console.log(\"btnAlert clicked\");\n\n if(!alert){\n UI.$btnAlert.removeClass(\"far\");\n UI.$btnAlert.addClass('fas');\n alert = true;\n }\n else{\n UI.$btnAlert.removeClass('fas');\n UI.$btnAlert.addClass(\"far\");\n alert = false;\n }\n}", "function submitInfo(event) {\r\n event.preventDefault();\r\n\r\n alert(\"Formulário enviado!\");\r\n}", "function __alert($msg) {\r\n __message({type:1, message:$msg, autoclose:3});\r\n}", "function alert(title, msg){\n\tif( typeof msg == 'undefined' )\n\t{\n\t\tmsg = title;\n\t\ttitle = '';\n\t}\n\t$.jAlert({\n\t\t'title': title,\n\t\t'content': msg\n\t});\n}", "function showFormValidationAlert() {\n\tformIsValid()\n\t\t? null\n\t\t: alert('Please complete the order form and try again.')\n}", "function submitForm(e){\r\n e.preventDefault();\r\n\r\n // Get values\r\n var name = getInputVal('name');\r\n var from = getInputVal('from');\r\n var email = getInputVal('email');\r\n var phone = getInputVal('phone');\r\n var to = getInputVal('to');\r\n var dep = getInputVal('dep');\r\n var ret = getInputVal('ret');\r\n var pass = getInputVal('pass');\r\n var age = getInputVal('age');\r\n\r\n // Save message\r\n saveMessage(age,name,email, phone,to,from,dep,ret,pass);\r\n\r\n // Show alert\r\n document.querySelector('.alert').style.display = 'block';\r\n\r\n // Hide alert after 3 seconds\r\n setTimeout(function(){\r\n document.querySelector('.alert').style.display = 'none';\r\n },3000);\r\n\r\n // Clear form\r\n document.getElementById('book').reset();\r\n}", "function successMessage() {\n setSubmitButtonMessage(\"Cocktail Saved!\");\n }", "function CustomAlert() {\n this.render = function(dialog) {\n\n var winWidth = window.innerWidth;\n var winHeight = window.innerHeight;\n var overlay = document.getElementById('overlay');\n var box = document.getElementById('box')\n\n //display box in center\n box.style.display = 'block';\n overlay.style.height = winHeight + 'px'\n box.style.left = (winWidth / 2) - (550 * .5) + 'px';\n box.style.top = '175px';\n box.style.display = 'block'\n\n //add content\n document.getElementById('head').innerHTML = \"World Record Status\"\n document.getElementById('body').innerHTML = dialog;\n document.getElementById('foot').innerHTML = '<button id=\"ok-btn\" onclick= \"Alert.ok()\"> OK </button>'\n }\n this.ok = function() {\n document.getElementById('box').style.display = 'none';\n document.getElementById('overlay').style.display = 'none';\n }\n}", "function UpdateClicked_Exception()\n{\n\tshowWaitAlert(getSeaPhrase(\"UPDATING_EXCEPTION_TE\",\"TE\"));\n\n\tif (arguments.length > 0 && arguments[0] == \"Submitted\")\n\t{\n\t\tUpdateTimeCard(\"Exception\", \"Submitted\");\n\t}\n\telse\n\t{\n\t\tUpdateTimeCard(\"Exception\");\n\t}\n}", "refreshAlert() {\n\t\t$(\"#alert\").css(\"display\", \"none\");\n\t}", "confirmationAlertwithOptionButton(title, message, positiveText, negativeText, skipText, positiveOnPress, negativeOnPress, skipOnPress, cancelableFlag ){\n Alert.alert(\n title,\n message,\n [\n {text: skipText, onPress: skipOnPress, style: 'destructive',},\n {text: negativeText, onPress: negativeOnPress, style : 'cancel'},\n {text: positiveText, onPress: positiveOnPress, style : 'default'},\n ],\n {cancelable: cancelableFlag},\n ); \n }", "function showValidationAlert(message) {\r\n showModalAlert(message);\r\n}", "function bsalert(message, alertClass, title) {\n\n // Show modal\n alertClass = alertClass || 'alert-danger';\n title = title || 'Alert';\n\n $('.modal-title').html(title);\n $('.modal-body').html(message).addClass(alertClass);\n $('#modal-button-ok').hide();\n $('#modal-button-cancel').hide();\n $('#modal-button-close').show();\n $(\"#dispatchModal\").modal('show');\n\n}", "function successActionMainPage(inputField, text, messageStatus) {\n let successMessage = `<div class=\"alert text-center alert-success alert-dismissible\" role=\"alert\">\n <strong>${text}</strong>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span></button>\n </div>`\n let alertMessage = `<div class=\"alert text-center alert-danger alert-dismissible\" role=\"alert\">\n <strong>${text}</strong>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span></button>\n </div>`\n let message = ''\n\n if (messageStatus === \"success\") {\n message = successMessage\n } else if (message === \"error\") {\n message = alertMessage;\n }\n\n document.querySelector(`${inputField}`).innerHTML = message\n window.setTimeout(function () {\n $('.alert').alert('close');\n }, 3000)\n}", "function newGradeAlert(){\n\n var data = new Object();\n data.title = $('#formNewAlertGrade #name_new_grade').val();\n data.condition = $('#formNewAlertGrade #condition_new_grade').val();\n data.threadhold = $('#formNewAlertGrade #threadhold_new_grade').val();\n data.students = $('#formNewAlertGrade #participants_new_grade').val();\n data.deliveryEmail = $('#formNewAlertGrade #form_new_alert_grade_delivery_email').prop('checked');\n data.deliveryText = $('#formNewAlertGrade #form_new_alert_grade_delivery_text').prop('checked');\n data.description = $('#formNewAlertGrade #description_new_grade').val();\n\n\n cleanNewGradeAlertFormError();\n\n $.ajax({\n type: 'POST',\n contentType: 'application/json',\n url: '/api/parent/alert/new',\n data: JSON.stringify(data),\n dataType: 'json',\n timeout: 60000,\n success: function(data) {\n\n // Close dialog\n $('#modal_alert_new_grade').modal('toggle');\n tblAlerts.ajax.reload(null, false);\n\n // Reset form\n $('#formNewAlertGrade')[0].reset();\n $('#formNewAlertGrade #form_new_alert_grade_delivery_email').change();\n $('#formNewAlertGrade #form_new_alert_grade_delivery_text').change();\n },\n error: function(data){\n var errorList = data.responseJSON.errorList;\n\n _.each(errorList, function(err){\n if(_.isEqual(err.field, \"title\")){\n // Title error\n $('#formNewAlertGrade #name_new_grade').closest('div').addClass('has-error');\n $('#formNewAlertGrade #name_new_grade').closest('div').append('<span class=\"help-block\">' + err.defaultMessage + '</span>');\n }\n });\n }\n });\n}", "function alertUser() {\n resetOutput();\n let alertDialog = document.getElementById(\"alertCustomDialog\");\n alertDialog.showModal();\n\n}", "function feedback() {\n alert(\"Your feedback is submitted.\");\n}", "function processForm() {\n alert(\"Thank You for Shopping.\");\n return false;\n }", "function alertDismissed() {\n // do something\n }", "function alertDismissed() {\n // do something\n }", "function despAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>' \n despErr.current.append(wrapper)\n }", "function onsubmitHandler(event) {\n event.preventDefault();\n\n warning();\n}", "function alert(message, title) {\n if (!title) {\n title = '系统提示'\n }\n return Dialog.create({\n title: title,\n message: message,\n ok: '确认',\n persistent: true\n })\n}", "function confirmSubmit(msgKey, myForm){\r\n\t$(\"#confirmOKButton\").prop(\"type\",\"submit\");\r\n\tmyForm.off('submit.confirm');\r\n\t$(\"#confirmCancel\").on('click',function(){\r\n\t\tenableConfirm(msgKey,myForm);\r\n\t});\t\t\r\n\t$(\"#confirmBody\").text(msg[msgKey]);\r\n\t$(\"#confirm\").modal();\r\n}", "function submitConformation() {\n swal(\"Thanks For !\", \"Buying The Mega Bus Ticket!\", \"success\");\n}", "onSubmit(e) {\n e.preventDefault();\n alert(\"Saved\");\n }", "function onAlertDismiss() {\r\n\t// do nothing\r\n}", "function showAlertFunc() {\n setShowAlert(true);\n }", "function submitErrorHandler (errMessage){\n alertDialog(errMessage);\n }", "function insert_alert(strongText = \"\", message = \"\", alertType = \"info\"){\n\n $(\"#alert\").hide().html(\"\")\n .append($(\"<div>\")\n .addClass(\"alert\")\n .addClass(\"alert-\" + alertType)\n .addClass(\"alert-dismissible\")\n .addClass(\"fade\")\n .addClass(\"show\")\n .append($(\"<button>\")\n .addClass(\"close\")\n .attr(\"data-dismiss\", \"alert\")\n .html(\"&times;\")\n )\n .append($(\"<span>\")\n\n .append($(\"<strong>\").html(strongText))\n .append($(\"<span>\").html(message))\n )\n ).fadeIn(250);\n\n}", "function issue_called(text_for_alert){\n window.alert(text_for_alert);\n}", "function show_alert(type, title, content) {\n\tconst icon = type == 'red' ? 'fa fa-warning' : 'fa fa-check';\n\n\t$.alert({\n\t\t\"type\": type,\n\t\t\"title\": title,\n\t\t\"content\": content,\n\t\t\"icon\": icon,\n\t\t\"backgroundDismiss\": true\n\t})\n}", "submitError(){\n\t\tif(!this.isValid()){\n\t\t\tthis.showErrorMessage();\n\t\t}\n\t}", "function jqAlert(title, msg, okFunc) {\r\n var shutting = false;\r\n $(\"#confirmDialog .message\").empty();\r\n $(\"#confirmDialog .message\").html(msg);\r\n $(\"#confirmDialog\").dialog({ buttons: {\r\n \"OK\": function () { shutting = true; $(this).dialog(\"close\"); if (okFunc != undefined) { okFunc(); }; }\r\n },\r\n title: title,\r\n close: function (event, ui) { if (!shutting) { if (okFunc != undefined) { okFunc(); }; }; },\r\n width: 500,\r\n modal: true,\r\n position: [(($('body')[0].offsetWidth / 2) - 250), 'center']\r\n });\r\n return false;\r\n}", "function submitAlerts(form) {\n // Read data from form\n // There's absolutely a better way to do this.\n let data = {};\n data[\"limit\"] = form.alertsLimit.value;\n data[\"titles\"] = form.alertsTitles.value;\n data[\"ldap\"] = form.alertsLdap.value;\n\n data[\"status\"] = form.querySelector(\"input[name=\\\"alertsStatus\\\"]:checked\").value;\n data[\"performed\"] = form.querySelector(\"input[name=\\\"alertsPerformed\\\"]:checked\").value;\n data[\"authenticated\"] = form.querySelector(\"input[name=\\\"alertsAuthenticated\\\"]:checked\").value;\n // Remove \"any\"s\n for (let key of [\"status\", \"performed\", \"authenticated\"]) {\n if (data[key] === \"any\") {\n delete data[key];\n }\n }\n\n data[\"after\"] = form.alertsAfter.value;\n data[\"before\"] = form.alertsBefore.value;\n // Parse dates\n for (let key of [\"after\", \"before\"]) {\n if (data[key]) {\n data[key] = Date.parse(data[key]) / 1000;\n }\n }\n\n removeEmpty(data);\n\n // Use jQuery for a GET request because I'm so sorry\n setVisible(\"alertsLoading\");\n $.get(\"api/query\", data, updateAlerts);\n\n // Prevent page from updating\n return false;\n}", "function alertToogle() {\n $('div.alert button.close').click(function (event) {\n event.stopPropagation();\n var span = $(event.target);\n var btn = span.parent('button.close');\n var div = btn.parent('div.alert');\n div.addClass('hidden');\n });\n}", "function disableAlert(request, response) {\n emitter.emit('disableAlert');\n response.send(200, 'An event was triggered to disable the alert', function(err) {\n if(err) {\n console.error(err.toString());\n } \n });\n}", "function adminAlert(title, text, type){\n var scraperAlert = $(\"#scraperAlert\");\n scraperAlert.html(\"<strong>\" + title + \"</strong> \" + text);\n scraperAlert.addClass(\"alert-\" + type);\n scraperAlert.animate({\n top: 150\n }, 400, function(){\n setTimeout(function(){\n scraperAlert.animate({\n top: -60\n }, 400, function(){\n scraperAlert.removeClass(\"alert-\" + type);\n });\n }, 4000);\n });\n }", "function hideAlerts() {\n $('#successful-register').hide();\n }", "function customeAlert(popClass, bodyClass, content) {\n $(popClass).html(content);\n $('body').addClass(bodyClass);\n $('.popUp').on('click', function (e) {\n e.stopPropagation();\n });\n return;\n }", "function submitAlert() {\n\t// do some basic checking of inputs\n\tif ($('#inputKWhrLimit').val() < 0 || $('#inputKWhrLimit').val() > 100) {\n\t\talert('Invalid Daily Energy Value. Please check.');\n\t\treturn;\n\t}\n\tif ($('#inputStbyLimit').val() < 0 || $('#inputStbyLimit').val() > 100) {\n\t\talert('Invalid Standby time%. Please check.');\n\t\treturn;\n\t}\n\t// construct alert object\n\tvar json = {\n\t email: $('#inputEmail').val(),\n\t\tdayKwhrFlg: $('#checkEnergyOver:checked').length,\n\t\tdayKwhrLmt: Number($('#inputKwhrLimit').val()),\n\t\tdayStbyFlg: $('#checkStandbyLow:checked').length,\n\t\tdayStbyLmt: Number($('#inputStbyLimit').val()),\n\t\tmodeChgFlg: $('#checkModeChanged:checked').length,\n\t\tSPChgFlg: $('#checkSPChanged:checked').length,\n\t\terrFlg: $('#checkFault:checked').length,\n\t\thtrElmntFlg: $('#checkElementUse:checked').length};\n\t// write the values to Firebase\n\tfireAlerts.set(json);\n\talert('Alerts has Changed Successfully!');\n}", "showFeedback(feedback) {\n if (feedback === \"phoneAndPasswords\") {\n confirmAlert({\n title: 'Feil',\n message: 'Telefonnummeret må være på 8 siffer og passordene må matche.',\n buttons: [\n {\n label: 'Ok',\n },\n ]\n });\n } else if (feedback === \"phone\") {\n confirmAlert({\n title: 'Feil',\n message: 'Telefonnummeret må være på 8 siffer.',\n buttons: [\n {\n label: 'Ok',\n },\n ]\n });\n } else if (feedback === \"passwords\") {\n confirmAlert({\n title: 'Feil',\n message: 'Passordene må matche.',\n buttons: [\n {\n label: 'Ok',\n },\n ]\n });\n } else if (feedback === \"successfullRegistration\") {\n confirmAlert({\n title: 'Suksess!',\n message: 'Bruker registrert!',\n buttons: [\n {\n label: 'Ok',\n },\n ]\n });\n } else if (feedback === \"samePhone\") {\n confirmAlert({\n title: 'Feil',\n message: 'Telefonnummeret er allerede i bruk.',\n buttons: [\n {\n label: 'Ok',\n },\n ]\n });\n } else if (feedback === \"sameEmail\") {\n confirmAlert({\n title: 'Feil!',\n message: 'Eposten er allerede i bruk!',\n buttons: [\n {\n label: 'Ok',\n },\n ]\n });\n } else if (feedback === \"email\") {\n confirmAlert({\n title: \"Feil!\",\n message: \"Eposten er ikke av gyldig format\",\n buttons: [\n {\n label: \"Ok\",\n }\n ]\n })\n } else if (feedback === \"pwLen\") {\n confirmAlert({\n title: \"Feil!\",\n message: \"Passordet må bestå av minst 8 tegn\",\n buttons: [\n {\n label: \"Ok\"\n }\n ]\n })\n } else if (feedback === \"tooLongData\") {\n confirmAlert({\n title: \"Feil!\",\n message: \"Navnet du har skrevet inn et for langt\",\n buttons: [\n {\n label: \"Ok\"\n }\n ]\n })\n }\n\n }", "function showManageAgentSuccessAlert() {\n\t\t \tvar successMsg = $(\"#myModal\").attr(\"saveAgentWithSuccess\");\n\t\t \t\n\t\t \tif (successMsg !== undefined) {\n\t\t \t\tdisplaySuccessMsg(successMsg);\n\t\t \t}\n\t\t }", "function windowCloseAlert() {\n\n //console.log(\"cycle=\"+cycle);\n //console.log(\"form.js: windowCloseAlert _cycleShow=\"+_cycleShow);\n\n if( _cycleShow ) {\n return;\n }\n\n window.onbeforeunload = confirmModifiedFormExit;\n\n function confirmModifiedFormExit() {\n\n var modified = false;\n\n if( $('#scanorderform').length != 0 ) {\n modified = checkIfOrderWasModified();\n }\n\n if( $('#table-scanorderform').length != 0 ) {\n modified = checkIfTableWasModified();\n }\n\n if( $('#table-slidereturnrequests').length != 0 ) {\n modified = checkIfTableWasModified();\n }\n\n //console.log(\"modified=\"+modified);\n if( modified === true ) {\n\n //set back institution\n var institution_original_id = localStorage.getItem(\"institution_original_id\");\n if( typeof institution_original_id !== 'undefined' && institution_original_id != \"\" && institution_original_id != null ) {\n $('.combobox-institution').select2('val', institution_original_id);\n }\n\n //console.log(\"modified msg\");\n //http://stackoverflow.com/questions/37727870/window-confirm-message-before-reload\n //'Custom text support removed' in Chrome 51.0 and Firefox 44.0.\n return \"Are you sure you would like to navigate away from this page? Text you may have entered has not been saved yet.\";\n } else {\n //console.log(\"non modified msg\");\n return;\n }\n }\n\n $('form').submit(function() {\n window.onbeforeunload = null;\n });\n}", "function customAlert(message, callback=null){\n console.log(\"function: customAlert\");\n\n // Dim background\n $('body').prepend(\n \"<div id='overlay' class='customAlert' \" +\n \"style='\" +\n \"position:fixed;\" +\n \"height:100%;\" +\n \"width:100%; \" +\n \"background-color:rgba(0, 0, 0, 0.6);\" +\n \"z-index:1;\" +\n \"'></div>\"\n );\n\n // Add white message area\n $('#overlay').append(\n \"<div id='messageBox' class='customAlert' \" +\n \"style='\" +\n \"background-color:white;\" +\n \"z-index:2; \" +\n \"position: absolute;\" +\n \"top: 50%;\" +\n \"left: 50%;\" +\n \"transform: translate(-50%, -50%);\" +\n \"border-radius:3%;\" +\n \"padding-bottom: 1%;\" +\n \"'></div>\"\n );\n\n // Add black text\n $('#messageBox').append(\n \"<h1 id='messageText' class='customAlert text'\" +\n \"style='\" +\n \"padding-left: 3%;\" +\n \"padding-right: 3%;\" +\n \"text-align: center;\" +\n \"'>\" +\n message +\n \"</h1>\"\n );\n\n // Adds OK button\n $('#messageBox').append(\n \"<button id='alertButton' class='customAlert text'\" +\n \"onclick='removeCustomAlert()'\" +\n \"style='\" +\n \"font-size: 2em;\"+\n \"margin:0 auto; \"+\n \"display:block; \" +\n \"text-align:center; \" +\n \"'>OK\" +\n \"</button>\"\n );\n\n // Adds callback to OK button click\n if(callback !== null){\n $(\"#alertButton\").click(callback);\n }\n}", "function AlertError(msg) {\n $(\"#alertError\").css('display', 'block');\n var error = \"<div class='alert alert-error'><button type='button' class='close' data-dismiss='alert'>&times;</button><span class='errorMsg'>\" + msg + \"</span></div>\";\n $(\"#alertError\").html(error);\n}", "function messageBox()\r\n{\r\n\tUIATarget.onAlert = function onAlert(alert) {\r\nvar title = alert.name();\r\n//UIALogger.logWarning(\"Alert with title '\" + title + \"' encountered.\");\r\n\t\tdelay(1);\r\nif (title == \"Error\"){\r\n\tdelay(2);\r\nif(alert.staticTexts()[\"Please check your details and relogin\"].isValid())\r\n\t{\r\n\t\talert.buttons()[\"OK\"].tap();\r\n\t\tUIALogger.logPass(\"Error message box is displayed\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tUIALogger.logFail(\"Error message box is not displayed\");\r\n\t}\r\n\t\r\n\treturn true;\r\n}\r\n\t\telse\r\n\t\t{\r\n\t\t\tUIALogger.logFail(\"Unable to find the ERROR message box\");\r\n\t\t\t//\talert.buttons()[\"OK\"].tap();\r\n\t\t}\r\n// return false to use the default handler\r\n\treturn false;\r\n}\r\n}", "function closeAlert() {\n vm.error = \"\";\n }", "function reactivateSubmit(form)\n{\n $(form).find('.processing_form_msg').html('Successfully saved!').css({'float':'none'}).show().pulse(false);\n $(form).find('.save_button').removeClass('in_use').parents('span').show();\n setTimeout(function() { $(form).find('.processing_form_msg').hide() }, 4000);\n}", "function titleAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>'\n titleErr.current.append(wrapper)\n }", "function hide_alert()\r\n{\r\n\t$('.alert').remove();\r\n}", "submitExtra() {\n }", "function successAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>' \n successMsg.current.append(wrapper)\n }", "function _hideAlert() {\r\n\t\twindow.dispatchEvent(new CustomEvent('_hideAlert'))\r\n\t}", "function showAlert() {\n alert = $mdDialog.alert({\n title: 'Attention',\n textContent: 'Incorrect username and/or password. Please enter information again.',\n ok: 'Close'\n });\n $mdDialog\n .show( alert )\n .finally(function() {\n alert = undefined;\n });\n }", "function submitIt()\n{\n $('form').on(\"submit\",function(){\n window.alert('Your form is going to be submitted now.')\n });\n}", "function fail() {\n\n //vise feilmelding\n BootstrapAlert($('#alert-container'), \"danger\", \"Det gikk noe galt med registrering\");\n}", "function userAlert(type, text) {\n var alertMarkup = '<div id=\"alert\" class=\"alert alert-dismissible fade show col-12\" role=\"alert\">\\n' +\n \t\t\t\t ' <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\\n' +\n \t\t\t ' <span aria-hidden=\"true\">&times;</span>\\n' +\n \t\t\t\t ' </button>\\n' +\n\t\t\t\t '</div>';\n\tvar result = $(alertMarkup).addClass('alert-' + type).append(text);\n $('#user-alert-container').empty().append(result)\n}", "function submitForm(){\r\n\r\n// e.preventDefault();\r\n\r\n // Get values\r\nvar\tname = getInputVal('fname');\r\nvar\tdob = getInputVal('dob');\r\nvar\tgname = getInputVal('gname');\r\nvar\tprclass = getInputVal('prclass');\r\nvar\tschooltype = getInputVal('schooltype');\r\nvar\tbsid = getInputVal('bsid');\r\nvar regID = getInputVal('regID');\r\nvar meet = meetDate;\r\n\r\n // Save message\r\n saveMessage(timestamp,name,dob,gname,prclass,schooltype,bsid,regID,meet);\r\n Swal.fire({\r\n title: 'Dhola High School',\r\n text: 'Registration Successful. Application ID: ' + timestamp + '. Note down for further use.',\r\n timerProgressBar: true,\r\n allowOutsideClick:false,\r\n allowEscapeKey:false\r\n});\r\n //swal(\"Dhola High School\",\"Registration Successful. Application ID: \" + timestamp + \". Note down for further use.\",\"success\");\r\n\r\n document.getElementById('registerForm').reset();\r\n}", "function alertas() {\r\n var aletas = document.getElementById(\"alerta\");\r\n alertas.innerHTML = \"<div class='alert alert-danger alert-dismissible'>\" +\r\n \"<button type='button' class='close' data-dismiss='alert'>\" + \"&times;\" + \"</button>\" +\r\n \"<strong>\" + \"Danger!\" + \"</strong>\" + \"This alert box could indicate a dangerous or potentially negative action.\" +\r\n \"</div>\";\r\n\r\n}" ]
[ "0.67509854", "0.65568304", "0.6374718", "0.6344766", "0.6321502", "0.6207952", "0.61506706", "0.6080448", "0.60609025", "0.60560423", "0.60534686", "0.60331005", "0.6012199", "0.5976175", "0.5972001", "0.59528106", "0.5952133", "0.5942666", "0.5941973", "0.5935046", "0.59103626", "0.59092903", "0.58919424", "0.58737826", "0.586677", "0.58599836", "0.58382624", "0.5837226", "0.5834247", "0.5827376", "0.5825861", "0.5817084", "0.58149797", "0.5811031", "0.5810785", "0.5802956", "0.5802681", "0.5800413", "0.57927436", "0.5787754", "0.5774066", "0.57650167", "0.57592577", "0.57474273", "0.574023", "0.57354295", "0.5730939", "0.5724646", "0.57239413", "0.57159203", "0.5709929", "0.57092583", "0.5701104", "0.569776", "0.5695728", "0.56955516", "0.56865054", "0.568562", "0.5683983", "0.568173", "0.568173", "0.56672543", "0.5662888", "0.56595874", "0.56569", "0.5654225", "0.56517553", "0.5649519", "0.5643448", "0.56221575", "0.5620672", "0.56137985", "0.5611942", "0.56043863", "0.55960155", "0.5595944", "0.5595429", "0.5588347", "0.55847764", "0.55844045", "0.5581625", "0.5572379", "0.5572321", "0.5570341", "0.55594856", "0.55525804", "0.55425787", "0.5540424", "0.55387044", "0.55269825", "0.55223286", "0.55223185", "0.55187905", "0.55133414", "0.55127794", "0.5512382", "0.5506305", "0.55051816", "0.5504828", "0.5504343", "0.5504051" ]
0.0
-1
Seite anzeigen. Wird von der AppKlasse aufgerufen.
async show(matches) { // URL-Parameter auswerten this._recordId = matches[1]; this._data = await this._app.database.selectById(this._recordId, "restaurants"); // Anzuzeigenden Seiteninhalt nachladen let html = await fetch("page-detail/page-detail.html"); let css = await fetch("page-detail/page-detail.css"); if (html.ok && css.ok) { html = await html.text(); css = await css.text(); } else { console.error("Fehler beim Laden des HTML/CSS-Inhalts"); return; } // Seite zur Anzeige bringen let bewertung = await this.bewertungBerechnen(); let pageDom = this._processTemplate(html, bewertung); this._app.setPageTitle(` ${this._data.name}`, {isSubPage: true}); this._app.setPageCss(css); this._app.setPageHeader(pageDom.querySelector("header")); this._app.setPageContent(pageDom.querySelector("main")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n //DO BEFORE START APP CONFIGURATION/INITIALIZATION\n super.start();\n }", "get mainApp() {\r\n return this._mainApp;\r\n }", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "get app() {\r\n return this._app;\r\n }", "function Dapp() {\n Dapp.currentInstance = this;\n }", "function App() {\n return null;\n }", "function App() {\n return null;\n }", "start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n }", "function startApp() {\n //first calls, default dataset? \n }", "function InitApplication() {\n ProcessCtrl.ePage.Masters.Application = {};\n ProcessCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }", "function InitApplication() {\n DataExtIntegrationCtrl.ePage.Masters.Application = {};\n DataExtIntegrationCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }", "getApp(){\n return this.app\n }", "function AppPage() {\n Page.apply(this, arguments);\n }", "function initApp() {\n\tinitSounds();\n\tinitSensors();\n\tshowWelcome();\n}", "function Application() {\n\t\n}", "function auxinApp(uiaId)\n{\n log.debug(\"auxinApp App constructor called...\");\n\n baseApp.init(this, uiaId);\n}", "setupAPP() {\n cart = Storage.getCart();\n this.setCartValues(cart);\n this.populateCart(cart);\n cartBtn.addEventListener(\"click\", this.showCart);\n closeCartButton.addEventListener(\"click\", this.hideCart);\n }", "function AppInit(){\n \n ctx = document.body.getAttribute(\"data-context\");\n if (ctx == null) throw \"No context defined!\" ;//on verra plus tard!\n\n //si une function, initialise\n ctx = window[ctx];\n if (ctx instanceof Function){\n CONTEXT = new ctx();\n }\n else {\n CONTEXT = ctx;//permet toujours de recuperer un objet, pour un site tout simple amateur, c'est suffisant\n ctx = CONTEXT.constructor;//recupere le type;\n }\n if (CONTEXT == null)throw \"No context defined!\" ;//on verra plus tard!\n \n defineBindObject(CONTEXT);\n\n //qqs property necessaires:\n //process_update: true/false: indique si est en train de mettre a jour les données\n \n CONTEXT[\"__process_update\"] = false;\n ctx.defineBindProperty( \"process_update\",{\n get : function(){\n return this.__process_update;\n },\n set: function(value){\n if (this.__process_update != value){\n this.__process_update = value;\n key = this.__uuid__+\":process_update\";\n\n if (key in BINDINGS) {\n\n __notifyDatasetChanged(this,BINDINGS[key], key);\n }\n }\n\n\n },\n enumerable: false,\n });\n\n //end_init: si true, initialisations terminées\n //en theorie, modifié 1 seule fois dans l'appli...\n CONTEXT[\"__end_init\"] = false;\n ctx.defineBindProperty( \"end_init\",{\n get : function(){\n return this.__end_init;\n },\n set: function(value){\n if (this.__end_init != value){\n this.__end_init = value;\n key = this.__uuid__+\":end_init\";\n\n if (key in BINDINGS) {\n __notifyDatasetChanged(this,BINDINGS[key], key);\n }\n }\n\n\n },\n enumerable: false,\n });\n \n \n //si existent des models dans la page (ie: models globaux), recupere les\n var model_node = document.querySelector(\"body>div[data-role='presenters']\");\n\n if (model_node != null){\n //n'affiche pas le contenu\n model_node.style.display = \"none\";\n\n models = model_node.querySelectorAll(\"body>div[data-role=presenters]>[data-role=presenter]\");\n //pour chque model trouvé....\n for (moi=0;moi<models.length;moi++){\n var model = models[moi];\n\n id = model.getAttribute(\"id\");\n //probleme EDGE et SVG: pas de children pour le SVG...\n if (id == null || (model.children==null && model.childNodes == null)) continue; //n'autorise pas de models sans id!\n \n\n //SI EDGE ET SVG, DOIT PASSER PAR ChildNodes????\n children = model.children;\n if (children==null){\n children = [];\n \n end = model.childNodes.length ;\n current = 0;\n cn = model.childNodes;\n do{\n node = cn[current];\n if (node.nodeType != 8 && (node.nodeType!=3 || /\\S/.test(node.nodeValue))){\n \n children.push(node);;\n }\n //ajoute\n \n current++;\n }while(current<end);\n }\n \n //ici, si plusieurs childs, veut dire plusieurs data-type\n if (children.length == 1){\n //cree les bindings pour ce model\n //bindings: les bindings presents dans le model\n //template: le template/presenter html pour le model\n //recycle: des presenters deja crées pour reutilisation\n //MODELS[id] = __get_bindings(children[0], false);//false: ne met pas en place les events handlers\n MODELS[id] ={bindings: __get_bindings(children[0], false), template: children[0], recycle:[]};\n } else {\n //utilise des data-types, doit creer un binding par data-type\n for (c_i = 0; c_i < children.length; c_i++){\n mdl = children[c_i];\n dtype = mdl.getAttribute(\"data-type\");\n \n if (dtype == null){\n //model par defaut\n //MODELS[id] = __get_bindings(mdl, false);\n MODELS[id] = {bindings: __get_bindings(mdl, false), template: mdl, recycle:[]};\n } else {\n //un datatype\n MODELS[id+\"_\"+dtype] = {bindings: __get_bindings(mdl, false), template: mdl, recycle:[]};\n }\n }\n }\n \n \n //comment faire pour eviter a chaque initialisation de binding model de devoir recuperer le html????\n }\n\n }\n\n //les bindings de la page web...\n BINDINGS = __get_bindings(document.body, true, \"//*[not(ancestor::div[@data-role='presenters']) and (@*[contains(.,'{binding ')] or contains(text(),'{binding ')) ]\");\n \n \n notifyDatasetChanged();\n\n CONTEXT.end_init = true;//notifie la fin du chargement...\n}", "function AppUtils() {}", "@action setup_apps() {\n this._applications_to_configure.forEach((app_conf) => {\n if ( !app_conf.name ) {\n throw new TypeError(`Apps need a name as part of their configuration! Looked inside: ${JSON.stringify(app_conf)}`)\n }\n\n // Parse its routes into our router\n // TideStore (.. which is badly named... its technically just a rendering engine).\n // will end up using the context to determine which layout to use during a render\n for (let route of app_conf.routes) {\n route.context.app_label = app_conf.name;\n this.router.set(route);\n }\n\n // Give the application some of its own configured data\n app_conf.app.store = app_conf.store;\n app_conf.app.tide = this;\n\n if(this._apps.has(app_conf.name)){\n throw new ConfigurationError(`The application named ${app_conf.name} was listed twice.`)\n }\n\n // Set the completed app in our table\n this._apps.set(app_conf.name, app_conf);\n });\n\n // Now that all the apps are in the listing\n // Let it complete them complete their initialization\n this.apps().map(app_conf => {\n let initial = this.initial_data[app_conf.name] || {};\n console.log(`[Tide] Initial for ${app_conf.name}`, initial);\n app_conf.ready(initial)\n })\n }", "constructor (){\n super();\n console.log ('1....App-Constructor')\n }", "function MAINCLASS(className)\r\n{\r\n\tself.app_className = className;\r\n\t//extend? ...\r\n}", "get appMode() { return this._appMode }", "activate() {\n window.App = this;\n }", "init() {\n // Action to execute on load of the app\n }", "function main() {\n\n\t//======================================\n\t//THE FOLLOWING SHOULD ALL BE SINGLETONS\n\t//======================================\n\n\t//A service to get data and set data from localStorage API\n\tlet todoService = new TodoService();\n\t//The todoApp Data model\n\tlet todoAppData = new TodoAppData(todoService.getLists());\n\t//A class that helps create DOM elements imperatively\n\tlet todoViewFactory = new TodoViewFactory();\n\t//Helps controll the view of the application\n\tlet todoViewSetter = new TodoViewSetter(todoViewFactory);\n\n\t//initializes the view\n\ttodoViewSetter\n\t\t.setListsMenu(todoAppData.lists)\n\t\t.setSelectedList(todoAppData.selectedList);\n\n\t//sets event listeners\n\tsetListeners(todoAppData, todoViewSetter, todoService);\n}", "function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }", "function get_app() {\n return app;\n}", "get app_name() {\n return this._app_name;\n }", "function AppList() {\n this._init.apply(this, arguments);\n}", "function App() {\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = Math.floor(Math.random() * (max - min) + min);\n this.Recipes = new RecipeModel_1.RecipeModel();\n this.RecipesCatalog = new RecipeCatalogModel_1.RecipeCatalogModel();\n this.RecipeCatalogDetails = new RecipeCatalogDetailsModel_1.RecipeCatalogDetailsModel();\n this.User = new UserModel_1.UserModel();\n }", "constructor(app) {\n super(app);\n }", "onEditApp () {}", "function WebApp() {\r\n\r\n // Collection of route mappings that map URL patterns to views\r\n this.routeMappings = [];\r\n\r\n // I am the collection of controllers. All controllers are intended to be\r\n // singleton instances.\r\n this.controller = null;\r\n\r\n\t\t// an application can register some helper methods here to be used in\r\n\t\t// templates, <%=webapp.helpers.format_date(this.date) %>, for example\r\n\t\tthis.helpers = {};\r\n\r\n /// validation rules to be used with forms\r\n this.validation_rules = {\r\n };\r\n\r\n // appended to all rest URLs. if specified, should not\r\n // end with a slash\r\n this.rest_service_prefix = '';\r\n this.templates_prefix = '/t/';\r\n this.forms_prefix = '/forms/';\r\n\r\n\r\n this.pageNotFoundView = undefined;\r\n\r\n\t\tthis.isRunning = false;\r\n\r\n this.visitedUrlsLog = [];\r\n\r\n this.testmode = false; // do not show error dialogs when running in testmode\r\n\r\n this.after_view_fully_loaded = null;\r\n\r\n this.xhr_id = 0;\r\n this.currently_active_xhrs = {};\r\n\r\n this.flash_messages = [];\r\n\r\n this.request_cache = {};\r\n this.request_cache_by_type = {};\r\n this.served_cached_requests = 0;\r\n this.served_total_requests = 0;\r\n\r\n /*\r\n Stores \"precognition\" data - the info about the server state\r\n the client knows without actually loading the data from the server.\r\n See 'Minority Report' for details\r\n */\r\n this.precog_cache = {};\r\n\r\n this.compiled_templates = {};\r\n\r\n this.showMessage = function (msg, title) {\r\n /*\r\n Displays a message - a nicer replacement for\r\n alert function\r\n */\r\n if (title) {\r\n msg = '<h1>' + title + '</h1>' + msg;\r\n }\r\n bootbox.alert(msg);\r\n };\r\n\r\n /* The code above is executed before the DOM is loaded so we need to\r\n postpone registering the error handlers until later\r\n */\r\n $(function () {\r\n\r\n $.ajaxSetup({\r\n beforeSend: function (jqXHR, settings) {\r\n jqXHR._url = settings.url;\r\n jqXHR._start = new Date();\r\n },\r\n success: function (data, textStatus, jqXHR) {\r\n webapp._addRequestStats(data, textStatus, jqXHR);\r\n }\r\n });\r\n /// Ajax spinner\r\n //$(\"body\").append($('<div id=\"ajax-spinner\" class=\"flash-message flash-message-normal\">Loading...</div>'));\r\n\r\n $(\"body\").append($('<div id=\"ajax-error\"> </div>'));\r\n\r\n /// Experiment with using Bootstrap's modal dialog\r\n /*$(\"body\").append($('<div id=\"ajax-error\" class=\"modal hide fade\"><div class=\"modal-header\">' +\r\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>' +\r\n '<h3>Server Error</h3></div>' +\r\n '<div class=\"modal-body\"></div>' +\r\n '<div class=\"modal-footer\">' +\r\n '<button class=\"btn\" data-dismiss=\"modal\" aria-hidden=\"true\">Close</button>' +\r\n '</div></div>'\r\n ));*/\r\n\r\n $(document).ajaxSend(function (e, jqx) {\r\n /* add an unique ID to an XHR so we can tell them apart later */\r\n webapp._rememberXHR(jqx);\r\n });\r\n\r\n $(document).ajaxComplete(function (e, jqx) {\r\n /* Called both on success and error */\r\n webapp._forgetXHR(jqx);\r\n });\r\n\r\n $(document).ajaxSuccess(function (e, jqx) {\r\n // TODOXXX: this parses .responseText to JSON\r\n // second time - it's inefficient but I wasn't\r\n // able to find how to get json data from ajaxSuccess\r\n var data;\r\n try {\r\n /*\r\n Arrgh, Firebug sometimes breaks here regardless of the try/except block\r\n Let's really crudely check if the response looks like JSON and bail out\r\n if it doesn't\r\n */\r\n if (jqx.responseText && jqx.responseText[0] === '{') {\r\n data = $.parseJSON(jqx.responseText);\r\n }\r\n } catch (exc) {\r\n // pass\r\n }\r\n\r\n webapp.processFlashMessages(data, jqx);\r\n });\r\n\r\n\r\n /*$(document).ajaxError(function (e, jqx) {\r\n webapp._forgetXHR(jqx);\r\n });*/\r\n\r\n $('#ajax-spinner').ajaxStart(function () {\r\n $(this).fadeIn();\r\n });\r\n $('#ajax-spinner').ajaxStop(function () {\r\n $(this).fadeOut();\r\n });\r\n $('#ajax-spinner').ajaxError(function () {\r\n $(this).fadeOut();\r\n });\r\n $('#ajax-spinner').ajaxComplete(function () {\r\n $(this).fadeOut();\r\n });\r\n /// Error message box\r\n $(document).ajaxError(function (event, jqxhr, ajaxOptions, thrownError) {\r\n\r\n var self = this,\r\n response,\r\n show_alert = function (msg) {\r\n webapp.flash_messages.push({\r\n css_class: 'flash-message-error',\r\n msg: msg\r\n });\r\n\r\n // process the messages right away\r\n if (webapp.getController().currentView.renderFlashMessages) {\r\n webapp.getController().currentView.renderFlashMessages();\r\n }\r\n };\r\n\r\n /* aborted calls trigger ajaxError too - we don't want to\r\n display any messages obviously. Also, responseText is null for\r\n such responses and status = 0.\r\n */\r\n if (jqxhr.statusText == 'abort') {\r\n return;\r\n }\r\n\r\n /*\r\n calling code can set `ignore_errors` attribute to signal\r\n that errors are expected and are handled by the calling code\r\n */\r\n if (jqxhr.ignore_errors) {\r\n return;\r\n }\r\n\r\n response = jqxhr.responseText.replace(new RegExp(\"/_debug/media/\", \"g\"), \"/webapp.client/weberror/\");\r\n\r\n\r\n if (ajaxOptions.webapp_error_response_processed) {\r\n return;\r\n }\r\n\r\n if (!webapp.testmode) {\r\n\r\n /* this one should work in debug mode too */\r\n if (jqxhr.status === 422) {\r\n window.location.reload(true);\r\n return;\r\n }\r\n\r\n /* When debug mode is on the messages are very long,\r\n so we use it to crudely distinquish between when we want to\r\n show a generic message or a traceback */\r\n if (response.length > 400) {\r\n show_alert(response);\r\n } else {\r\n switch (jqxhr.status) {\r\n case 410:\r\n /*\r\n When a resource is soft-deleted the server sends 410 Gone\r\n with a small JSON dict with a `message` attribute\r\n */\r\n show_alert(JSON.parse(response).message);\r\n webapp.relocateTo(webapp.previousPageUrl());\r\n break;\r\n case 422:\r\n /* otherwise it shows a default message momentarily */\r\n break;\r\n case 500:\r\n show_alert(\"There's been a server error. Our engineers have been notified.\");\r\n break;\r\n case 502:\r\n show_alert(\"The site is down. Please try again later.\");\r\n break;\r\n default:\r\n show_alert(\"Can't connect to the site. Please check your internet connection.\");\r\n break;\r\n\r\n }\r\n }\r\n\r\n } else {\r\n //alert(response);\r\n webapp.getController().showMainView(webapp.serverErrorView, webapp.getController().currentView.event);\r\n $(\"div.activeContentView\").html(response);\r\n }\r\n // This was here to deal with deleted tasks,\r\n // but it produces undesirable effects in other places\r\n // webapp.relocateTo(webapp.previousPageUrl());\r\n });\r\n\r\n });\r\n\r\n /// TODO: Not sure it belongs here\r\n $.fn.serializeObject = function () {\r\n /// This creates a custom function which\r\n /// serializes a form into an object which\r\n /// can easily be converted to JSON representation\r\n /// TODO: not sure how robust this is with multiple values\r\n /// See http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-jquery\r\n var o = {},\r\n a = this.serializeArray();\r\n\r\n $.each(a, function () {\r\n // remove formish templates - template's name contains *\r\n if (this.name.indexOf('*') === -1) {\r\n if (o.hasOwnProperty(this.name)) {\r\n /* If the property already exists then we check\r\n if it's an array already, if not we're converting it\r\n to an array and then we append the value\r\n */\r\n if (!o[this.name].push) { /* 'push' is how we tell Array from something else */\r\n o[this.name] = [o[this.name]];\r\n }\r\n o[this.name].push(this.value || '');\r\n } else {\r\n o[this.name] = this.value || '';\r\n }\r\n }\r\n });\r\n\r\n /// unchecked checkboxes are not serialized by serializeArray\r\n /// which conforms to HTML standards but is quite annoying\r\n /// we send 'false' if a checkbox is unchecked\r\n /// but only if there's no already a value (a scalar or an array)\r\n /// for that name.\r\n\r\n $.each(this.find('input:checkbox').not(':checked'), function () {\r\n if (!o.hasOwnProperty(this.name)) {\r\n o[this.name] = false;\r\n }\r\n });\r\n\r\n /// make empty multiselects to return [] - otherwise they're ignored\r\n /// also, for multiselects we convert single values to arrays with one element\r\n $.each(this.find('select'), function () {\r\n var s = $(this);\r\n if (s.attr(\"multiple\")) {\r\n if (s.val() === null) {\r\n o[this.name] = [];\r\n } else if (typeof s.val() === \"string\") {\r\n o[this.name] = [o[this.name]];\r\n }\r\n }\r\n });\r\n\r\n return o;\r\n };\r\n\r\n\t}", "function App() {\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 100;\n this.Postcards = new PostcardModel_1.PostcardModel();\n this.Collections = new CollectionModel_1.CollectionModel();\n }", "App(appName) {\n\t\tthis.utils.logger.debug({description: 'Application action called.', appName: appName, template: new App(appName), func: 'App', obj: 'Grout'});\n\t\treturn new App(appName);\n\t}", "function VisApp() {\n BaseApp.call(this);\n}", "get isSingleApp() {\n return !this.applications || this._appsLength < 2;\n }", "function App() {\n\t\tthis.init = function(position) {\n\t\t\tthis.wrapper = document.querySelector(\".wrapper\");\n\t\t\tthis.location = location.success(position);\n\n\t\t\treturn (this.location) ? this.render() : this.renderFail(\"Something went wrong\");\n\t\t}\n\n\t\tthis.render = function() {\n\t\t\tthis.mainContainer = new MainContainer(this.location);\n\t\t\tthis.mainContainer.init(this.wrapper);\n\t\t\tthis.mainContainer.renderLayout();\n\t\t}\n\n\t\tthis.renderFail = function(err) {\n\t\t\tthis.wrapper.innerHTML = err;\n\n\t\t\treturn new Error();\n\t\t}\n\t}", "app(x, prev) {\n prev ? this.removeApplication(true) : this.callUpdate();\n }", "app(x, prev) {\n prev ? this.removeApplication(true) : this.callUpdate();\n }", "runApp() {\n this.addButton()\n this.allPanes = document.createElement(\"div\")\n this.allPanes.id = \"allpanes\"\n this.applicationHolder.append(this.allPanes)\n this.btn.click()\n }", "function Main(){\n PubSub.call(this); // super();\n\n // ui system\n this.screens = new Screens(this);\n\n this.onceOn('init', this.init, this);\n }", "function App() {\n this.db = new DatabaseConnection_1.DatabaseConnection();\n this.express = express();\n this.middleware();\n this.routes();\n this.setViews();\n var classifier = new ReleaseClassifier_1.ReleaseClassifier();\n var commitClassifier = new CommitClassifier_1.CommitClassifier();\n //classifier.readReleases();\n //commitClassifier.readCommits();\n }", "function App () {\n Base.call(this);\n this.dependencies = {};\n}", "_ready() {\n this.tabs = new Tabs(this.app)\n }", "function initApp() {\n // Listening for auth state changes.\n // [START authstatelistener]\n firebase.auth().onAuthStateChanged(function(user) {\n showHomePage();\n if (user) {\n // User is signed in.\n /** This section of code builds up the pages only the provider is allowed to see **/\n provider = {};\n provider.displayName = user.displayName;\n provider.email = user.email;\n /** build more provider properties here **/\n\n listenOnDateBase();\n\n $(\"li[name=signedInMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedOutMenu]\").hide(); // hide what's not relevant\n\n } else {\n // User is signed out.\n provider = null;\n $(\"li[name=signedOutMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedInMenu]\").hide(); // hide the user's data to create a feeling that it's gone\n tearDownUserPages(); // remove database listenrs and destory all the pages to prevent private info from leeking\n }\n });\n}", "bootContinued () {\n\n this.router = new Router(this.model.sections);\n this.router.on('ROUTE_CHANGE', this.on_ROUTE_CHANGE.bind(this));\n\n this.menu = new Menu(this.model.sections, this.router.getRoute());\n this.menu.on('MENU_SELECT', this.router.navigate.bind(this.router));\n\n this.sectionsController = new SectionsController(this.model.sections);\n this.sectionsController.on('PRELOAD_ENTER', this.on_PRELOAD_ENTER.bind(this));\n this.sectionsController.on('PRELOAD_EXIT', this.on_PRELOAD_EXIT.bind(this));\n this.sectionsController.changeSection(this.router.getRoute());\n\n // passed manually to children: top to bottom.\n window.addEventListener('resize', this.on_RESIZE.bind(this));\n }", "function App() {\n _classCallCheck(this, App);\n\n //**********CREATE STATE**********/\n var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this));\n\n _this.state = {\n // name: 'Joe',\n listingsData: _listingsData2.default,\n city: 'All',\n house_type: 'All',\n bedrooms: '0',\n min_price: '0',\n max_price: '1000000',\n min_space: '0',\n max_space: '8000',\n elevator: false,\n storage: false,\n jacuzzi_tub: false,\n separate_shower: false,\n fireplace: false,\n swimming_pool: false,\n filteredData: _listingsData2.default,\n populateFormsData: '',\n sort: 'price-descending',\n view: 'grid',\n search: '',\n bgColor: ''\n };\n\n _this.change = _this.change.bind(_this);\n _this.filteredData = _this.filteredData.bind(_this);\n _this.populateFormsData = _this.populateFormsData.bind(_this);\n _this.changeView = _this.changeView.bind(_this);\n return _this;\n }", "function Application() {}", "function AppView() {\n View.apply(this, arguments);\n\n this.menuToggle = false;\n this.generator = new Generator();\n\n _eventCookiesHandler.call(this);\n // _checkCookies.call(this);\n\n this._eventInput.on('updateDimensions', _handleDimensions.bind(this));\n }", "function app(window) {\n console.log('JS-Widget starting'); // set default configurations\n\n var configurations = {\n someDefaultConfiguration: false\n }; // all methods that were called till now and stored in queue\n // needs to be called now \n\n var globalObject = window[window['JS-Widget']];\n var queue = globalObject.q;\n\n if (queue) {\n for (var i = 0; i < queue.length; i++) {\n if (queue[i][0].toLowerCase() == 'init') {\n configurations = extendObject(configurations, queue[i][1]);\n fetchConfig(configurations.configSourceUrl, function (fetchedConfig) {\n configurations = Object.assign(configurations, fetchedConfig);\n globalObject.configurations = configurations;\n Object(__WEBPACK_IMPORTED_MODULE_1__views_message__[\"a\" /* show */])();\n });\n console.log('JS-Widget started', configurations);\n configurations.networkHandleId;\n } else apiHandler(queue[i][0], queue[i][1]);\n }\n } // override temporary (until the app loaded) handler\n // for widget's API calls\n\n\n globalObject = apiHandler;\n globalObject.configurations = configurations;\n}", "function LTApp() {\n this.WIN = $( window );\n this.DOC = $( document );\n this.BODY = $( 'body' );\n this.HTML = $( 'html' );\n this.INITED = false;\n }", "function App() {\n this.modules = [];\n this.registry = new registry.Registry();\n\n this._started = false;\n\n // Register a bunch of default utilities\n this.registry.registerUtility(notification.defaultNotifier,\n 'notifier');\n\n // And set up default components.\n this.include(authz.acl);\n this.include(identity.simple);\n this.include(storage.noop);\n}", "get app () {\n return Metadata.getClassMetaValue(Object.getPrototypeOf(this), 'ravel', 'instance');\n }", "function startup() {\n // Set initial UI data for our app and Vue\n // App data will be populated after updateUI is called in onMessage EVENT_BRIDGE_OPEN_MESSAGE \n dynamicData = deepCopy(CONFIG.INITIAL_DYNAMIC_DATA);\n defaultMaterialProperties = {\n shadeless: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].shadeless),\n pbr: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].pbr)\n };\n \n // Create the tablet app\n ui = new AppUi({\n buttonName: CONFIG.BUTTON_NAME,\n home: URL,\n onMessage: onMessage, // UI event listener \n // Icons are located in graphicsDirectory\n // AppUI is looking for icons named with the BUTTON_NAME \"avatar-101\" \n // For example: avatar-101-a.svg for active button icon, avatar-101-i.svg for inactive button icon\n graphicsDirectory: Script.resolvePath(\"./resources/icons/\"), \n onOpened: onOpened,\n onClosed: onClosed\n });\n\n // Connect unload function to the script ending\n Script.scriptEnding.connect(unload);\n // Connect function callback to model url changed signal\n MyAvatar.skeletonModelURLChanged.connect(onAvatarModelURLChanged);\n }", "function App() {\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 102;\n this.Properties = new PropertyModel_1.PropertyModel();\n this.Users = new UserModel_1.UserModel();\n this.Bookings = new BookingModel_1.BookingModel();\n this.Reviews = new ReviewModel_1.ReviewModel();\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n }", "function initApp() {\n var urlParams, configManager, layoutManager;\n console.log('jimu.js init...');\n urlParams = getUrlParams();\n\n DataManager.getInstance();\n\n html.setStyle(jimuConfig.loadingId, 'display', 'none');\n html.setStyle(jimuConfig.mainPageId, 'display', 'block');\n\n layoutManager = LayoutManager.getInstance({\n mapId: jimuConfig.mapId\n }, jimuConfig.layoutId);\n configManager = ConfigManager.getInstance(urlParams);\n\n layoutManager.startup();\n configManager.loadConfig();\n }", "function main() {\n\n var clientLib = namespace.lookup('com.pageforest.client');\n\n // Client library for Pageforest\n ns.client = new clientLib.Client(ns);\n\n // Use the standard Pageforest UI widget.\n //ns.client.addAppBar();\n\n // This app demonstrates auto-loading - will reload the doc if\n // it is changed by another user.\n ns.client.autoLoad = true;\n\n // Quick call to poll - don't wait a whole second to try loading\n // the doc and logging in the user.\n ns.client.poll();\n\n // Expose appid\n items.appid = ns.client.appid;\n }", "function main() {\n var ui = MyApp.ui,\n widget = MyApp.widget;\n\n // SC.View initially has no layers, so you'll add your widget to your \n // view's layers so it can display itself and receive events.\n ui.get('layers').pushObject(widget);\n\n // Next, you'll tell `SC.app` that you want your `SC.View` surface to \n // become the app's user interface ('ui'). Each app has only one active \n // `ui` surface, though you can change it at any time.\n SC.app.set('ui', ui);\n\n // You can also add arbitary surfaces to the application using \n // `SC.app.addSurface(...)`, but this is for a more advanced tutorial.\n}", "function AppContext() {\n this.lastMaintenanceTime = new Date(0);\n if (AppContext._singleton) {\n throw new Error(\"Singleton instance already created\");\n }\n this._devicePropsStatic = [];\n this._devicePropsDynamic = [];\n this.setAppContextStateToLoggedOut();\n AppContext._singleton = this;\n }", "function App() {\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 102;\n this.User = new UserModel_1.UserModel();\n this.Message = new MessageModel_1.MessageModel();\n this.Chat = new ChatModel_1.ChatModel();\n this.FriendList = new FriendListModel_1.FriendListModel();\n }", "function App () {\n\n this.taskRepository = new TaskRepository();\n\n this.todosController = new TodosController(this.taskRepository);\n\n }", "constructor(props){\n super(props);\n\n this.onAppClick = this.onAppClick.bind(this);\n }", "function appDefaultView(){\n\t//clears everything on the page\n\t\n\tclearSection();\n\t\n\tvar local_simulation = get_local_simulation();\n\t//sets the top bar to be the default look\n\tdefaultheaderView();\n\tif(getVerified() == false){\n\t\talert('You do not have permission to access this. Please get a token first.');\n\t}else{\n\t\t//sets the page to view to 'user information' page\n\t\tvar apps = DeviceAppsListTemplate(local_simulation.apps);\n\t\tvar content = getContainer();\n\t\tif(local_simulation.apps==''||local_simulation.apps==null){\n\t\t\tapps += \"No applications are registed to this simulation.\";\n\t\t}\n\t\tcontent.innerHTML = apps;\n\t\t//sets the sidebar to the sidebar for when inside a simulation\n\t\tsimulationSideBarView();\n\t\tremoveClass('active');\n\t\tdocument.getElementById('my-apps-link').className='active';\n\t}\n}", "constructor() {\n this.appPages = [\n // { title: 'Inbox', url: '/folder/Inbox', icon: 'mail' },\n // { title: 'Outbox', url: '/folder/Outbox', icon: 'paper-plane' },\n // { title: 'Favorites', url: '/folder/Favorites', icon: 'heart' },\n // { title: 'Archived', url: '/folder/Archived', icon: 'archive' },\n // { title: 'Trash', url: '/folder/Trash', icon: 'trash' },\n // { title: 'Spam', url: '/folder/Spam', icon: 'warning' },\n ];\n }", "constructor() {\n super();\n console.log('App-Constructor');\n }", "function resumeInitApp() {\n // this needs the db to exist\n setLoadMessage('Initializing Handlers');\n initGlobalUIHandlers();\n\n // sections\n setLoadMessage('Loading Sections');\n loadSections();\n $('.app-version-number').text(app.getVersion());\n\n // populate some menus\n setLoadMessage('Populating Menus');\n globalDBUpdate();\n\n removeLoader();\n}", "static getInstance() {\n // check if an instance of the class is already created\n if (!AppInfo.singleton) {\n // If not created create an instance of the class\n // store the instance in the variable\n AppInfo.singleton = new AppInfo();\n }\n // return the singleton object\n return AppInfo.singleton;\n }", "init(app) {\n console.log(\"message\");\n super.init(app);\n // let headerLeft = document.getElementById(\"headerLeft\");\n this.setNotification();\n this.registerEvent();\n \n }", "function App() {\n this.express = express();\n this.middleware();\n this.routes();\n this.profiles = new Array();\n this.profiles.push(new IProfile_1.IProfile(1, 'wes', 31, '[email protected]'));\n this.profiles.push(new IProfile_1.IProfile(2, 'Troy', 21, '[email protected]'));\n }", "function initializeApp () {\n makeQuiz();\n eventHandlers();\n}", "function AppTracker() {\n this._init.apply(this, arguments);\n}", "function setAppHandler(app) {\n appHandler = app;\n}", "function App(core, ee) {\n this.core = core;\n this.ee = ee;\n this.sessionfile = __dirname + \"/session.json\";\n}", "constructor(_atdiroverride = -1, _apiurl = -1, _averbose = false){\r\n\t\tthis._app_initialized = false;\r\n\t\tthis._app_conf = { _template_dir: _atdiroverride, _api_url: _apiurl };\r\n\t\tthis._app_templates = [];\r\n\t\tthis._app_templates_buffer = [];\r\n\t\tthis._app_template_styles = [];\r\n\t\tthis._app_started = false;\r\n\t\tthis._app_verbose = _averbose;\r\n\t}", "function loadApp() {\n console.log(\"loadApp\");\n displayHomePage();\n}", "function initializeApp() {\n //adding click functionality to the page\n addHandlers();\n}", "static init() {\n console.log(\"App is Initialize...\");\n }", "function initApp() {\n\tauthCode = null;\n\tchildWindow = null;\n\t//registerBbm();\n\n\t// setup our Foursquare credentials, and callback URL to monitor\n\tfoursquareOptions = {\n\t\tclientId: '*',\n\t\tclientSecret: '*',\n\t\tredirectUri: '*'\n\t};\n\n\t// (bbUI) push the start.html page\n\tbb.pushScreen('start.html', 'start');\n}", "function configLoadApp()//app\n{\n\tapplication_0();\n\tvar appul=document.getElementById(\"appul\");\n\tvar appArr=application;\n\tfor(var i=0;i<appArr.length;i++)\n\t{\n\t\tvar liElement=document.createElement(\"LI\")\n\t\tvar aElement=document.createElement(\"A\")\n\t\tvar imgElement=document.createElement(\"IMG\")\n\t\tvar imgnum=appArr[i][3];\n\t\tif(imgnum==\"\"||imgnum==undefined)\n\t\t{\n\t\t\timgnum=2\n\t\t}\n\t\telse\n\t\t{\n\t\t\timgnum=parseInt(imgnum)\n\t\t}\n\t\timgElement.src=\"images/menuicon\"+imgnum+\".gif\"\n\t\taElement.appendChild(imgElement);\n\t\taElement.href=\"#\"\n\t\taElement.hidefocus=\"true\";\n\t\taElement.innerHTML=aElement.innerHTML+appArr[i][0]\n\t\tliElement.appendChild(aElement);\n\t\tliElement.onclick=new Function(\"selectApp(this,\"+i+\")\")\n\t\tif(appArr[i][1]==1)\n\t\t{\n\t\t\tlastApp=liElement;\n\t\t\tliElement.className=\"Selected\"\n\t\t}\n\t\t\n\t\tappul.appendChild(liElement);\n\t}\n\t\n\tvar liElement=document.createElement(\"LI\")\n\tvar aElement=document.createElement(\"A\")\n\taElement.href=\"#\"\n\taElement.innerText=\">\"\n\tliElement.appendChild(aElement);\n\tliElement.onclick=showAppAfter\n\tliElement.style.display=\"none\"\n\tappul.appendChild(liElement);\n\tdocument.getElementById(\"mainFrame\").src=application[0][2]\n\tcheckAppW()\n}", "function adminAppsView(){\n\tremoveClass('active');\n\tdocument.getElementById('nav-option-applications').className='active';\n\t\n\tvar local_session = get_local_simulation();\n\tvar applications = local_session.apps;\n\tvar app_map = mapDevicestoApp( applications);\n\tconsole.log(app_map);\n\tvar html = viewAdminApplicationsTemplate(app_map);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n}", "function Application() {\n this.element = document.getElementById('application');\n this.startMenu = new StartMenu();\n this.startButton = new MenuButton('start-button', this.startMenu);\n}", "function onAppReady(obj) {\r\n \"use strict\";\r\n \r\n console.log(\"init.js: onAppReady\");\r\n \r\n require([\"MainApp\", \"Router\", \"Config\", \"DataService\", \"handlebars\", \"templates\"], function (MainApp, Router, Config, DataService, handlebars, templates) {\r\n window.app = new MainApp(Config, templates, DataService);\r\n window.app.init();\r\n });\r\n}", "function Application(){\n\t\t\n\t\t\n\t\t/*\n\t\t * Fonction qui initialise une carte\n\t\t */\n\t\tthis.addGMap = function(option){\n\t\t\tif (GBrowserIsCompatible()) {\n\t\t map = new GMap2(document.getElementById(\"map\"));\n\t\t map.addControl(new GLargeMapControl());\n\t\t map.addControl(new GMapTypeControl());\n\t\t map.setCenter(new GLatLng(46.99559235540579,6.931241154670715), 15);\n\t\t\t\tmap.setMapType(G_SATELLITE_TYPE);\n\t\t }\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction qui ajoute une carte avec des données neuchâteloises\n\t\t */\n\t\tthis.addGMapNeuchatel = function(option){\n\t\t\tif (GBrowserIsCompatible()) {\n\t\t\t\tmap = new GMap2(document.getElementById(\"map\"));\n\n\t\t\t\t// Create tile layers\n\t\t\n\t\t\t\t// une couche holistic ortho\n\t\t\t\t// var tileHolistic = new GTileLayer(new GCopyrightCollection(\"sitn\"),15,19);\n\t\t\t\t// tileHolistic.myLayers ='orthos_2006_0';\n\t\t\t\t// tileHolistic.myFormat ='image/jpeg'; // image/png; mode=24bit\n\t\t\t\t// tileHolistic.myBaseURL ='http://sitn.ne.ch/ogc-sitn-ecoparc/wms?';\n\t\t\t\t// \t\t \ttileHolistic.getTileUrl = CustomGetTileUrl;\n\t\t\t\t// \t\t\n\t\t\t\t// var tileHolisticPlan = new GTileLayer(new GCopyrightCollection(\"sitn\"),15,15);\n\t\t\t\t// tileHolisticPlan.myLayers ='plan_ville_15000';\n\t\t\t\t// tileHolisticPlan.myFormat ='image/jpeg';\n\t\t\t\t// tileHolisticPlan.myBaseURL ='http://sitn.ne.ch/ogc-sitn-ecoparc/wms?';\n\t\t\t\t// \t\t \ttileHolisticPlan.getTileUrl = CustomGetTileUrl;\n\t\t\t\t// \t\t\n\t\t\t\t// var tileHolisticPlan10000 = new GTileLayer(new GCopyrightCollection(\"sitn\"),16,17);\n\t\t\t\t// tileHolisticPlan10000.myLayers ='plan_ville_10000';\n\t\t\t\t// tileHolisticPlan10000.myFormat ='image/jpeg';\n\t\t\t\t// tileHolisticPlan10000.myBaseURL ='http://sitn.ne.ch/ogc-sitn-ecoparc/wms?';\n\t\t\t\t// \t\t \ttileHolisticPlan10000.getTileUrl = CustomGetTileUrl;\n\t\t\n\t\t\t\tvar tileOrtho= new GTileLayer(new GCopyrightCollection(\"sitn\"),1,19);\n\t\t\t\ttileOrtho.myLayers='ortho'; // ombrage_mnt25,ombrage_laser_terrain,plan_ensemble,ortho,communes\n\t\t\t\ttileOrtho.myFormat='image/jpeg';\n\t\t\t\ttileOrtho.myBaseURL='http://sitn.ne.ch/ogc-sitn-open/wms?';\n\t\t\t//\ttileOrtho.myBaseURL='http://sitn.ne.ch/ogc-sitn-plantes-invasives/wms?';\n\t\t \ttileOrtho.getTileUrl=CustomGetTileUrl;\n\t\t\n\t\t\t\tvar layer1=[G_NORMAL_MAP.getTileLayers()[0]]; \n\t\t\t\tvar layer2=[tileOrtho]; \n\t\t\t\tvar layer3=[G_HYBRID_MAP.getTileLayers()[0]];\n\t\t\t\t// var layer6=[tileHolistic];\n\t\t\t\t// var layer7=[tileHolisticPlan];\n\t\t\t\t// var layer8=[tileHolisticPlan10000];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tvar cartePlanGoogle = new GMapType(layer1, G_SATELLITE_MAP.getProjection(), \"Plan\", G_SATELLITE_MAP);\n\t\t\t\tvar carteNeuch = new GMapType(layer2, G_SATELLITE_MAP.getProjection(), \"Photos Neuchâtel\", G_SATELLITE_MAP);\n\t\t \tvar carteOrthoGoogle = new GMapType(layer3, G_SATELLITE_MAP.getProjection(), \"Photos Google\", G_SATELLITE_MAP);\n\t\t\t\t// var carteHolistic = new GMapType(layer6, G_SATELLITE_MAP.getProjection(), \"Holistic\", G_SATELLITE_MAP);\n\t\t\t\t// \t\t\tvar carteHolisticPlan = new GMapType(layer7, G_SATELLITE_MAP.getProjection(), \"Plan Neuch\", G_SATELLITE_MAP);\n\t\t\t\t// \t\t\tvar carteHolisticPlan10000 = new GMapType(layer8, G_SATELLITE_MAP.getProjection(), \"Plan Neuch2\", G_SATELLITE_MAP);\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t\t\tmap.getMapTypes().length = 0;\n\t\t \tmap.addMapType(cartePlanGoogle);\n\t\t\t\tmap.addMapType(carteNeuch);\n\t\t \tmap.addMapType(carteOrthoGoogle);\n\t\t\t\t// map.addMapType(carteHolistic);\n\t\t\t\t// map.addMapType(carteHolisticPlan);\n\t\t\t\t// map.addMapType(carteHolisticPlan10000);\n\n\t\t\t\tmap.setCenter(new GLatLng(46.995394778431226,6.9428551197052), 16,carteNeuch);\n\t\t\t\t\n\t\t\t\t// ajoute les contrôles\n\t\t\t\tmap.addControl(new GLargeMapControl());\n\t\t\t\tmap.addControl(new GMapTypeControl());\n\t\t\t}else{\n\t\t\t\talert(\"Sorry, the Google Maps API is not compatible with this browser\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction appellée au clic de la carte\n\t\t */\n\t\tthis.ajouteMarker = function(overlay, point){\n\t\t//\tmap.clearOverlays();\n\t\t\tif (point) {\n\t\t\t\tmap.addOverlay(new GMarker(point));\n\t\t\t\tmap.panTo(point);\n\t\t\t\tlatitude = point.lat();\n\t\t\t\tlongitude = point.lng();\n\t\t\t\t// echo(latitude);\n\t\t\t\t// echo(longitude);\n\t\t\t\t\n\t\t\t\t// avant d'ajouter la nouvelle valeur du point sauve l'ancienne\n\t\t\t\tvar lat = $('#latitude').val();\n\t\t\t\tvar lng = $('#longitude').val();\n\t\t\t\t$('#latitude2').val(lat);\n\t\t\t\t$('#longitude2').val(lng);\n\t\t\t\t\n\t\t\t\t// met à jour la coordonnée\n\t\t\t\t$('#latitude').val(latitude);\n\t\t\t\t$('#longitude').val(longitude);\n\t\t\t\t// délègue la recherche et l'affichage de l'atlitude\n\t\t\t\tapp.getSwissCoord(point);\n\t\t\t\tapp.getAltitude(point);\n\t\t\t\tapp.logParcours(point);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Fonction qui permet d'obtenir l'altitude via un script local qui va piocher chez geoname.org\n\t\t */\n\t\tthis.getAltitude = function(point){\n\t\t\t//carto.php?action=altitude&lat=46.94952985143932&lng=6.834204196929932\n\t\t\tvar url = chemin+\"utile/ajax/carto.php\";\n\t\t\t\n\t\t\t// appelle un script local\n\t\t\t// url , param, fonction de callback\n\t\t\t$.get(url,{'action':'altitude','lat':point.lat(),'lng':point.lng()},app.rafraichitAltitude);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction qui affiche l'altitude\n\t\t */\n\t\tthis.rafraichitAltitude = function(html){\n\t\t\t$('#altitude').val(html);\n\t\t}\n\t\t\n\t\n\t\t/*\n\t\t * Fonction qui permet d'obtenir l'altitude via un script local qui va piocher chez geoname.org\n\t\t */\n\t\tthis.getSwissCoord = function(point){\n\t\t\t//carto.php?action=altitude&lat=46.94952985143932&lng=6.834204196929932\n\t\t\tvar url = chemin+\"utile/ajax/carto.php\";\n\t\t\t\n\t\t\t// appelle un script local\n\t\t\t// url , param, fonction de callback\n\t\t\t$.get(url,{'action':'wgs84toch1903','lat':point.lat(),'lng':point.lng()},app.rafraichitSwissCoord);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction qui affiche les coordonnée suisse\n\t\t */\n\t\tthis.rafraichitSwissCoord = function(html){\n\t\t\t$('#swissCoord').val(html);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction qui permet d'obtenir l'altitude via un script local qui va piocher chez geoname.org\n\t\t */\n\t\tthis.logParcours = function(point){\n\t\t\t//carto.php?action=altitude&lat=46.94952985143932&lng=6.834204196929932\n\t\t\tvar url = chemin+\"utile/ajax/carto.php\";\n\t\t\t// point précédent\n\t\t\tvar oldLat = $('#latitude2').val();\n\t\t\tvar oldLng = $('#longitude2').val();\n\t\t\t\n\t\t\t// url , param, fonction de callback\n\t\t\t$.get(url,{'action':'wgs84toch1903','lat':point.lat(),'lng':point.lng()},app.rafraichitLogCoord);\n\t\t\t$.get(url,{'action':'altitude','lat':point.lat(),'lng':point.lng()},app.rafraichitLogAltitude);\n\t\t\t\n\t\t\t// va chercher la distance entre le point courant et le précédent. sauf si ce dernier = 0 (donc pas de point précédent)\n\t\t\tif (oldLat!=0) {\n\t\t\t\t$.get(url,{'action':'distance','lat':point.lat(),'lng':point.lng(),'lat2':oldLat,'lng2':oldLng},app.rafraichitLogDistance);\n\t\t\t};\n\t\t\t\n\t\t\tapp.ajouteContenuLog('<br />');\n\t\t\t\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction fait le log\n\t\t */\n\t\tthis.rafraichitLogAltitude = function(html){\n\t\t\t$('#parcours').append('&nbsp;&nbsp;&nbsp;<span class=\"altitude\">'+html+'</span>');\n\t\t}\n\t\tthis.rafraichitLogCoord = function(html){\n\t\t\t$('#parcours').append('&nbsp;&nbsp;&nbsp;<span class=\"coord\">'+html+'</span>');\n\t\t}\n\t\tthis.rafraichitLogDistance = function(html){\n\t\t\t$('#parcours').append('&nbsp;&nbsp;&nbsp;<span class=\"distance\">'+html+'</span>');\n\t\t}\n\t\t\n\t\t/*\n\t\t * Fonction fait permettant d'ajouter du contenu au log.. des <br /> par exemple..\n\t\t */\n\t\tthis.ajouteContenuLog = function(html){\n\t\t\t$('#parcours').append(html);\n\t\t}\n\t\t\n\t\t/*\n\t\t * reset. efface les points et les logs ... ne semble pas fonctionner.. pourquoi ??\n\t\t */\n\t\tthis.reset = function(){\n\t\t\t$('#parcours').empty();\n\t\t\tmap.clearOverlays();\n\t\t}\n\t\t\n\t\t\n\t\t/////////////// geocoding ///////\n\t\t/*\n\t\t * va chercher l'adresse dans le formulaire et demande à google via un géocodeur de créer une marker\n\t\t */\n\t\t\n\t\tthis.setMarkerFromAddress = function(){\n\t\t\t// efface la carte la carte\n\t\t//\tmap.clearOverlays();\n\n\t\t\t// on crée un Client Geocoder\n\t\t\tvar geo = new GClientGeocoder();\n\t\t\t\n\t\t\tvar adresse = $('#inputAdresse').val();\n\t\t\t\n\t\t\tgeo.getLatLng(adresse, app.setMarker);\n\t\t}\n\t\t\n\t\t\n\t/*\n\t * ajoute un marker\n\t */\n\t\tthis.setMarker = function(point){\n\t\t//\tmap.clearOverlays();\n\t\t\tif (point) {\n\t\t\t\tmap.addOverlay(new GMarker(point));\n\t\t\t\tmap.panTo(point);\n\t\t\t\tlatitude = point.lat();\n\t\t\t\tlongitude = point.lng();\n\t\t\t\t// echo(latitude);\n\t\t\t\t// echo(longitude);\n\t\t\t\t\n\t\t\t\t// avant d'ajouter la nouvelle valeur du point sauve l'ancienne\n\t\t\t\tvar lat = $('#latitude').val();\n\t\t\t\tvar lng = $('#longitude').val();\n\t\t\t\t$('#latitude2').val(lat);\n\t\t\t\t$('#longitude2').val(lng);\n\t\t\t\t\n\t\t\t\t// met à jour la coordonnée\n\t\t\t\t$('#latitude').val(latitude);\n\t\t\t\t$('#longitude').val(longitude);\n\t\t\t\t// délègue la recherche et l'affichage de l'atlitude\n\t\t\t\tapp.getSwissCoord(point);\n\t\t\t\tapp.getAltitude(point);\n\t\t\t\tapp.logParcours(point);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t}", "checkIfChildApp() {\n if (finsembleWindow.windowOptions &&\n finsembleWindow.windowOptions.customData &&\n finsembleWindow.windowOptions.customData.parentUUID &&\n finsembleWindow.windowOptions.customData.parentUUID !== system_1.System.Application.getCurrent().uuid) {\n let parent = system_1.System.Application.wrap(finsembleWindow.windowOptions.customData.parentUUID);\n parent.addEventListener(\"crashed\", this.close.bind(null, false));\n parent.addEventListener(\"initialized\", this.close.bind(null, false));\n parent.addEventListener(\"out-of-memory\", this.close.bind(null, false));\n }\n }", "constructor(app) {\n this.mode = null;\n this.oldMode = null;\n this.app = app;\n this.updateUITools();\n }", "poll(_pri) {\n HSystem.reniceApp(this.appId, _pri);\n }", "bootstrapKiosk() {\n this.loading = 'Bootstrapping application...';\n if (this.active_building && this.active_level) {\n if (localStorage) {\n localStorage.setItem('KIOSK.building', this.active_building.id);\n localStorage.setItem('KIOSK.level', this.active_level.id);\n if (this.active_rotation) {\n localStorage.setItem('KIOSK.orientation', this.active_rotation.value);\n }\n if (this.active_location) {\n localStorage.setItem('KIOSK.location', `${this.active_location.id}`);\n }\n }\n this._router.navigate(['/welcome']);\n }\n this.loading = null;\n }", "function _initApp(){\n console.log('[ app_logic.js ] : ' + 'initiating app ..'); // debug message > app is launching\n _check_modules(); // check if the necessary modules are present\n _initial_setup_app_init(); // actually init the app's 'initial setup' config/params (..)\n }", "function AppMonitor() {\n}", "function initApp () {\n loadThemes();\n}", "get appBtn () { return $(\"~App\")}", "function AppGroup() {\n this._init.apply(this, arguments);\n}", "constructor(_priority, _label) {\n\n super();\n\n this.elemId = 0; // document.body\n\n // Special null viewId for HApplication instances,\n // they share a system-level root view; the document object\n this.viewId = null;\n\n // storage for views\n this.views = [];\n\n // storage for dom element id's in view, not utilized in HApplication by default\n this.markupElemIds = [];\n\n // Views in Z order. The actual Z data is stored in HSystem, this is just a\n // reference to that array.\n this.viewsZOrder = HSystem.viewsZOrder;\n\n // Finalize initialization via HSystem\n HSystem.addApp(this, _priority);\n\n if (_label) {\n this.label = _label;\n }\n else {\n this.label = 'ProcessID=' + this.appId;\n }\n }", "constructor(_priority, _label) {\n\n super();\n\n this.elemId = 0; // document.body\n\n // Special null viewId for HApplication instances,\n // they share a system-level root view; the document object\n this.viewId = null;\n\n // storage for views\n this.views = [];\n\n // storage for dom element id's in view, not utilized in HApplication by default\n this.markupElemIds = [];\n\n // Views in Z order. The actual Z data is stored in HSystem, this is just a\n // reference to that array.\n this.viewsZOrder = HSystem.viewsZOrder;\n\n // Finalize initialization via HSystem\n HSystem.addApp(this, _priority);\n\n if (_label) {\n this.label = _label;\n }\n else {\n this.label = 'ProcessID=' + this.appId;\n }\n }", "function Main() {\n configApp(roleSelection);\n}", "onChildAppStart () {\n\n }", "constructor(app = null) {\n this.app = app;\n }", "static getApp(id) {\n if (id in App.appCache) {\n return App.appCache[id];\n } else {\n const instance = new App(id);\n\n App.appCache[id] = instance;\n\n return instance;\n }\n }", "initSliderVariablesApp(){\n super.initSliderVariablesApp();\n\n this._initAppVariable(\"Speed\", 1);\n this._initAppVariable(\"Gravity\", 5);\n }" ]
[ "0.59443486", "0.5921244", "0.5871539", "0.5839616", "0.5835826", "0.5810795", "0.5810795", "0.57308877", "0.56739163", "0.5656072", "0.5653936", "0.5599793", "0.5574181", "0.5567349", "0.5559737", "0.5557001", "0.5538022", "0.5513588", "0.55119854", "0.54901546", "0.5486249", "0.5434682", "0.5417872", "0.5402856", "0.54014647", "0.53838146", "0.53809726", "0.53694236", "0.534762", "0.5331711", "0.5314952", "0.5308117", "0.5305971", "0.5303903", "0.5302959", "0.5292538", "0.5286634", "0.528215", "0.5263218", "0.52604294", "0.52604294", "0.52597904", "0.5256146", "0.5255219", "0.52485895", "0.52474135", "0.5228136", "0.522293", "0.5216586", "0.5214397", "0.5206157", "0.520089", "0.51968193", "0.5189228", "0.5178336", "0.5167411", "0.5167097", "0.5146807", "0.51448923", "0.5143727", "0.5143586", "0.5140968", "0.5140033", "0.5138169", "0.5135616", "0.5131933", "0.51215214", "0.51200306", "0.51156825", "0.51110876", "0.5102447", "0.509077", "0.5088763", "0.50864995", "0.50835836", "0.5074138", "0.5072618", "0.50725627", "0.5064236", "0.5062395", "0.505969", "0.5053246", "0.5049694", "0.50454557", "0.5042501", "0.5041746", "0.503723", "0.50303406", "0.5026663", "0.50226146", "0.50189185", "0.5014371", "0.501373", "0.5010063", "0.50081605", "0.50081605", "0.50063026", "0.50058126", "0.50052696", "0.50045514", "0.49981833" ]
0.0
-1
DISPLAY'S THE GOOGLE MAP IN THE HTML CENTERED ON THE USER'S POSITION
function showMap(myLat, myLong) { // Create a LatLng object with the GPS coordinates. // var myLatLng = new google.maps.LatLng(lat, lon); // Create the Map Options var mapOptions = { zoom: 2, center: {lat: myLat, lng: myLong}, mapTypeId: google.maps.MapTypeId.ROADMAP // disableDefaultUI: true }; // Generate the map // var heatmap = new google.maps.visualization.HeatmapLayer({ // data: heatMapData // }; // Setting the map to the html div var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); // Setting the heatmap layer onto the map (must come after the above line of code) // heatmap.setMap(map); var marker = new google.maps.Marker({ position: {lat: myLat, lng: myLong}, map: map, title: 'Hello World!' }); return map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSuccess(position) {\n \n document.getElementById('map').innerHTML = \"<iframe src = \\\"https:\\/\\/maps.google.com\\/maps?q=\"+position.coords.latitude+\",\"+position.coords.longitude+\"&hl=es;z=14&amp;output=embed\\\" frameborder=\\\"0\\\" style=\\\"height:100%; width:100%\\\"><\\/iframe>\";\n\n }", "function showPosition(position) {\r\n x.innerHTML = \"Latitude: \" + position.coords.latitude +\r\n \"<br>Longitude: \" + position.coords.longitude + \"<br>Altitude: \" + position.coords.altitude;\r\n\tvar latlon = position.coords.latitude + \",\" + position.coords.longitude;\r\n\r\n var img_url = \"https://maps.googleapis.com/maps/api/staticmap?center=\"\r\n +latlon+\"&zoom=14&size=400x300&sensor=false\";\r\n document.getElementById(\"map\").innerHTML = \"<img src='\"+img_url+\"'>\";\r\n}", "function showPosition(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n latlon = new google.maps.LatLng(lat, lon)\n mapholder = document.getElementById('mapholder')\n mapholder.style.height = '250px';\n mapholder.style.width = '500px';\n\n var myOptions = {\n center:latlon,zoom:14,\n mapTypeId:google.maps.MapTypeId.ROADMAP,\n mapTypeControl:false,\n navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL}\n }\n \n var map = new google.maps.Map(document.getElementById(\"mapholder\"), myOptions);\n var marker = new google.maps.Marker({position:latlon,map:map,title:\"You are here!\"});\n\t\n\t\t\n\tlt = document.getElementById(\"la\").value = innerHTML = position.coords.latitude;\n\tlg = document.getElementById(\"lo\").value = innerHTML = position.coords.longitude;\n}", "function displayMap(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n\n\n latLng = new google.maps.LatLng(latitude, longitude);\n\n var mapOptions = {\n center:latLng, \n zoom:12,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n }; \n\n map = new google.maps.Map(document.getElementById(\"myMap\"), mapOptions);\n}", "function showCoords() {\n // TODO: Set the map center to the latitude / longitude position of your own home\n\n\n // TODO: Zoom the map close enough\n\n}", "function showMap()\n{\n //Get the position of this place\n var pos =JSON.parse(window.sessionStorage.getItem(\"position\"));\n var mapCenter = new google.maps.LatLng(pos.lat,pos.lng);\n\n //Create the map with the center in the place's position\n map = new google.maps.Map(document.getElementById('map-canvas'), {\n center: mapCenter,\n zoom: 14\n });\n \n //Create a marker with this place\n var marker = new google.maps.Marker({\n position: mapCenter,\n map: map,\n });\n}", "function showMap() {\r\n\tvar def_lat = document.getElementById('lat-box').innerHTML;\r\n\tvar def_lng = document.getElementById('lng-box').innerHTML;\r\n\tvar latLng = new google.maps.LatLng(def_lat, def_lng);\r\n\tvar map = new google.maps.Map(document.getElementById('map-canvas'), {\r\n\t\t\tzoom: 16,\r\n\t\t\tcenter: latLng,\r\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\r\n\t});\r\n\tvar marker = new google.maps.Marker({\r\n\t\t\tposition: latLng,\r\n\t\t\tmap: map,\r\n\t\t\tdraggable: false\r\n\t});\r\n}", "function displayMap(resLat,resLong,pId){\n $(\"#\"+pId).append(\"<iframe width='250' height='250' frameborder='0' style='border:0' src='https://www.google.com/maps/embed/v1/view?zoom=18&center=\" + resLat + \",\" + resLong + \"&key=\" + apiKey_displayMap + \"' allowfullscreen></iframe>\");\n}", "function getMap(content, latitude, longitude) {\n var mapOptions = {\n center: new google.maps.LatLng(0, 0),\n zoom: 1,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n map = new google.maps.Map(document.getElementById(content +\"_map\"), mapOptions);\n\n var latLong = new google.maps.LatLng(latitude, longitude);\n var marker = new google.maps.Marker({\n position: latLong\n });\n\n marker.setMap(map);\n map.setZoom(20);\n map.setCenter(marker.getPosition()); \n \n }", "draw() {\n if (!this.getMap() || !this._html) {\n return;\n }\n if (!this._marker && !this._position) {\n return;\n }\n\n const divPixel = this.getProjection().fromLatLngToDivPixel(\n this._position || this._marker.getPosition()\n );\n\n if (divPixel) {\n const widthInfo = this._html.floatWrapper.clientWidth;\n const heightInfo = this._html.floatWrapper.clientHeight;\n\n this._html.floatWrapper.style.top = `${Math.floor(divPixel.y)}px`;\n this._html.floatWrapper.style.left = `${Math.floor(divPixel.x)}px`;\n }\n if (!this._isOpen) {\n this._isOpen = true;\n this.resize();\n this.reposition();\n this.activateCallback('afterOpen');\n GOOGLE_MAP_API.event.trigger(\n this.getMap(),\n `${this._eventPrefix}opened`,\n this\n );\n }\n }", "function showPosition(position){\n\tconsole.log(\"position :\",position);\n\tdisplayCoords.innerHTML = \"Latitude : \"+\n\t\tposition.coords.latitude +\n\t\t\"<br />Longitude: \" +\n\t\tposition.coords.longitude;\n\n\t\t//display the map\n\t\tshowOnGoogleMap(new google.maps.LatLng(position.coords.latitude,\n\t\t\t position.coords.longitude));\n\n\n}", "showMap(mapCenter) {\n // The location of Uluru\n var uluru = { lat: -25.344, lng: 131.036 };\n // The map, centered at Uluru\n var map = new window.google.maps.Map(\n document.getElementById('map'), { zoom: 15, center: mapCenter });\n this.directionsRenderer.setMap(map);\n // The marker, positioned at Uluru\n var marker = new window.google.maps.Marker({ position: mapCenter, map: map });\n\n }", "function gwmap_indicate_position(whichMap, posX, posY, width, height, zoom)\r\n{\r\n // use default values for width and height of not passed\r\n if (!width) width='300px';\r\n if (!height) height='300px';\r\n // add timestamp to div id to make sure we have a unique identifier\r\n var divId = 'gwmap_' + new Date().getTime();\r\n // output the div we use to display the map\r\n document.write('<div id=\"'+divId+'\" style=\"width: '+width+'; height: '+height+';\"></div>');\r\n // create map object and attach\r\n mapObj = new GWMap(divId, whichMap, zoom, posX, posY);\r\n mapObj.indicatePosition(posX, posY);\r\n}", "function initMap() {\n\n //below line returns geolocation object that gives webcontent access to current position\n navigator.geolocation.getCurrentPosition(pos => {\n const { latitude: lat, longitude: lng } = pos.coords\n\n //Creates a new map inside of the given HTML container, DIV element\n map = new google.maps.Map(document.getElementById('map'), {\n center: { lat, lng },\n zoom: 16\n })\n }, err => {\n console.error(err)\n })\n}", "function displayMap(coordinates) {\n // The map, centered at park\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 6,\n center: coordinates,\n });\n // The marker, positioned at park\n const marker = new google.maps.Marker({\n position: coordinates,\n map: map,\n });\n }", "function renderMap(LAT,LNG){\n \n // declaring the google map obl and geting the division where it should be loaded\n map = plugin.google.maps.Map.getMap(mapDiv);\n\n // creating a map obj that will be passed to map \n mapObj = {\n target: {lat: LAT, lng: LNG},\n zoom: 17,\n tilt: 60,\n bearing: 140,\n duration: 5000\n }\n \n // addint a marker to the map\n var marker = map.addMarker({\n position: {lat: LAT, lng: LNG},\n title: \"Your Task Location\",\n animation: plugin.google.maps.Animation.BOUNCE\n });\n\n //passig the map obg to initialize the map\n map.animateCamera(mapObj);\n marker.showInfoWindow();\n\n}", "function showMap(lat, long) {\n // Create a Google LatLng object from users current position\n var googleLatLong = new google.maps.LatLng(lat, long);\n // Create an object literal to define map properties\n var mapOptions = {\n zoom: 12,\n center: googleLatLong,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n // Retrieve map element from DOM\n var mapDiv = document.getElementById(\"map\");\n // Make map div visible\n mapDiv.style.display = \"block\";\n // Add map to page and center it on current position\n map = new google.maps.Map(mapDiv, mapOptions);\n map.panTo(googleLatLong);\n}", "function initialize() {\n var center = new google.maps.LatLng(document.getElementsByTagName('p')[2].innerHTML,document.getElementsByTagName('p')[1].innerHTML);\n var mapOptions = {\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: center,\n };\n this.map = new google.maps.Map(document.getElementById('map_canvas'),\n mapOptions);\n}", "function myMap() {\n var mapCanvas = document.getElementById(\"map\");\n var mapOptions = {\n center: new google.maps.LatLng(51.5, -0.2), zoom: 10\n };\n var map = new google.maps.Map(mapCanvas, mapOptions);\n }", "function initialize() {\nvar frm = {lat:25.020192, lng:121.529104, title: 'Get off at here!', msg:'<h2>Taipower MRT Ext2</h2><p>300m away from my apartment, it is just a 5m walk from here.</p>' };\n// xinhai rd\nvar to = {lat:25.021402, lng:121.531651, title: 'My apartment', msg: '<p>2F, No. 90, Sec. 1, Xin-hai Rd.</p><h2>There is a coin laundry store next to it.</h1>'};\nvar xinhai = new google.maps.LatLng(to.lat, to.lng);\nvar opt =\n{ \ncenter:xinhai,\nzoom:17,\n//mapTypeId: google.maps.MapTypeId.TERRAIN,\nmapTypeId: google.maps.MapTypeId.ROADMAP,\n};\nmap = new google.maps.Map(document.getElementById(\"googlemap\"),opt);\n// google.maps.event.addDomListener(window, 'load', initialize);\n}", "function initMap() {\r\n // The location of Uluru\r\n const uluru = { lat: -25.344, lng: 131.036 };\r\n // The map, centered at Uluru\r\n const map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 4,\r\n center: uluru,\r\n });\r\n // The marker, positioned at Uluru\r\n const marker = new google.maps.Marker({\r\n position: uluru,\r\n map: map,\r\n });\r\n}", "function load(){\r\n if(GBrowserIsCompatible()){\r\n map = new GMap2(document.getElementById(\"map\"));\r\n map.addControl(new GLargeMapControl());\r\n map.addControl(new GMapTypeControl());\r\n LatLng=new GLatLng(47.643742,6.8565076);\r\n map.setCenter(LatLng, 13);\r\n //map.setCenter(new GLatLng(48.125768, 7.481689), 8);\r\n }else {\r\n alert(\"Sorry, the Google Maps API is not compatible with this browser\");\r\n }\r\n getPosition.delay(2000);\r\n //getGeofences.delay(4000);\r\n}", "function showMap(e){\n\n //capture target <li> element on to a variable for later use. \n var target=e.target.innerHTML;\n \n //use target as the latlon input for google api map url\n var img_url=\"http://maps.googleapis.com/maps/api/staticmap?center=\"+target+\"&zoom=14&size=640x200&sensor=true\";\n \n //use map url image to display map on mapholder DOM\n document.getElementById(\"mapholder\").innerHTML=\"<object><img src='\"+img_url+\"'></object>\";\n\n //On mouseout event display no map\n if (e.type==\"mouseout\") {\n document.getElementById(\"mapholder\").innerHTML=\"\";\n }//end of if\n \n }//end of showMap function", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 10,\n center: { lat: 41.8781, lng: -87.6298 },\n });\n \n }", "function displayMap() {\n var canvas = document.createElement(\"canvas\");\n var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;\n canvas.width = (width*0.891);\n canvas.height = (width*0.891);\n var output2 = document.querySelector(\"#two\");\n output2.appendChild(canvas);\n var context = canvas.getContext(\"2d\");\n var img = document.createElement(\"img\");\n img.src = \"https://maps.googleapis.com/maps/api/staticmap?center=\" + latitude + \",\" + longitude + \"&zoom=17&size=\" + width + \"x\" + width + \"&scale=2&maptype=hybrid&language=english&markers=color:white|\" + latitude + \",\" + longitude + \"&key=AIzaSyDP68CXSK9TynSN4n_Moo7PPakL8SQM0xk\";\n img.onload = function imageDraw() {\n context.drawImage(img, 0, 0, (width*0.891), (width*0.891));\n }\n}", "function initMap() {\n // The location of Uluru\n var uluru = { lat: -25.344, lng: 131.036 };\n // The map, centered at Uluru\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru\n });\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({ position: uluru, map: map });\n}", "function gmapRecenter(map) {\n var latnew = Number(document.getElementById(\"pln-latitude\").value);\n const lngnew = Number(document.getElementById(\"pln-longitude\").value);\n const loca = { lat: latnew, lng: lngnew };\n map.setCenter(loca);\n map.setZoom(15);\n\n //* Also recentre Bing Map at the same time\n GetMap(document.getElementById(\"pln-latitude\").value, document.getElementById(\"pln-longitude\").value);\n}", "function initMap() {\n var map;\n map = new google.maps.Map(document.getElementById(\"map-view\"), {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8\n });\n\n\n}", "function initMap() {\n // The location of Uluru\n var uluru = {lat: -25.344, lng: 131.036};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 4, center: uluru});\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({position: uluru, map: map});\n}", "function initMap() {\n var mapDiv = document.getElementById('contact-map-inside');\n var map = new google.maps.Map(mapDiv, {\n center: {\n lat: 40.7058254,\n lng: -74.1180847\n },\n zoom: 12\n });\n}", "function show_map(position) {\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n ShowMap_LatLong(lat, lon, null, false);\n }", "function showMap() {\n\n\t\tvar website = getUrlVars()['website'];\n\t\tvar email = getUrlVars()['email'];\n\t\tvar telephone = getUrlVars()['telephone'];\n\t\tvar featureRelId = getUrlVars()['transferId'];\n\t\tvar userSiteId = getUrlVars()['touchId'];\n\t\tvar featureId = getUrlVars()['mId'];\n\t\tvar lat = getUrlVars()['lat'];\n\t\tvar longi = getUrlVars()['long']; \n\t\tvar userLocation = getUrlVars()['location'];\n if (lat == '' || lat == undefined || lat == null) {\n userLocation = ' another location';\n\t\talert(userLocation);\n }\n var i = 0;\n if (lat != '' && lat != undefined && lat != null) {\n i++;\n\t\t\n }\n if (i == 1) {\n\n var html = \"\";\n html += \"<h4>Points showing your current location and entered location</h4>\";\n\t\t\n var showButton = '<div data-role=\"controlgroup\" data-mini=\"mini\" data-type=\"horizontal\"> <a href=\"tel:' + telephone + '\" data-role=\"button\" >Call us</a> <a rel=\"external\" href=\"detail.html?id=0&transferId=' + featureRelId + '&touchId=' + userSiteId + '&mId=' + featureId + '&return_url=' + website + '\" data-role=\"button\" >Website</a> <a rel=\"external\" href=\"mailto:' + email + '?Subject=share location?body=latitude is ' + lat + ' and longitude is ' + longi + '\" data-role=\"button\">Email</a></div>';\n $('#direction-detail').html(html);\n\t\t$('#direction-buttons').html(showButton);\n \n\t $('#map_canvas').gmap().bind('init', function (evt, map) {\n\t\t\tvar Position2 = new google.maps.LatLng(lat, longi);\n\t\t$('#map_canvas').gmap('addMarker', { 'position': Position2, 'bounds': true }).click(function () {\n\t\t$('#map_canvas').gmap('openInfoWindow', { 'content': '<div>' + userLocation + '</div>' }, this);\n\t\t});\n $('#map_canvas').gmap('getCurrentPosition', function (position, status) {\n\t\t\n if (status === 'OK') {\n var clientPosition = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n \n $('#map_canvas').gmap('addMarker', { 'position': clientPosition, 'bounds': true }).click(function () {\n $('#map_canvas').gmap('openInfoWindow', { 'content': '<div>My current location</div>' }, this);\n });\n\n \n }\n });\n });\n\t\t\n } else {\n var html = \"<h3>Get directions</h3>\";\n html += \"<div style='padding:10px'>Sorry ! Failed to load directions. </div>\";\n\t\t$('#main-content').html(html);\n }\n\ngetUserAppereance();\n try {\n $(\"#main-content\").trigger('create');\n } catch (e) {\n $(\"#main-content\").listview();\n }\n}", "static get template() {\n return `\n<div class=\"mapouter\"><div class=\"gmap_canvas\"><iframe width=\"300\" height=\"300\" id=\"gmap_canvas\" \nsrc=\"https://maps.google.com/maps?q=[[lat]]%2C[[lng]]&t=&z=[[zoom]]&ie=UTF8&iwloc=&output=embed\" \nframeborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\"></iframe>\n</div><style>.mapouter{text-align:right;height:300px;width:300px;}.gmap_canvas {overflow:hidden;background:none!important;height:300px;width:300px;}</style></div>\n `;\n }", "function showPos(position){ \n latt = position.coords.latitude; \n long = position.coords.longitude; \n var lattlong = new google.maps.LatLng(latt, long); \n var myOptions = { \n center: lattlong, \n zoom: 15, \n mapTypeControl: true, \n navigationControlOptions: {style:google.maps.NavigationControlStyle.SMALL} \n } \n var maps = new google.maps.Map(document.getElementById(\"headquaters-map\"), myOptions); \n var markers = \n new google.maps.Marker({position:lattlong, map:maps, title:\"This is Geolocation!\"}); \n}", "function gmInitialize() {\n $('#contents').html('<div id=\"map\"></div>');\n var myLatLng = new google.maps.LatLng(29.516596899999996, -95.71289100000001);\n GEO = new google.maps.Geocoder();\n MAP = new google.maps.Map(document.getElementById('contents'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: myLatLng,\n zoom: 4\n });\n}", "function initMap() {\r\n // The location of Uluru\r\n const uluru = { lat: 55.74303813644981, lng: 37.58454627585226 };\r\n // The map, centered at Uluru\r\n const map = new google.maps.Map(document.getElementById(\"map\"), {\r\n zoom: 14,\r\n center: uluru,\r\n });\r\n // The marker, positioned at Uluru\r\n const marker = new google.maps.Marker({\r\n position: uluru,\r\n map: map,\r\n });\r\n }", "function displayMap() {\n $('#mapDiv').append(googleMap);\n}", "function initMap() {\n var latLng = {\n lat: 20.6772885,\n lng: -103.3856328\n }\n var map = new google.maps.Map(document.getElementById('mapa'), {\n 'center': latLng,\n 'zoom': 14,\n 'mapTypeId':google.maps.MapTypeId.ROADMAP,\n /*\n 'draggable' : false,\n 'scrollwheel ':false\n */\n });\n\n var contenido = '<h2>GDLWEBCAMP</h2>'+\n '<p>Del 10 al 12 de Diciembre</p>'+\n '<p>Visitanos!</p>'\n\n var informacion = new google.maps.InfoWindow({\n content: contenido\n });\n\n var marker = new google.maps.Marker({\n position: latLng,\n map: map,\n title:'GDLWEBCAMP'\n });\n\n marker.addListener('click',function(){\n informacion.open(map, marker);\n });\n\n}", "function initMap() {\r\n\tlet uluru = {\r\n\t\tlat: -36.879889,\r\n\t\tlng: 174.707658\r\n\t};\r\n\tconst map = new google.maps.Map(\r\n\t\tdocument.getElementById('googleMap'), {\r\n\t\t\tzoom: 12,\r\n\t\t\tcenter: uluru\r\n\t\t}\r\n\t);\r\n\tconst marker = new google.maps.Marker({\r\n\t\tposition: uluru,\r\n\t\tmap: map\r\n\t});\r\n}", "function initMap() {\n // The location of Uluru\n var uluru = {lat: 54.913185, lng: 9.779275};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 4, center: uluru});\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({position: uluru, map: map});\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 37.78,\n lng: -122.44\n },\n zoom: 6\n });\n\n}", "function initMap() {\n // The location of Uluru\n var uluru = { lat: 20.010991, lng: 42.619209 };\n // The map, centered at Uluru\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n}", "function display_map(lat, long, zoom) {\n var mapOptions = {\n center: new google.maps.LatLng(lat, long),\n zoom: zoom,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n var canvas = $('#map_canvas')[0];\n map = new google.maps.Map(canvas, mapOptions);\n}", "function initMap() {\n // The location of Uluru\n var uluru = {lat: 37.971996112, lng: 23.73416373};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 14, center: uluru});\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({position: uluru, map: map});\n}", "function rendermap() {\n var mapProp = {\n mapTypeId : google.maps.MapTypeId.ROADMAP\n };\n // map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapProp);\n // // using vanilla js\n map = new google.maps.Map($(\"#map-canvas\")[0], mapProp); // using jQuery\n}", "function showMap() {\n\tupdateMoneyInfo();\n\n\tdocument.getElementById(\"top_section\").innerHTML = MAP_UPPER_SECTION_HTML;\n\n\tinitMap();\n\tresizeAllCells();\n\tredrawMap();\n\n\tvar arrowSize = document.getElementById(\"arrow_left\").offsetWidth;\n\tdocument.getElementById(\"arrow_up\").style.height = arrowSize + \"px\";\n\tdocument.getElementById(\"arrow_down\").style.height = arrowSize + \"px\";\n\n\tblockAllButtons();\n\tunblockAllButtons();\n}", "function displayMap(e) {\n e.preventDefault();\n var ctr = getCenter();\n var z = getZoom();\n googleMap = new google.maps.Map(document.getElementById('mymap'), {\n center: ctr,\n zoom: z\n });\n var marker = new google.maps.Marker( {\n position: ctr\n });\n \n marker.setMap(googleMap);\n\n var infoWindow = new google.maps.InfoWindow( {\n content: selectedName\n });\n\n marker.addListener( 'click', function() {\n infoWindow.open(googleMap, marker)\n });\n}", "function generateGoogleMap(){\n\t\t\n\t\tvar lat = $(\"#lat\").html();\n\t\tvar lng = $(\"#long\").html();\n\t\t\n\t\t$(\".demobot_0\").append(\"<div class='mapHolder'></div>\");\n\t\t\n\t\tvar latlng = new google.maps.LatLng(lat, lng);\n\t\t\n\t\tvar myOptions = {\n\t\t\tzoom: 14,\n\t\t\tcenter: latlng,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t };\n\t\tvar map = new google.maps.Map($(\".mapHolder\")[0], myOptions);\n\t\t\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: latlng, \n\t\t\tmap: map, \n\t\t\ttitle:\"Here I am!!\"\n\t\t}); \n\t}", "function setupMap(e){\n \n var coords = {lat: 48.8957235, lng: 2.2494012};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 14,\n center: coords,\n mapTypeId\t: google.maps.MapTypeId.ROADMAP\n });\n\n var marker = new google.maps.Marker({\n position: coords,\n map: map,\n title: \"Opticien Krys\",\n pixelOffset: new google.maps.Size(100,140)\n });\n}", "function initMap() {\n // Your location (this one is centered in Boston). If you want another location just google: get latitude and logtitude from adress or right away: latlong.net\n const loc = { lat: 42.361145, lng: -71.057083 };\n // Centered map on location\n const map = new google.maps.Map(document.querySelector('.map'), {\n zoom: 14,\n center: loc // center position is going to be in the location\n });\n // The marker, positioned at location\n const marker = new google.maps.Marker({ position: loc, map: map }); // position should be the const loc location and the map should show the const map map.\n}", "function insertGoogleMap(e) {\n var map = Maps.newStaticMap()\n .setSize(800, 600) // Insert a Google Map 800x600 px\n .setZoom(15)\n .setCenter(e); // e contains the address entered by the user\n\n SpreadsheetApp.getActiveDocument()\n .getCursor() // Find the location of the cursor in the document\n .insertInlineImage(map.getBlob()); // insert the image at the cursor\n}", "function initMap() {\n // The location of Uluru\n var uluru = {lat: 40.2330185, lng: -111.6644888};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 18, center: uluru});\n\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({position: uluru, map: map});\n}", "function initMap() {\n // appending our #map div to our map variable \n map = new google.maps.Map(document.getElementById('map'), {\n // choose our location\n center: { lat: lat, lng: lng },\n // choose our zoom\n zoom: 8\n });\n // create marker variable \n var marker = new google.maps.Marker({\n // grab lat and lng for our positioning, same as our center\n position: { lat: lat, lng: lng },\n // put it on the same map\n map: map,\n })\n }", "function DisplayMap()\n{\n\tvar popup = window.open(\"\", \"\", \"width = 610, height = 473\");\n\tpopup.document.open();\n\tpopup.document.write(\"<title>Location</title>\");\t\n\tpopup.document.write(\"<img src='graphics/location_large.png' alt='Location of PfP' />\");\n\tpopup.document.close();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 8\n });\n \n}", "function initMap() {\n // The location of the cafe\n var office = {lat: 35.656440, lng: -105.951910};\n // The map, centered at the cafe\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 16, center: office});\n // The marker, positioned at the cafe\n var marker = new google.maps.Marker({position: office, map: map});\n}", "function initMap() {\n\t\t\t // The location of Uluru\n\t\t\t var uluru = {lat: -25.344, lng: 131.036};\n\t\t\t // The map, centered at Uluru\n\t\t\t var map = new google.maps.Map(\n\t\t\t document.getElementById('map'), {zoom: 4, center: uluru});\n\t\t\t // The marker, positioned at Uluru\n\t\t\t var marker = new google.maps.Marker({position: uluru, map: map});\n\t\t\t\t}", "function centerMap() {\n getLocation()\n }", "function initMap() {\n // The location of Uluru\n const uluru = { lat: -25.344, lng: 131.036 };\n // The map, centered at Uluru\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n console.log(\"initmap map\");\n console.log(map);\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n} // end of function initMap", "function initMap() {\n var defalutLocation = new google.maps.LatLng(42.4062040, -71.1188770);\n\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 16,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: defalutLocation\n });\n}", "function initMap() {\n var options = {\n center : {lat: 0, lng: 0},\n zoom: 4\n };\n \n map = new google.maps.Map(document.getElementById('map'), options);\n\n //var marker = new google.maps.Marker({position: location, map: map});\n\n infoWindow = new google.maps.InfoWindow;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n userlat = position.coords.latitude;\n userlng = position.coords.longitude;\n console.log(\"Your coordinates are:\");\n console.log(userlat);\n console.log(userlng);\n infoWindow.setPosition(pos);\n infoWindow.setContent('Your location.');\n infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } \n else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "initMap() {\n var uluru = {lat: -25.363, lng: 131.044};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "function initMap() {\r\n var myCenter = new google.maps.LatLng(-26.412462, 31.177307);\r\n var mapCanvas = document.getElementById(\"map\");\r\n var mapOptions = {center: myCenter, zoom: 13};\r\n var map = new google.maps.Map(mapCanvas, mapOptions);\r\n var marker = new google.maps.Marker({position:myCenter});\r\n marker.setMap(map);\r\n google.maps.event.addListener(marker,'click',function() {\r\n var infowindow = new google.maps.InfoWindow({\r\n content:'<a href=\"https://www.facebook.com/MTNSz/\">Swazi MTN URL</a>'\r\n });\r\n infowindow.open(map,marker);\r\n });\r\n}", "function onMapClick(e) {\r\n var lat = e.latlng.lat;\r\n var lng = e.latlng.lng;\r\n map.fitBounds([e.latlng]); \r\n \r\n popup\r\n .setLatLng(e.latlng)\r\n .setContent(\"<img src='wavinghand.gif' alt='gif' width='280px height= '500px'/></br> <p class= 'popup'>You are here:</br><br/>Lat: \" + lat +\" Lng: \" + lng)\r\n .openOn(map); \r\n\r\n}", "function view_contact_draw_map() {\n\n // Draw San Francisco Map\n\n var element = document.getElementById(\"contact-location-map-san-francisco\");\n var latitude = 37.7893041;\n var longitude = -122.4003783;\n var tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere San Francisco Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"88 Stevenson St</br>\" +\n \"San Francisco, CA 94107\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n // Draw Hamburg Map\n\n element = document.getElementById(\"contact-location-map-germany\");\n latitude = 53.54386;\n longitude = 10.02979;\n tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere Hamburg Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"Friesenstraße 13, 20097</br>\" +\n \"Hamburg, Germany\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n // Draw NY Map\n\n element = document.getElementById(\"contact-location-map-new-york\");\n latitude = 40.7483005;\n longitude = -73.990655;\n tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere New York Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"132 West 31st St</br>\" +\n \"New York, NY 10001\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n }", "function getMap(latitude, longitude) {\n\n var mapOptions = {\n center: new google.maps.LatLng(0, 0),\n zoom: 5,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n map = new google.maps.Map\n (document.getElementById(\"map\"), mapOptions);\n\n\n var latLong = new google.maps.LatLng(latitude, longitude);\n\n var marker = new google.maps.Marker({\n position: latLong\n });\n\n marker.setMap(map);\n map.setZoom(10);\n map.setCenter(marker.getPosition());\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.6131516, lng:-58.3772316}, /* Coordenadas de la ciudad de Buenos Aires */\n zoom: 12\n });\n }", "function initMap(lat,lng,mapcont) {\n var maper = new google.maps.Map(document.getElementById(mapcont), {\n zoom: 15,\n center: {lat: lat, lng: lng}\n });\n \n var marker = new google.maps.Marker({\n position: {lat: lat, lng: lng},\n map: maper,\n title: eventVenueName\n });\n }", "function initMap() {\n // The location of Uluru\n const beckbagan = { lat: 22.538142445390086, lng: 88.36075198119023 };\n // The map, centered at Uluru\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 400,\n center: beckbagan,\n });\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: beckbagan,\n map: map,\n });\n }", "function displayMap(gallery) {\n map = new google.maps.Map(document.querySelector(\".box.map\"), {\n center: { lat: gallery.Latitude, lng: gallery.Longitude },\n zoom: 17,\n mapTypeId: 'satellite'\n });\n }", "function init_map() {\r\n var center = new google.maps.LatLng(48.5859718, 7.743764800000008);\r\n var myOptions = {\r\n zoom: 15,\r\n center: center,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP\r\n };\r\n map = new google.maps.Map($('#map .gmap-map')[0], myOptions);\r\n marker = new google.maps.Marker({\r\n map: map,\r\n position: new google.maps.LatLng(48.5859718, 7.743764800000008)\r\n });\r\n infowindow = new google.maps.InfoWindow({content: '<strong>Villa Kleber</strong><br> 6 Quai Kleber, 67000 Strasbourg<br>'});\r\n google.maps.event.addListener(marker, 'click', function () {\r\n infowindow.open(map, marker);\r\n });\r\n infowindow.open(map, marker);\r\n google.maps.event.addDomListener(window, 'resize', function() {\r\n map.setCenter(center);\r\n });\r\n }", "function getMap(latitude, longitude) {\n \n \n var mapOptions = {\n center: new google.maps.LatLng(0, 0),\n zoom: 1,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n \n map = new google.maps.Map\n (document.getElementById(\"map\"), mapOptions);\n \n \n var latLong = new google.maps.LatLng(latitude, longitude);\n writeAddressName(latLong);\n var marker = new google.maps.Marker({\n position: latLong\n });\n \n marker.setMap(map);\n map.setZoom(15);\n map.setCenter(marker.getPosition());\n}", "function initMap() {\n\tvar browserLoc = {lat: loc.userLat, lng: loc.userLong};\n\tvar map = new google.maps.Map(document.getElementById('searchMap'), {\n\t center: {lat: loc.userLat, lng: loc.userLong},\n\t zoom: 15\n });\n\tvar marker = new google.maps.Marker({\n\t\tposition: browserLoc,\n\t\tmap: map,\n\t\tanimation: google.maps.Animation.DROP,\n\t\ticon: userMarker\n\t});\n}", "function displayEmailDocGeoLoc() {\n\n }", "function initMap() {\n // The location of Uluru\n const uluru = { lat: 6.574399, lng: 3.34028 };\n // The map, centered at Uluru\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n }", "function initMap() {\n\n\n \n var uluru = {lat: 23.874758, lng:90.382677};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 17,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n \n var infoWindow = new google.maps.InfoWindow({\n content: '<h1>Jasim Uddin Road</h1><p>Latitude : <b><big>23.874758</big></b>&emsp;Longitude : <b><big>90.382677</big></b>'\n });\n\n\n marker.addListener('click', function() {\n infoWindow.open(map, marker);\n });\n}", "function initMap() {\n const myLatLng = { lat: 44.59824417, lng: -110.5471695 };\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 8,\n center: myLatLng,\n });\n \n}", "function map(){\n\t// Setting the center of the map in the center of Romania\n var latlng = new google.maps.LatLng(46, 25);\n \n var myOptions = {\n zoom: 6,\n center: latlng,\n streetViewControl: false,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n zoomControl: true\n };\n \n map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\n \n \n // Starting the map watch ( watches your position )\n google.maps.event.addListenerOnce(map, 'tilesloaded', function(){\n watchID = navigator.geolocation.watchPosition(geo_success, geo_error, { maximumAge: 5000, timeout: 5000, enableHighAccuracy: true }); \n }); \n}", "function getMap(latitude, longitude) {\n\n var mapOptions = {\n center: new google.maps.LatLng(0, 0),\n zoom: 1,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n map = new google.maps.Map\n (document.getElementById(\"map\"), mapOptions);\n\n\n var latLong = new google.maps.LatLng(latitude, longitude);\n\n var marker = new google.maps.Marker({\n position: latLong\n });\n\n marker.setMap(map);\n map.setZoom(15);\n map.setCenter(marker.getPosition());\n}", "function getMap(latitude, longitude) {\n\n var mapOptions = {\n center: new google.maps.LatLng(0, 0),\n zoom: 1,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n map = new google.maps.Map\n (document.getElementById(\"map\"), mapOptions);\n\n\n var latLong = new google.maps.LatLng(latitude, longitude);\n\n var marker = new google.maps.Marker({\n position: latLong\n });\n\n marker.setMap(map);\n map.setZoom(15);\n map.setCenter(marker.getPosition());\n}", "function initMap() {\n // create a container to draw the map inside a <div>\n const mapCanvas = (document.getElementById(\"map-container\"));\n\n // define some map properties\n const mapOptions = {\n center: {lat: 43.011987, lng: -81.200276},\n zoom: 7\n };\n\n // call the constructor to create a new map object\n // and then get your geo location\n map = new google.maps.Map(mapCanvas, mapOptions);\n\n //create new infoWindow object to get information about the place\n infoWindow = new google.maps.InfoWindow;\n\n // close infoWindow in case there are some open infoWindows\n google.maps.event.addListener(map, \"click\", function() {\n infoWindow.close();\n });\n\n //set new map position\n getLocation();\n\n }", "function initMap() {\n var usa = { lat: 42.87, lng: -97.38 };\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: usa\n });\n}", "function displayEventInfo(e) {\n if (e.targetType == \"map\") {\n var point = new Microsoft.Maps.Point(e.getX(), e.getY());\n var loc = e.target.tryPixelToLocation(point);\n document.getElementById(\"textBox\").value = loc.latitude + \", \" + loc.longitude;\n\n }\n }", "function initMap(){\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -3.0665, lng: 37.3507},\n zoom: 10\n })\n}", "function initMap() {\n var location = new google.maps.LatLng(29.7292957, -95.5481154);\n\n var mapoptions = {\n center: location,\n zoom: 17,\n };\n\n var map = new google.maps.Map(\n document.getElementById('map-container'),\n mapoptions\n );\n\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n title: 'Houston',\n });\n }", "function initMap() {\n var centerTarget = {lat: Number(item.mapY) ,lng: Number(item.mapX)};\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: centerTarget\n });\n\n new google.maps.Marker({\n position: centerTarget,\n map: map,\n icon: '/APIcamp/img/marker.png'\n });\n }", "function drawMap() {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 5,\r\n center: { lat: 0, lng: 0 },\r\n mapTypeId: 'roadmap'\r\n });\r\n}", "function initMap() {\n var map;\n var home = {lat: 39.581 , lng: -104.916};\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n center: home,\n zoom: 16\n });\n\n //var marker = new google.maps.Marker({map: map, position: home,title:\"ass eating capital of america2\"});\n\n Window.google_map = map;\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0, lng: 0},\n zoom: 3\n });\n}", "function initMap() {\n\t// The location of Uluru\n\tvar uluru = { lat: 49.411791, lng: 32.021873 };\n\t// The map, centered at Uluru\n\tvar map = new google.maps.Map(\n\t\tdocument.getElementById('map'), { zoom: 17, center: uluru });\n\t// The marker, positioned at Uluru\n\tvar marker = new google.maps.Marker({ position: uluru, map: map });\n}", "function initMap() {\n var location = {lat: -7.759827,lng: 110.408346};\n var map = new google.maps.Map(document.getElementById(\"googleMap\"), {\n zoom: 12,\n center: location,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n });\n var marker = new google.maps.Marker({\n position: location,\n map: map\n });\n}", "function initMap() {\n // The location of Uluru\n var bm = {lat: 41.086065, lng: 29.043930};\n var nh = {lat: 41.086613, lng: 29.045489};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 14, center: bm});\n // The marker, positioned at Uluru\n var bm_marker = new google.maps.Marker({position: bm, map: map, label: 'BM', title: 'BM Buillding B (-2th) floor (for workshops)'});\n var nh_marker = new google.maps.Marker({position: nh, map: map, label: 'NH', title: 'New Hall 105'});\n }", "function initialize() {\n var mapProp = {\n center:new google.maps.LatLng(pilotLatitude,pilotLongitude),\n zoom:5,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n };\n var map=new google.maps.Map(document.getElementById(\"map\"), mapProp);\n \n var infoWindow = new google.maps.InfoWindow({map: map});\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n infoWindow.setPosition(pos);\n infoWindow.setContent('You are here.');\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n }\n else {\n // when browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "function initMap() {\n\tmap = new google.maps.Map(document.getElementById('map'), {\n \t\t// Centers on SF\n \t\tcenter: {lat: 37.7749, lng: -122.4194},\n \t\tzoom: 4\n\t});\n}", "function showMap3(position){\r\n\r\n currentLng = position.coords.longitude;\r\n sessionStorage.setItem(\"aktueller Längengrad\", currentLng);\r\n currentLat = position.coords.latitude;\r\n sessionStorage.setItem(\"aktueller Breitengrad\", currentLat);\r\n\r\n var currentPosition = {\r\n lat: currentLat,\r\n lng: currentLng\r\n };\r\n\r\n //Optionen\r\n var optionen = {\r\n zoom: 13,\r\n center: new google.maps.LatLng(currentLat, currentLng)\r\n };\r\n\r\n map = new google.maps.Map(document.getElementById('karteAusgabe'), optionen);\r\n\r\n /*\r\n var marker = new google.maps.Marker({\r\n position: myLatLng,\r\n map: map,\r\n });*/\r\n\r\n var image = 'img/pin2.png';\r\n markerCurrent = new google.maps.Marker({\r\n position: currentPosition,\r\n map: map,\r\n icon: image,\r\n\r\n title: \"Aktuelle Position\"\r\n });\r\n\r\n for (var i=0; i<myLocations.length; i++){\r\n\r\n var posAlleLokale = myLocations[i];\r\n\r\n var locationLng = parseFloat(posAlleLokale.longitude);\r\n var locationLat = parseFloat(posAlleLokale.latitude);\r\n\r\n var positionAlleLokale = {\r\n lat:locationLat,\r\n lng:locationLng\r\n }\r\n //alert(locationLng+\" \"+locationLat);\r\n\r\n var markerAlleLokale={\r\n position: positionAlleLokale,\r\n map: map,\r\n title: posAlleLokale.bezeichnung\r\n }\r\n\r\n\r\n markerAlleLok = new google.maps.Marker(markerAlleLokale);\r\n }\r\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 8,\n center: centerCords\n \n \n });\n addMarkerInfo();\n}", "function initMap() {\n map = new google.maps.Map( document.getElementById( 'map' ),\n { center: { lat: 41.3326, lng: -72.9475 },\n zoom: origZoom,\n styles: [ { \"featureType\": \"poi\", \"stylers\": [ { \"visibility\": \"off\" } ] } ]\n }\n );\n // origMapCenter = new google.maps.LatLng( 41.3326, -72.9475 );\n origMapCenter = map.getCenter();\n}", "function drawMap(latlng) {\n\t\t\n var myOptions = {\n zoom: 17,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.SATELLITE\n };\n var map = new google.maps.Map(document.getElementById(\"map-canvas\"), myOptions);\n // Add an overlay to the map of current lat/lng\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n title: \"Greetings!\"\n });\n }", "function show_this_location(lat,lang)\n{\n \n $('#map-canvas').data('type', 3);\n clearMarkers();\n var my_latlang=new google.maps.LatLng(lat,lang);\n // document.getElementById('searchbytext').style.display=\"none\";\n moveMarker(\"\",my_latlang);\n map.setCenter(my_latlang);\n \n \n}", "function myMap() {\n var mapProp= {\n center:new google.maps.LatLng(51.508742,-0.120850),\n zoom:5,\n };\n var map=new google.maps.Map(document.getElementById(\"googleMap\"),mapProp);\n }" ]
[ "0.7700875", "0.743997", "0.7384327", "0.7360375", "0.72922325", "0.7190038", "0.7053787", "0.70445526", "0.6993402", "0.6944326", "0.6941431", "0.6874592", "0.6873061", "0.6871294", "0.6862834", "0.68468744", "0.6842874", "0.6790366", "0.67781776", "0.67701864", "0.6761343", "0.67506665", "0.6741197", "0.6733662", "0.6726742", "0.67190146", "0.6708842", "0.67074543", "0.67032653", "0.6702106", "0.6701892", "0.6697143", "0.667949", "0.66684157", "0.6666113", "0.66641814", "0.6649164", "0.6648708", "0.6646689", "0.66363543", "0.663431", "0.6633297", "0.6630572", "0.66266364", "0.6626502", "0.6625748", "0.66245544", "0.66226155", "0.6621895", "0.66187716", "0.6616211", "0.6615944", "0.66149473", "0.6613139", "0.66093457", "0.6608611", "0.6583957", "0.6578337", "0.65776014", "0.65775865", "0.65667546", "0.65661633", "0.65651166", "0.6564405", "0.6560144", "0.6559925", "0.6559623", "0.6558255", "0.65535444", "0.65527517", "0.65476245", "0.6547581", "0.65421456", "0.65310746", "0.6530963", "0.6530645", "0.65284246", "0.6526396", "0.65203565", "0.65203565", "0.65197414", "0.65195495", "0.65172946", "0.65163976", "0.6510031", "0.6508705", "0.65064454", "0.65049684", "0.6498526", "0.6498411", "0.6496628", "0.6496602", "0.6483271", "0.64820707", "0.64797676", "0.6477399", "0.6477182", "0.6469305", "0.6469274", "0.64692" ]
0.6705653
28
We need this function to gather all the data coming from several indices. In this example we are using the `indexName` to namespace those data to avoid erasing them each time an instance is updated. You can choose to use any namespace of your choice, if the `indexName` is not a differentiator.
onProps(props) { this.setState({hits: {...this.state.hits, [props.indexName]: props.hits}, query: props.query}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getIndices() {\n return this._registry.get('properties', 'schemaData', { indices: [] })\n .indices.map(data => {\n if (!data.hasOwnProperty('name') || !data.name)\n data.indexName = this.getStorageIndexName();\n else\n data.indexName = this.getStorageIndexPrefix() + data.name;\n return data;\n }).filter(schema => schema != undefined);\n }", "getAllByIndex(storeName, indexName, keyRange) {\n const data = [];\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(keyRange);\n request.onsuccess = (event) => {\n const cursor = event.target.result;\n if (cursor) {\n data.push(cursor.value);\n cursor.continue();\n }\n else {\n resolve(data);\n }\n };\n })\n .catch((reason) => reject(reason));\n }));\n }", "function createIndexes() {\n configs.getMetrics().forEach((Metric) => {\n const base = {\n \"mappings\": {\n \"properties\": {\n \"metric\": {\n \"type\": \"keyword\"\n },\n \"project\": {\n \"type\": \"keyword\"\n },\n \"timestamp\": {\n \"type\": \"date\"\n },\n \"hash\": {\n \"type\": \"keyword\"\n }\n }\n }\n };\n\n // dummy initilization to get the schema\n const current = new Metric({}, \"\", {});\n\n // merge the keys from the schema into the complete metric\n _.merge(base.mappings.properties, current.schema());\n\n const elasticReporter = configs.getElasticReporter();\n\n // put the new index into elasticsearch\n axios.put(`http://${elasticReporter.address}:${elasticReporter.port}/fe-${current.info().name.replace(/ /g, \"-\")\n .toLowerCase()}`, base)\n .then(function () {\n logger.info(`Index for '${current.info().name}' added successfully`);\n })\n .catch(function (error) {\n logger.error(\"Error inserting into elastic\");\n logger.error(error);\n });\n });\n}", "rebuildIndices() {\n const me = this,\n isFiltered = me.isFiltered,\n indices = me._indices || (me._indices = {}),\n keyProps = Object.keys(indices),\n indexCount = keyProps.length,\n values = me._values,\n count = values.length;\n\n let i, j;\n\n // First, clear indices.\n if (isFiltered) {\n indices[filteredIndicesProperty] = {};\n }\n for (i = 0; i < indexCount; i++) {\n indices[keyProps[i]] = {};\n if (isFiltered) {\n indices[filteredIndicesProperty][keyProps[i]] = {};\n }\n }\n\n /*\n * Rebuild the indices object.\n * Loop through all items adding an entry for each one to each index.\n * So collection.add({id : foo, name : 'Nige'}, {id : 'bar', name : 'Faye'}) where collection has had an index\n * added for the \"name\" property would result in:\n *\n * {\n * id : {\n * foo : 0,\n * bar : 1\n * },\n * name : {\n * Nige : 0,\n * Faye : 1\n * }\n * }\n */\n for (i = 0; i < count; i++) {\n const item = values[i];\n\n for (j = 0; j < indexCount; j++) {\n const keyProp = keyProps[j];\n // This does indices.name['Nige'] = 0\n indices[keyProp][safeIndexKey(item[keyProp])] = i;\n }\n }\n\n // Create a parallel lookup structure into the _filteredValues\n if (isFiltered) {\n const values = me._filteredValues,\n count = values.length,\n indices = me._indices[filteredIndicesProperty];\n\n for (i = 0; i < count; i++) {\n const item = values[i];\n\n for (j = 0; j < indexCount; j++) {\n const keyProp = keyProps[j];\n // This does indices[filteredIndicesProperty].name['Nige'] = 0\n indices[keyProp][safeIndexKey(item[keyProp])] = i;\n }\n }\n }\n\n me._indicesInvalid = false;\n }", "getDateIndex(indexName) {\n const me = this; // Date indices are created on first usage and after that kept up to date on changes\n\n if (!me.dateIndicesRequested) {\n me.dateIndicesRequested = true;\n me.syncIndices('splice', me.storage.allValues);\n }\n\n return me[`_${indexName}Index`];\n }", "rebuildIndices() {\n const me = this,\n isFiltered = me.isFiltered,\n indices = me._indices || (me._indices = {}),\n keyProps = Object.keys(indices),\n indexCount = keyProps.length,\n values = me._values;\n let filteredIndices;\n\n if (isFiltered) {\n filteredIndices = indices[filteredIndicesProperty] = {};\n } // First, clear indices.\n\n for (let i = 0; i < indexCount; i++) {\n const index = indices[keyProps[i]];\n index.clear();\n\n if (isFiltered) {\n let filteredIndex = filteredIndices[keyProps[i]];\n\n if (filteredIndex) {\n filteredIndex.clear();\n } else {\n filteredIndex = filteredIndices[keyProps[i]] = new Map(); // Piggyback config\n\n filteredIndex.unique = index.unique;\n }\n }\n }\n\n doRebuildIndices(values, indices, keyProps, indexCount); // Create a parallel lookup structure into the _filteredValues\n\n if (isFiltered) {\n doRebuildIndices(me._filteredValues, filteredIndices, keyProps, indexCount);\n }\n\n me._indicesInvalid = false;\n }", "function loadIndexes() {\n // Get search indexes.\n dataService.fetch('get', '/api/admin/indexes').then(\n function (data) {\n $scope.activeIndexes = data;\n // Get mappings configuration.\n dataService.fetch('get', '/api/admin/mappings').then(\n function (mappings) {\n // Reset the scopes variables for mappings.\n $scope.activeMappings = {};\n $scope.inActiveMappings = {};\n\n // Filter out active indexes.\n for (var index in mappings) {\n if (!$scope.activeIndexes.hasOwnProperty(index)) {\n $scope.inActiveMappings[index] = mappings[index];\n }\n else {\n $scope.activeMappings[index] = mappings[index];\n }\n }\n },\n function (reason) {\n $scope.message = reason.message;\n $scope.messageClass = 'alert-danger';\n }\n );\n },\n function (reason) {\n $scope.message = reason.message;\n $scope.messageClass = 'alert-danger';\n }\n );\n }", "async function getAllIndexers() {\n const url = getIndexerUrl();\n const indexerList = await getData({ uri: url });\n return indexerList;\n}", "function IndicesBuilder() {\n this._indices = [];\n this._indexObjs = [];\n }", "getInitialIndexes() {\n this.setState({\n initialLoading: true,\n initialLoadText: 'índices...',\n loadError: false\n });\n this.subscribe(\n TimeseriesService.list({template_category: 'emac-index', max_events: 1}),\n data => {\n this.setState(state => ({\n indexes: data,\n tableData: generateTableData(Object.values(state.targets), data, state.tickets, availability),\n initialLoading: false,\n lastUpdate: moment().format(config.DATETIME_FORMAT)\n }));\n this.setDataUpdate();\n },\n (err) => this.setState({loadError: true, initialLoading: false})\n );\n }", "function refreshIndex(_index){\n\talgolia.deleteByQuery(\"\", function(err) {\n\t\tif (!err) {\n\t\t\tconsole.log('success deleting all');\n\t\t}\n\t\talgolia.saveObjects(_index, function(err, content) {\n\t\t\tif (!err) {\n\t\t\t\tconsole.log('success indexing all');\n\t\t\t}\n\t\t\tconsole.log(content);\n\t\t});\n\t});\n}", "_rebuildIndex() {\n this._index = {};\n for (let role in this.access) {\n let rules = this.access[role] || {};\n (rules.allow || []).forEach(function(action){\n let key = this._getIndexKey(role, action);\n this._index[key] = true;\n }, this);\n (rules.deny || []).forEach(function(action){\n let key = this._getIndexKey(role, action);\n this._index[key] = false;\n }, this);\n }\n }", "async fetchExistingRecords () {\n const client = getAlgoliaClient()\n\n // return an empty array if the index does not exist yet\n const { items: indices } = await client.listIndices()\n\n if (!indices.find(index => index.name === this.name)) {\n console.log(`index '${this.name}' does not exist!`)\n return []\n }\n\n const index = client.initIndex(this.name)\n let records = []\n\n await index.browseObjects({\n batch: batch => (records = records.concat(batch))\n })\n\n return records\n }", "UpdateIndex()\n {\n // Esvazia os indices.\n this.index = {};\n this.specialIndex = {};\n \n for(var i = 0; i < this.gameObjects.length; i++)\n {\n // Verifica se ja existe um objeto do mesmo tipo nos indices e o adiciona.\n if(this.index[this.gameObjects[i].object.type])\n {\n this.index[this.gameObjects[i].object.type].push(i);\n }\n else\n {\n this.index[this.gameObjects[i].object.type] = [];\n this.index[this.gameObjects[i].object.type].push(i);\n }\n \n // Adiciona um indice especial caso exista.\n if(this.gameObjects[i].specialIndex)\n {\n this.specialIndex[this.gameObjects[i].key] = i;\n }\n }\n }", "async function createDeduper() {\n\n const client = new elasticsearch.Client({\n host: 'localhost:9200',\n apiVersion: '7.6',\n });\n\n function addHash(hit) {\n const doc = hit._source;\n const name = doc.name.default;\n const postal = doc.parent.postalcode;\n\n if(name && postal) {\n const pos = doc.center_point;\n const hash = name + postal + 'station';\n if (!stationHashes[hash]) {\n stationHashes[hash] = [];\n }\n stationHashes[hash].push({'popularity': doc.popularity, 'lat': pos.lat, 'lon': pos.lon});\n hashCount++;\n }\n }\n\n const responseQueue = [];\n\n logger.info( 'Reading existing stations for deduping');\n const response = await client.search({\n index: 'pelias',\n scroll: '30s',\n size: 10000,\n body: {\n 'query': {\n 'term': {\n 'layer': {\n 'value': 'station',\n 'boost': 1.0\n }\n }\n }\n }\n });\n responseQueue.push(response);\n\n while (responseQueue.length) {\n const body = responseQueue.shift();\n body.hits.hits.forEach(addHash);\n\n // check to see if we have collected all docs\n if (!body.hits.hits.length) {\n logger.info('Extracted ' + hashCount + ' existing stations for deduping');\n break;\n }\n // get the next response if there are more items\n responseQueue.push(\n await client.scroll({\n scrollId: body._scroll_id,\n scroll: '30s'\n })\n );\n }\n}", "function dbIndexQuery(index, indexName){\n var tx = dbRequest.result.transaction('task')\n var store = tx.objectStore('task');\n const statusIndex= store.index(index);\n const getStatus=statusIndex.getAll(indexName);\n\n getStatus.onsuccess=(e)=>{\n\n let web= e.target.result\n let webKey=getStatus.key\n web.map((pend)=>{\n createLi(pend.time,pend.task,pend.status,activityDisplay)\n console.log(web)\n\n })\n }\n }", "function getResourcesData(data) {\n var indexName = data.company;\n var startdate = data.strdate + ' 00:00:00';\n var enddate = data.enddate + ' 23:59:59';\n var from = 0;\n var size = 10;\n var filter = {};\n var regionfilter = {};\n var productfilter = {};\n var sorting_order = data.shortingorder;\n var sorting_field = data.sortingfield;\n\n if (data.size) {\n size = data.size;\n }\n\n if (data.currentpage) {\n from = ((data.currentpage - 1) * size);\n }\n\n if (data.filter != \"\") {\n filter = {\n \"multi_match\": {\n \"query\": data.filter,\n \"fields\": [\"ResourceId\", \"aws:*\", \"user:*\"],\n \"type\": \"phrase_prefix\"\n }\n };\n }\n\n if (data.region != \"\") {\n regionfilter = { \"match\": { \"__AvailabilityRegion\": data.region } };\n }\n\n if (data.product != \"\") {\n productfilter = { \"match\": { \"ProductName\": data.product } };\n }\n var sort = {};\n sort[sorting_field] = { \"order\": sorting_order };\n\n var query = {\n \"from\": from,\n \"size\": size,\n \"sort\": [sort],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"range\": {\n \"UsageStartDate\": {\n \"gte\": startdate,\n \"format\": \"yyyy-MM-dd HH:mm:ss\"\n }\n }\n },\n {\n \"range\": {\n \"UsageEndDate\": {\n \"lte\": enddate,\n \"format\": \"yyyy-MM-dd HH:mm:ss\"\n }\n }\n },\n filter,\n productfilter,\n regionfilter\n\n ]\n\n }\n\n },\n \"aggs\": {\n \"total_cost\": {\n \"sum\": {\n \"field\": \"BlendedCost\"\n }\n },\n \"total_quantity\": {\n \"sum\": {\n \"field\": \"UsageQuantity\"\n }\n }\n },\n \"_source\": [\n \"ProductName\",\n \"UsageType\",\n \"__AvailabilityRegion\",\n \"ItemDescription\",\n \"UsageStartDate\",\n \"UsageEndDate\",\n \"UsageQuantity\",\n \"BlendedRate\",\n \"BlendedCost\",\n \"Operation\",\n \"aws:*\",\n \"user:*\",\n \"ResourceId\"\n ]\n };\n\n //debugQuery(query);\n\n return elasticClient.search({\n index: indexName,\n body: query\n })\n\n}", "calAllIndex() {\n for (let i = 0; i < this.length; i++) {\n for (let j = 0; j < this.breath; j++) {\n let index = i + \"-\" + j;\n this.indexes.push(index);\n }\n }\n return this.indexes;\n }", "function processResults(indexes) {\n // Contains all the information\n let info = {};\n // Process all the indexes\n for (let i = 0; i < indexes.length; i++) {\n const index = indexes[i];\n // Let's unpack the object\n info[index.name] = [];\n for (let name in index.key) {\n info[index.name].push([name, index.key[name]]);\n }\n }\n\n return info;\n }", "function processResults(indexes) {\n // Contains all the information\n let info = {};\n // Process all the indexes\n for (let i = 0; i < indexes.length; i++) {\n const index = indexes[i];\n // Let's unpack the object\n info[index.name] = [];\n for (let name in index.key) {\n info[index.name].push([name, index.key[name]]);\n }\n }\n\n return info;\n }", "function processResults(indexes) {\n // Contains all the information\n let info = {};\n // Process all the indexes\n for (let i = 0; i < indexes.length; i++) {\n const index = indexes[i];\n // Let's unpack the object\n info[index.name] = [];\n for (let name in index.key) {\n info[index.name].push([name, index.key[name]]);\n }\n }\n\n return info;\n }", "function processResults(indexes) {\n // Contains all the information\n let info = {};\n // Process all the indexes\n for (let i = 0; i < indexes.length; i++) {\n const index = indexes[i];\n // Let's unpack the object\n info[index.name] = [];\n for (let name in index.key) {\n info[index.name].push([name, index.key[name]]);\n }\n }\n\n return info;\n }", "async function getIndex() {\n const contents = fs.readdirSync(`./${ipfs.host}/`);\n iLog('Trying to load indices from local files ...');\n for (i in contents) {\n if (contents[i][0] === 'i' && !fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\n const indexFile = fs.readFileSync(`./${ipfs.host}/${contents[i]}`);\n const indexDump = JSON.parse(indexFile);\n global.indices[contents[i].substr(5,contents[i].length-10)] = elasticlunr.Index.load(indexDump);\n }\n }\n try {\n await fs.statSync(`./${ipfs.host}/hostedFiles.json`);\n global.ipfsearch.hostedFiles = JSON.parse(await fs.readFileSync(`./${ipfs.host}/hostedFiles.json`));\n } catch (e) { }\n if (Object.keys(global.indices).length === 0) {\n // file does not exist, create fresh index\n iLog('No local indices exist, generating new index files ...');\n const contents = fs.readdirSync(`./${ipfs.host}/`);\n for (i in contents) {\n if (fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\n global.indices[contents[i]] = createIndex();\n await readFilesIntoObjects(contents[i], `./${ipfs.host}/${contents[i]}`);\n // save the index\n await saveIndex(global.indices[contents[i]], `./${ipfs.host}/index${contents[i]}.json`);\n }\n }\n }\n}", "index (name, fragment /*, ...processors*/) {\n let keyPaths = compileKeyPaths(fragment)\n let processors = toArray(arguments, 2)\n\n let state = null\n let subset = null\n let answer = null\n\n var query = this.indexes[name] = () => {\n if (this.state !== state) {\n state = this.state\n\n let next = extract(state, keyPaths, subset)\n\n if (next !== subset) {\n subset = next\n answer = pipeline(subset, processors, state)\n }\n }\n\n return answer\n }\n\n return query\n }", "*_findInIndex(index0, key0, key1, key2, name0, name1, name2, graphId) {\n let tmp, index1, index2;\n const entityKeys = this._entities;\n const graph = (0, _N3DataFactory.termFromId)(graphId, this._factory);\n const parts = {\n subject: null,\n predicate: null,\n object: null\n };\n\n // If a key is specified, use only that part of index 0.\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n parts[name0] = (0, _N3DataFactory.termFromId)(entityKeys[value0], this._factory);\n // If a key is specified, use only that part of index 1.\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n parts[name1] = (0, _N3DataFactory.termFromId)(entityKeys[value1], this._factory);\n // If a key is specified, use only that part of index 2, if it exists.\n const values = key2 ? key2 in index2 ? [key2] : [] : Object.keys(index2);\n // Create quads for all items found in index 2.\n for (let l = 0; l < values.length; l++) {\n parts[name2] = (0, _N3DataFactory.termFromId)(entityKeys[values[l]], this._factory);\n yield this._factory.quad(parts.subject, parts.predicate, parts.object, graph);\n }\n }\n }\n }\n }\n }", "function indexDump() {\n\tconst indexes = {};\n\tfor (const collection of db.getCollectionNames()) {\n\t\tindexes[collection] = db.getCollection(collection).getIndexes();\n\t}\n\tprintjson(indexes);\n}", "static async pGetIndexAdditionalItem (baseIndex = 0, doLogging = true) {\n\t\tconst indexer = new od.Omnidexer(baseIndex);\n\n\t\tawait Promise.all(od.Omnidexer.TO_INDEX.filter(it => it.category === Parser.CAT_ID_ITEM).map(async ti => {\n\t\t\tconst filename = `../data/${ti.file}`;\n\t\t\tconst data = require(filename);\n\n\t\t\tif (ti.postLoad) ti.postLoad(data);\n\n\t\t\tif (ti.additionalIndexes && ti.additionalIndexes.item) {\n\t\t\t\tif (doLogging) console.log(`indexing ${filename}`);\n\t\t\t\tconst extra = await ti.additionalIndexes.item(indexer, data);\n\t\t\t\textra.forEach(add => indexer.pushToIndex(add));\n\t\t\t}\n\t\t}));\n\n\t\treturn indexer.getIndex();\n\t}", "function getProductWiseData(postdata) {\n var data = postdata;\n var startdate = data.strdate;\n var enddate = data.enddate;\n var indexval = data.company;\n var regionfilter = {};\n\n if (data.region != \"\") {\n regionfilter = { \"match\": { \"__AvailabilityRegion\": data.region } };\n }\n\n var query = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"range\": {\n \"UsageStartDate\": {\n \"gte\": startdate,\n \"format\": \"yyyy-MM-dd\"\n }\n }\n },\n {\n \"range\": {\n \"UsageEndDate\": {\n \"lte\": enddate,\n \"format\": \"yyyy-MM-dd\"\n }\n }\n },\n regionfilter\n ]\n }\n },\n \"aggs\": {\n \"product_name\": {\n \"terms\": {\n \"field\": \"ProductName\",\n \"order\": { \"TotalBlendedCost\": \"desc\" }\n\n },\n \"aggs\": {\n \"TotalBlendedCost\": {\n \"sum\": {\n \"field\": \"BlendedCost\"\n }\n }\n }\n }\n }\n\n };\n\n return elasticClient.search({\n index: indexval,\n size: 0,\n body: query\n });\n}", "function index() {\n\t\tdebug('index request');\n\t\t// query here plz\n\t\tvar query = table.select(table.star()).from(table).toQuery();\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('index resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.index, {\"error\": \"db error\"}); // TODO better specific error reporting\n\t\t\t} else {\n\t\t\t\tdebug(resp.rows);\n\t\t\t\temit(routes.index, resp.rows);\n\t\t\t}\n\t\t});\n\t}", "buildIndex() {\n this.db\n .collection(\"centers\")\n .get()\n .then(snapshot => this.createCenters(snapshot))\n .then(centers => this.createIndex(centers))\n .then(index => (this.idx = index));\n }", "function resolve_indices(indices)\n\t\t{\n\t\t\t// Eran - just return a promise with empty array instead of making the call to get the aliases from ES because we're not going to use it anyway\n\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\tresolve([]);\n\t\t\t})\n\t\t\t\n\t\t\tvar something;\n\t\t\tindices = _.uniq(_.map(indices, encodeURIComponent));\n\n\t\t\t// Previously there was `ignore_missing=true` query param\n\t\t\t// Looks like it did nothing\n\t\t\t// Also it is deprecated and not supported by ES5, thus removed\n\t\t\tsomething = ejs.client.get(\"/\" + indices.join(\",\") + \"/_alias?ignore_unavailable=true\",\n\t\t\t\t\tundefined, undefined, function (data, p)\n\t\t\t\t{\n\t\t\t\t\tif (p === 404)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\t\t\t\t\telse if (p === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\talertSrv.set('Error', \"Could not contact Elasticsearch at \" + ejs.config.server +\n\t\t\t\t\t\t\t\". Please ensure that Elasticsearch is reachable from your system.\", 'error');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\talertSrv.set('Error', \"Could not reach \" + ejs.config.server + \"/_alias. If you\" +\n\t\t\t\t\t\t\t\" are using a proxy, ensure it is configured correctly\", 'error');\n\t\t\t\t\t}\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\t);\n\n\t\t\treturn something.then(function (p)\n\t\t\t{\n\n\t\t\t\tvar indices = [];\n\t\t\t\t_.each(p, function (v, k)\n\t\t\t\t{\n\t\t\t\t\tindices.push(k);\n\t\t\t\t\t// Also add the aliases. Could be expensive on systems with a lot of them\n\t\t\t\t\t_.each(v.aliases, function (v, k)\n\t\t\t\t\t{\n\t\t\t\t\t\tindices.push(k);\n\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn indices;\n\t\t\t}\n\t\t\t);\n\t\t}", "function indexCatalog() {\n catalog={\n byId: {},\n items: [],\n categories: [],\n discounts: {}\n};\n catalog_raw.forEach((e) => {\n \n if (!catalog.byId[e.id]) catalog.byId[e.id]=e;\n\n if (e.type==\"ITEM\") {\n catalog.items.push(e);\n if (e.item_data.variations) e.item_data.variations.forEach((v) => {\n catalog.byId[v.id]=v;\n })\n }\n if (e.type==\"MODIFIER_LIST\") {\n if (e.modifier_list_data.modifiers) e.modifier_list_data.modifiers.forEach((m) => {\n m.modifier_data.modifier_list_id=e.id;\n console.log(m.modifier_data.modifier_list_id);\n catalog.byId[m.id]=m;\n })\n }\n if (e.type==\"DISCOUNT\") {\n if (e.discount_data.name) {\n catalog.discounts[e.discount_data.name.toLowerCase()]={ id: e.id };\n }\n }\n if (e.type==\"CATEGORY\") {\n catalog.categories.push(e);\n }\n })\n}", "function reIndex() {\n GLOBAL.redis_con = redis.createClient();\n redis_con.smembers(etc.redisKey('index', 'articles'), function (err, to_index_articles) {\n if (err) {\n return redis_con.end()\n }\n redis_con.smembers(etc.redisKey('index', 'categories'), function (err, to_index_categories) {\n if (!err) {\n\n // Perform the reindex process only if there are any articles\n // or categories to reindex\n if (to_index_categories.length + to_index_articles.length) {\n etc.startMongoDB('Articles', function (err, Articles, db) {\n if (err) {\n redis_con.end();\n if (db) {\n db.close();\n }\n console.error('database problem');\n process.exit(1);\n }\n\n\n Articles.find({_id: {$in: to_index_articles}, published: true}).toArray(function (err, article_results) {\n if (err) {\n redis_con.end();\n return db.close()\n }\n\n\n var article_details = mongoArrayToDict(article_results);\n delete article_results;\n\n db.collection('Categories', function (err, Categories) {\n if (err) {\n redis_con.end();\n return db.close()\n }\n Categories.find({_id: {$in: to_index_categories}}).toArray(function (err, category_results) {\n if (err) {\n redis_con.end();\n return db.close();\n }\n\n var category_details = mongoArrayToDict(category_results);\n delete category_results;\n\n var created_partial_index = createPartialIndex(to_index_articles, article_details,\n to_index_categories, category_details);\n var partial_index = created_partial_index[0];\n var entities_to_update = created_partial_index[1];\n var partial_index_keywords = [];\n for (keyword in partial_index) partial_index_keywords.push(keyword);\n\n db.collection('SearchIndex', function (err, SearchIndex) {\n if (err) {\n redis_con.end();\n return db.close()\n }\n SearchIndex.find({}).toArray(function (err, complete_index_array) {\n if (err) {\n redis_con.end();\n return db.close()\n }\n\n var complete_index_dict = mongoIndexArrayToDict(complete_index_array);\n delete complete_index_array;\n var latest_added_index = mergeIndices(complete_index_dict, partial_index, entities_to_update);\n\n\n // Create global references to the mongodb and redis connection, so\n // as to be able to close them when the reindexing process in completed.\n GLOBAL.db = db;\n GLOBAL.redis_con = redis_con;\n\n // Count the number of keywords to update\n // NOTE: this loop cannot be merged with the loop\n // below as the final value of `keywords_to_update`\n // must be known as the latter loop iterates.\n for (var keyword in latest_added_index) keywords_to_update++;\n\n if (!keywords_to_update) {\n checkReIndexCompleted()\n } else {\n for (var keyword in latest_added_index) {\n\n SearchIndex.save({_id: keyword, list: latest_added_index[keyword]}, function (err) {\n GLOBAL.total_keywords_updated++;\n checkReIndexCompleted();\n });\n }\n }\n\n })\n })\n\n\n })\n });\n\n });\n })\n } else {\n redis_con.end()\n }\n }\n })\n\n\n });\n}", "view(headers, input) {\n const type = input.type;\n\n const viewConfig = this.searchConfig.views.types[type];\n const indexTypeConfig = viewConfig.indexType;\n\n const filter = this.filterPart(viewConfig, input);\n const postFilters = this.postFilters(viewConfig, input);\n\n const query = {\n sort: this.sortPart(viewConfig, input) || undefined,\n query: {\n bool: {filter}\n }\n };\n\n const finalResponse = {\n totalResults: 0,\n results: []\n };\n\n console.log('=======> View: ', JSON.stringify(indexTypeConfig));\n\n return this.esClient.allPages(indexTypeConfig.index, indexTypeConfig.type, query, 100,\n (response) => {\n if (response && response.hits && response.hits.hits) {\n const hits = response.hits.hits;\n if (hits) {\n _.forEach(hits, (hit) => {\n const doc = hit._source;\n if (!postFilters || _.every(postFilters, postFilter => postFilter(doc))) {\n finalResponse.totalResults++;\n finalResponse.results.push(doc);\n }\n });\n }\n }\n })\n .then(() => finalResponse);\n }", "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "function buildIndexData(candidateName, candidateLocation, totalWorkEx, skillsdata, transactionIdVar, candidateIdVar) {\r\n let dataJson = {};\r\n dataJson.candidate_name = candidateName;\r\n dataJson.candidate_location = candidateLocation;\r\n dataJson.workExperience = parseInt(totalWorkEx);\r\n dataJson.skillSet = skillsdata;\r\n dataJson.candidate_trans_id = transactionIdVar;\r\n dataJson.candidate_id = candidateIdVar;\r\n return dataJson;\r\n}", "printIndex() {\n\t\tconsole.log('--------------------------')\n\t\tconsole.log('Index Status: ');\n\t\tObject.keys(this.index).forEach( (key) => {\n\t\t\tvar str = key + \" --> \";\n\t\t\tstr += this.index[key].map( (i) => {\n\t\t\t\treturn i.metadata.name;\n\t\t\t}).join(', ');\n\t\t\tconsole.log(str);\n\t\t});\n\t\tconsole.log('--------------------------')\n\t}", "function IndexCore(algoliasearch, indexName) {\n\t this.indexName = indexName;\n\t this.as = algoliasearch;\n\t this.typeAheadArgs = null;\n\t this.typeAheadValueOption = null;\n\t\n\t // make sure every index instance has it's own cache\n\t this.cache = {};\n\t}", "constructor(index_def) {\n\n this.index_def = index_def;\n this.map_records = []; \n\n\n\n\n\n }", "async emptyKibanaIndex() {\n await emptyKibanaIndexAction({\n client: this.client,\n log: this.log,\n kbnClient: this.kbnClient,\n });\n }", "function _index(objects) {\n var index = {};\n for (var i=0; i < objects.length; i++) {\n var n = objects[i];\n n.uuid = \"a\" + uuid();\n index[n.id] = n;\n }\n return index;\n }", "getCachedDataByIndex(storename, index, key) {\n return this.cache.then((db) => {\n return db.transaction(storename).objectStore(storename).index(index).getAll(key);\n });\n }", "constructor(fieldsToIndex) {\n this.fieldIndexes = {};\n this.fieldsToIndex = fieldsToIndex;\n this.fieldsToIndex.forEach(field => {\n this.fieldIndexes[field] = {};\n });\n this.byId = {};\n this.spatialIndex = rbush();\n\n // internal sets to be used for intermediary operations\n // allowing us to avoid unncesseary allocations / GC\n this.pool = {\n emptySet: new Set(), // a set that's always empty, sometimes used a reference when we need an empty set\n fields: [], // sub-results from multiple fields\n spatial: new Set(), // the result of a spatial search\n ids: new Set(), // the id set resulting from the intersecting all the sub-results\n resultReference: null // sometimes we can directly reference an index slice for our results, avoiding copying ids\n };\n }", "async function run() {\n // Let's start by indexing some data\n await client.index({\n index: 'game-of-thrones',\n body: {\n character: 'Ned Stark',\n quote: 'Winter is coming.'\n }\n })\n\n await client.index({\n index: 'game-of-thrones',\n body: {\n character: 'Daenerys Targaryen',\n quote: 'I am the blood of the dragon.'\n }\n })\n\n await client.index({\n index: 'game-of-thrones',\n // type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6\n body: {\n character: 'Tyrion Lannister',\n quote: 'A mind needs books like a sword needs a whetstone.'\n }\n })\n\n // here we are forcing an index refresh, otherwise we will not\n // get any result in the consequent search\n await client.indices.refresh({ index: 'game-of-thrones' })\n\n // Let's search!\n const { body } = await client.search({\n index: 'game-of-thrones',\n // type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6\n body: {\n query: {\n match: { quote: 'winter' }\n }\n }\n })\n\n console.log(body.hits.hits)\n}", "async loadIndex() {\n const indexURL = this.config.indexURL\n return loadIndex(indexURL, this.config, this.genome)\n }", "function getAll(successCallback, errorCallback) {\n let origin = 'Index.getAll()';\n logger(origin + logEnum.begin);\n\n let request = tryGetAll(origin, _index, errorCallback);\n if (!request) {\n checkTasks();\n return;\n }\n\n request.onsuccess = function (event) {\n requestSuccessAction(\n event.target.result,\n origin,\n successCallback,\n `All records returned from index \"${_index.name}\"`\n );\n };\n\n request.onerror = function () {\n requestErrorAction(origin, request.error, errorCallback);\n };\n}", "get indices() {\n return this._indices;\n }", "async function run () {\n const escenicArticles = await getEscenicArticles(client, elascticsearchSourceIndexParams).catch(console.log)\n const transformedArticles = transformEscenicArticle(escenicArticles)\n transformedArticles\n .map(article => createUrlNavIdMapping(article))\n // await bulkIndex(transformedArticles)\n}", "function subCalc_INDEXES(o) {\n return member.subCalc(INDEXES, function subCalc_INDEXES(options) {\n return options.selectors || (o && o.skipBySpot && options.bySpot) ? false : {}\n })\n }", "syncIndices(action, added = emptyArray$5, removed = emptyArray$5, replaced) {\n const me = this,\n replacedCount = replaced === null || replaced === void 0 ? void 0 : replaced.length; // Only create indices if they have been requested\n\n if (me.dateIndicesRequested) {\n switch (action) {\n case 'clear':\n me._startDateIndex = {};\n me._dateIndex = {};\n break;\n // Add and remove\n\n case 'splice':\n // Handle replacement of records by instances with same ID\n if (replacedCount) {\n added = added.slice();\n removed = removed.slice();\n\n for (let i = 0; i < replacedCount; i++) {\n removed.push(replaced[i][0]);\n added.push(replaced[i][1]);\n }\n }\n\n const addedCount = added.length,\n removedCount = removed.length;\n let dateMS, endDateMS; // Remove entries from indices\n\n if (removedCount) {\n for (let i = 0; i < removedCount; i++) {\n var _DateHelper$clearTime, _outgoingEvent$endDat, _outgoingEvent$endDat2;\n\n const outgoingEvent = removed[i];\n dateMS = (_DateHelper$clearTime = DateHelper.clearTime(outgoingEvent.startDate)) === null || _DateHelper$clearTime === void 0 ? void 0 : _DateHelper$clearTime.getTime();\n endDateMS = (_outgoingEvent$endDat = (_outgoingEvent$endDat2 = outgoingEvent.endDate) === null || _outgoingEvent$endDat2 === void 0 ? void 0 : _outgoingEvent$endDat2.getTime()) !== null && _outgoingEvent$endDat !== void 0 ? _outgoingEvent$endDat : dateMS; // Must handle unscheduled events\n\n if (dateMS) {\n me.removeIndexEntry('startDate', outgoingEvent, DateHelper.makeKey(dateMS));\n\n do {\n me.removeIndexEntry('date', outgoingEvent, DateHelper.makeKey(dateMS));\n dateMS += MS_PER_DAY$1;\n } while (dateMS < endDateMS);\n }\n }\n } // Add entries to indices\n\n if (addedCount) {\n for (let i = 0; i < addedCount; i++) {\n const newEvent = added[i]; // Can only be date-indexed if it's scheduled\n\n if (newEvent.isScheduled) {\n var _DateHelper$clearTime2, _newEvent$endDate$get, _newEvent$endDate;\n\n dateMS = (_DateHelper$clearTime2 = DateHelper.clearTime(newEvent.startDate)) === null || _DateHelper$clearTime2 === void 0 ? void 0 : _DateHelper$clearTime2.getTime();\n endDateMS = (_newEvent$endDate$get = (_newEvent$endDate = newEvent.endDate) === null || _newEvent$endDate === void 0 ? void 0 : _newEvent$endDate.getTime()) !== null && _newEvent$endDate$get !== void 0 ? _newEvent$endDate$get : dateMS; // Must handle unscheduled events\n\n if (dateMS) {\n me.addIndexEntry('startDate', newEvent, DateHelper.makeKey(dateMS));\n\n do {\n me.addIndexEntry('date', newEvent, DateHelper.makeKey(dateMS));\n dateMS += MS_PER_DAY$1;\n } while (dateMS < endDateMS);\n }\n }\n }\n }\n\n break;\n }\n }\n }", "async index () {\n const transactions = await Transaction.all();\n return transactions;\n }", "serialize() {\n const result = {\n tag: this.tagIndex,\n reg: this.register,\n store: this.store,\n field: this.field,\n index: {}\n };\n Object.entries(this.index).forEach(([key, index]) => {\n result.index[key] = index.serialize();\n });\n return result;\n }", "function batchEnsureIndexes(collections) {\n for (var collection in collections) {\n print(\"//-- Ensuring indexes for \" + collection + \" collection...\");\n for (var index_group in collections[collection]) {\n index_group = collections[collection][index_group];\n\n formatted_index_group = formatIndexGroup(index_group);\n parametizedEnsureIndex(collection, formatted_index_group);\n }\n }\n}", "async loadIndex() {\n const indexURL = this.config.indexURL;\n let indexFilename;\n if (isFilePath(indexURL)) {\n indexFilename = indexURL.name;\n } else {\n const uriParts = parseUri(indexURL);\n indexFilename = uriParts.file;\n }\n const isTabix = indexFilename.endsWith(\".tbi\") || this.filename.endsWith('.gz') || this.filename.endsWith('.bgz')\n let index;\n if (isTabix) {\n index = await loadBamIndex(indexURL, this.config, true, this.genome);\n } else {\n index = await loadTribbleIndex(indexURL, this.config, this.genome);\n }\n return index;\n }", "function getGlobalIndexQuery(indexName) {\n if (!dbConfig.GlobalSecondaryIndexes) return null\n const gsi = dbConfig.GlobalSecondaryIndexes.find(item => item.IndexName===indexName)\n if (!gsi) return null\n return configureIndex(gsi)\n }", "loadAll(filterQuery) {\r\n var esQuery = '';\r\n if( filterQuery != \"\" ){\r\n esQuery = filterQuery;\r\n }\r\n var defer = this.$q.defer();\r\n var vm = this;\r\n this.esClient.msearch({\r\n body: [\r\n {\r\n index: ES_Details.NaprawaSpawarekIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } },\r\n {\r\n index: ES_Details.ManufacturerIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } },\r\n {\r\n index: ES_Details.MachineryIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } },\r\n {\r\n index: ES_Details.CustomersIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } }\r\n ]\r\n })\r\n .then(function(result) {\r\n console.log(\"Result:\",result);\r\n // wszystko oprocz stanow idzie do jednego wora\r\n for (var i = 1; i < result.responses.length; i++) {\r\n var response = result.responses[i];\r\n response.hits.hits.forEach(hit => {\r\n vm.dataStore[hit._id] = hit._source;\r\n });\r\n }\r\n // stany ida do osobnego wora\r\n result.responses[0].hits.hits.forEach(hit => {\r\n var hitData = hit._source;\r\n hitData.id = hit._id;\r\n hitData.Klient = vm.dataStore[hitData.idKlienta];\r\n hitData.Urzadzenie = vm.dataStore[hitData.idModelu];\r\n hitData.Urzadzenie.Producent = vm.dataStore[hitData.Urzadzenie.idProducenta];\r\n vm.inWarehouse.push(hitData);\r\n });\r\n\r\n console.log(\"Processed Result:\",vm.dataStore);\r\n console.log(\"Processed Result:\",vm.inWarehouse);\r\n defer.resolve(vm.inWarehouse);\r\n });\r\n return defer.promise;\r\n }", "function getAllComponentsIndexNames() {\n socketService.getAllComponentsIndexNames()\n .success(function (resp) {\n $scope.responseStatusHandler(resp);\n resp.allComponentsIndexNames.forEach(function (componentReference) {\n $scope.allComponentsIndexNames[componentReference.componentIndex] = componentReference.name;\n });\n })\n .error(function (errResponse) {\n $scope.responseStatusHandler(errResponse);\n })\n }", "reindex() {\n this.reindexFlag_ = false;\n\n if (this.timeModel_) {\n this.timeModel_.removeDimension(this.id_);\n\n if (this.binMethod) {\n var valueFn = this.binMethod.getValue.bind(this.binMethod);\n // add dimension that will handle an array of keys\n var isArray = this.binMethod.getBinType() == 'Date' ?\n DateRangeBinType[/** @type {DateBinMethod} */ (this.binMethod).getDateBinType()] : false;\n isArray = this.binRanges_ ? isArray : false;\n this.timeModel_.addDimension(this.id_, valueFn, isArray);\n\n if (this.secondaryBinMethod) {\n this.timeModel_.addDimension(this.multiId_, this.combinedAccessor.bind(this), isArray);\n } else {\n this.timeModel_.removeDimension(this.multiId_);\n }\n }\n }\n }", "constructor() {\n this.indexMap = new Map();\n this.store = [];\n this.idx = 0;\n }", "keepIndexing() {\n while (this.pendingRequests < this.MAX_CONCURRENT_REQUESTS\n && this.idsToIndex.length\n ) {\n this.beginIndexRequest();\n }\n }", "async function addDataToElastic(){\n await Helper.deleteIdentifierURLs(config.ORIGINAL_SITEMAP);\n const [indexed_urls, indexed_fis] = await Handler.convertDataFromSitemap();\n\n // Create Elasticsearch client and an index\n /*const client = Elastic.createElasticsearchClient(config.ELASTICSEARCH_HOST);\n Elastic.createElasticsearchIndex(client, config.URL_INDEX);\n Elastic.createElasticsearchIndex(client, config.FRAGMENT_IDENTIFIER_INDEX);\n\n\n // Add data in bulk mode to Elasticsearch\n Elastic.addDataInBulkMode(client, indexed_urls, config.URL_INDEX, config.URL_TYPE);\n Elastic.addDataInBulkMode(client, indexed_fis, config.FRAGMENT_IDENTIFIER_INDEX, config.FRAGMENT_IDENTIFIER_TYPE);*/\n}", "async function getIndexes() {\n return await fetch('https://api.coingecko.com/api/v3/indexes').then(res => res.json());\n }", "static get indexName() {\n return \"control\";\n }", "function reIndexWithDashtypeAndDashURL() {\n searchAll('brands', 'brand', function(response) {\n var hits = response.hits;\n for (var i = 0; i < hits.length; i++) {\n var recordCount = hits[i]._source.account_record_total;\n //console.log(\"PRE TINKER:\" + JSON.stringify(hits[i]._source, null, 2));\n\n if (recordCount > 0) {\n hits[i]._source.account_dashboard_types = ['eCommerce'];\n hits[i]._source.account_dashboard_url = GA_DASHBOARD_BASEURL + GA_DASHBOARD_TEMPLATE.replace(/\\*/, 'accountId:%22' + hits[i]._id + \"%22\");\n //console.log(\"POST TINKER:\" + JSON.stringify(hits[i]._source, null, 2));\n index('brands', 'brand', hits[i]._source);\n //process.exit();\n }\n\n }\n });\n}", "checkIndex() {\n this.client.indices.exists({\n index: 'events'\n }).then((response) => {\n if (response.body === false) {\n this.initMapping('events', './mapping/events.json');\n }\n });\n }", "async indexAll({ response }) {\n const groupes = await Groupe.query().distinct('name', 'id').fetch()\n\n if (groupes) {\n return response.status(200).send({\n message: 'found',\n data: groupes,\n })\n } else {\n return response.status(204).send({\n message: 'not data found',\n })\n }\n }", "index({ params }, res) {\n res.json(facets);\n }", "static async initialize() {\n // Create id index\n await this.createIndex('id', {\n id : -1,\n });\n\n // Create type index\n await this.createIndex('type', {\n type : -1,\n });\n\n // Create id+type index\n await this.createIndex('id+type', {\n id : -1,\n type : -1,\n });\n\n // Create user index\n await this.createIndex('userID', {\n 'user.id' : -1,\n });\n }", "async index () {\n return await Operator.all()\n }", "get index() {\n\n }", "function processIndexes(billingMode, indexes) {\n return indexes.reduce(function(newIndexes, index){\n var newIndex = {\n IndexName: index.IndexName,\n KeySchema: index.KeySchema,\n Projection: index.Projection\n };\n if (billingMode === 'PROVISIONED') {\n if(index.ProvisionedThroughput) {\n newIndex.ProvisionedThroughput = {\n ReadCapacityUnits: index.ProvisionedThroughput.ReadCapacityUnits,\n WriteCapacityUnits: index.ProvisionedThroughput.WriteCapacityUnits\n };\n }\n }\n newIndexes.push(newIndex);\n return newIndexes;\n }, []);\n}", "function index_browser_es_bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new index_es_ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + index_browser_es_MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = index_browser_es_pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(index_browser_es_identityFunction);\n\n var formatResult = index_browser_es_identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = index_browser_es_formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function createIndex(indexName, done) {\n console.log('made index', indexName);\n var indexBody = {\n settings: {\n index: {\n number_of_shards: 1,\n number_of_replicas: 0\n }\n },\n mappings: {\n _default_: {\n properties: {\n '@timestamp': {\n type: 'date',\n index: 'not_analyzed'\n },\n id: {\n type: 'integer',\n index: 'not_analyzed',\n include_in_all: false\n },\n country: {\n type: 'string',\n index: 'not_analyzed'\n },\n agent: {\n type: 'multi_field',\n fields: {\n agent: {\n type: 'string',\n index: 'analyzed'\n },\n raw: {\n type: 'string',\n index: 'not_analyzed'\n }\n }\n },\n clientip: {\n type: 'ip'\n },\n ip: {\n type: 'ip'\n },\n memory: {\n type: 'double'\n }\n }\n }\n }\n };\n\n client.indices.create({\n ignore: 400,\n index: indexName,\n body: indexBody\n }, done);\n}", "function createIndexNamedRange() {\n var d = DocumentApp.getActiveDocument();\n var rangeBuilder = d.newRange();\n var body = d.getBody();\n var startElem = body.findText(\"QUESTION PRESENTED\").getElement();\n var endElem = body.findText(\"End index\").getElement();\n rangeBuilder.addElementsBetween(startElem, endElem);\n d.addNamedRange(\"index\", rangeBuilder);\n}", "refreshIndexes() {\n this.element.find('tr').removeAttr('aria-rowindex');\n this.element.find('tr').removeAttr('data-index');\n\n if (this.hasLeftPane) {\n this.element.find('.datagrid-wrapper.left tbody > tr').each((idx, obj) => {\n const el = $(obj);\n el.attr('aria-rowindex', idx + 1);\n el.attr('data-index', idx);\n });\n }\n\n const page = this.settings.paging && this.pagerAPI.activePage > 1 ?\n (this.pagerAPI.activePage - 1) * this.settings.pagesize : 0;\n this.element.find('.datagrid-wrapper.center tbody > tr').each((idx, obj) => {\n const el = $(obj);\n el.attr('aria-rowindex', idx + page + 1);\n el.attr('data-index', idx + page);\n });\n\n if (this.hasRightPane) {\n this.element.find('.datagrid-wrapper.right tbody > tr').each((idx, obj) => {\n const el = $(obj);\n el.attr('aria-rowindex', idx + 1);\n el.attr('data-index', idx);\n });\n }\n }", "function IndexSet() {\n this._indexes_lookup = {}; // To keep distinct indexes\n this._indexes = []; // All the keys in the object are transformed to string, so we keep the integers in this list\n Array.prototype.slice.call(arguments).map(this.addIndex, this); // Extra constructor parameters are assumed to be indexes to add\n}", "async function initIndices() {\n let reachable = true;\n try {\n await esClient.ping();\n\n } catch (err) {\n log.error(LOG_ID, 'Creating index for job in elasticsearch failed, ES unreachable');\n reachable = false;\n }\n if (reachable) {\n let exists = await esClient.indices.exists({index: INDEX_JOBS});\n if (!exists) {\n let settings = {\n \"mappings\": {\n [TYPE_JOBS]: {\n \"properties\": {\n [STATE_FIELD]: {\n \"type\": \"object\",\n \"enabled\": false\n }\n }\n }\n }\n };\n // create index\n await esClient.indices.create({index: INDEX_JOBS, body: settings});\n }\n }\n\n}", "_first$indexRequest (ctx$indexRequestedFrom) {\n this.$indexHasBeenRequested = true;\n for (let i = 0, len = this.firstLastNodesList.length; i < len; ++i) {\n const ctx = this.getContextStartingFrom(this.firstLastNodesList[i].first);\n // Overwrite the defineProperty.\n if (ctx) { ctx.$index = observable(i); }\n }\n return ctx$indexRequestedFrom.$index()\n }", "function createNameIndexReq(name, i) {\r\n return {\"collectionName\":name, \"index\":i};\r\n}", "readMany(indices) {\n return indices.map(index => this.read(index));\n }", "processIndex(indexName) {\n if (!this.isSchemaAttached) return;\n\n check(indexName, String);\n var index = this.getIndexDatum(indexName);\n\n if (index && this.collection) {\n //the index has already been attached. We can proceed.\n var self = this;\n Meteor.startup(function() {\n if (index.needsDrop) {\n SchemaIndex.dropIndex(self.collection, indexName);\n }\n\n if (index.needsBuild) {\n SchemaIndex.ensureIndex(self.collection, indexName, index.fields,\n index.options\n );\n }\n }\n );\n }\n }", "getIndices(propertyName) {\n const indices = [this.indices[propertyName]];\n\n if (this.isFiltered) {\n indices.push(this.indices[filteredIndicesProperty][propertyName]);\n }\n\n return indices;\n }", "async beginIndexRequest() {\n const keyString = this.idsToIndex.shift();\n const provider = this;\n\n this.pendingRequests += 1;\n const identifier = await this.openmct.objects.parseKeyString(keyString);\n const domainObject = await this.openmct.objects.get(identifier.key);\n delete provider.pendingIndex[keyString];\n try {\n if (domainObject) {\n await provider.index(identifier, domainObject);\n }\n } catch (error) {\n console.warn('Failed to index domain object ' + keyString, error);\n }\n\n setTimeout(function () {\n provider.pendingRequests -= 1;\n provider.keepIndexing();\n }, 0);\n }", "static async createOptimalIndexes(collections) {\n await collections['metadatas'].ensureIndex({\"metadata.key\": 1, \"metadata.value\": 1});\n }", "function generateIndexMap(allUniqueColIndex, startDim, dimNum)\r\n {\r\n var map = {};\r\n for(var i = 0; i < allUniqueColIndex.length; ++i)\r\n {\r\n map[buildOneHeader(allUniqueColIndex[i], startDim, dimNum)] = i;\r\n }\r\n return map;\r\n }", "function generateIndexes () {\n\tlet indexes = []\n\tvariables.forEach( variable => {\n\t\tlet key = `properties.${variable}`\n\t\tlet index = [ { 'properties.country': 1, 'properties.location': 1, [key] : 1, time: -1 }, { background: true } ]\n\t\tindexes.push(index)\n\t})\n\treturn indexes\n}", "getByIndex(storeName, indexName, key) {\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.get(key);\n request.onsuccess = (event) => {\n resolve(event.target.result);\n };\n })\n .catch((reason) => reject(reason));\n }));\n }", "function get() {\n const {getBrands} = require('node-car-api');\n const {getModels} = require('node-car-api');\n var allCars = [];\n\n async function getAllBrands () {\n const brands = await getBrands();\n return brands;\n }\n\n async function getBrandModels (brand, callback) {\n console.log('\\nBrand : ' + brand)\n const models = await getModels(brand);\n\n if(models.length == 0) {\n console.log(\"-> 0 result\")\n }\n else {\n models.forEach((model) => {\n console.log(\"-> \" + model.model);\n model.volume = Number(model.volume); //convert volume into a number\n allCars.push(model);\n })\n }\n setTimeout(() => {\n callback();\n }, 500);\n }\n\n getAllBrands().then(function(brands) {\n brands.reduce((promise, item) => {\n return promise.then(() => new Promise((resolve) => {\n getBrandModels(item, resolve)\n }))\n }, Promise.resolve())\n .then(() => {\n //Push each model into elasticsearch\n allCars.forEach((car, index) => {\n setTimeout(() => {\n client.index({\n index: 'caradisiac',\n id: car.uuid,\n type: 'model',\n body: car\n },function(err,resp,status) {\n console.log(resp);\n });\n }, index*5)\n })\n })\n })\n}", "function index_ranking(result) {\n var type = E.TYPE.RANKING;\n //index ranking in a separate document\n var ranking = result.ranking;\n u.each(ranking, function (rank, id) {\n var search_id = result.term + '-' + result.guests;\n var body = {};\n body.timestamp = result.timestamp;\n body[search_id] = rank;\n\n //need to check if exist first or elasticsearch will error if update is called without existing document\n client.exists({index: E.INDEX, type: type, id: id}).then(function (exists) {\n if (exists === true) {\n //update existing doc\n client.update({index: E.INDEX, type: type, id: id, body: {doc: body}}).then(handleSuccess).catch(handleError);\n } else {\n //create new doc\n client.index({index: E.INDEX, type: type, id: id, body: body}).then(handleSuccess).catch(handleError);\n }\n }).catch(handleError);\n });\n}", "async _reindex(newIndex, branch) {\n let branchIndex = this.constructor.branchToIndexName(branch);\n let alias = await this.es.indices.getAlias({\n name: branchIndex,\n ignore: [404]\n });\n if (alias.status === 404) {\n this.log.info('%s is new, nothing to reindex', branch);\n } else {\n this.log.info('reindexing %s into %s', branch, newIndex);\n await this.es.reindex({\n body: {\n source: { index: branchIndex },\n dest: { index: newIndex }\n }\n });\n\n }\n this.log.info('updating alias %s to %s', branchIndex, newIndex);\n await this.es.indices.updateAliases({\n body: {\n actions: [\n { remove: { index: '_all', alias: branchIndex } },\n { add: { index: newIndex, alias: branchIndex } }\n ]\n }\n });\n\n }", "function doAddDataIndexes() {\r\n var countriesTable = \"//b[text()='Mis votos por país']/ancestor::*[position()=5]\".findNode();\r\n var genTable = \"//b[text()='Mis votos por género']/ancestor::*[position()=5]\".findNode();\r\n var orig_statsTable = \"//td[text()='Nº de críticas validadas:']/ancestor::*[position()=3]\".findNode();\r\n var persTable = \"//b[text()='Datos personales']/ancestor::*[position()=5]\".findNode();\r\n var statsTable = orig_statsTable.cloneNode(true);\r\n statsTable.style.marginTop = \"10\";\r\n orig_statsTable.parentNode.insertBefore(statsTable, orig_statsTable.nextSibling);\r\n\r\n function getIndiceRareza() {\r\n /*\r\n Si, ya se que esta duplicada esta función, quizas haga algo con ello algún dia\r\n */\r\n function getSavedSoulMatesLists() {\r\n var ssml = eval(GM_getValue(userId + \".ssml\"));\r\n if (typeof ssml == \"undefined\") {\r\n ssml = new Object();\r\n ssml.items = new Array();\r\n ssml.last = 0;\r\n }\r\n return ssml;\r\n }\r\n\r\n // Obtenemos las ultimas almas gemelas\r\n var ssml = getSavedSoulMatesLists();\r\n if (ssml.last > 0) {\r\n var lista = eval(GM_getValue(userId + \".sml.\" + ssml.last));\r\n // Si son 20, devolvemos el indice de la ultima\r\n if (lista.length < 20) {\r\n return 20 - lista.length;\r\n } else {\r\n return (100 / lista.sm[20].affinity).toFixed(2);\r\n }\r\n // Si son menos, 20-nº almas gemelas.\r\n\r\n } else {\r\n return 0;\r\n }\r\n }\r\n\r\n function addIndexHeader(delta) {\r\n GM_addStyle('a.bindexeslink {color:white;cursor:pointer;font-size:80%;text-decoration:none;} !important');\r\n GM_addStyle('a.bindexeslink:visited {color:white;cursor:pointer;font-size:80%;text-decoration:none;} !important');\r\n\r\n var clon = statsTable.rows[0].cloneNode(true);\r\n clon.cells[0].firstChild.firstChild.innerHTML = \"Índices <a class='bindexeslink' href='http://filmaffinity.mforos.com/1360515/7122665-indices-indicadores-e-indicios/'>(Detalles)</a>\";\r\n statsTable.rows[statsTable.rows.length - 2].parentNode.insertBefore(clon, statsTable.rows[statsTable.rows.length - delta]);\r\n }\r\n\r\n function addToStatsTable(text, value, hint) {\r\n var clon = statsTable.rows[statsTable.rows.length - 2].cloneNode(true);\r\n clon.cells[0].textContent = text;\r\n clon.cells[1].innerHTML = \"<b>\" + value + \"</b>\";\r\n clon.cells[0].title = hint;\r\n statsTable.rows[statsTable.rows.length - 2].parentNode.insertBefore(clon, statsTable.rows[statsTable.rows.length - 1]);\r\n }\r\n\r\n var miPais = persTable.rows[5].cells[1].textContent;\r\n var rowEEUU = \"//td[text()='Estados Unidos']/..\".findNode(countriesTable);\r\n var vistasEEUU = 0;\r\n var mediaEEUU = 0;\r\n if (rowEEUU != null) {\r\n vistasEEUU = rowEEUU.cells[1].textContent;\r\n mediaEEUU = parseFloat(rowEEUU.cells[2].textContent.replace(',', '.'));\r\n }\r\n\r\n\r\n var rowPais = \"//td[text()='{PAIS}']/..\".replace(/{PAIS}/g, miPais).findNode(countriesTable);\r\n var mediaPais = 0;\r\n var vistasPais = 0;\r\n if (rowPais != null) {\r\n mediaPais = parseFloat(rowPais.cells[2].textContent.replace(',', '.'));\r\n vistasPais = rowPais.cells[1].textContent;\r\n }\r\n\r\n var rowDocumentales = \"//td[text()='Documental']/..\".findNode(genTable);\r\n var vistosDocumentales = 0;\r\n var mediaDocumentales = 0;\r\n if (rowDocumentales != null) {\r\n vistosDocumentales = rowDocumentales.cells[1].textContent;\r\n mediaDocumentales = parseFloat(rowDocumentales.cells[2].textContent.replace(',', '.'));\r\n }\r\n\r\n // Obtenemos las variables basicas\r\n var totalPaises = countriesTable.rows.length - 1;\r\n var vistasTotal = statsTable.rows[1].cells[1].textContent;\r\n var mediaTotal = parseFloat(statsTable.rows[2].cells[1].textContent.replace(',', '.'));\r\n var vistasCastellano = 0;\r\n var paisesUnaPelicula = 0;\r\n var paisesUnaPeliculaVoto8910 = 0;\r\n var paisesCastellano = 0;\r\n var paisesPromedioMayorEEUU = 0;\r\n var paisesPromedioMenorEEUU = 0;\r\n\r\n // Recorremos la tabla de paises para obtener el resto de\r\n // datos\r\n for (var i = 1; i <= totalPaises; i++) {\r\n var pais = countriesTable.rows[i].cells[0].textContent;\r\n var peliculas = parseInt(countriesTable.rows[i].cells[1].textContent);\r\n var media = parseFloat(countriesTable.rows[i].cells[2].textContent.replace(',', '.'));\r\n if (typeof countriesSpanish[pais] != \"undefined\") {\r\n vistasCastellano += peliculas;\r\n paisesCastellano++;\r\n }\r\n if (peliculas == 1) {\r\n paisesUnaPelicula++;\r\n if (media >= 8) {\r\n paisesUnaPeliculaVoto8910++;\r\n }\r\n }\r\n if (peliculas > 1) {\r\n if (media > mediaEEUU) {\r\n paisesPromedioMayorEEUU++;\r\n } else if (media < mediaEEUU) {\r\n paisesPromedioMenorEEUU++;\r\n }\r\n }\r\n }\r\n\r\n /*\r\n Calculamos los indices\r\n */\r\n if (vistasTotal > 0) {\r\n var IUI = (100 * vistasCastellano) / vistasTotal;\r\n var IAO = (100 * (vistasCastellano - vistasPais)) / vistasTotal;\r\n var IB = (100 * vistasEEUU) / vistasTotal;\r\n }\r\n if (totalPaises > 0) {\r\n var IBI = (100 * paisesUnaPelicula) / totalPaises;\r\n }\r\n var II = paisesUnaPeliculaVoto8910;\r\n var IAA = 10 * (mediaPais - mediaTotal);\r\n var IDC = paisesCastellano;\r\n var IPCH = 0;\r\n if (paisesPromedioMayorEEUU > 0) {\r\n IPCH = paisesPromedioMenorEEUU / paisesPromedioMayorEEUU;\r\n }\r\n var IBD = 0;\r\n if (vistosDocumentales > 0) {\r\n IBD = (100 * vistosDocumentales) / vistasTotal;\r\n }\r\n addToStatsTable(\"General: \", IB.toFixed(2) + \"%\", \"Numero de películas de EE.UU. en relación al número de películas vistas.\");\r\n addToStatsTable(\"Búsqueda infructuosa: \", IBI.toFixed(2) + \"%\", \"Número de países con una sola película votada en relación al total de países votados.\");\r\n addToStatsTable(\"Ingratitud: \", II, \"Número de países con una sola película pero con 8, 9 ó 10 de votación.\");\r\n addToStatsTable(\"Autoaceptación: \", IAA.toFixed(2), \"Diez veces la diferencia entre la votación promedio de tu propio país y tu votación promedio.\");\r\n addToStatsTable(\"Uso del idioma: \", IUI.toFixed(2) + \"%\", \"Número de películas en castellano, en relación al número de películas votadas.\");\r\n addToStatsTable(\"Aceptación del otro: \", IAO.toFixed(2) + \"%\", \"Número de películas en castellano, sin contar las de tu país en relación al número de películas votadas.\");\r\n addToStatsTable(\"Difusión: \", IDC, \"Número de países votados de habla castellana.\");\r\n addToStatsTable(\"Rareza: \", getIndiceRareza(), \"Inverso del grado de afinidad de tu última Alma Gemela.\");\r\n addToStatsTable(\"Percepción de la Calidad de Hollywood: \", IPCH.toFixed(2), \"Número de países con votación promedio menor que la de EE.UU. en relación a los países con votación promedio mayor a la de EE.UU. Excluyendo los países con una sola película votada.\");\r\n addToStatsTable(\"Bien Documentado:\", IBD.toFixed(2) + \"%\", \"Porcentaje de documentales que has votado sobre el total votado.\");\r\n addIndexHeader(11);\r\n\r\n // Como ahora duplicamos la tabla, borramos los restos de la tabla anterior\r\n for (var n = 0; n < 6; n++) {\r\n statsTable.rows[0].parentNode.removeChild(statsTable.rows[0]);\r\n }\r\n // y la ultima fila\r\n statsTable.rows[0].parentNode.removeChild(statsTable.rows[statsTable.rows.length - 1]);\r\n }", "_updateIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n //creates index file if it doesn't already exist\n let inCouch = yield this._isInCouch(\"index\", \"index\");\n if (!inCouch) {\n yield this.couchdb.createDatabase(\"index\");\n yield this.couchdb.createDocument(\"index\", {}, \"index\");\n }\n let data = yield readFile(path.join(this.localRepoPath, \"/EventIndex.json\"), \"utf8\");\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\"'));\n let events = json[\"Events\"];\n events.sort(function (a, b) {\n return Date.parse(b.StartDate) - Date.parse(a.StartDate);\n });\n let couchDocument = yield this.couchdb.getDocument(\"index\", \"index\");\n yield this.couchdb.createDocument(\"index\", { Events: events, \"_rev\": couchDocument.data[\"_rev\"] }, \"index\");\n });\n }", "function _indexCreate(_, indexName, localeCode, model, options, isFunctionIndex) {\n\tvar opt = options || {};\n\tvar diagnoses = opt.diagnoses;\n\t// check if index exists\n\tvar elasticBaseUrl = exports.serverConfig.baseUrl;\n\tif (!elasticHelpers.indexExists(_, elasticBaseUrl, indexName, opt)) {\n\t\t// create index\n\t\tvar reqUrl = elasticBaseUrl + \"/\" + indexName;\n\t\tvar par = {\n\t\t\turl: reqUrl,\n\t\t\tmethod: 'PUT'\n\t\t};\n\t\tvar req = streams.httpRequest(par);\n\t\tvar set = _getIndexSettings(localeCode, isFunctionIndex);\n\t\tset && req.write(_, JSON.stringify(set));\n\t\tvar resp = req.end().response(_);\n\t\telasticHelpers.debugTrace(opt, \"elasticIndex.index put settings status: \" + resp.statusCode);\n\t\t//\n\t\t_processElasticResp(_, resp, null, diagnoses, locale.format(module, \"indexCreated\", indexName));\n\t\t// add search facets: add to index a new type $facet, every entry should have code and description; the id is the code\n\t\t// create a mapping\n\t\tvar mapping = {\n\t\t\t$facet: {\n\t\t\t\tproperties: {\n\t\t\t\t\tcode: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tindex: \"no\",\n\t\t\t\t\t\tinclude_in_all: false\n\t\t\t\t\t},\n\t\t\t\t\tdescription: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tindex: \"no\",\n\t\t\t\t\t\tinclude_in_all: false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tvar _options = {\n\t\t\turl: elasticBaseUrl + \"/\" + indexName + \"/$facet/_mapping\",\n\t\t\tmethod: 'PUT'\n\t\t};\n\t\treq = streams.httpRequest(_options);\n\t\treq.write(_, JSON.stringify(mapping));\n\t\tresp = req.end().response(_);\n\t\t//\n\t\t_processElasticResp(_, resp, null, diagnoses, locale.format(module, \"mappingUpdated\", \"$facet\"));\n\t\t// index facets\n\t\t// indexing facets one by one is easyier to make them non searchable than if we would add a map.\n\t\tvar facets = model.getSearchFacets(_);\n\t\tif (facets && facets.length) {\n\t\t\telasticHelpers.debugTrace(opt, \"ElasticIndex.updateFacets\");\n\t\t\t//\n\t\t\tvar _indexName = indexName;\n\t\t\t//\n\t\t\t_options = {\n\t\t\t\turl: elasticBaseUrl + \"/_bulk\",\n\t\t\t\tmethod: 'PUT'\n\t\t\t};\n\t\t\treq = streams.httpRequest(_options);\n\t\t\t//\n\t\t\tfacets.forEach_(_, function(_, f) {\n\t\t\t\tvar action = {\n\t\t\t\t\tindex: {\n\t\t\t\t\t\t_index: _indexName,\n\t\t\t\t\t\t_type: \"$facet\",\n\t\t\t\t\t\t_id: f.code\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treq.write(_, JSON.stringify(action) + \"\\n\");\n\t\t\t\telasticHelpers.debugTrace(opt, \"ElasticIndex.updateFacets: index data: \" + sys.inspect(f));\n\t\t\t\treq.write(_, JSON.stringify(f) + \"\\n\");\n\t\t\t});\n\t\t\tresp = req.end().response(_);\n\t\t\t//\n\t\t\t_processElasticResp(_, resp, null, diagnoses, \"$facets updated\");\n\t\t}\n\t\t//\n\t\texports.registerModelEvents(_, config.searchEngine);\n\t}\n}", "get indices() {\n return this._state.indices;\n }", "function initIndex(storeName, indexName, rwMode) {\n let args = [storeName, indexName, rwMode];\n let task = {\n args: args,\n fn: setIndex\n };\n\n tasks.push(task);\n}", "async function getAllLogsFromToday(req, res) {\n log.info('Log route: /log/all getAllLogsFromToday() Started');\n try {\n const { index } = req.body;\n const query = await client.search({\n index,\n type: 'doc',\n size: '10000',\n body: bodybuilder()\n .query('match_all')\n .sort('@timestamp', 'desc')\n .build(),\n });\n return res.status(200).json({\n success: true,\n msg: query,\n });\n } catch (error) {\n log.error(`Log route: /log/all getAllLogsFromToday() error: ${error}`);\n cacheUtil.incrementErrorCount(error.message || error);\n return res.status(400).json({\n success: false,\n msg: `Error : ${error}`,\n });\n } finally {\n log.info('Log route: /log/all getAllLogsFromToday () Ended');\n }\n}" ]
[ "0.69299984", "0.6372046", "0.6188884", "0.6167241", "0.5976565", "0.5860668", "0.5855596", "0.5834705", "0.57975215", "0.57781416", "0.5749914", "0.56766707", "0.56383383", "0.56328434", "0.56149787", "0.55863184", "0.55457354", "0.55413467", "0.5479946", "0.5479946", "0.5479946", "0.5479946", "0.54788727", "0.5469105", "0.5447833", "0.5429839", "0.5425982", "0.5418725", "0.54082847", "0.53847903", "0.5367336", "0.53280395", "0.53152084", "0.5306804", "0.5284901", "0.5284901", "0.5284901", "0.5284901", "0.5284901", "0.5284901", "0.52846587", "0.5279225", "0.5256362", "0.52234167", "0.5221741", "0.52197754", "0.51913095", "0.5184075", "0.5174474", "0.5159852", "0.5155878", "0.5147556", "0.51301247", "0.5129822", "0.5122042", "0.51204526", "0.51138043", "0.51135445", "0.5109952", "0.5108502", "0.5106418", "0.50999665", "0.5087334", "0.5085937", "0.5082746", "0.5078633", "0.50656277", "0.5061063", "0.50597936", "0.50529224", "0.5044237", "0.50404996", "0.5037115", "0.5033068", "0.5030305", "0.5027071", "0.5026716", "0.50255334", "0.5021612", "0.50117344", "0.5001319", "0.49945", "0.49851692", "0.49739334", "0.4970149", "0.49695072", "0.49691916", "0.49564454", "0.49482533", "0.4941162", "0.49366015", "0.49355173", "0.49309656", "0.49277133", "0.48959917", "0.48817924", "0.48811883", "0.48743856", "0.48677206", "0.4866298", "0.48631692" ]
0.0
-1
We trigger an update of the autocomplete if the props changed.
componentWillReceiveProps(nextProps) { this.props.onProps(nextProps); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateAutoCompleteHelper() {\n const that = this;\n\n that.$.autoCompleteString.style.width = that.$.input.offsetWidth + 'px';\n that.$.autoCompleteString.style.height = that.$.input.offsetHeight + 'px';\n that.$.autoCompleteString.style.left = that.$.input.offsetLeft + 'px';\n that.$.autoCompleteString.style.top = that.$.input.offsetTop + 'px';\n\n if (!that._focusedItem) {\n that.$.autoCompleteString.textContent = '';\n return;\n }\n\n if (that._focusedItem[that.inputMember].length !== that.$.input.value.length) {\n that.$.autoCompleteString.textContent = that.$.input.value + that._focusedItem[that.inputMember].slice(that.$.input.value.length);\n }\n }", "onChange() {\n this.$emit('change', this.autocompleteText);\n }", "componentDidUpdate(prevProps) {\n if(prevProps.searchTerm !== this.props.searchTerm){\n this.props.fetchFilteredProperties(0);\n }\n }", "componentDidUpdate(prevProps) {\n if(prevProps.customer !== this.props.customer) {\n this.setInputValues();\n }\n }", "onSuggestChange(event, o) {\n switch(o.method) {\n // this is necessary for the input to show each letter as its typed\n case 'type':\n this.setState({\n value: o.newValue\n });\n break;\n // one of the suggests was selected\n case 'click':\n let creatures = this.creatures;\n creatures.push({id: o.newValue.id, name: o.newValue.name});\n this.props.setModuleEditingPiece({creatures: creatures});\n // clear the input\n this.setState({\n value: ''\n });\n break;\n }\n }", "function _triggerRefresh() {\n gAutoComplete.trigger( \"apexrefresh\" );\n } // _triggerRefresh", "function triggerUpdate() {\r\n // pesquisa produto\r\n $(\"[id^='campo_nome'], [id^='campo_prod_cod']\").autocomplete({\r\n source: function(request, response) {\r\n $.ajax({\r\n url: _pasta+\"json.php?pagina=produtos_redux\",\r\n dataType: \"json\",\r\n data: {term: request.term},\r\n success: function(data) {response(data);}\r\n });\r\n },\r\n select: function(event, ui) {\r\n var num = $(this).parents(\"tr\").attr(\"num\");\r\n\r\n $(\"[id^='label_prod_cod']\").each( function(event){\r\n var val = parseInt($(this).text());\r\n\r\n if(val == ui.item.id) {\r\n alert(\"Este produto ja existe nesta lista.\");\r\n ui.item.label = \"\";\r\n ui.item.id = \"\";\r\n ui.item.preco = \"\";\r\n }\r\n });\r\n\r\n $(\"#campo_nome_\"+num).val(ui.item.label);\r\n $(\"#campo_prod_cod_\"+num).val(ui.item.id);\r\n $(\"#label_cod_\"+num).text(ui.item.id);\r\n $(\"#label_valor_original_\"+num).text(ui.item.preco);\r\n }\r\n });\r\n\r\n // re-calcula totais da linha\r\n $(\"[id^='campo_perc_desconto'], [id^='campo_valor_promocao']\").blur(function() {\r\n atualizaLinhaProduto(this);\r\n });\r\n}", "attributeChangedCallback(prop) {\n if(prop === 'inputId' || prop === 'label' || prop === 'suggestionList') {\n this.renderAndUpdateDom();\n }\n }", "componentDidUpdate() {\n var { props } = this,\n container = $(`#FieldDropdown-${this.props.fieldID}`);\n\n if(props.value.length > 0) {\n container.dropdown('set exactly', props.value);\n } else {\n container.dropdown('clear');\n }\n }", "updated(changedProperties) {\n if (super.updated) {\n super.updated(changedProperties);\n }\n changedProperties.forEach((oldValue, propName) => {\n if (\n [\"optionsPerRow\", \"icons\", \"allowNull\", \"__iconList\"].includes(propName)\n ) {\n clearTimeout(this.__rebuild);\n this.__rebuild = setTimeout(() => {\n this._getOptions();\n }, 0);\n }\n if (propName == \"value\") {\n /**\n * fires when value changes\n * @event value-changed\n */\n this.dispatchEvent(\n new CustomEvent(\"value-changed\", {\n detail: {\n value: this[propName],\n },\n })\n );\n }\n });\n }", "componentDidUpdate(prevProps) {\n\t\tconst { schema: prevSchema, value: prevValue } = prevProps;\n\t\tconst { schema: nextSchema, value: nextValue } = this.props;\n\t\tif (prevSchema !== nextSchema) {\n\t\t\tthis.setState(oldState =>\n\t\t\t\tinitItems(nextSchema, nextValue, oldState.searchCriteria, this.onToggleItem.bind(this)),\n\t\t\t);\n\t\t} else if (prevValue !== nextValue) {\n\t\t\tthis.setState(oldState => updateItems(oldState.items, nextValue, oldState.searchCriteria));\n\t\t}\n\t}", "async componentDidUpdate (prevProps, prevState) {\n console.log(prevState.substr + ' _ ' + this.state.substr)\n if (prevState.substr !== this.state.substr) {\n await this.updateResults();\n }\n if (this.props.curr_item.name !== undefined && this.state.substr != this.props.curr_item.name) {\n this.setState({\n substr: this.props.curr_item.name,\n value: this.props.curr_item._id,\n assisted_search_results: []\n })\n }\n }", "componentDidUpdate(prevProps){\n if(prevProps.searchText !== this.props.searchText){\n this.runSearch(this.props.searchText);\n }\n }", "onPlaceChanged() {\n let place = this.autocomplete.getPlace();\n\n if (!place.geometry) {\n // User entered the name of a Place that was not suggested and\n // pressed the Enter key, or the Place Details request failed.\n this.$emit('no-results-found', place, this.id);\n return;\n }\n\n if (place.address_components !== undefined) {\n // return returnData object and PlaceResult object\n this.$emit('placechanged', this.formatResult(place), place, this.id);\n\n // update autocompleteText then emit change event\n this.autocompleteText = document.getElementById(this.id).value\n this.onChange()\n }\n }", "onSuggestionsFetchRequested ({ value }) {\n this.setState({\n suggestions: getSuggestions(value, this.props.autocomplete)\n })\n }", "_onChange () {\n this.forceUpdate()\n }", "componentDidUpdate(prevProps, prevState){\n\t\tif(this.props.searchName.length > 0 && prevProps.searchName.localeCompare(this.props.searchName) != 0){\n\t\t\tthis.searchName(this.props.searchName);\n\t\t}\n\t}", "componentDidUpdate(prevProps) {\n if (this.props.visible !== prevProps.visible && this.props.visible === true) {\n this.makeFullSearch();\n }\n }", "_autoComplete(noSelectionRefresh) {\n const that = this;\n\n if (that.autoComplete === 'list') {\n return;\n }\n\n if (that.$.listBox._items.length === 0 && typeof that.dataSource !== 'function') {\n that.close();\n return;\n }\n\n const value = that.$.input.value.length < that.minLength ? '' :\n (that.displayMode === 'escaped' ? that._toDefaultDisplayMode(that.$.input.value) : that.$.input.value), //displayMode is a jqxTextBox property\n isItemFocused = function (items) {\n for (let i = 0; i < items.length; i++) {\n if (items[i]._focused && items[i].hasAttribute('focus')) {\n return true;\n }\n }\n };\n\n let selectedItem;\n\n if (that.$.listBox.selectedValues.length === 1) {\n selectedItem = that.$.listBox.getItem(that.$.listBox.selectedValues[0]);\n }\n\n that.$.autoCompleteString.textContent = '';\n that.$.listBox.$.filterInput.value = that.autoComplete === 'none' || that.$.input.value.length < that.minLength ? '' : value;\n\n const queryCallback = function () {\n if (!that.$.listBox.isAttached || !that.$.input) {\n return;\n }\n\n const activeElement = that.enableShadowDOM ? that.shadowRoot.activeElement : document.activeElement;\n\n that._setDropDownSize();\n\n if (that.opened) {\n that._positionDetection.positionDropDown();\n that._positionDetection.checkBrowserBounds();\n }\n\n if (that.$.listBox._filteredItems && that.$.listBox._filteredItems.length > 0) {\n that.$.listBox._scrollView.scrollTop = that.$.listBox._filteredItems[0].offsetTop;\n\n if (that.autoComplete !== 'none' && that.$.input.value.length >= that.minLength && !isItemFocused(that.$.listBox._filteredItems)) {\n that._focus(that.$.listBox._filteredItems[0]);\n }\n\n if (activeElement === that.$.input && that.autoComplete === 'inline' && that.$.input.value.length >= that.minLength) {\n that._updateAutoCompleteHelper();\n }\n\n if (selectedItem && selectedItem[that.inputMember] === that.$.listBox._filteredItems[0][that.inputMember] && selectedItem.value === that.$.listBox._filteredItems[0].value) {\n that.$.listBox.context = that.$.listBox;\n that.$.listBox._select(that.$.listBox._filteredItems[0], true);\n that.$.listBox.context = listBoxContext;\n }\n\n if (value !== that.$.listBox._filteredItems[0][that.inputMember] || (JQX.TextBox && that instanceof JQX.TextBox && that.dropDownOpenMode === 'auto')) {\n if (that._closedFromKeyCombination) {\n that._closedFromKeyCombination = false;\n return;\n }\n\n if (value.length < that.minLength && !(JQX.TextBox && that instanceof JQX.TextBox && that.dropDownOpenMode === 'auto')) {\n that.close();\n return;\n }\n\n if (that.isCompleted && that.dropDownOpenMode !== 'none' && activeElement === that.$.input) {\n that.open();\n }\n }\n\n return;\n }\n\n that.close();\n }\n\n //Context Fix\n let listBoxContext = that.$.listBox.context;\n\n that.$.listBox.context = that.$.listBox;\n that.$.listBox._filterItems(noSelectionRefresh ? true : false, queryCallback, JQX.TextBox && that instanceof JQX.TextBox && that.dropDownOpenMode === 'auto');\n that.$.listBox.context = listBoxContext;\n\n }", "didReceiveAttrs() {\n if (this.get('autocomplete')) {\n this.get('autocomplete').setOptions(this.getOptions());\n }\n }", "componentDidUpdate(prevProps){\n if(this.props.selectedCountry !== prevProps.selectedCountry){\n this.getUserList(this.props.selectedCountry);\n }\n }", "_onSuggestionsFetchRequested({value}) {\n this.setState({\n suggestions: this._getSuggestions(value)\n });\n }", "onUpdateContent() {\n this.checkAutocomplete();\n\n if (!this.search) {\n this.emmitEvent('');\n }\n }", "function searchUpdated(term) {\n setsearch(term);\n }", "componentDidUpdate(preProps, prevState) {\n if (preProps.mySpell !== this.props.mySpell) {\n this.getMySpell()\n }\n }", "function refresh() {\n // trigger the before refresh event\n gAutoComplete.trigger( \"apexbeforerefresh\" );\n\n // Clear the autocomplete field\n $s(gAutoComplete[0], \"\", \"\");\n\n // clear the auto complete select list\n gAutoComplete.flushCache();\n\n // trigger the after refresh event\n gAutoComplete.trigger( \"apexafterrefresh\" );\n } // refresh", "async componentDidUpdate(prevProps) {\n // Condition for the searchbar\n if (this.props.search !== prevProps.search && this.props.start_search === true) {\n await this.setState({loading: true});\n await this.fetchUserData(this.props.search);\n await this.filterUserData(this.props.source);\n }\n\n // Condition for the VCS source/ filter\n if (this.props.source !== prevProps.source && this.props.start_search === true) {\n await this.filterUserData(this.props.source)\n }\n }", "componentWillReceiveProps(props) {\n this.updateOptionList(props.stops);\n }", "onSuggestionsFetchRequested({ value }) {\n this.setState({\n suggestions: this.getSuggestions(value)\n });\n }", "componentDidUpdate(prevProps, prevState) {\n if (prevState.pending && !this.state.pending) {\n // Autosize textareas to fit input\n autosize(document.querySelectorAll('textarea'));\n\n // Autocomplete the location field for the video\n const location = document.getElementById(\"location\");\n if (location) {\n const options = {\n componentRestrictions: {country: 'us'},\n };\n const place = new google.maps.places.Autocomplete(location, options);\n\n // Update the location field\n document.getElementById('location').value = this.state.location.name;\n }\n }\n }", "componentDidUpdate(previousProps) {\n this.props.list && !previousProps.list && setEditFormData(this.props.list)\n }", "onFocus() {\n this.biasAutocompleteLocation();\n this.$emit('focus');\n }", "onSuggestionsFetchRequested({ value }) {\n this.setState({\n suggestions: this.getSuggestions(value)\n })\n }", "onSuggestionsFetchRequested ({ value }) {\n this.setState({\n suggestions: this.getSuggestions(value)\n });\n }", "componentDidUpdate(prevProps, prevState) {\n\n if (!_isEqual(prevProps.user, this.props.user) && this.props.user) {\n this.props.search();\n }\n }", "componentDidUpdate(prevProps) {\n\t\tlet prevResourceId = prevProps.selectedItem.resource_id\n\t\tlet nextResourceId = this.props.selectedItem.resource_id\n\n\t\tif (prevResourceId !== nextResourceId) {\n\t\t\tlet selectedItem = this.props.selectedItem\n\n\t\t\tthis.setState({\n\t\t\t\tresource_id: selectedItem.resource_id,\n\t\t\t\tdescriptionValue: selectedItem.description,\n\t\t\t\turlValue: selectedItem.url,\n\t\t\t\tresourceValue: selectedItem.topic.topic_id,\n\t\t\t\tdropdownValue: `${selectedItem.topic.topic_id} - ${selectedItem.topic.name}`\n\t\t\t})\n\t\t}\n\t}", "updated(_changedProperties){}", "updated(_changedProperties){}", "componentDidUpdate(prevProps) {\n this.refreshSynonyms(this.props.singleTokens[prevProps.match.params.id]);\n if (prevProps.match.params.id !== this.props.match.params.id) {\n this.initTokenWithSynonymAlias(this.props.match.params.id);\n this.props.onUpdateVocab(\n this.props.singleTokens[prevProps.match.params.id]\n );\n this.props.onGetCompleteness();\n }\n }", "setAutoComplete() {\n var _this = this,\n inventory_id = this.getWareHouseId();\n $(\"#c_p_name\").autocomplete({\n source: this.productNames,\n select: function (event, ui) {\n var label = ui.item.label;\n var value = ui.item.value;\n _this.clearFields(['#c_p_quantity', '#c_p_r_price']);\n _this.setProductDetails(inventory_id, value);\n $(\"#c_p_quantity\").focus();\n _this.errors.clearErrors();\n }\n });\n }", "updateSearchResults( evt ) {\n\t\tthis.setState( {\n\t\t\tsearchText: evt.target.value,\n\t\t} );\n\t}", "updateSearchResults( evt ) {\n\t\tthis.setState( {\n\t\t\tsearchText: evt.target.value,\n\t\t} );\n\t}", "updated(_changedProperties) { }", "function update() {\n\t\t\t// if we get here too early, back off\n\t\t\tif (!cache.isReady()) {\n\t\t\t\tpopup.showSpinner();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// get matching names and insert them into the list, selecting the first\n\t\t\tcache.match();\n\t\t\tbuildItems();\n\t\t\tlastSelected = null;\n\t\t\tselect();\n\n\t\t\t/**\n\t\t\t * if we have at least {minLength} chars, search to augment\n\t\t\t * the (incomplete) name cache\n\t\t\t */\n\t\t\tif (keyCache.getLength() >= options.minLength) {\n\t\t\t\tcache.search();\n\t\t\t}\n\t\t}", "onSuggestionsFetchRequested({ value })\n {\n this.setState({\n suggestions: this.getSuggestions(value)\n });\n }", "shouldComponentUpdate(nextProps) {\n return nextProps.term === this.props.term;\n }", "function onWidgetsUpdate() {\n var metadata = getMetadata(store.getState().widgets);\n\n store.setState(_extends({}, store.getState(), {\n metadata: metadata,\n searching: true\n }));\n\n // Since the `getSearchParameters` method of widgets also depends on props,\n // the result search parameters might have changed.\n search();\n }", "componentDidUpdate(prevProps) {\n if (this.props.map !== prevProps.map && this.mapEditor) {\n this.mapEditor.update();\n }\n }", "checkAutocomplete() {\n if (this.airports) {\n this.filteredAirports = this.filter(this.airports, this.search, this.fields);\n\n let keys = Object.keys(this.filteredAirports);\n\n if (keys.length == 1 && this.search) {\n this.autocomplete = this.filteredAirports[keys[0]];\n this.aita = this.autocomplete.aitaCode;\n } else {\n if (this.hasSuggestions() && this.search) {\n this.emmitEvent('');\n }\n\n this.autocomplete = undefined;\n }\n }\n }", "componentDidUpdate(prevProps, prevState) {\n if (prevState.filteredByName !== this.state.filteredByName || prevState.filteredByTag !== this.state.filteredByTag) {\n this.filter();\n }\n }", "updateFieldKv(event) {\n this.props.uiState.setFieldsUsingKvString(event.target.value);\n this.setSuggestions(event.target.value);\n if (this.state.suggestionIndex) {\n this.setState({\n suggestionIndex: 0\n });\n }\n }", "function CompanyAutoComplete_CompAttVals() {\n $(\"#txtCompany\").autocomplete({\n select: function (a, b) {\n $(this).val(b.item.label);\n $('#hdnCompNam').val(b.item.label);\n $('#ddlCompany').val(b.item.value);\n GetAttributes4CompAttValues();\n $(\"#txtCompany\").attr(\"disabled\", true);\n $(\"#lnkChngComp\").show(1000);\n return false;\n },\n source: getCompaniesJson(),\n minLength: 2\n });\n}", "componentDidUpdate(prevProps) {\n\t\tif (prevProps.chosenMovies.length !== this.props.chosenMovies.length) {\n\t\t\tthis.setState({\n\t\t\t\titems: this.props.chosenMovies\n\t\t\t});\n\t\t}\n\t}", "checkAutoCompletion(targetInput) {\n if (!targetInput)\n return;\n if (targetInput.value) {\n // if value is already set, we set the value directly\n this.setAutoCompleteValue(targetInput.value);\n }\n else {\n // if value is not set, we start listening for it\n targetInput.addEventListener('input', e => {\n const value = e.target.value;\n this.setAutoCompleteValue(value);\n });\n }\n }", "function onAutoCompleteSuccess() {\n\tclearOldSuggestions();\n \t// In this context, 'this' means the XMLHttpRequest itself.\n \taddSuggestionsToPanel(this.response);\n}", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "function CompanyAutoComplete_CompAtts() {\n $(\"#txtCompany\").autocomplete({\n select: function (a, b) {\n $(this).val(b.item.label);\n $('#hdnCompNam').val(b.item.label);\n $('#ddlComps').val(b.item.value);\n GetCompAttributes();\n $(\"#txtCompany\").attr(\"disabled\", true);\n $(\"#lnkChngComp\").show(1000);\n return false;\n },\n source: getCompaniesJson(),\n minLength: 2\n });\n}", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "autoComplete () {\n var that = this;\n var autocompleteOn = true;\n GEPPETTO.CommandController.availableTags();\n\n var commandInputAreaEl = $(\"#\" + this.props.id + \"_component #commandInputArea\");\n // bind console input area to autocomplete event\n commandInputAreaEl.bind(\"keydown\", function (event) {\n if (event.keyCode === $.ui.keyCode.TAB\n && $(this).data(\"ui-autocomplete\").menu.active) {\n event.preventDefault();\n }\n if (event.keyCode === $.ui.keyCode.BACKSPACE) {\n autocompleteOn = false;\n }\n })\n .autocomplete({\n minLength: 0,\n delay: 0,\n source: that.matches.bind(that),\n focus: function () {\n // prevent value inserted on focus\n return false;\n },\n open: function (event, ui) {\n if (autocompleteOn) {\n var suggestions = $(this).data(\"uiAutocomplete\").menu.element[0].children\n , firstElement = suggestions[0]\n , inpt = commandInputAreaEl\n , original = inpt.val()\n , firstElementText = $(firstElement).text()\n , suggestionsSize = suggestions.length;\n /*\n * here we want to make sure that we're not matching something that doesn't start\n * with what was typed in\n */\n if (firstElementText.toLowerCase().indexOf(original.toLowerCase()) === 0) {\n\n // only one suggestion\n if (suggestionsSize == 1) {\n if (inpt.val() !== firstElementText) {\n inpt.val(firstElementText); // change the input to the first match\n\n inpt[0].selectionStart = original.length; // highlight from beginning of input\n inpt[0].selectionEnd = firstElementText.length;// highlight to the end\n }\n } else {\n // match multiple suggestions\n if (inpt.val() !== \"\") {\n let mostCommon;\n var elementsText = [];\n for (var i = 0; i < suggestionsSize; i++) {\n elementsText[i] = $(suggestions[i]).text();\n }\n var A = elementsText.slice(0).sort(),\n word1 = A[0], word2 = A[A.length - 1],\n i = 0;\n if (word1 != word2) {\n while (word1.charAt(i) == word2.charAt(i)){\n ++i;\n }\n // match up most common part\n mostCommon = word1.substring(0, i);\n } else {\n mostCommon = word1;\n }\n\n if (inpt.val().indexOf(mostCommon) == -1) {\n inpt.val(mostCommon);// change the input to the first match\n\n inpt[0].selectionStart = original.length; // highlight from end of input\n inpt[0].selectionEnd = mostCommon.length;// highlight to the end\n }\n }\n }\n }\n } else {\n autocompleteOn = true;\n }\n }\n });\n }", "componentDidUpdate() {\n const props = this.getProps();\n if (this.editor && !this.editor.getValue()) this.editor.setValue(props.value);\n }", "componentDidUpdate(prevProps) {\n if (prevProps.store.zip.short_name !== this.props.store.zip.short_name) {\n this.setState({\n short_name: this.props.store.zip.short_name\n })\n }\n }", "update(_changedProperties) {\n super.update();\n }", "onCustomWidgetBeforeUpdate(changedProperties) {\r\n\r\n\t\t}", "handleFormComAutoComplete(searchText) {\r\n this.setState({companyName: searchText});\r\n this.handleCompanyAutoComplete(searchText);\r\n this.handleComAutoCompleteSelect(searchText);\r\n }", "componentDidUpdate(prevProps){\n this.props.list && !prevProps.list &&\n this.props.setFormDataForEdit(this.props.list)\n }", "function onWidgetsUpdate() {\n const metadata = getMetadata(store.getState().widgets);\n\n store.setState({\n ...store.getState(),\n metadata,\n searching: true,\n });\n\n // Since the `getSearchParameters` method of widgets also depends on props,\n // the result search parameters might have changed.\n search();\n }", "componentDidUpdate(prevProps) {\n if (prevProps !== this.props)\n this.setState({ selectedItems: new Set() });\n return true;\n }", "componentDidUpdate(prevProps) {\n\n //get customer Details only if props has changed\n if (this.props.val !== prevProps.val) {\n this.getcustomerDetails(this.props.val)\n }\n }", "shouldComponentUpdate(nextProps, nextState) {\n if (nextProps.subeData) {\n\n //todo : autocomplete datasının hazırlanması\n for (let i = 0; i < nextProps.subeData.length; i++) {\n let sube = nextProps.subeData[i];\n let subeAd = sube.Sube_Adi_Ad;\n let subeKod = sube.Sube_Sube_Kd;\n let subeIsim = Helper.getCityNameByNo(sube.Sube_Il_Kd);\n\n let val = subeAd + \"-\" + subeKod + \"-\" + subeIsim;\n sube.combinedAutoCompleteVal = val;\n this.autoCompleteData.push(sube);\n }\n\n //todo : subeData ataması ! eğer seçilen şehir yoksa bütün data eğer var ise filtrelenmiş data için\n //todo : reducerdaki datayı ham kullanmak yerine manipulatedDataArr objesini kullandık.\n this.manipulatedSubeDataArr = nextProps.subeData;\n }\n\n return true;\n }", "componentDidUpdate(prevProps) {\n if (prevProps.match.params.id !== this.props.match.params.id) {\n this.initTokenWithSynonymAlias(this.props.match.params.id);\n this.props.onUpdateVocab(\n this.props.multiTokens[prevProps.match.params.id]\n );\n this.props.onGetCompleteness();\n }\n }", "componentDidUpdate() {\n // Isolate location and add google maps autocomplete on it\n const location = document.getElementById('location');\n if (location) {\n // Autocomplete the user's city\n const options = {\n types: ['(cities)'],\n componentRestrictions: {country: 'us'},\n };\n const place = new google.maps.places.Autocomplete(location, options);\n }\n\n // Autosize textareas (for example, the bio textarea)\n autosize(document.querySelectorAll('textarea'));\n }", "onSuggestionsFetchRequested (value) {\n let that=this;\n this.getSuggestions(value,function(result){\n that.setState({\n suggestions: result\n });\n })\n\n\n }", "componentDidUpdate(prevProps, prevState) {\n if (this.state.search == !prevState.search || this.props.clear == true) {\n this.getAppointments();\n }\n }", "componentDidUpdate(prevProps) {\n if(this.props.title !== prevProps.title) {\n this.getMealData();\n }\n }", "onSuggestionsFetchRequested({ value }) {\n if (value.length < 3) {\n this.setState({suggestions: []});\n return;\n }\n\n if (value.substring(0, 3) == this.state.prevSearch.substring(0, 3)) {\n this.setState(state => {\n return ({\n suggestions: autocompleteFilter(state.cachedSuggestions, value, this.props.identifier)\n })\n });\n }\n else {\n fetch(`entry/complete/?identifier=${this.props.identifier}&value=${value}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n }).then(response => response.json()).then(data => {\n if (data.ok) \n this.setState({\n suggestions: data.suggestions,\n cachedSuggestions: data.suggestions,\n prevSearch: value\n })\n });\n }\n }", "handleChange() {\n this.forceUpdate();\n }", "handleComAutoCompleteSelect(chosenRequest) {\r\n this.setState({companyName: chosenRequest}, () => this.handleSubmit());\r\n }", "componentDidUpdate(prevProps) {\n const { filters } = this.props;\n if (prevProps.filters !== filters) {\n this.loadVehicles();\n }\n }", "componentDidUpdate(prevProps) {\n if (\n prevProps.currentIndex != this.props.currentIndex ||\n prevProps.list.length != this.props.list.length\n )\n this.setState({\n ...this.EditStateFunction()\n });\n }", "componentDidUpdate (prevProps, props) {\n if (prevProps !== props) {\n if (prevProps.sort !== this.props.sort) {\n const { setUserJobs } = this.props\n setUserJobs(this.props.jobs, this.props.sort)\n }\n if (prevProps.sort !== this.props.sort ||\n prevProps.inactive !== this.props.inactive) {\n this.checkForChanges()\n }\n }\n }", "componentDidUpdate(prevProps, prevState) { // eslint-disable-line\n if (this.state.value !== prevState.value) {\n this.props.setValue(this.state.value);\n if (this.state.manualChangeKey !== prevState.manualChangeKey || this.props.shouldUpdateAlways) {\n this.props.onChangeInput(this.props.name, this.state.value);\n }\n }\n }", "async componentDidUpdate(prevProps, prevState){\n if (prevState.rangeShort !== this.state.rangeShort){\n await this.getData();\n }\n if (prevState.rangeLong !== this.state.rangeLong){\n await this.getData();\n }\n }", "onSuggestionsClearRequested () {\n\t\tthis.setState({\n\t \tsuggestions: []\n\t })\n\t}", "onCustomWidgetBeforeUpdate(oChangedProperties) {\n\n\t\t}", "componentDidUpdate(prevProps) {\n // Typical usage (don't forget to compare props):\n if (this.props !== prevProps) {\n if(this.props.value.option_weight !== undefined) {\n this.setState({id: Number(this.props.value.option_weight)});\n this.setState({option_label: 'Option ' + (Number(this.props.value.option_weight) + 1)});\n this.setState({option_text: this.props.value.option_text});\n } else {\n this.setState({id: this.props.value.id});\n this.setState({option_label: 'Option ' + (this.props.value.id + 1)});\n this.setState({option_text: this.props.value.option_text});\n }\n \n }\n }", "updated(_changedProperties) {\n }", "updated(changedProperties) {\n super.updated(changedProperties);\n const event = new CustomEvent('updated', {\n bubbles: true,\n cancelable: true\n });\n this.dispatchEvent(event);\n }", "function set_suggestions(field, suggestions) {\n field.autocomplete({\n source: suggestions\n });\n}", "componentDidUpdate(prevProps){\n // Zoom to new location.\n if(this.props.location !== prevProps.location)\n this.zoomToArea(this.props.location);\n\n // New business list, toggle old list markers off and create new markers for new list.\n if(this.props.businessList !== prevProps.businessList){\n this.toggleMarkers(prevProps.businessList, false);\n this.props.businessList.forEach((business) => {\n business[\"marker\"] = this.createMarker(business);\n });\n }\n // New filtered list, toggle old list markers off and toggle new list markers on.\n else if(this.props.filteredBusinessList !== prevProps.filteredBusinessList){\n this.toggleMarkers(prevProps.filteredBusinessList, false);\n this.toggleMarkers(this.props.filteredBusinessList, true);\n }\n }", "componentDidUpdate(prevPros) {\n\t\tif (this.props.val !== prevPros.val) {\n\t\t\tthis.getCustomerDetails(this.props.val);\n\t\t}\n\t}", "handleFormLocAutoComplete(searchText) {\r\n this.setState({location: searchText});\r\n this.handleLocationAutoComplete(searchText);\r\n this.handleLocationAutoCompleteSelect(searchText);\r\n }", "resetAutoCompleteResults({ commit }) {\n commit('setAutoCompleteResults', {\n categoryItems: [],\n productItems: [],\n });\n\n commit('setAutoCompleteResultsArray', []);\n\n commit('setSelectedItemPosition', -1);\n\n commit('setSelectedItemId', null);\n\n commit('setShowAutoCompleteResults', false);\n }", "componentDidUpdate (prevProp) {\n\t\tconsole.log('ujeen ----> prevProp : ', prevProp.val);\n\t}", "componentWillReceiveProps(nextProps){\n if(nextProps.enabled){\n //If component becomes enabled, set focus on input\n this.setInputFocus(); \n\n //If user selected a new location, reset state\n if(nextProps.locationName !== this.props.locationName){\n //Reset everything except current search term in input field\n this.setState({\n lastSearchTerm: '',\n loading: false,\n results: []\n });\n }\n } \n }", "setLocationSuggestions(event){\n if (this.country_mode) return false;\n let display_location_mode = this.input_location_mode_changed ? this.input_location_mode : 1;\n let get_started = this,\n new_location = {\n input_location_mode: display_location_mode,\n input_location: event.target.value\n };\n\n get_started.setState({\n input_location: event.target.value,\n show_location_suggestions: true\n });\n\n if (get_started.$set_location_suggestions){\n clearTimeout(get_started.$set_location_suggestions);\n }\n\n // debounce location suggestions by 500ms.\n get_started.$set_location_suggestions = setTimeout(()=>{\n CalculatorApi.getAutoComplete(new_location)\n .then((locations)=>{\n get_started.setState({\n locations: locations,\n show_location_suggestions: true\n });\n });\n }, 500);\n }", "shouldUpdate(_changedProperties){return true;}", "componentDidUpdate(prevProps) {\r\n\r\n //get Employee Details only if props has changed\r\n if (this.props.val !== prevProps.val) {\r\n this.getEmployeeDetails(this.props.val)\r\n }\r\n }", "firstUpdated(_changedProperties){}", "firstUpdated(_changedProperties){}" ]
[ "0.6664672", "0.65073925", "0.6455506", "0.633346", "0.6323923", "0.6273839", "0.6269641", "0.6237986", "0.6195088", "0.6169356", "0.6163454", "0.613245", "0.6101667", "0.6098556", "0.6075636", "0.6063945", "0.6055582", "0.6047421", "0.60135496", "0.5987259", "0.59837204", "0.59807754", "0.59623617", "0.59515727", "0.5951055", "0.59502685", "0.5922533", "0.59190476", "0.5913023", "0.5905855", "0.59047747", "0.58987236", "0.58928895", "0.58877534", "0.58729595", "0.58729565", "0.586953", "0.586953", "0.5864495", "0.5855654", "0.5854814", "0.5854814", "0.5847552", "0.5839333", "0.58161294", "0.58085954", "0.5796321", "0.5785399", "0.5772028", "0.57675046", "0.5766369", "0.57537955", "0.5741154", "0.57307476", "0.57186466", "0.5713636", "0.5713636", "0.5713636", "0.57122064", "0.57107776", "0.57072496", "0.56948674", "0.5686727", "0.5686202", "0.56859064", "0.5683561", "0.56816846", "0.56740767", "0.567347", "0.5663309", "0.5662214", "0.56542116", "0.5641419", "0.5634078", "0.5633438", "0.5626132", "0.56104165", "0.56035817", "0.56021416", "0.5588899", "0.5584129", "0.55814505", "0.5578085", "0.55770886", "0.55709505", "0.5569481", "0.5564477", "0.5561817", "0.5561228", "0.5559626", "0.55562407", "0.5538422", "0.55383617", "0.5536396", "0.5529305", "0.5528466", "0.55117905", "0.55052495", "0.549786", "0.5495348", "0.5495348" ]
0.0
-1
Consume the log message. When log capacity is satisfied, chunk will be send out.
function Consumer(options){ this.options = options; this.size = 0; this.chunks = new Array(); this.last = new Date().getTime(); this.chunk = helper.defaultChunk(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processQueue_() {\n if (!this.queue_.length) return;\n const [size, callback] = this.queue_[0];\n\n if (this.getBufferSize_() < size) return;\n\n const chunk = this.consumeBuffer_(size);\n this.queue_.shift();\n callback(chunk);\n this.processQueue_();\n }", "function consume(message) {\n var start = new Date().getTime()\n , payload = JSON.parse(message.content.toString('UTF8'));\n\n logger.info('received batch');\n batchHandler.process(payload)\n .then(function(batchId) {\n channel.ack(message);\n logger.info('batch ' + batchId + ' processed in ' + (new Date().getTime() - start) / 1000 + ' seconds.');\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 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,", "doFetchFirstLogChunk() {\n // check the FSM state\n // if the job is still queued or running, stop the current log fetch and get logs.\n if (!Jobs.isTerminalStatus(this.fsm.getCurrentState().state.mode)) {\n this.doStopLogs();\n this.requestJobLog(0);\n }\n this.getLogPanel().scrollTo(0, 0);\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 drainBuffer(cb) {\n if (!state.buffer.length)\n return cb()\n var done = multicb()\n var wait = false\n state.buffer.forEach(function(entry) {\n if (hasHandled(entry.depId, entry.seq)) {\n // dep has been handled, run it now\n applyMessage(entry.msg, done())\n wait = true\n }\n })\n if (!wait)\n return cb()\n done(cb)\n }", "consume() {\n return this._onConsume();\n }", "_read(size) {\n\t // If we haven't reached the end of the source buffer, push the next chunk onto\n\t // the internal stream buffer.\n\t if (this._offset < this._length) {\n\t this.push(this._source.slice(this._offset, (this._offset + size)));\n\t this._offset += size;\n\t }\n\t // If we've consumed the entire source buffer, close the readable stream.\n\t if (this._offset >= this._length) {\n\t this.push(null);\n\t }\n\n\t}", "function logged() {\r\n this._size += bytes;\r\n this._pendingSize -= bytes;\r\n\r\n debug('logged %s %s', this._size, output);\r\n this.emit('logged', info);\r\n\r\n // Do not attempt to rotate files while opening\r\n if (this._opening) {\r\n return;\r\n }\r\n\r\n // Check to see if we need to end the stream and create a new one.\r\n if (!this._needsNewFile()) {\r\n return;\r\n }\r\n\r\n // End the current stream, ensure it flushes and create a new one.\r\n // This could potentially be optimized to not run a stat call but its\r\n // the safest way since we are supporting `maxFiles`.\r\n this._rotate = true;\r\n this._endStream(() => this._rotateFile());\r\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 handle_data_available(event) {\n if (event.data.size > 0) {\n recordedChunks.push(event.data);\n }\n}", "doFetchLastLogChunk() {\n // if the FSM is not in a terminal state, stop the log fetch\n // and get the latest logs\n if (!Jobs.isTerminalStatus(this.fsm.getCurrentState().state.mode)) {\n this.doStopLogs();\n this.requestLatestJobLog();\n }\n this.getLogPanel().scrollTo(0, this.getLastLogLine().offsetTop);\n }", "function processConsume(data) {\n setConsume(data);\n}", "async run() {\n this.watcher = fs.watch(this.logsPath);\n console.log(\"Starting Logger...\");\n // I know this function gets a bit callback helly but its an alpha\n // after a an hour or two of refactoring im sure it can be cleaner (ex. promisify everything)\n this.watcher\n .on('change', (eventType, filename) => {\n\n // checks if its a change event and if the file is included in watchfiles\n if (eventType === 'change' && this.watchFiles.includes(filename)) {\n \n // creates a read steam from last byte read onwards\n let tmpStream = fs.createReadStream(`${this.logsPath}/${filename}`, { start: this.bytesRead[filename] });\n \n // once data is recived we process it\n tmpStream\n .on('data', (chunk) => {\n // turn buffer chunks into string\n let chunk2Str = chunk.toString();\n \n // changed this up, now it runs through line parser and then gets\n // reattached as a string to be dumped in the buffer.\n let jsonParsedLines = this.parsedLinesToJSON(this.lineParser(filename, chunk2Str));\n \n // append to buffer file\n fs.appendFile(this.tmpBuff, jsonParsedLines, (err) => {\n // errors are handled not to crash program but they dont log themselves...yet\n if (err)\n console.log(err);\n else\n // this line ensures that once the content has been read, every byte goes in the counter\n // so that next pass around it start right where it left off\n this.bytesRead[filename] += Buffer.byteLength(chunk2Str);\n\n // after getting the size of the current buffer file and based on the set interval\n // we decide if we want to send the buffer to the server or wait for more logs\n // this can be changed via interval to the developers choosing, to not make 1000 http\n // requests a second every time there is a new log line\n if (this.getFilesizeInBytes(this.tmpBuff) >= this.buffInterval)\n this.theTransporter(this.tmpBuff, this.bbToArr(this.tmpBuff));\n });\n // closing the stream\n tmpStream.close();\n });\n \n }\n else if (eventType === 'rename' && /\\d{8}-\\d{6}.log$/.test(filename) && fs.existsSync(`${this.logsPath}/${filename}`)) {\n try {\n let filePath = `${this.logsPath}/${filename}`;\n let data = fs.readFileSync(filePath);\n this.theTransporter(filePath, this.lineParser(filename, data.toString()));\n }\n catch(err) {\n console.log(err);\n }\n }\n else {\n console.log(\"Unknown eventType or buff/backlog file\");\n }\n })\n .on('error', (err) => {\n // send to server error log\n console.log(err);\n console.log(\"Logger Offline...\");\n })\n .on('close', () => {\n if (this.getFilesizeInBytes(this.tmpBuff) > 1)\n this.theTransporter(this.tmpBuff, this.bbToArr(this.tmpBuff));\n if (this.getFilesizeInBytes(this.backlog) > 1)\n this.theTransporter(this.backlog, this.bbToArr(this.backlog));\n });\n }", "async read(buffer, offset, length) {\n if (length === 0) {\n return 0;\n }\n if (this.peekQueue.length === 0 && this.endOfStream) {\n throw new EndOfFileStream_1.EndOfStreamError();\n }\n let remaining = length;\n let bytesRead = 0;\n // consume peeked data first\n while (this.peekQueue.length > 0 && remaining > 0) {\n const peekData = this.peekQueue.pop(); // Front of queue\n if (!peekData)\n throw new Error('peekData should be defined');\n const lenCopy = Math.min(peekData.length, remaining);\n buffer.set(peekData.subarray(0, lenCopy), offset + bytesRead);\n bytesRead += lenCopy;\n remaining -= lenCopy;\n if (lenCopy < peekData.length) {\n // remainder back to queue\n this.peekQueue.push(peekData.subarray(lenCopy));\n }\n }\n // continue reading from stream if required\n while (remaining > 0 && !this.endOfStream) {\n const reqLen = Math.min(remaining, maxStreamReadSize);\n const chunkLen = await this.readFromStream(buffer, offset + bytesRead, reqLen);\n bytesRead += chunkLen;\n if (chunkLen < reqLen)\n break;\n remaining -= chunkLen;\n }\n return bytesRead;\n }", "function consume() {\n\tvar req, postObject = queue.last;\n\n\t// Don't do anything if there's nothing in the queue\n\tif (!postObject) {\n\t\treturn;\n\t}\n\n\t// Mark the request\n\tpostObject.openCalaisTries = 1;\n\tqueue.remove(postObject);\n\tsent.append(postObject);\n\n\treq = http.request({\n\t\t\thost: 'api.opencalais.com',\n\t\t\tpath: '/tag/rs/enrich',\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'x-calais-licenseID': apiKey,\n\t\t\t\t'content-type': 'text/raw',\n\t\t\t\t'accept': 'application/json',\n\t\t\t\t'enableMetadataType': 'GenericRelations,SocialTags',\n\t\t\t\t'content-length': postObject.message.length\n\t\t\t}\n\n\t\t},\n\t\tfunction(res) {\n\t\t\tvar data = '';\n\n\t\t\tres.setEncoding('utf8');\n\n\t\t\tres.on('data', function(chunk) {\n\t\t\t\tdata += chunk;\n\t\t\t});\n\n\t\t\tres.on('end', function() {\n\t\t\t\tsent.remove(postObject);\n\n\t\t\t\tprocess(postObject, data);\n\t\t\t\tconsume();\n\t\t\t});\n\t\t});\n\n\treq.on('error', function(e) {\n\t\tconsole.error('OpenCalais module: problem with request', e, postObject);\n\n\t\tsent.remove(postObject);\n\n\t\t// Put the request back in the queue and try again if it failed less than three times\n\t\tif (postObject.openCalaisTries < 3) {\n\t\t\tqueue.append(postObject);\n\t\t\tpostObject.openCalaisTries++;\n\t\t}\n\n\t\tconsume();\n\t});\n\n\treq.write(postObject.message, 'utf8');\n\treq.end();\n}", "function buffer_(self, capacity) {\n return new _definitions.Stream(M.map_(M.bind_(M.bind_(M.do, \"done\", () => T.toManaged(Ref.makeRef(false))), \"queue\", () => (0, _toQueue.toQueue_)(self, capacity)), ({\n done,\n queue\n }) => {\n return T.chain_(done.get, _ => {\n if (_) {\n return Pull.end;\n } else {\n return T.catchSome_(T.chain_(Q.take(queue), _ => Take.done(_)), _ => {\n if (O.isNone(_)) {\n return O.some(T.zipRight_(done.set(true), Pull.end));\n }\n\n return O.none;\n });\n }\n });\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 handler(buffer) {\n let chunks = buffer.toString().split(\"\\n\");\n\n for (let chunk of chunks) {\n chunk = chunk.replace(/(\\r\\n|\\n|\\r)/gm, \"\").trim();\n\n if (chunk == \"OK\") {\n // if end of message stop listner and return result\n this.removeListener(\"data\", handler);\n resolve(answer);\n\n // if line is busy or another but not error\n } else if (chunk == \"BUSY\" || chunk == \"NO DIAL TONE\" || chunk == \"NO CARRIER\") {\n resolve();\n\n } else if (chunk == \"ERROR\") {\n this.removeListener(\"data\", handler);\n reject(`ERROR result on command - ${command}. Answer - ${chunk}`);\n\n } else {\n // if message is not fully get add to result this chunk\n answer += chunk;\n };\n };\n }", "consume() {}", "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 bufferMessage() {\n var nextMessage = messages.shift();\n\n if (!conf.buffer) { return nextMessage; }\n\n nextMessage.buffer = [nextMessage.description];\n\n // continue shifting elements off the queue while they are the same event and timestamp so they can be buffered together into a single request\n while (messages.length\n && (messages[0].timestamp >= nextMessage.timestamp && messages[0].timestamp < (nextMessage.timestamp + conf.buffer_seconds))\n && messages[0].event === nextMessage.event) {\n\n // append description to our buffer and shift the message off the queue and discard it\n nextMessage.buffer.push(messages[0].description);\n messages.shift();\n\n }\n\n // join the buffer with newlines\n nextMessage.description = nextMessage.buffer.join(\"\\n\");\n\n // delete the buffer from memory\n delete nextMessage.buffer;\n\n return nextMessage;\n}", "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", "_read(size) { // how much to read (not used often)\n if (this.index == this.source.length) return this.push(null)\n\n this.push((this.source[this.index++]).toString() + '\\n') // we can only push strings and buffers (not numbers)\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 }", "async consume() {\n if (this.state.consuming) return;\n if (!this.queue.meta.length) return;\n\n this.state.consuming = true;\n console.log('Consuming queue...', 'Orders in queue: ' + this.queue.meta.length);\n\n const filledTransactions = await this.queue.digest();\n\n //repopulate queue with closing (unconfirmed) transactions\n for (let orderId in filledTransactions) {\n const txn = filledTransactions[orderId];\n const price = Number(txn.price);\n if (txn.side === 'BUY') {\n const profit = price + (price * this.config.profitPercentage) + (price * .001);\n this.sell(Number(txn.executedQty), profit);\n }\n if (txn.side === 'SELL') {\n const profit = price - (price * this.config.profitPercentage) - (price * .001);\n this.purchase(Number(txn.executedQty), profit);\n }\n }\n\n console.log('Consumed queue.', 'Orders in queue: ' + this.queue.meta.length);\n this.state.consuming = false;\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 }", "_read(size) {\n /*\n console.log(`read called with size ${size}`);\n for (let i = 0; i < this.streams.length; i++) {\n const currentStream = this.streams[i];\n let chunk = currentStream.read();\n if (Buffer.isBuffer(chunk)) {\n chunk = chunk.toString();\n console.log(`chunk for stream ${i}: ${chunk}`);\n }\n }\n */\n /*\n //this[kSource].fetchSomeData(size, (data, encoding) => {\n this.push(Buffer.from(data, encoding));\n console.log(`reading buffer: ${Buffer.from(data, encoding)}`);\n });\n */\n }", "function consume() {\n var message = messages.pop();\n return message.body();\n }", "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 }", "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 $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" ]
[ "0.5705241", "0.55820364", "0.5539325", "0.5539325", "0.5539325", "0.5539325", "0.5488231", "0.5447962", "0.54330546", "0.54330546", "0.54330546", "0.54330546", "0.54330546", "0.5399743", "0.5363185", "0.5350229", "0.53465194", "0.53340256", "0.52627414", "0.5249275", "0.5230986", "0.52027476", "0.52011687", "0.5185363", "0.5163091", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5146046", "0.5144759", "0.5127398", "0.51032263", "0.5077258", "0.50766104", "0.505927", "0.5056053", "0.5056053", "0.50462174", "0.5036611", "0.5023644", "0.50234395", "0.5021006", "0.5010881", "0.49965104" ]
0.0
-1
This function will list all the sub categories under selected category
createListItems() { //This is used to give active class to the selected category jQuery('.active_cat').removeClass('active_cat'); jQuery("#category_" + this.props.category.cat_id).addClass("active_cat"); //Store the selected meal under sub category(sub menu) to get access in order page if (this.props.meal) sessionStorage.setItem("selected_meal", JSON.stringify(this.props.meal)); //creates the sub category(sub menu) cards layout, selectMeal is the action triggered when meal card is clicked return this.props.category.sub_cat.map((meal, index) => { return ( <div key={index} className="col-md-4 col-lg-3 col-sm-6 col-xs-12 cards" onClick={() => this.props.selectMeal(meal)}> <img src={meal.subcat_thumbnail} alt="meal pic" /> <div style={{ padding: '5px' }}> <label>{meal.subcat_name}</label> <p>{meal.subcat_desc}</p> <label style={{ right: '0', position: 'absolute', bottom: '0', marginRight: '20px', color: 'red' }}>{meal.subcat_price}</label> </div> </div> ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 categoriesselect(data){\n\tvar pageURL = window.location.href;\n\tvar user_id = pageURL.substr(pageURL.lastIndexOf('/') + 1);\n\tvar home_url = $('#home_url').val();\n\tvar category_id = $(data).attr('id');\n\tvar category_type = $(data).attr('data-cat');\n var result='';\n var sub_cat_name = '';\n var sub_cat_id = '';\n\tif(category_type == 'sub'){\n\t\tvar parent_id = $(data).parents('li').find('.categories').attr('id');\n\t\tvar category_name = $(data).html();\n\t\tvar parent_cat_name = $(data).parents('li').find('.categories').html();\n\t\tif(checkIfCategoryExists_reg(parent_id)){\n\t\t\tvar exists = false;\n\t\t\t$('.added_category ul li .categories').each(function() {\n\t\t\t\tvar search_id = $(this).attr('id');\n\t\t\t\tif(search_id == parent_id){\t\t\t\t\t\n\t\t\t\t\t$(this).siblings('.subcategories').find('li').each(function(){\n\t\t\t\t\t\tsub_cat_id = $(this).find('a').attr('id');\n\t\t\t\t\t\tif(sub_cat_id == category_id){\n\t\t\t\t\t\t\texists = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif(exists == false){\t\t\t\t\t\t\n\t\t\t\t\t\tajaxRequest_reg(user_id,parent_id,category_id); //Ajax request\n\t\t\t\t\t\t$(this).siblings('.subcategories').append('<li><a href=\"javascript:;\" id=\"'+category_id+'\" data-cat=\"sub\">'+category_name+'</a><span class=\"cross_category_reg\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span></li>');\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(exists == false){\n\t\t\t\t//$(data).siblings('.checked_category').show();\n\t\t\t\t$(data).siblings('.checked_category').attr('style','display:block');\n\t\t\t}\n\t\t}else{\t\n\t\t\tif(checkNoOfCategories_reg() <= 10){\n\t\t\t\tajaxRequest_reg(user_id,parent_id,category_id); //Ajax request\t\t\n\t\t\t\t$('.added_category_list_heading .added_category ul.added_category_ul').append('<li><a href=\"javascript:;\" id=\"'+parent_id+'\" data-cat=\"parent\" class=\"categories\">'+parent_cat_name+'</a><span class=\"cross_category_reg\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span><ul class=\"subcategories\"><li><a href=\"javascript:;\" id=\"'+category_id+'\" data-cat=\"sub\">'+category_name+'</a><span class=\"cross_category_reg\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span></li></ul></li>');\n\t\t\t\t$(data).siblings('.checked_category').attr('style','display:block');\n\t\t\t}else{\n\t\t\t\t$('.forerror').addClass('disp_none');\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\tif(checkIfCategoryExists_reg(category_id) == false){\n\t\t\tif(checkNoOfCategories_reg() <= 10){\n\t\t\t\tvar category_name = $(data).html();\n\t\t\t\tvar sub_cat = $(data).next('.subcategories').html();\n\t\t\t\tresult = '<li><a href=\"javascript:;\" id=\"'+category_id+'\" data-cat=\"parent\" class=\"categories\">'+category_name+'</a><span class=\"cross_category_reg\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span>';\n\t\t\t\tresult += '<ul class=\"subcategories\">';\n\t\t\t\tif($(data).next('.subcategories').find('li').length == 0){\n\t\t\t\t\tajaxRequest_reg(user_id,category_id,1); //Ajax request\n\t\t\t\t}\n\t\t\t\t$(data).next('.subcategories').find('li').each(function() {\n\t\t\t\t\tsub_cat_name = $(this).find('a').html();\n\t\t\t\t\tsub_cat_id = $(this).find('a').attr('id');\n\t\t\t\t\t$(this).find('.checked_category').show();\n\n\t\t\t\t\tajaxRequest_reg(user_id,category_id,sub_cat_id); //Ajax request\n\n\t\t\t\t\tresult += '<li><a href=\"javascript:;\" id=\"'+sub_cat_id+'\" data-cat=\"sub\">'+sub_cat_name+'</a><span class=\"cross_category_reg\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span></li>';\t\t\t\n\t\t\t\t});\n\t\t\t\tresult += '</li>';\n\t\t\t\t$('.added_category_list_heading .added_category ul.added_category_ul').append(result);\n\t\t\t}else{\n\t\t\t\t$('.forerror').removeClass('disp_none');\n\t\t\t}\n\t\t}\n\t}\n\t$('.added_category_list').removeClass('error');\n\t$('.fill_fields').addClass('disp_none');\n\t$('.add_cat_list').removeClass('error');\n\t$('.forerror').addClass('addcategory');\n\tif($('.added_category_list_heading .added_category ul.added_category_ul').html() != ''){\n\t\t$('#no_categories').hide();\n\t}\n\n\t//if main category select the all main and sub cat selected\n}", "function getCategoryInfo() {\n\t\tAdminService.categories().get({ categoryId: vm.categoryId }, function (response) {\n\t\t\tif (response.data.length > 0) {\n\t\t\t\tvm.category = response.data[0];\n\t\t\t\tif(vm.category.type == 'article') {\n\t\t\t\t\tvm.category.listType = \"all\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (response.data[0].parentId !== '0') {\n\t\t\t\t\tvar parentId = response.data[0].parentId\n\t\t\t\t\tvm.models.push(parentId); // Model value for selected sub categories\t\t\t\t\t\n\t\t\t\t\t/* Get parent Info */\n\t\t\t\t\tAdminService.categories().get({ categoryId: parentId }, function (parentInfo) {\n\t\t\t\t\t\tif (parentInfo.data[0].parentId === 0) {\n\t\t\t\t\t\t\tvm.parentId = parentId;\n\t\t\t\t\t\t\tvm.hideMainCategory = false;\n\t\t\t\t\t\t\tgetMainCategories(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvm.hideMainCategory = true\n\t\t\t\t\t\t\tAdminService.subCategories().get({ parentCatId: parentInfo.data[0].parentId }, function (subCatResOnj) {\n\t\t\t\t\t\t\t\tif (subCatResOnj.code == 200 && subCatResOnj.data.list.length > 0) {\n\t\t\t\t\t\t\t\t\tvm.subCategoryList.push({ label: 'Sub Category', list: subCatResOnj.data.list, model: \"subCat\" + 1 })\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tvm.noDataText = false;\n\t\t\t} else {\n\t\t\t\tvm.noDataText = response.message;\n\t\t\t}\n\t\t});\n\t}", "function categories_select(data){\n\tvar pageURL = window.location.href;\n\tvar user_id = pageURL.substr(pageURL.lastIndexOf('/') + 1);\n\tvar home_url = $('#home_url').val();\n\tvar category_id = $(data).attr('id');\n\tvar category_type = $(data).attr('data-cat');\n var result='';\n var sub_cat_name = '';\n var sub_cat_id = '';\n\tif(category_type == 'sub'){\n\t\tvar parent_id = $(data).parents('.subcategories').parent().find('.categories').attr('id');\n\t\tvar category_name = $(data).html();\n\t\tvar parent_cat_name = $(data).parents('.subcategories').parent().find('.categories').html();\n\t\t\n\t\tif(checkIfCategoryExists(parent_id)){\n\t\t\tvar exists = false;\n\t\t\t$('.added_category ul li .categories').each(function() {\n\t\t\t\tvar search_id = $(this).attr('id');\n\t\t\t\tif(search_id == parent_id){\t\t\t\t\t\n\t\t\t\t\t$(this).siblings('.subcategories').find('li').each(function(){\n\t\t\t\t\t\tsub_cat_id = $(this).find('a').attr('id');\n\t\t\t\t\t\tif(sub_cat_id == category_id){\n\t\t\t\t\t\t\texists = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif(exists == false){\t\t\t\t\t\n\t\t\t\t\t\tajaxRequest(user_id,parent_id,category_id); //Ajax request\n\t\t\t\t\t\t$(this).siblings('.subcategories').append('<li><a href=\"javascript:;\" id=\"'+category_id+'\" data-cat=\"sub\">'+category_name+'</a><span class=\"cross_category\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span></li>');\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(exists == false){\n\t\t\t\t//$(data).siblings('.checked_category').show();\n\t\t\t\t$(data).siblings('.checked_category').attr('style','display:block');\n\t\t\t}\n\t\t}else{\t\n\t\t\tif(checkNoOfCategories() <= 10){\n\t\t\t\tajaxRequest(user_id,parent_id,category_id); //Ajax request\t\t\n\t\t\t\t$('.added_category_list_heading .added_category ul.added_category_ul').append('<li><a href=\"javascript:;\" id=\"'+parent_id+'\" data-cat=\"parent\" class=\"categories\">'+parent_cat_name+'</a><span class=\"cross_category\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span><ul class=\"subcategories\"><li><a href=\"javascript:;\" id=\"'+category_id+'\" data-cat=\"sub\">'+category_name+'</a><span class=\"cross_category\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span></li></ul></li>');\n\t\t\t\t$(data).siblings('.checked_category').attr('style','display:block');\n\t\t\t}else{\n\t\t\t\t$('.forerror').addClass('disp_none');\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\tif(checkIfCategoryExists(category_id) == false){\n\t\t\tif(checkNoOfCategories() <= 10){\n\t\t\t\tvar category_name = $(data).html();\n\t\t\t\tvar sub_cat = $(data).next('.subcategories').html();\n\t\t\t\tresult = '<li><a href=\"javascript:;\" id=\"'+category_id+'\" data-cat=\"parent\" class=\"categories\">'+category_name+'</a><span class=\"cross_category\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span>';\n\t\t\t\tresult += '<ul class=\"subcategories\">';\n\t\t\t\tif($(data).next('.subcategories').find('li').length == 0){\n\t\t\t\t\tajaxRequest(user_id,category_id,1); //Ajax request\n\t\t\t\t}\n\t\t\t\t$(data).next('.subcategories').find('li').each(function() {\n\t\t\t\t\tsub_cat_name = $(this).find('a').html();\n\t\t\t\t\tsub_cat_id = $(this).find('a').attr('id');\n\t\t\t\t\t$(this).find('.checked_category').show();\n\n\t\t\t\t\tajaxRequest(user_id,category_id,sub_cat_id); //Ajax request\n\n\t\t\t\t\tresult += '<li><a href=\"javascript:;\" id=\"'+sub_cat_id+'\" data-cat=\"sub\">'+sub_cat_name+'</a><span class=\"cross_category\"><img src=\"'+home_url+'img/category_cancel.png\" class=\"img-fluid\"></span></li>';\t\t\t\n\t\t\t\t});\n\t\t\t\tresult += '</li>';\n\t\t\t\t$('.added_category_list_heading .added_category ul.added_category_ul').append(result);\n\t\t\t}else{\n\t\t\t\t$('.forerror').removeClass('disp_none');\n\t\t\t}\n\t\t}\n\t}\n\n\t$('.added_category_list').removeClass('error');\n\t$('.fill_fields').addClass('disp_none');\n\n\tif($('.added_category_list_heading .added_category ul.added_category_ul').html() != ''){\n\t\t$('#no_categories').hide();\n\t}\n\n\t//if main category select the all main and sub cat selected\n}", "function loadSubCategory() {\n $.ajax({\n url: 'all-sub-category',\n type: 'GET',\n success: function(data) {\n $('#category_table').html(data);\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 }", "async getSubcategories(_, __, context) {\n // 1. check auth\n const user = isAdmin(context);\n try {\n const subcategories = await Subcategory.find().sort({ createdAt: -1 });\n\n newArr = [];\n\n for (let obj of subcategories) {\n newArr.push({ subcategory: obj });\n }\n return newArr;\n } catch (err) {\n throw new Error(err);\n }\n }", "retriveSubCategory(context, cat) {\n\t\t\taxios.get(\"/show/product/subcategory/\" + cat\n\t\t\t).then((res) => {\n\t\t\t\tcontext.commit('PRODUCT_SUB_CATEGORY', res.data.data);\n\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t}", "findAllSubcategoriesByCategoryId(id) {\n return this\n .findOne({_id: id, enabled: true})\n .populate({\n path: 'subcategories',\n match: {enabled: true},\n select: 'url title'\n })\n .select('subcategories')\n .exec();\n }", "function loadSubCategory(sub_categories){\n\t\t\n\t\t$.each(sub_categories, function(index,sub_category) {\n\t\t $(\"#itemSubCategory\").append(\n\t\t $(\"<option class='dynamic-sub-option'></option>\").val(sub_category.subcategory_id).html(sub_category.name)\n\t\t );\n\t\t});\n\t}", "getAllCategoriesAndSubcats() {\n return this\n .find({enabled: true})\n .populate({\n path: 'subcategories',\n select: 'title url',\n match: {enabled: true}\n })\n .select('title url subcategories')\n .exec();\n }", "function buildCategoryMenu()\n {\n var checkbox_html_start = \"<div class='checkbox category-list'><label><input type='checkbox' class='category-check category' \";\n var checkbox_html_end = \"</label></div>\";\n $.each( categories, function(key,value){\n if(findSubCategory(categories[key]).length > 0)\n {\n var html_content = checkbox_html_start+ \"data-category='\" +value+ \"' />\"+value +\"</label><span class='category-plus'>&nbsp;[+]</span></div>\";\n }\n else\n {\n var html_content = checkbox_html_start+ \"data-category='\" +value+ \"' />\"+value +\"</label></div>\";\n }\n $('#categories-menu').append(html_content);\n if(findSubCategory(categories[key]).length > 0){\n $.each( findSubCategory(categories[key]), function(sub_key, sub_value){\n var html_content = checkbox_html_start+ \"data-category='\" +value+ \"' data-sub-category='\"+sub_value+\"'/>\"+sub_value +checkbox_html_end;\n $('#categories-menu').append(html_content);\n $('#categories-menu div:nth-last-child(1)').last().addClass(\"sub-category event \").css('display','none');\n });\n }\n });\n //$('.category-list').fadeIn(2000);\n }", "function displayCategories(categories) {\r\n let htmlString = '';\r\n\r\n //Creates an 'All' category option\r\n htmlString = htmlString + `<li class=\"category-all\">All</li>`;\r\n $.each(categories, function (i, category) {\r\n htmlString = htmlString + getCategoryItemHTML(category);\r\n });\r\n categoryListEl.html(htmlString);\r\n categoryAll = $(\".category-all\");\r\n categoryAll.on('click', function () {\r\n displayAccom(filteredAccommodation);\r\n });\r\n\r\n //Filter accommodation by category\r\n let categoryItems = $(\".category-item\");\r\n categoryItems.on('click', function () {\r\n let categoryid = $(this).data('categoryid');\r\n let filteredAccomByCategory = filterByCategory(filteredAccommodation, categoryid);\r\n displayAccom(filteredAccomByCategory);\r\n });\r\n}", "displayCategories(){\n const categoriesList = cocktail.getCategories()\n .then(categories => {\n const catList = categories.categories.drinks;\n \n // append the first option without value\n const firstOption = document.createElement('option');\n firstOption.textContent = '-- Select --';\n firstOption.value = '';\n document.querySelector('#search').appendChild(firstOption);\n\n // append the other options\n catList.forEach(category => {\n const option = document.createElement('option');\n option.textContent = category.strCategory;\n option.value = category.strCategory.split(' ').join('_');\n document.querySelector('#search').appendChild(option);\n \n });\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 }", "static getTreeList(category) {\n let children = [];\n children.push(category);\n category.children.forEach(child => {\n children = children.concat(Category.getTreeList(child));\n });\n return children;\n }", "function _dex_getCategories(){ // Step 1 of 2 – Gets top-level categories\n var t=new Date().getTime(),out={},ar=LibraryjsUtil.getHtmlData(\"http://www.dexknows.com/browse-directory\",/\\\"http:\\/\\/www\\.dexknows\\.com\\/local\\/(\\w+\\/\\\">.+)<\\/a>/gm)//return ar;\n ,i=ar.length;while(i--){ar[i]=ar[i].split('/\">');ar[i][1]=ar[i][1].replace(/&amp;/g,\"&\");out[ar[i][0]]={\"displayName\":ar[i][1]}}\n LibraryjsUtil.write2fb(\"torrid-heat-2303\",\"dex/categories/\",\"put\",out)}//function test(){/*print2doc*/Logger.log(_dex_getCategories())}", "function getSubCat (child_class, id) {\n $.post(\"/ad/sub-cat\", { id: id} ).done(function( data ) {\n\t\t\t\n data = $.parseJSON(data);\n\t\t\t/*\n\t\t\tfunction sortResults(prop, asc) {\n\t\t\t\tdata = data.sort(function(a, b) {\n\t\t\t\t\tif (asc) {\n\t\t\t\t\t\treturn (a[prop] > b[prop]) ? 1 : ((a[prop] < b[prop]) ? -1 : 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn (b[prop] > a[prop]) ? 1 : ((b[prop] < a[prop]) ? -1 : 0);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tshowResults();\n\t\t\t}\n\t\t\t/*\n\t\t\tdata = data.sort(function (a, b) {\n\t\t\t\treturn a.value.localeCompare( b.value );\n\t\t\t});\n\t\t\t*/\n $('.'+child_class).empty();\n $('.'+child_class).append('<option></option>');\n\t\t\n\t\t\tvar i = 0;\n $.each(data, function( index, value){\n\t\t\t\tif (index == '904' || index == '908' || index == 904 || index == 908 || value.name== 'All' || value.name=='all'){\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$('.'+child_class).append('<option value=\"'+value.id+'\">'+getTrans(value.name)+'</option>');\n\t\t\t\t\ti = 1;\n\t\t\t\t}\n });\n\t\t\t\n\t\t\t\n\n\t\t\tif (i == 1)\n\t\t\t\t$('.'+child_class).show('slow');\n\t\t\telse\n\t\t\t\t$('.'+child_class).hide('slow');\n\n });\n }", "function hideAllChildren() {\n\t\t$(\".category-menu li ul\").hide();\n\t}", "function getSubcategories_(subCatId, fromSearch){\r\n\tvar results = '';\r\n\r\n\r\n\t//if from search , request comes\r\n\r\n\tvar query = window.location.search.substring(1);\r\n\tif(query && fromSearch){\r\n\t var vars = query.split('&');\r\n\t var vars1 = vars[0];\r\n\t var vars2 = vars[1];\r\n\t var vars3 = vars[2];\r\n\r\n\t var inputsCat = vars1.split('=');\r\n\t var catId = inputsCat[1];\r\n\r\n\t var inputsSubCat = vars2.split('=');\r\n\t var subCatId = inputsSubCat[1];\r\n\r\n\t var inputsDocId = vars3.split('=');\r\n\r\n\t var docId = inputsDocId[1];\r\n\t var targetURL = \"faqsForSubCategory?subCategoryID=\"+subCatId+\"&catId=\"+catId+\"&subcatId=\"+subCatId+\"&docId=\"+docId;\r\n\t}\r\n\telse{\r\n\t\tvar targetURL = \"faqsForSubCategory?subCategoryID=\"+subCatId;\r\n\t}\r\n\tvar targetURL = \"faqsForSubCategory?subCategoryID=\"+subCatId+\"&docId=\"+docId;\r\n\tdocument.getElementById(\"top_faqs_div_\").innerHTML = '<img class=\"loaderimg\" src=\"images/firstchoice/loading-3-anim-transparent.gif\" />';\r\n\r\n\tdocument.getElementById(\"faq_explain_\").innerHTML = \"<div id='docHeading'></div>\";\r\n\tvar subcat= \"subcat_\"+subCatId;\r\n\r\n\r\n\ttabsSelection(\"sub_before_you_go_\", \"subcat-tab-selected\", subcat, \"DIV\");\r\n//\r\n\tvar xmlhttp;\r\n\tif (window.XMLHttpRequest) {// code for IE7+, Firefox,\r\n\t// Chrome, Opera, Safari\r\n\t\txmlhttp = new XMLHttpRequest();\r\n\t}\r\n\telse {// code for IE6, IE5\r\n\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n\txmlhttp.onreadystatechange = function() {\r\n\t\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n\t\t\t\tresults = xmlhttp.responseText;\r\n\t\t\t\tvar subString1=results.split('test1');\r\n\r\n\t\t\t\tvar subresult = subString1[1];\r\n\r\n\t\t\t\tvar subString=subresult.split('test2');\r\n\r\n\t\t\t\tvar ObjStr = subString[0];\r\n\t\t\t\tvar divId = \"top_faqs_div_\";\r\n\t\t\t\tif(ObjStr != '[]' || ObjStr != ''){\r\n\r\n\t\t\t\tdocument.getElementById(divId).innerHTML = ObjStr;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tdocument.getElementById(divId).innerHTML = \"No documents available\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t }\r\n var url = targetURL;\r\n xmlhttp.open(\"GET\",url,true);\r\n xmlhttp.send();\r\n if(ObjStr != '[]' || ObjStr != ''){\r\n\t return true;\r\n }\r\n return false;\r\n}", "_GetSubCtegoriesLEVEL1 () {\n GetAllCtegoriesByParent (this.props.category.id,1).then(Data => {\n this.setState({\n subcategories1: Data,\n })\n })\n }", "function show_all() {\n\tcategories.forEach(category => show(category));\n}", "function ListCategories () \n{\n\tMakeXMLHTTPCallListCategories(\"GET\", \"http://uvm061.dei.isep.ipp.pt/ARQSI/Widget/WidgetAPI/EditorAPI.php?type=GetAllCategories\");\n}", "function getcategories()\n{\n\t\n\t$.ajax({\n\t\turl:'./getcategories',\n\t\ttype:'get',\n\t\t\n\t\tsuccess:function(data)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\tvar categoriesdata=data.categories;\n\t\t\t//this load data update data directly when is success update\n\t\t\t\t\n\t\t\tvar getcategory='<option disabled selected required>choose news category';\n\t\tfor(var i=0;i<categoriesdata.length;i++)\n\t\t\t{\n\t\t\t\tgetcategory+=` \n \n \n\n \n \t<option id=\"catval\">${categoriesdata[i].category}</option>\n \t\n \n `;\n\t\t\t}\n\t\tgetcategory+='</option>';\n\t\t\t$('#category').html(getcategory);\n\t\t\t\n\t\t}\n\t});\n}", "function displayCategories(categories) {\n\n // empty variable which will contain html string for categories\n let categoriesListingHtml = '';\n\n // variable to create diff id for categories in loop\n let num = 1;\n\n categories['categories'].forEach(category => {\n\n let categoryName = category['category'];\n\n // if not trash categories, concat as string in variable\n if(!trashCategories.includes(categoryName)) {\n categoriesListingHtml += `<li><a id=\"category${num}\" href=\"#\">${categoryName}</a></li>`;\n num++;\n }\n \n });\n\n // add html string to document to display on screen \n document.querySelector('.categories').innerHTML = categoriesListingHtml;\n\n // reset variable so that we can use same category id to add click event listner\n num = 1;\n\n categories['categories'].forEach(category => {\n\n categoryName = category['category'];\n\n if(!trashCategories.includes(categoryName)) {\n\n // add event listener for category, this will be used to get products in that category\n document.getElementById(`category${num}`).addEventListener(\"click\", getProductsInCategory);\n num++;\n }\n \n });\n\n // get products for first category in list\n document.getElementById('category1').click();\n }", "filterByCategory(category) {\n\t\tconsole.log(this.selectedCategories);\n\t}", "function buildCategoriesHTML(selectedCategory){\n\tvar allCategories = Object.keys(MULTIVERSEOBJECT);\n\tvar categoryHTML = '';\n\tfor (var i = 0; i < allCategories.length; i++) {\n\t\tif (allCategories[i] == selectedCategory) {\n\t\t\tcategoryHTML += '<div class=\"categoryselected\" id=\"' + allCategories[i] +'\" onclick =\"categoryOnClick()\"> '+ allCategories[i] +' </div>';\n\t\t} \n\t\telse {\n\t\t\tcategoryHTML += '<div class=\"categoryunselected\" id=\"' + allCategories[i] +'\" onclick =\"categoryOnClick()\"> '+ allCategories[i] +' </div>';\n\t\t}\n\t}\n\tdocument.querySelector('.categories').innerHTML = categoryHTML;\n\n\t//Logic for Category single selection\n\tvar categoryDivs = document.querySelectorAll('.categories div');\n\tfor (var i = 0; i < categoryDivs.length; i++) {\n\t\tcategoryDivs[i].onclick = function(){\n\t\t\tbuildCategoriesHTML(this.id);\n\t\t}\n\t}\n\tALLSEARCHENGINESINCATEGORY = MULTIVERSEOBJECT[selectedCategory];\n\tSELECTEDCATEGORY = selectedCategory;\n\tSELECTEDSEARCHENGINES = [ALLSEARCHENGINESINCATEGORY.names[0]]; // Again defaultng on the first tab;\n\tbuildTabsHTML(selectedCategory, SELECTEDSEARCHENGINES);\t\n}", "get subCategory () {\n\t\treturn this._subCategory;\n\t}", "function getCategories() {\n \n // API call to get categories\n fetch(\"https://my-store2.p.rapidapi.com/catalog/categories\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ef872c9123msh3fdcc085935d35dp17730cjsncc96703109e1\",\n \"x-rapidapi-host\": \"my-store2.p.rapidapi.com\"\n }\n })\n .then(response => {\n return response.json();\n })\n .then(response => {\n\n // call display catgories to display it on screen\n displayCategories(response);\n })\n .catch(err => {\n console.error(err);\n });\n }", "function selectAllCategories() {\n return db(\"categories\").select(\"*\").orderBy(\"id\");\n }", "function getCategories() {\n\trimer.category.find(function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function fetchSubCategories(id,wc,active){\n\twc = wc || 'nothing';\n\t$.post(\"../ajaxfiles/fasc.php\",{wc:wc,active:active},function(data){\n\t\t$(\"#\"+id).html(data);\n\t\t//alert(data);\t\n\t});\n}", "getAllCategories() {\n return this.http.get(this.allCategoryUrl);\n }", "function getAllCategories(callBack) {\r\n selectAll(function (results) {\r\n var len = results.length;\r\n var i;\r\n\r\n //loop continues for every value in db table\r\n for (i = 0; i < len; i++) {\r\n listOfCategories[i] = results[i];\r\n }\r\n setDatabaseName('dbCat', ['users', 'items', 'categories', 'subcategories ', 'events', 'watchlist']);\r\n setCurrObjectStoreName('subcategories');\r\n // need to get all the subcats and items before building the html\r\n startDB(function () {\r\n getAllSubcategories(callBack);\r\n }); // async func\r\n });\r\n}", "setSub() {\n\t\tconsole.log('called constructor setSub');\n\t\tlet sub_category_selected_display = [],\n\t\t\tcategory_selected = this.state.category_selected;\n\t\tif ((this.state.category_selected && this.state.category_selected.length) || (this.state.sub_category_selected && this.state.sub_category_selected.length)) {\n\t\t\tif (this.state.category_selected && this.state.category_selected.length) {\n\t\t\t\tthis.state.category_selected.map((id) => {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\tif (id == op.id) {\n\t\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\t\tthis.state.sub_category_selected.map((sub_id) => {\n\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_id) === -1) {\n\t\t\t\t\t\t\tsub_category_selected_display.push(sub_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\tthis.state.sub_category_selected.map((data) => {\n\t\t\t\t\tif (sub_category_selected_display.indexOf(data) === -1) {\n\t\t\t\t\t\tsub_category_selected_display.push(data);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.props.location.search == '?cat=[]&subcat=[]&layer=[]') {\n\n\t\t\t} else {\n\t\t\t\t/*if (this.state.category_list && this.state.category_list.length) {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// this.setCategory(true, op.id);\n\t\t\t\t\t\tif (category_selected.indexOf(op.id) === -1) {\n\t\t\t\t\t\t\tcategory_selected.push(op.id);\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\tthis.setState({\n\t\t\tsub_category_selected_display: sub_category_selected_display,\n\t\t\tcategory_selected: category_selected\n\t\t});\n\t}", "getCategories(req, res) {\n return db.Category.findAll({\n include: [{\n model: db.Category,\n as: 'ParentCategory',\n }],\n })\n .then(foundCategories => res.status(200).json(foundCategories))\n .catch(err => errorHandler(req, res, err));\n }", "async getCatToSub(_, { categoryId }) {\n try {\n const subcategories = await Subcategory.find({ category: categoryId });\n return subcategories;\n } catch (error) {\n throw new Error(error);\n }\n }", "async categories() {\n return await this.fetch(\"/categories/list\");\n }", "function fetchCategoriesForSelect() {\n fetchOperations.fetchCategories().then(forEachCategory);\n }", "function GetSubItemsByCategoryId(id) {\n return $resource(_URLS.BASE_API + 'get_sub_items_by_category_id/' + id + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function getCategorySelect() {\n\tajax('GET', 'categories', null, createCategorySelect);\n}", "populateCategories() {\n\t\tthis.m_catMenu.innerHTML = \"\";\n\t\tCONFIG.CATEGORIES.forEach(function(item) {\n\t\t\tGUI.m_catMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t}", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "findCategoryBySubcategoryId(id, cb) {\n this\n .findOne({subcategories: id})\n .select('title url')\n .exec(cb);\n }", "static async getAllCategoriesAndQuestions() {\n categories = [];\n let categoryIds = await Category.getCategoryIds();\n for ( let categoryId of categoryIds ) {\n let fullCategory = await Category.getCategory(categoryId);\n categories.push(fullCategory);\n }\n return categories;\n }", "function get_categories_view() {\r\n\tvar cats = this.get_categories().map(function(obj) {\r\n\t\tvar str = '<a href=\"' + obj.getURI() + '\">' + obj.title + '</a>';\r\n\t\treturn str.replace(/&(?!\\w+;)/g, '&amp;')\r\n\t}).join(', ');\r\n\r\n\treturn this.categories != null ? new XMLList(cats) : '';\r\n}", "function categories() {\n loadingWheel(true);\n getData(false);\n fetch(dataUrl)\n .then(response => response.json())\n .then(category => {\n let categoryList = category.trivia_categories;\n categoryList.forEach(category => {\n\n let categoryOption = document.createElement(\"option\");\n let categoryName = document.createElement(\"p\");\n let name = document.createTextNode(category.name);\n\n categoryName.appendChild(name);\n categoryOption.appendChild(categoryName);\n categoryOption.id = category.id;\n categoryOption.classList.add(\"category\");\n document.getElementById(\"categoryList\").appendChild(categoryOption);\n });\n loadingWheel(false);\n start.classList.remove(\"hide\");\n })\n .catch(() => console.error());\n}", "function category(result) {\n //Get categories\n const cate = result.map(item => item.category)\n // Remove duplicates or more\n const diferentCategory = (valor, indice, self) => {\n return self.indexOf(valor) === indice;\n }\n let categories = cate.filter(diferentCategory);\n\n //Short categories\n let sortCategories = categories.sort(function (a, b) {\n return a - b;\n });\n\n //Build categories\n for (let i = 0; i < sortCategories.length; i++) {\n $categoryList.innerHTML += `\n <li class=\"catButton\"><a class=\"panel--subitem-button\">${sortCategories[i]}</a></li>\n `\n }\n getCatFilter(result);\n}", "function getAllSubcategories(callBack) {\r\n selectAll(function (results) {\r\n var len = results.length;\r\n var i;\r\n //loop for each result\r\n for (i = 0; i < len; i++) {\r\n listOfSubcategories[i] = results[i];\r\n }\r\n\r\n console.log(\"getAllSubcategories.length:\" + listOfSubcategories.length);\r\n setDatabaseName('dbCat', ['users', 'items', 'categories', 'subcategories ', 'events', 'watchlist']);\r\n setCurrObjectStoreName('items');\r\n startDB(function () {\r\n getAllItems(callBack);\r\n }); // async func\r\n\r\n });\r\n}", "function printAllCategories(categories) {\n let stringbuilderCategories = '<h4>Kategorier</h4><ul class=\"list-group\">';\n categories.forEach(element => stringbuilderCategories += '<li class=\"list-group-item\" onclick=\"getAllQuestions('\n + element.id + ')\"><h5>' + element.categoryName + '</h5></li>');\n stringbuilderCategories += '</ul>'; \n $(\"#FAQCategories\").html(stringbuilderCategories);\n}", "function getCategories() {\n $.get(\"/api/categories\", renderCategoryList);\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 }", "function stateHandlerListCategories()\n{ \n if ( xmlHttpObj.readyState == 4 && xmlHttpObj.status == 200) \n {\n var categoriesList = new Array();\n\n \tvar docxml = xmlHttpObj.responseXML;\n \tvar nodelist = docxml.getElementsByTagName(\"categoria\");\n\n \tfor (var i = 0; i < nodelist.length; i++) {\n \t\tvar value = nodelist[i].textContent;\n\n \t\tif (!checkIfExists(categoriesList, value)) \n \t\t{\n \t\t\tcategoriesList.push(value);\n \t\t};\n \t};\n\n \tdocument.getElementById(\"scategories\").innerHTML += CreateSelectHTML(categoriesList);\n ListBooksByCategory();\n }\n}", "function getCategoriesToDisplay(cb){\n db.sequelize\n .query(\n //0 = denied, -1 = Pending Approval\n \"SELECT categoryName, id, parentId FROM Categories ORDER BY id ;\"\n , {type: db.sequelize.QueryTypes.SELECT}\n )\n .then(function(results){\n cb(results);\n });\n }", "function catscatscats(subcategories) {\n\n var form = $(\"<div id='selopt' class='form-group'><select id='dropdown'></select></div>\"),\n button = $(\"<button id='changeSub'>Submit Changes</button><br><br><h5>Current Subcategories:</h5><br>\"),\n Subcategory = Parse.Object.extend(\"Subcategory\"),\n query = new Parse.Query(Subcategory);\n\n //Put label to the DOM\n $(\"#here\").append($(\"<br><br><h4>Subcategories</h4><br><h5>Add More:</h5><br>\"));\n $(\"#here\").append($(form)).append(button);\n\n //Query subcategories chosen, and to be chosen\n\n //To find subcategories to choose from\n query.find().then(function (results) {\n var i, objectId, name, option;\n for (i = 0; i < results.length; i += 1) {\n //Create idividual options for input form\n objectId = results[i].id;\n name = results[i].get(\"name\");\n option = $(\"<option id='option\" + objectId + \"' value='\" + objectId + \"'>\" + name + \"</option>\");\n $(\"#dropdown\").append(option);\n }\n }).then(function (query) {\n //Add on change event that listens for the value of the selected option\n $(\"#changeSub\").on(\"click\", function () {\n var chosen = $(\"#dropdown\").val(),\n user = Parse.User.current();\n\n //Save chosen to subcategories (choices)\n user.addUnique(\"subcategories\", chosen);\n user.save(null, {\n success: function (user) {\n console.log(\"Success changing account information...\");\n //This is so that the new information is displayed as a\n //confirmation that it has happened\n window.location.reload();\n },\n error: function (user, error) {\n console.log(\"An error occured changing account information...\");\n }\n });//End of save\n });\n }, function () {\n console.log(\"ERROR occured in catscatscats()\");\n });//END OF SUBCAT QUERY\n //Calls the visual subcat appending function\n domdomdom();\n }//end of catscatscats", "function getAllChildData()\n {\n var ajax_url = \"/ajax/get_product_cat_child_data\";\n $.ajax({\n url: ajax_url, \n method :'GET',\n dataType: \"json\", \n success: function(result){\n if(result.length <= 0)\n return false;\n \n for(var key in result)\n {\n if (result.hasOwnProperty(key)) {\n all_cat_data[key] = result[key];\n }\n }\n /* apply carat class on category if has children */\n checkIfHasChild();\n }\n });\n return false;\n }", "function getCategories() {\n $.ajax({\n type: \"GET\",\n url: \"getCategories\",\n success: (data) => makeCategoriesHTML(data)\n })\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 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 getAllCategories() {\n $.get(\"FAQ/GetEveryCategories\", function (output) {\n allCategories = output; \n printAllCategories(output);\n });\n}", "function list(array_list)\n{\n $(\"#lista-subategorias\").html(\"\"); //reset child options\n $(array_list).each(function (i) { //populate child options \n $(\"#lista-subategorias\").append(\"<option value=\\\"\"+array_list[i].value+\"\\\">\"+array_list[i].display+\"</option>\");\n });\n}", "getCategories() {\n return this.categories;\n }", "function showAllCategories(){\n NEAR_FIELD_OBJECTS.scene.children.forEach(child => {\n child.visible = true\n })\n}", "function openSubCategory(node_id,role){\n\n // RESET ADVERTISMENT LIST , filter box, img and urgent and scroll bar\n resetParametr();\n\n condition = [];\n var object = {};\n object.key = 'category';\n object.value = node_id;\n condition.push(object);\n\n // CHANGE NODE LIST\n if (role === 'parent')\n {\n $.ajax({\n url:'/Api/Desktop/nodeList',\n method:'post',\n data:{id:node_id},\n dataType:'json',\n success:function (data) {\n\n if(data['category']!=='')\n {\n $('#category_descktop').html(data['category']);\n\n\n }\n else\n {\n $('#category_descktop').html('');\n }\n\n if (data['blog']!=='')\n {\n $('#blog_view').html(data['blog']);\n }\n else\n {\n $('#blog_view').html('');\n }\n }\n });\n }\n else\n {\n $('.selected').removeClass('border-danger selected');\n $(role).addClass('selected border-danger');\n }\n\n // CHANGE FILTER\n $.ajax({\n url:'/Api/Desktop/changeCategory',\n method:'post',\n data:{id:node_id},\n success:function (data) {\n if(data!=='')\n {\n $('#custom_id').html(data);\n }\n else\n {\n $('#custom_id').html('');\n }\n }\n });\n\n // LOAD DATA\n load_data();\n\n loadSubCategoryName(node_id);\n}", "function Categories(props) {\n const { getAll, categories } = props;\n\n useEffect(() => {\n getAll();\n }, [getAll]);\n\n const catsToRender = [];\n\n if (categories) {\n categories.forEach((category, i) => {\n catsToRender.push(\n <MenuItem\n className=\"menu-item\"\n value={category.name}\n key={i}\n onClick={() => {\n props.changeCategory(category);\n }}\n >\n {category.displayName || category.name}\n </MenuItem>\n );\n });\n }\n\n return (\n <div id=\"categories\" className=\"cont-child\">\n <h2>Browse our Categories</h2>\n <Select\n value={props.currentCategory ? props.currentCategory.name : ''}\n className=\"cat-select\"\n >\n {catsToRender}\n </Select>\n </div>\n );\n}", "function getCategories() {\r\n\t\t// body...\r\n\t\t$.ajax({\r\n url: URL+'categories/',\r\n type: 'GET',\r\n dataType: 'json',\r\n headers: {\r\n 'auth': '12345'\r\n },\r\n contentType: 'application/json;',\r\n success: function (result) {\r\n // CallBack(result);\r\n console.log(result);\r\n\r\n $.each(result.data, function(key,val){\r\n \tcategories_menu += '<li><a href=\"categories.html?id='+val.idCategories+'\">'+val.categoriesName+'</a></li>';\r\n \tcategories_menu_mm += '<li class=\"page_menu_item menu_mm\"><a href=\"categories.html?id='+val.idCategories+'\">'+val.categoriesName+'</a></li>';\r\n });\r\n $('#menu_categories').append(categories_menu);\r\n $('.page_menu_selection').append(categories_menu_mm);\r\n },\r\n error: function (error) {\r\n \r\n }\r\n });\r\n\t}", "function CategoryList ({ categories }) {\n if (!categories.length) {\n return null\n }\n\n return (\n <nav className='breadcrumbs push-center'>\n <label>Categories:</label>\n <ul className='category-list'>\n <li>\n <NavLink exact to='/' activeClassName='active'>all</NavLink>\n </li>\n {categories.map(({ name, path }) => (\n <li key={`${name}${path}`}>\n <NavLink exact to={`/${path}`} activeClassName='active'>{name}</NavLink>\n </li>\n ))}\n </ul>\n </nav>\n )\n}", "function categoryListHandler(e) {\n var parentPath = e.target.id;\n content.style.display = 'block';\n recentActivity.style.display = 'none';\n // update currentParentPath\n currentParentPath = parentPath + '/';\n sendAjaxReq('GET', '/category/all?parent=' + sanitizePath(parentPath), updateAllPanes);\n }", "function showPortfolio(category){\n $(\"#myWorks\").find('li').siblings('li').removeClass('open_categories').children('div').hide();\n $(\"#myWorks\").find('li').each(function(){\n if ($(this).data('category').indexOf(category) >= 0){\n $(this).addClass('open_categories').children('div').show();\n } else if (category == \"All\") {\n $(this).addClass('open_categories').children('div').show();\n };\n }) \n }", "getAllcategory() {\n this.albumcategoryServices.getAll('', '1', '100').subscribe(res => {\n this.categoryList = res.result;\n });\n }", "getAllcategory() {\n this.albumcategoryServices.getAll('', '1', '100').subscribe(res => {\n this.categoryList = res.result;\n });\n }", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "function displayCategory() {\n displayHeading();\n displayList();\n}", "function getCategoryList(){\n \t\n\t\t$.ajax({\n\t\t\turl:\"http://localhost:8080/flipkart/webapi/category/getAllCategoryList\",\n\t\t\ttype:\"GET\",\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\tconsole.log(data);\n\t \t\tcategory_list = data;\n\t \t\tloadCategory(data);\n\t \t}\n\t \t\n\t \telse\n\t \t\talert(\"failed to get Categories\");\n\t },\n\t \n\t error : function(data){\n\t \talert(\"failed to get Categories !\");\n\t }\n\t \n\t\t});\n\t}", "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n }", "function WR_Shortcode_Product_Categories() {\n\t \tvar button = $( '.sc-cat-list[data-expand=\"true\"]' ).children( 'a' );\n\t \t$( '.sc-cat-list[data-expand=\"true\"] ul' ).hide();\n\n\t \tbutton.on( 'click', function() {\n\t \t\t$( this ).next().slideToggle();\n\t \t} );\n\t }", "function populateCategories() {\n if (this.status >= 300) return apiFail();\n\n var data = JSON.parse(this.responseText);\n var categoriesEl = byId('categories');\n\n // empty the current list\n while (categoriesEl.firstChild)\n categoriesEl.removeChild(categoriesEl.firstChild);\n\n data.categories.forEach(function (category, idx) {\n var li = document.createElement('li');\n li.textContent = category.title;\n li.dataset.url = category.productsURL;\n li.onclick = selectCategoryClickHandler;\n categoriesEl.appendChild(li);\n });\n\n selectCategory(categoriesEl.firstChild);\n}", "function selectMagSubCategoriesAJAX(selected_category)\n{\n\tvar selected_lang = jQuery.url.segment(3);\n\tvar ajaxURL = admin_base_url +'magazine_utilities/populate_sub_category_list/'+ selected_category +'/'+ selected_lang;\n\t$('#sub_category option:selected').text(\"Loading...\");\n\t\n\t$.ajax({\n\t\turl: ajaxURL,\n\t\tdataType: 'json',\n\t\tsuccess: function(data) {\n\t\t\t\n\t\t\tif( data.result=='success' )\n\t\t\t\t$('#div_mag_subcategory').html(data.html_content);\n\t\t\t\n\t\t}\n\t});\n}", "function listCategory(catId, catName, resultitems) {\n // reSetMarkers(); // clean up the category and map state\n // showDialog(false); // hide our info-dialog, if necessary\n //\n resultitems.sort(topicSort); // alphabetical ascending\n var topicIdsToShow = new Array();\n //\n var sideBarCategories = jQuery(\"#categoryListing\");\n sideBarCategories.empty();\n sideBarCategories.append('&nbsp;<b class=\"redTitle\">' +catName + '</b><br/>&nbsp;&nbsp;');\n sideBarCategories.append('<small>('+resultitems.length+ ' Objekte)</small><p/>');\n sideBarCategories.append('<table width=\"240\" cellpadding=\"2\" cellspacing=\"0\" id=\"catListingTable\"></table>');\n for (var i = 0; i < resultitems.length; i++) {\n var nr = i+1;\n jQuery(\"#catListingTable\").append('<tr width=\"100%\" class=\"topicRowDeselected\">'\n + '<td width=\"20px\" class=\"iconCell\" valign=\"center\" align=\"center\">'\n // + '<img src=\"http://www.berlin.de/imperia/md/images/system/icon_punkt_rot.gif\"/></td>'\n + '<b>' + nr + '.</b></td>'\n +' <td>'+resultitems[i].name+'</td></tr>');\n // jQuery(\"#topicRow-\"+topicsToShow[i].id).attr('onclick', 'javascript:showTopicInMap(\"'+topicsToShow[i].id+'\");');\n // jQuery(\"#topicRowHref-\"+topicsToShow[i].id).attr('href', 'javascript:showTopicInMap(\"'+topicsToShow[i].id+'\");');\n // topicIdsToShow.push(topicsToShow[i].id);\n }\n }", "function initiateSubCategories(subtopic) \n{\n\tdocument.getElementById('backBtn').removeAttribute(\"disabled\");\n\tdocument.getElementById('categoryTitle').innerHTML = subtopic;\n\tvar div = document.getElementById('categoryContainer');\n\tstrPath += \"/\" + subtopic; // Updated location string with subtopic\n\n\tclearButtons(div);\n\tsetCategories(strPath);\n}", "printCategory(categories) {\n const categorySelect = document.getElementById('categorySelect');\n let html = `<option value=\"\">Cualquier Categoria</option>`\n\n categories.forEach((category) =>{\n html +=`<option value=\"&category=${category.id}\">${category.name}</option>`;\n });\n\n categorySelect.innerHTML= html;\n }", "function getSelectedCategories() {\n let selectedCategories = [];\n categoryListItems.forEach((element, i) => {\n if (element.checked && i > 0) selectedCategories.push(element.name);\n });\n if (selectedCategories.length === categoryListItems.length - 1) selectedCategories = [];\n return selectedCategories;\n}", "function getCategories() {\n fetch(apiCategorias)\n .then((res) => res.json())\n .then((dataJson) => {\n printCategories(dataJson.trivia_categories);\n })\n .catch((err) => {\n console.error(err);\n });\n}", "function renderCategoryList(data) {\n if (!data.length) {\n window.location.href = \"/categories\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createCategoryRow(data[i]));\n }\n categorySelect.empty();\n console.log(rowsToAdd);\n console.log(categorySelect);\n categorySelect.append(rowsToAdd);\n categorySelect.val(category_id);\n }", "static async getAllMainCategories(req, res) {\n const mainCategoryDomain = new MainCategoryDomain();\n mainCategoryDomain.getAllMainCategories(req, res);\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 load_categories(){\n\t\tconnect('GET', 'index.php?q=/books/categories', {})\n\t\t\t.done(function(response){\n\t\t\t\tvar cats = $('#fieldCategory');\n\t\t\t\tcats.html('');\n\t\t\t\tfor (var x in response.data){\n\t\t\t\t\tvar id = response.data[x].id;\n\t\t\t\t\tvar description = response.data[x].description;\n\t\t\t\t\tcats.append(`<option value=\"${id}\">${description}</option>`);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.fail(notify_error);\n\t}", "function displaySubCategory(category_id,step) {\n $(\"#sub_category\").html(\"<p class='text-center'><i class='fa fa-spinner'></i></p>\");\n $.ajax ({\n type : 'post',\n url : cat_url,\n data : {option: category_id},\n success : function(data) {\n $(\"#sub_category\").html(\"\");\n // console.log(data);return false;\n if (data == undefined) {\n alert(\"Oops Something went wrong. Kindly contact your administrator.\");\n return false;\n }\n if (data.length == 0) {\n alert('No sub categories available. Kindly contact support team.');\n return false;\n }\n var subcategory = '';\n for(var i=0; i < data.length; i++) {\n var value = data[i];\n subcategory += '<div class=\"col-lg-4 col-md-4 col-sm-12 col-sx-12\">'+\n '<a class=\"category-item text-center\" onclick=\"saveSubCategory('+value.id+', '+step3+')\">'+\n '<div class=\"category-img bg-img\" '+\n ' style=\"background-image: url('+value.picture+')\">'+\n '</div><h3 class=\"category-tit\">'+value.name+'</h3>'+\n '</a>'+\n '</div>';\n }\n $(\"#sub_category\").append(subcategory);\n $(\"#\"+step).click();\n },\n error : function(data) {\n alert(\"Oops Something went wrong. Kindly contact your administrator.\");\n }\n });\n}", "function GetDBCategories(){\n\tif (!window.openDatabase) { \n \t\talert('Databases are not supported in this browser.'); \n \t\treturn; \n \t} \n\n\t$('.category').html('');\n\t\n\tdb.transaction(function(tx) {\n\t\tvar innerJoin = '';\n\t\tvar where = '';\n\t\t\n\t\tif (loggedInUser != 1){\n\t\t\tinnerJoin = ' LEFT JOIN UserLessons ON Lesson.LessonId = UserLessons.lesson_id';\n\t\t\twhere = ' WHERE UserLessons.user_id ='+loggedInUser + ' OR Category.OwnerId = '+loggedInUser;\n\t\t}\n\t\t\n\t\tdoQuery(tx, 'SELECT * FROM Category LEFT JOIN Lesson ON Category.CategoryId = Lesson.CategoryId'+ innerJoin + where +' GROUP BY Category.CategoryName;', [],function(tx,result){\n\t\t\tif (result != null && result.rows != null) {\n\t\t\t\tif (result.rows.length != 0){\n\t\t\t\t for (var i = 0; i < result.rows.length; i++) {\n\t\t \t\t\tvar row = result.rows.item(i);\n\t\t \t\t\tvar catId = row.CategoryId;\n\t\t \t\t\t$('.category').append('<li class=\"cat\" id=\"cat_'+ catId +'\"><span class=\"cat-title\">' + row.CategoryName + '</span></li>');\n\t\t \t\t\t$('.category li#cat_' + catId).append('<img class=\"renameCategoryIcon pointer\" src=\"'+ PATH_IMG +'rename-w.png\" /><img class=\"deleteCategoryIcon pointer\" src=\"'+ PATH_IMG +'delete-w.png\" />');\n\t\t\t\t\t\t\t\t \t\t\t\n\t\t \t\t\tGetDBLessons(catId, setHtmlForLessons); \n\t\t \t\t\tinitBinding();\n\t\t \t}\n\t\t }\n\t\t else {\n\t\t \t$('.category').append('<p class=\"info\">Für dich stehen momentan noch keine Fächer zur Verfügung. Lege ein eigenes Fach an oder bitte den Administrator darum, dir Lektionen zuzuweisen.</p>');\n\t\t }\n\t \t}\n\t\t});\n\t},errorCB,nullHandler);\n\n\treturn;\n}", "function buildSidebarCategories(all_categories) {\n var sideCat = $('ul#sidebar_categories').empty();\n all_categories.sort(sortName);\n for(i = 0; i < all_categories.length; i++) {\n var cat_item = $('<li>').addClass('hvr-bounce-to-right')\n .append( $('<a>')\n .attr('href', 'blog.html?category=' + all_categories[i].name)\n .html(all_categories[i].name.replace(/_/g,' ').capFirstLetter())\n .append( $('<span>').html(all_categories[i].count) )\n );\n sideCat.append(cat_item);\n }\n $('<div>').addClass('load_all').append(\n $('<a>').attr('href','posts/categories.html').html('All Categories')\n ).insertAfter('ul#sidebar_categories');\n}", "function getMainCategories(isActive) {\n\t\tAdminService.categories().get({ sort: 'name', type: 'article', isActive: isActive }, function (response) {\n\t\t\tif (response.code == 200) {\n\t\t\t\tvm.mainCategoryList = response.data;\n\t\t\t}\n\t\t})\n\t}", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "filterTopCategories() {\n const result = [];\n if (!this.searchResults) return;\n this.topCategories = [];\n const sr = this.searchResults;\n sr.forEach((item) => {\n if (item.categoryPath) {\n const cats = item.categoryPath.split('/');\n const exactNode = cats[cats.length - 1];\n if (!result.some(e => e.name === exactNode) && result.length < 3) {\n result.push(new TopCategory(exactNode));\n }\n }\n });\n this.topCategories = result;\n }", "function filterCategory(cat) {\n //if all is selected, displays all products\n if (cat.toLowerCase() === \"all\") {\n Products(products);\n }\n //filters products depending on category selected\n else {\n let filteredProducts = products.filter(\n prod => prod.category === cat.toLowerCase()\n );\n Products(filteredProducts);\n }\n}", "function showMenu(categories){\n console.log(categories);\n //lt - link template\n let lt = document.querySelector(\"#linkTemplate\").content;\n categories.forEach(function(category){\n\n //if a category doesn't contain anything, don't show it\n if(category.count > 0){\n let clone = lt.cloneNode(true);\n let parent = document.querySelector(\"#categorymenu\");\n clone.querySelector(\"a\").textContent=category.name;\n clone.querySelector(\"a\").setAttribute(\"href\", \"index.html?categoryid=\"+category.id)\n parent.appendChild(clone);\n\n }\n });\n\n //http://ioanavladau.com/wp/wp-json/wp/v2/events?categories=8\n\n}", "getHeaderSubcat(context) {\n\t\t\taxios.get(\"/show/header/category\"\n\t\t\t).then((res) => {\n\t\t\t\tcontext.commit('HEADER_SUB_CATEGORY', res.data.data);\n\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t}", "function getCategories(req, res) {\n console.log(\"getCategories endpoint\");\n\n client\n .query(`SELECT distinct category from expenses where category in('Maintenance_Repair', 'Gas', 'Propane', 'Parking_Toll', 'InitialCosts', 'RigUpgrades', 'InternationalCashExchange', 'Entertainment', 'Food', 'Internet', 'Rent');`)\n .then(data => {\n res.status(200).send(data.rows);\n console.log(`queried for distinct categories and sent to client`);\n })\n .catch(err => {\n res.status(404).send(err);\n })\n}", "setCategories(c) {\n this.allCategories = c;\n }", "static getLeaves(category) {\n let children = [];\n if (category.children.length == 0) {\n children.push(category);\n } else {\n category.children.forEach(child => {\n children = children.concat(Category.getLeaves(child));\n });\n }\n return children;\n }", "function printCategories(data) {\n\tvar $row = $('<div class=\"row\"></div>');\n\tdata.forEach((item, index)=>{\n\t\tlet frame = `\n\t\t\t\t<div class=\"col-6\" id=\"col--${item.id}\">\n\t\t\t\t\t<h3>${item.name}</h3>\n\t\t\t\t</div\n\t\t\t`;\n\t\tif (index % 2 === 0) {\n\t\t\t$($row).append(frame);\n\t\t\tif (index === data.length -1) {\n\t\t\t\tframe = `\n\t\t\t\t\t<div class=\"col-6\">\n\t\t\t\t\t\t<h3>Your Sandwich:</h3>\n\t\t\t\t\t\t<ul id=\"item-list\"></ul>\n\t\t\t\t\t\t<h4>Your Total: $<span id=\"total\"></span></h4>\n\t\t\t\t\t</div>`;\n\t\t\t\t$($row).append(frame);\n\t\t\t\t$('#menu').append($row);\n\t\t\t}\n\t\t} else {\n\t\t\t$($row).append(frame);\n\t\t\t$('#menu').append($row);\n\t\t}\n\t});\n}", "function fetchCategoriesAndSubcategoriesFromDB(uiCallback) {\n let reference = db.collection(\"categories\");\n let resultArray = [];\n reference\n .withConverter(categoryConverter)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n if (doc.exists) {\n resultArray.push(doc.data());\n } else {\n return codes.NOT_FOUND;\n }\n });\n uiCallback(resultArray);\n })\n .catch((error) => {\n console.log(\n `Category fetch error! Error code: ${error.errorCode}\\nError Messsage: ${error.errorMessage}`\n );\n uiCallback(codes.FETCH_FAILURE);\n return codes.FETCH_FAILURE;\n });\n}" ]
[ "0.7441592", "0.695153", "0.6942101", "0.69071865", "0.6838817", "0.6765603", "0.6754103", "0.6640523", "0.661851", "0.66110444", "0.6588842", "0.6537597", "0.6505056", "0.64698845", "0.6459706", "0.64331573", "0.64147663", "0.63845557", "0.6365538", "0.6345924", "0.63453215", "0.6319885", "0.63019294", "0.62991667", "0.6284947", "0.6269933", "0.6264807", "0.62603587", "0.62321717", "0.62296885", "0.62170327", "0.62156224", "0.61765677", "0.6163743", "0.615892", "0.6157556", "0.61568165", "0.61501276", "0.61408204", "0.6107552", "0.6102911", "0.60931504", "0.6084847", "0.607526", "0.6073907", "0.60682756", "0.6046781", "0.6044173", "0.60377514", "0.6034825", "0.60096556", "0.599853", "0.59864414", "0.5977117", "0.5975721", "0.5974074", "0.59728175", "0.5965762", "0.59620476", "0.59578127", "0.59565717", "0.59530795", "0.59523356", "0.59510505", "0.5948055", "0.59431404", "0.59397674", "0.5933061", "0.5932794", "0.5932446", "0.5932446", "0.59289265", "0.5923631", "0.5923257", "0.59226644", "0.59208536", "0.5917074", "0.5912074", "0.59077066", "0.5893165", "0.5890034", "0.58892137", "0.58878523", "0.5871138", "0.5870337", "0.5864648", "0.58573866", "0.5848593", "0.58411026", "0.5838658", "0.5830751", "0.5829697", "0.5826319", "0.5825813", "0.5824952", "0.5814776", "0.5814741", "0.57939655", "0.57814336", "0.57752305", "0.57746255" ]
0.0
-1
This function helps component to have access to the store (state) as props category : selected category meal : selected sub category
function mapStateToProps(state) { return { category: state.activeCategory, meal: state.activeMeal }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getcategory(state){\n return state.category\n }", "categ(state,data)\n {\n return state.category=data\n }", "setSub() {\n\t\tconsole.log('called constructor setSub');\n\t\tlet sub_category_selected_display = [],\n\t\t\tcategory_selected = this.state.category_selected;\n\t\tif ((this.state.category_selected && this.state.category_selected.length) || (this.state.sub_category_selected && this.state.sub_category_selected.length)) {\n\t\t\tif (this.state.category_selected && this.state.category_selected.length) {\n\t\t\t\tthis.state.category_selected.map((id) => {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\tif (id == op.id) {\n\t\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\t\tthis.state.sub_category_selected.map((sub_id) => {\n\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_id) === -1) {\n\t\t\t\t\t\t\tsub_category_selected_display.push(sub_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\tthis.state.sub_category_selected.map((data) => {\n\t\t\t\t\tif (sub_category_selected_display.indexOf(data) === -1) {\n\t\t\t\t\t\tsub_category_selected_display.push(data);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.props.location.search == '?cat=[]&subcat=[]&layer=[]') {\n\n\t\t\t} else {\n\t\t\t\t/*if (this.state.category_list && this.state.category_list.length) {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// this.setCategory(true, op.id);\n\t\t\t\t\t\tif (category_selected.indexOf(op.id) === -1) {\n\t\t\t\t\t\t\tcategory_selected.push(op.id);\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\tthis.setState({\n\t\t\tsub_category_selected_display: sub_category_selected_display,\n\t\t\tcategory_selected: category_selected\n\t\t});\n\t}", "onCategoryChange(categorySelected) {\n this.setState({\n categorySelected\n });\n if (categorySelected === null) {\n this.state.props.categoryChangeListener(-1);\n } else {\n this.state.props.categoryChangeListener(categorySelected.value)\n }\n }", "setSelectedCategoryId(state, categoryId) {\n state.selectedCategoryId = categoryId;\n }", "choosenCat (category) {\n\t\tthis.setState({\n\t\t\tisFiltering: true,\n\t\t});\n\t\tif ( this.state.isLocationBased ){\n\t\t\tthis.filterOnCat(this.props.data.allRestaurantses, category).then((resturants) => {\n\t\t\t\tthis.filterOnLocation(resturants).then((resturants) => {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tstep: 2,\n\t\t\t\t\t\tselectedCategory: category,\n\t\t\t\t\t\trestaurantsList: resturants,\n\t\t\t\t\t\tisFiltering: false,\n\t\t\t\t\t\tisLoading: true\n\t\t\t\t\t});\n\t\t\t\t\tthis.shouldPosBeUpdated();\n\t\t\t\t})\n\t\t\t})\n\t\t\t\n\t\t} else {\n\t\t\tthis.filterOnCat(this.props.data.allRestaurantses, category).then((resturants) => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tstep: 2,\n\t\t\t\t\tselectedCategory: category,\n\t\t\t\t\trestaurantsList: resturants,\n\t\t\t\t\tisFiltering: false,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}", "componentDidMount() {\n this.getCategorys()// get frist class category because the default state parentId is '0'\n \n }", "onChangeCategory(e) {\n\t\tthis.props.onChangeCategory(e.target.value);\n\t}", "supCategory(v) {\n\t\tthis.setState({\n\t\t\tspecfic: v\n\t\t});\n\t}", "constructor(props) {\n super(props);\n this.categories = [\n {\n id: 1,\n label: 'Yoga',\n },\n {\n id: 2,\n label: 'Fitness',\n },\n {\n id: 3,\n label: 'Dance',\n },\n {\n id: 4,\n label: 'Pilates',\n },\n ];\n\n this.state = {\n selectedCategory: this.categories[0]\n }\n }", "onCategorySelected(category) {\n this.props.actions.products.selectProductCategory(category);\n this.props.actions.app.changeStatusBarStyle();\n this.props.navigation.transitionTo('products', { onPop: this.handleWelcomeBar });\n }", "onChangeEvent(c) {\n this.selectedCategory = c;\n }", "handleCatClick(categoria, e) {\n const { activeCat } = this.state;\n\n // prevent navigation through this button\n e.preventDefault();\n\n // if this category is already selected this unselects it\n if (activeCat === categoria) {\n return this.setState({\n activeCat: \"\",\n });\n }\n\n // otherwise we keep category name in state\n this.setState({\n activeCat: categoria,\n });\n }", "onCategoryInputChange(e) {\n const selectValue = e.target.value;\n\n this.setState({category: selectValue});\n }", "constructor(props) {\n super(props);\n this.state = {\n isInCategory: false\n }\n }", "setCategory(obj){\n console.log(\"setCategory : \" + obj.target.value)\n this.setState({category: obj.target.value}, function(){this.getSubCategoryList()});\n }", "createListItems() {\n //This is used to give active class to the selected category\n jQuery('.active_cat').removeClass('active_cat');\n jQuery(\"#category_\" + this.props.category.cat_id).addClass(\"active_cat\");\n\n //Store the selected meal under sub category(sub menu) to get access in order page\n if (this.props.meal)\n sessionStorage.setItem(\"selected_meal\", JSON.stringify(this.props.meal));\n\n //creates the sub category(sub menu) cards layout, selectMeal is the action triggered when meal card is clicked\n return this.props.category.sub_cat.map((meal, index) => {\n return (\n <div key={index} className=\"col-md-4 col-lg-3 col-sm-6 col-xs-12 cards\" onClick={() => this.props.selectMeal(meal)}>\n <img src={meal.subcat_thumbnail} alt=\"meal pic\" />\n <div style={{ padding: '5px' }}>\n <label>{meal.subcat_name}</label>\n <p>{meal.subcat_desc}</p>\n <label style={{ right: '0', position: 'absolute', bottom: '0', marginRight: '20px', color: 'red' }}>{meal.subcat_price}</label>\n </div>\n </div>\n );\n });\n }", "handleCategoryChange(currIndex){\n\n var currentCategories = this.state.categories;\n currentCategories[currIndex].selected = ! currentCategories[currIndex].selected;\n this.setState({categories: currentCategories});\n//alert('category change!' + currIndex + currentCategories[currIndex].selected);\n }", "handleClick(value) {\n this.setState({\n category: value\n })\n //console.log(this.state.category);\n }", "filterByCategory(category) {\n\t\tconsole.log(this.selectedCategories);\n\t}", "handleClickCat(id) {\n console.log('click')\n this.setState({selectedCat: this.state.catData[id]})\n }", "componentWillReceiveProps(nextProps) {\n //console.log(nextProps.currentCategoryId, this.props.currentCategoryId)\n //console.log(nextProps.parentsCategoryId, this.props.parentsCategoryId)\n\n // if the value of currentCategoryId and parentsCategoryId not change at all, no any futher action\n if (nextProps.currentCategoryId == this.props.currentCategoryId && nextProps.parentsCategoryId == this.props.parentsCategoryId) {\n return;\n }\n\n // check both category changed or only category1 changed\n if (nextProps.parentsCategoryId == 0) {\n //alert(nextProps.currentCategoryId)\n this.setState({\n firstCategoryId: nextProps.currentCategoryId,\n secondCategoryId: 0\n })\n } else {\n // both categories changed: 2 level select\n this.setState({\n firstCategoryId: nextProps.parentsCategoryId,\n secondCategoryId: nextProps.currentCategoryId\n }, () => {\n this.loadSecondCategory();\n })\n }\n }", "function App() {\n const [mealCategory, setmealCategory] = useState({ category: \"\", meals: []});\n\n const addmealCategory = (category) => {\n setmealCategory({ ...mealCategory, category})\n }\n\n const addMeal = (meal) => {\n let newMeals;\n if(!mealCategory.meals.includes(meal)) {\n newMeals = [...mealCategory.meals, meal];\n } else {\n newMeals = mealCategory.meals.filter(item => item !== meal);\n }\n setmealCategory({ ...mealCategory, meals:[newMeals]})\n }\n /*const [menuItems, setMenuItems] = useState(items);\n const [categories, setCategories] = useState(allCategories);\n\n const filterItems = (category) => {\n if (category === \"flex meal\") {\n setMenuItems(items);\n return console.log(setMenuItems(items));\n }\n const newItems = items.filter((item) => item.category === category);\n setMenuItems(newItems);\n }; */\n return (\n <>\n <Header />\n <div className=\"w-4/5 mx-auto\">\n \n <Switch>\n <Route path=\"/category\">\n <Category addmealCategory={addmealCategory} mealCategory={mealCategory} />\n </Route>\n <Route path=\"/flex\">\n <Flex addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/breakfast\">\n <Breakfast addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/lunch\">\n <Lunch addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/dinner\">\n <Dinner addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/menu\">\n <Menu/>\n </Route>\n <Route path=\"/order\">\n <Order mealCategory={mealCategory} />\n </Route>\n <Route path=\"/\" component={Home}/>\n </Switch>\n </div>\n </>\n );\n}", "onCategoryChange(category) {\n // Update the state\n this.setState({value: category});\n // Close the popup\n this.onClosePopup();\n // Callback\n if (this.props.onChange) this.props.onChange(category);\n }", "function Categories(props) {\n const { getAll, categories } = props;\n\n useEffect(() => {\n getAll();\n }, [getAll]);\n\n const catsToRender = [];\n\n if (categories) {\n categories.forEach((category, i) => {\n catsToRender.push(\n <MenuItem\n className=\"menu-item\"\n value={category.name}\n key={i}\n onClick={() => {\n props.changeCategory(category);\n }}\n >\n {category.displayName || category.name}\n </MenuItem>\n );\n });\n }\n\n return (\n <div id=\"categories\" className=\"cont-child\">\n <h2>Browse our Categories</h2>\n <Select\n value={props.currentCategory ? props.currentCategory.name : ''}\n className=\"cat-select\"\n >\n {catsToRender}\n </Select>\n </div>\n );\n}", "selectAllCategory(categoryName){\n let categoryToSelect = cloneDeep(this.state.saveData[categoryName])\n let newSelected = cloneDeep(this.state.selected) \n for (let tag of categoryToSelect){\n newSelected[tag] = true;\n }\n\n this.setState({selected:newSelected})\n\n }", "componentWillReceiveProps(nextProps){\n const {posts, postsByCat, globalSettings} = nextProps;\n let selectedCategory = globalSettings.selectedCat;//this.determineTrueSelectedCategory();//globalSettings.selectedCat;\n if(postsByCat.hasOwnProperty(selectedCategory)){ //if category exists\n this.filterPostsBySelectedCategory(posts,postsByCat, selectedCategory);\n }\n }", "componentWillReceiveProps(nextProps) {\r\n if (nextProps.selectedCategory !== this.state.selectedCategory) {\r\n this.setState({ selectedCategory: nextProps.selectedCategory });\r\n }\r\n }", "componentWillReceiveProps(nextProps) {\n if (nextProps.currentCategory !== this.props.currentCategory) {\n //console.log('nextProps', nextProps.currentCategory)\n\n let { title, description, imagePath } = nextProps.currentCategory\n\n this.setState({\n edit:true,\n checked:true,\n data:{\n ...this.state.data,\n title,\n description,\n imagePath\n }\n })\n }\n }", "function mapStateToProps({ categories }) {\r\n return {\r\n categories: categories.categories\r\n }\r\n}", "function selectCategoryClickHandler(ev) {\n selectCategory(ev.target);\n}", "category(event){\n this.setState({\n category:event.target.value\n })\n }", "category(event){\n this.setState({\n category:event.target.value\n })\n }", "onChangeCategory(e){\n\n var selectedIndex = e.target.options.selectedIndex;\n this.setState({\n name: e.target.value,\n cid:e.target.options[selectedIndex].getAttribute('id')\n }\n )\n\n axios.get(`http://localhost:5000/SubCategory/category_by_id?id=${e.target.options[selectedIndex].getAttribute('id')}&type=single`)\n .then(response => {\n if(response.data.length > 0 ) {\n\n this.setState({\n subCategories:response.data,\n subcategory : response.data[0].name,\n sid:response.data[0]._id\n\n })\n\n }\n })\n }", "handleSelectDecisionCategoryChange(event, index, value) {\n console.log('DecisionAdd::handleSelectDecisionCategoryChange')\n let change = this.state\n change.decision.category = value\n this.setState(change)\n console.log(this.state)\n }", "@computed get isSelectedCatagory() {\n return typeof this.categoryData.selectedCategoryId === 'number';\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 }", "category () {\n if (this.categoryId) {\n return BacklogItemCategories.findOne(this.categoryId)\n }\n }", "function getCategoryInfo() {\n\t\tAdminService.categories().get({ categoryId: vm.categoryId }, function (response) {\n\t\t\tif (response.data.length > 0) {\n\t\t\t\tvm.category = response.data[0];\n\t\t\t\tif(vm.category.type == 'article') {\n\t\t\t\t\tvm.category.listType = \"all\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (response.data[0].parentId !== '0') {\n\t\t\t\t\tvar parentId = response.data[0].parentId\n\t\t\t\t\tvm.models.push(parentId); // Model value for selected sub categories\t\t\t\t\t\n\t\t\t\t\t/* Get parent Info */\n\t\t\t\t\tAdminService.categories().get({ categoryId: parentId }, function (parentInfo) {\n\t\t\t\t\t\tif (parentInfo.data[0].parentId === 0) {\n\t\t\t\t\t\t\tvm.parentId = parentId;\n\t\t\t\t\t\t\tvm.hideMainCategory = false;\n\t\t\t\t\t\t\tgetMainCategories(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvm.hideMainCategory = true\n\t\t\t\t\t\t\tAdminService.subCategories().get({ parentCatId: parentInfo.data[0].parentId }, function (subCatResOnj) {\n\t\t\t\t\t\t\t\tif (subCatResOnj.code == 200 && subCatResOnj.data.list.length > 0) {\n\t\t\t\t\t\t\t\t\tvm.subCategoryList.push({ label: 'Sub Category', list: subCatResOnj.data.list, model: \"subCat\" + 1 })\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tvm.noDataText = false;\n\t\t\t} else {\n\t\t\t\tvm.noDataText = response.message;\n\t\t\t}\n\t\t});\n\t}", "retriveSubCategory(context, cat) {\n\t\t\taxios.get(\"/show/product/subcategory/\" + cat\n\t\t\t).then((res) => {\n\t\t\t\tcontext.commit('PRODUCT_SUB_CATEGORY', res.data.data);\n\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t}", "componentDidMount() {\n if(this.props.data_food)\n this.setState({\n id: this.props.data_food.id,\n food_name: this.props.data_food.food_name,\n price: this.props.data_food.price,\n description: this.props.data_food.description, \n active: this.props.data_food.active,\n category_name: this.props.data_food.category_name\n })\n else{\n this.setState({\n category_name: this.props.categories[0].category_name\n })\n }\n }", "function FavoriteItem(props) {\n const dispatch = useDispatch();\n const [category, setCategory] = useState('none')\n const addCategory = (event) => {\n console.log(event.target.value)\n dispatch({type: 'ADD_CATEGORY', payload: props.id, catId: event.target.value})\n }\n useEffect(() => {\n checkCat();\n }, []);\n console.log(props.catId)\n const checkCat = () => {\n switch (props.catId) {\n case 1:\n setCategory('Funny');\n break;\n case 2:\n setCategory('Cohort');\n break;\n case 3:\n setCategory('Cartoon');\n break;\n case 4:\n setCategory('NSFW');\n break;\n case 5:\n setCategory('Meme');\n break;\n default:\n }\n }\n \n \n return(\n <div className=\"item\">\n <p><img src={props.image} /></p>\n <br />\n <p>Add Category</p>\n <img src={props.url}/>\n {category === \"none\" ? (\n <>\n <button value=\"1\" onClick={(event) => addCategory(event)}>Funny</button> \n <button value=\"2\" onClick={(event) => addCategory(event)}>Cohort</button> \n <button value=\"3\" onClick={(event) => addCategory(event)}>Cartoon</button> \n <button value=\"4\" onClick={(event) => addCategory(event)}>NSFW</button> \n <button value=\"5\" onClick={(event) => addCategory(event)}>Meme</button> \n </>\n ) : <p>{category}</p>}\n </div>\n )\n}", "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 }", "setSubCategory(obj){\n console.log(\"setSubCategory : \" + obj.target.value)\n this.setState({subcate: obj.target.value});\n }", "componentDidMount() {\n AppData.getAllCategory(localStorage.getItem(\"userId\"))\n .then((AppDataCategoryArray) => {\n this.setState({\n category: AppDataCategoryArray\n })\n })\n AppData.getIndividualCategory(this.props.categoryId)\n .then((category) => this.setState({\n id: category.id,\n userId: category.userId,\n name: category.name,\n })\n )\n }", "renderCategory(){\n return(\n <Category category={window.category} onClick={(product, isEnter) => this.handleClick(product, isEnter)} />\n );\n}", "constructor(props) {\n\t\tsuper(props);\n\t\tvar keys = {};\n\t\tthis.props.categories.forEach(category => {\n\t\t\tkeys[category.system_name] = { display: category.title, open: false, selected: false, osm_tags: category.osm_tags, colour: category.colour }\n\t\t});\n\t\tif (this.props.user && this.props.user.categories) {\n\t\t\tObject.keys(keys).forEach(category => {\n\t\t\t\tthis.props.user.categories.forEach(user_cat => {\n\t\t\t\t\tif (user_cat === category) keys[category].selected = true;\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tthis.state = {\n\t\t\tdescription: (this.props.user && this.props.user.description ? this.props.user.description : ''),\n\t\t\tdepartments: this.props.user.departments ? this.props.user.departments : [],\n\t\t\tlogo: (this.props.user && this.props.user.logo ? this.props.user.logo : null),\n\t\t\tcover: this.props.user.cover,\n\t\t\toffline: this.props.user.status !== 'Active',\n\t\t\tpromo_images: this.props.user.promo_images ? this.props.user.promo_images : [],\n\t\t\textended: this.props.user.extended,\n\t\t\tessential: this.props.user.essential,\n\t\t\tamenities: (this.props.user.amenities ? this.props.user.amenities : []),\n\t\t\ttwitter: this.props.user.twitter,\n\t\t\tinstagram: this.props.user.instagram,\n\t\t\tfacebook: this.props.user.facebook,\n\t\t\tgoogle_plus: this.props.user.google_plus,\n\t\t\twebsite: this.props.user.website,\n\t\t\tservices: (this.props.user.services || []),\n\t\t\taddresses: (this.props.user.addresses || []),\n\t\t\tservice_answers: this.props.user.service_answers || {},\n\t\t\tservice_answer_groups: this.props.user.service_answer_groups || {},\n\t\t\tservice_booking_days: this.props.user.service_booking_days || {},\n\t\t\tcategories: this.props.categories,\n\t\t\tcategory_keys: keys,\n\t\t\tdate_of_birth_invalid: false,\n\t\t\tpercent_complete: this.calculatePercentage(),\n\t\t\tvalid_logo: true,\n\t\t\tvalid_cover: true,\n\t\t\tvalid_promo: true,\n\t\t\tcurent_provider_option_group: '',\n\t\t\tcurrent_image_label: '',\n\t\t\tcurrent_provider_option: '',\n\t\t\tcurrent_provider_optionprice: '',\n\t\t\tcurrent_provider_optionsize: '',\n\t\t\tcurrent_provider_optiongrouping: '',\n\t\t\tcurrent_provider_optionimage: null,\n\t\t\tvalid_current_provider_optionimage: true,\n\t\t\tcurrent_item_tab: 0,\n\t\t\taddress: '',\n\t\t\tlocation: [],\n\t\t\tgovernorate: '',\n\t\t\tneighbourhood: '',\n\t\t\tblock: '',\n\t\t\tstreet: '',\n\t\t\thouse: '',\n\t\t\taddress_public: false,\n\t\t\taddress_distance: 0,\n\t\t\tedit_address: false,\n\t\t\tedit_address_index: -1,\n\t\t\tdepartment_name: '',\n\t\t\texpanded: null,\n\t\t\tshow_departments: (this.props.user.departments && this.props.user.departments.length > 0 ? true : false),\n\t\t\tshow_quick_profile: false,\n\t\t\tshow_image_profile: false\n\t\t};\n\t}", "function categorySelect() {\n\t//카테고리 선택 안했을때 -> hamburger\n\tmenus.forEach((menu) => {\n\t\tif (menu.dataset.type !== \"hamburger\") {\n\t\t\t// console.log(menu.dataset.type);\n\t\t\tmenu.classList.add(\"invisible\");\n\t\t}\n\t});\n\n\t//카테고리 선택시\n\tcategory.addEventListener(\"click\", (event) => {\n\t\tconst filter = event.target.dataset.filter;\n\t\tif (filter == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t//선택 카테고리 색상 변경\n\t\tconst active = document.querySelector(\".category_btn.selected\");\n\t\tactive.classList.remove(\"selected\");\n\t\tevent.target.classList.add(\"selected\");\n\n\t\t//메뉴 선별\n\t\tmenus.forEach((menu) => {\n\t\t\tif (filter === menu.dataset.type) {\n\t\t\t\tmenu.classList.remove(\"invisible\");\n\t\t\t} else {\n\t\t\t\tmenu.classList.add(\"invisible\");\n\t\t\t}\n\t\t});\n\t});\n}", "function useCategoryBase() {\n const category = useSelector((state) => state[typeStore.CATEGORY]);\n const dispatch = useDispatch();\n\n let categoryObj = {};\n category.map((item) => (categoryObj[item.id] = item));\n\n // func handle\n const getListCategory = async (obj = {}) => {\n const { message, categories } = await baseAPI.getAll(url_api.CATEGORY, obj);\n if (message === 'OK') {\n dispatch({\n type: typeAction.CATEGORY.GET,\n payload: { category: [...categories] },\n });\n } else messageAnt.warn(message);\n };\n return {\n category,\n categoryObj,\n getListCategory,\n };\n}", "constructor(props) {\n super(props);\n this.state = {\n categories: [\n {'name': 'gas', 'color': '#5fd8b9'},\n {'name': 'clothing', 'color': '#69698C'},\n {'name': 'food', 'color': '#F44E6A'},\n {'name': 'health', 'color': '#FC8FB4'},\n {'name': 'house', 'color': '#57D68A'},\n {'name': 'going out', 'color': '#B09EE5'}\n ],\n category: \"\",\n color: \"\",\n date: \"\",\n total: \"\",\n payee: \"\"\n }\n\n this.selectCategory = this.selectCategory.bind(this);\n this.handleInputChange = this.handleInputChange.bind(this);\n this.submitData = this.submitData.bind(this);\n }", "function mapStateToProps(state) {\n return {\n categories: getCategories(state),\n };\n}", "function mapStateToProps(state) {\n return {\n categories: getCategories(state),\n };\n}", "function catSelector(event) {\n // find object of selected cat and set it as active cat\n activeCat = cats.find(function (x) {\n return x.name === event.target.textContent;\n });\n // clear container of previous cat\n clearHtml();\n // add selected cat to html\n renderCat();\n}", "setCategoryFromStorage() {\n // check for category. if none set to all.\n let currCat = localStorage.getItem('category');\n if (!currCat) {\n // set default.\n localStorage.setItem('category', 'restaurants');\n currCat = 'restaurants';\n }\n IndexAnimationsObj.category = currCat;\n // set list-group button to active for current category\n this.$categoryButtons.children().each(function (index) {\n if ($(this).val() === currCat) {\n $(this).addClass('active');\n // set card-map-zone filter display to category name\n $('.cat-display').text($(this).text());\n }\n });\n }", "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}", "onCategorySelect(e) {\n try {\n e.preventDefault();\n let target = e.currentTarget.id;\n let selection = ''; //defaults to '' if selection is not found\n console.log(`onCategorySelect(): ${target}`);\n let newSelections = JSON.parse( JSON.stringify( this.state.selectedCategories ) );\n\n switch(target) {\n case 'online-category-header':\n selection = {\n index: newSelections.indexOf('online'),\n channel: 'online',\n };\n break;\n\n case 'channels-category-header':\n selection = {\n index: newSelections.indexOf('channels'),\n channel: 'channels',\n };\n break;\n \n case 'recent-category-header':\n selection = {\n index: newSelections.indexOf('recent'),\n channel: 'recent',\n };\n break;\n\n default:\n selection = {\n index: -1,\n channel: 'N/A',\n };\n }\n\n /*\n console.log('onCategorySelect() selection info:');\n console.log(`-index: ${selection.index}`);\n console.log(`-channel: ${selection.channel}`);\n */\n if ( selection.index >= 0 ) { //if the channel already exists\n //console.log(`Chat menu onCategorySelect(): ${selection.channel} already exists, removing channel`); \n newSelections.splice( selection.index, 1 ); //removes channel from selected channels\n this.setState({ selectedCategories: newSelections });\n }\n\n else if( selection.channel !== 'N/A' ) { //channel doesn't exist yet \n //console.log(`Chat menu onCategorySelect(): ${selection.channel} doesn't exist, adding channel`); \n newSelections.unshift( selection.channel ) //adds channel to selected channels\n this.setState({ selectedCategories: newSelections }); \n }\n\n else {\n console.log(`Chat menu onCategorySelect(): invalid channel selection - no action taken`); \n }\n \n }\n catch(err) {\n console.log(`ERR chat_menu.js onCategorySelect(): ${err.message}`);\n }\n \n }", "static mapState(state) {\n let {categories} = state.core.category;\n return {\n categories\n };\n }", "onCategorySelectChange(checked, newCategory) {\n const { selectedCategories } = this.state;\n if(checked) {\n this.setState({ selectedCategories: [...selectedCategories, newCategory]});\n } else {\n this.setState({ selectedCategories: selectedCategories.filter(({ sid }) => sid !== newCategory.sid )});\n }\n }", "showProduct(idCategory) {\n if(idCategory){\n this.props.changeCategory(Number(idCategory));\n this.updateCategory(Number(idCategory));\n }else{\n this.props.changeCategory();\n this.updateCategory(null);\n }\n }", "function clickCategories(e) {\n setList(PRODUCTS[e.target.dataset.category]);\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 }", "handleCategory(categoryName) {\n\t\tthis.props.onCategoryCheck(categoryName);\n\t}", "function mapDispatchToProps (dispatch) {\n return {\n selectCategory: (data) => dispatch(selectCategory(data)),\n };\n}", "async editCategory(category) {\n this.setState({ selectedCategory: category, isOpenCategoryModal: true });\n }", "onChangeSubCategory(e){\n\n var selectedIndex = e.target.options.selectedIndex;\n this.setState({\n subcategory: e.target.value,\n sid:e.target.options[selectedIndex].getAttribute('id')\n }\n )\n }", "init() {\n this.category = this.inputs.getProp('category');\n }", "constructor(props) {\n super(props);\n this.state = {\n books: [],\n categoryId: this.props.match.params.categoryId,\n };\n }", "function Cat({ data, selected, updateCatSelection }) {\n if (data) {\n const src = `http://quantcats.herokuapp.com/static/cats/${data}.png`;\n return updateCatSelection ? (\n <img\n onClick={updateCatSelection}\n alt=\"Cat\"\n src={src}\n className={selected ? \"selected\" : \"\"}\n />\n ) : (\n <img alt=\"Cat\" src={src} />\n );\n }\n\n return null;\n}", "handleChangeSubcategory(newSubcategory) {\n this.setState({\n subcategory: newSubcategory,\n anchorEl: null,\n });\n }", "function handleSelection(value) {\n setCategory(value);\n setVisible(false);\n }", "function selectCategory(e) {\n\tif (e.target.nodeName == \"DIV\") {\n\t\tlet category = \"\";\n\t\t//If the user is unselecting the category\n\t\tif (e.target.classList.contains(\"active-category\")) {\n\t\t\te.target.classList.remove(\"active-category\");\n\t\t} else {\n\t\t\t//Make everything unselected\n\t\t\tfor (let i = 0; i < categorySelect.children.length; i++) {\n\t\t\t\tcategorySelect.children[i].classList.remove(\"active-category\");\n\t\t\t}\n\n\t\t\t//Make the selected category active\n\t\t\te.target.classList.add(\"active-category\");\n\t\t\tcategory = e.target.innerText;\n\t\t}\n\n\t\t//Call searchProducts from the corresponding js file in the HTML\n\t\turlQueryPush(category);\n\t}\n}", "componentDidMount() {\n /** The categories in categoryData are not in the same order as they are in the categories array\n * so you have to get the id from the categories array and then search the categoryData for the matching id\n * to set that item so the correct questions are displayed for the category that was clicked. \n */\n this.props.categoryData.map((category, index) => {\n if (category.id === this.props.categories[this.props.category].id) {\n this.props.setQuestion(this.props.categoryData[index]); \n }\n });\n }", "function checkbox(categoryid, categoryname, restaurantID){\n const selectedCategory={id: categoryid, name: categoryname};\n const categorize = restaurantList.map(currentRestaurant=>{\n if(restaurantID===currentRestaurant.id){\n let labeled=false;\n currentRestaurant.category.map(currentCategory=>{\n if(currentCategory.id===categoryid){\n currentRestaurant.category.splice(currentRestaurant.category.indexOf(currentCategory),1);\n labeled=true;\n }\n return labeled;\n });\n if(labeled===false){\n currentRestaurant.category.push(selectedCategory);\n return {...currentRestaurant}\n }\n } \n return currentRestaurant; \n });\n setRestaurants(categorize);\n }", "function Categories() {\n const dispatch = useDispatch();\n const category = useSelector((state) => state.categories.categoryList);\n\n \n const activate = (category, description) => {\n dispatch(action.activated(category, description))\n }\n\n return (\n <div>\n <Typography>Browse our Categories</Typography>\n {category.map((item) => {\n return <Button key={item._id} onClick={() => activate(item.name, item.description)}>{ item.name }</Button>\n })}\n </div>\n );\n}", "function chooseCategory(input) {\n\t var category = data[input];\n\t return category;\n\t }", "constructor(){\n super();\n this.state = {\n newProject:{},\n categories:['Web Design', 'Web Development', 'Mobile Development']\n }\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}", "async categoryselected(pos, value) { \n var acceestoken=await commons.get_token();\n var s3config = require(\"./config/AWSConfig.json\"); \n this.setState({ loading: true });\n this.refs.loaderRef.show();\n if (value == Strings.discover_category_home) {\n this.mixpanelTrack(\"Store Home Page\");\n var cats = this.state.categories;\n var catsLanguage=this.state.categoriesLanguage;\n var cur_staxdata = [];\n var count=0;\n for (var i = 0; i < cats.length; i++) { \n if (cats[i] == Strings.discover_category_favorite||cats[i]==Strings.discover_category_home||cats[i]==Strings.discover_category_new)\n continue;\n var aws_data = require(\"./config/AWSConfig.json\");\n var aws_lamda = require(\"./config/AWSLamdaConfig.json\");\n var urlName=\"\";\n if (this.state.username == null || this.state.username == commons.guestuserkey()) { \n urlName=aws_lamda.commenapis;\n }\n else\n {\n urlName=aws_lamda.contentmanagement;\n } \n await fetch('' + aws_data.path + aws_data.stage + urlName, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization':acceestoken\n },\n body: JSON.stringify({\n \"operation\":\"getContentList\",// \"getSingleCategoryList\",\n \"category\": catsLanguage[i],\n \"widgetname\": \"\"+this.state.searchquery,\n \"userid\": this.state.username,\n \"LastEvaluatedKey\": {}\n }),\n }).then((response) => response.json())\n .then(async (responseJson) => { \n var catstax_obj = {}; \n catstax_obj[\"category\"] = cats[i];\n catstax_obj[\"key\"] = count;\n catstax_obj[\"staxdata\"] = responseJson.data;\n for (var j = 0; j < catstax_obj[\"staxdata\"].length; j++) {\n catstax_obj[\"staxdata\"][j].staxpreview = s3config.s3path + \"/\" + s3config.s3bucketname + \"/\" + s3config.s3storefolder + \"/Thumbnail_\" + catstax_obj[\"staxdata\"][j].staxid + \".jpg\" + \"?time=\" + catstax_obj[\"staxdata\"][j].createtime;\n }\n if(catstax_obj[\"staxdata\"].length>0)\n cur_staxdata.push(catstax_obj);\n var last_val_map = this.state.last_key_val_mapping;\n if (responseJson.hasOwnProperty(\"LastEvaluatedKey\"))\n last_val_map[cats[i]] = responseJson.LastEvaluatedKey;\n this.setState({\n catgorychoosen: Strings.discover_category_home,\n staxdata: cur_staxdata,\n staxdata_categorized: [],\n last_key_val_mapping: last_val_map,\n loading: false\n });\n count++;\n this.refs.loaderRef.hide();\n })\n .catch((error) => {\n console.error(error);\n });\n }\n }\n else {\n var aws_data = require(\"./config/AWSConfig.json\");\n var aws_lamda = require(\"./config/AWSLamdaConfig.json\");\n var operation =\"getContentList\"// \"getSingleCategoryList\"\n this.mixpanelTrack(value);\n if (value == Strings.discover_category_new)\n {\n var urlName=\"\";\n if (this.state.username == null || this.state.username == commons.guestuserkey()) { \n urlName=aws_lamda.commenapis;\n }\n else\n {\n urlName=aws_lamda.contentmanagement;\n } \n await fetch('' + aws_data.path + aws_data.stage +urlName, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization':acceestoken\n },\n body: JSON.stringify({\n \"operation\": \"getLatestStax\"\n }),\n }).then((response) => response.json())\n .then(async (responseJson) => {\n var resp = [];\n resp = responseJson;\n for (var j = 0; j < resp.length; j++) {\n resp[j].key=responseJson[j].contentid;\n resp[j].staxpreview = s3config.s3path + \"/\" + s3config.s3bucketname + \"/\" + s3config.s3storefolder + \"/Thumbnail_\" + responseJson[j].contentid + \".jpg\" + \"?time=\" + resp[j].createtime;\n }\n this.setState({\n loading: false,\n staxdata_categorized: resp,\n catgorychoosen: value\n });\n this.refs.loaderRef.hide();\n })\n .catch((error) => {\n console.error(error);\n }); \n }\n else{\n if (value == Strings.discover_category_favorite)\n {\n operation = \"getfavouriteContentList\";\n }\n var cats=this.state.categories;\n var catsLanguage=this.state.categoriesLanguage;\n var valueDisplay=\"\"\n for(var i=0;i<catsLanguage.length;i++)\n {\n if (value ==cats[i])\n {\n valueDisplay=value;\n value=catsLanguage[i];\n break;\n }\n }\n var urlName=\"\";\n if (this.state.username == null || this.state.username == commons.guestuserkey()) { \n urlName=aws_lamda.commenapis;\n }\n else\n {\n urlName=aws_lamda.contentmanagement;\n } \n await fetch('' + aws_data.path + aws_data.stage + urlName, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization':acceestoken\n },\n body: JSON.stringify({\n \"operation\": operation,\n \"category\": value,\n \"widgetname\": \"\"+this.state.searchquery,\n \"userid\": this.state.username,\n \"LastEvaluatedKey\": {}\n }),\n }).then((response) => response.json())\n .then(async (responseJson) => {\n var last_val_map = this.state.last_key_val_mapping;\n if (responseJson.hasOwnProperty(\"LastEvaluatedKey\"))\n last_val_map[value] = responseJson.LastEvaluatedKey;\n else\n delete last_val_map[value];\n var resp = [];\n\n if (value == Strings.discover_category_favorite)\n resp = responseJson;\n else\n resp = responseJson.data;\n for (var j = 0; j < resp.length; j++) {\n resp[j].staxpreview = s3config.s3path + \"/\" + s3config.s3bucketname + \"/\" + s3config.s3storefolder + \"/Thumbnail_\" + resp[j].staxid + \".jpg\" + \"?time=\" + resp[j].createtime;\n }\n this.setState({\n loading: false,\n staxdata_categorized: resp,\n catgorychoosen: valueDisplay\n });\n this.refs.loaderRef.hide(); \n })\n .catch((error) => {\n this.setState({ loading: false });\n this.refs.loaderRef.hide();\n console.error(error);\n });\n }\n }\n }", "handleCategory(event) {\n let category = event.target.innerHTML\n dispatch(fetchCategory(category))\n }", "function App() {\n // menu item to pass in our date name items\n const [menuItems, setMenuItems] = useState(items);\n\n // categories and empty array\n const [categories, setCategories] = useState(allCategories);\n\n //\n const filterItems = (category) => {\n // now we gonna set up a functionality\n if (category === \"all\") {\n setMenuItems(items);\n return; // all our items\n }\n //we go with newItem and the origin list anf filter\n const newItems = items.filter((item) => item.category === category);\n // we re looking for catogory with the same values\n // and our setmenuitems is our newitems\n setMenuItems(newItems);\n };\n\n return (\n <main>\n <section className=\"menu section\">\n <div className=\"title\">\n <h2>\n Our menu<div className=\"underline\"></div>\n </h2>\n </div>\n <Categories categories={categories} filterItems={filterItems} />\n <Menu items={menuItems} />\n </section>\n </main>\n );\n}", "_GetSubCtegoriesLEVEL1 () {\n GetAllCtegoriesByParent (this.props.category.id,1).then(Data => {\n this.setState({\n subcategories1: Data,\n })\n })\n }", "investmentCategorySelected() {\n\t\tlet\ttype,\n\t\t\t\tdirection;\n\n\t\t// Check the category selection\n\t\tif (this.transaction.category && \"object\" === typeof this.transaction.category) {\n\t\t\tswitch (this.transaction.category.id) {\n\t\t\t\tcase \"TransferTo\":\n\t\t\t\t\ttype = \"SecurityTransfer\";\n\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TransferFrom\":\n\t\t\t\t\ttype = \"SecurityTransfer\";\n\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"RemoveShares\":\n\t\t\t\t\ttype = \"SecurityHolding\";\n\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"AddShares\":\n\t\t\t\t\ttype = \"SecurityHolding\";\n\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"Sell\":\n\t\t\t\t\ttype = \"SecurityInvestment\";\n\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"Buy\":\n\t\t\t\t\ttype = \"SecurityInvestment\";\n\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"DividendTo\":\n\t\t\t\t\ttype = \"Dividend\";\n\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t// No default\n\t\t\t}\n\n\t\t\t// Update the transaction type & direction\n\t\t\tthis.transaction.transaction_type = type;\n\t\t\tthis.transaction.direction = direction;\n\t\t}\n\t}", "updateCategory(id) {\n this.setState({\n category_id: id\n });\n }", "clearSelectedCategory(categoryName){\n let categoryToClear = cloneDeep(this.state.saveData[categoryName])\n let newSelected = cloneDeep(this.state.selected) \n for (let tag of categoryToClear){\n newSelected[tag] = false;\n }\n\n this.setState({selected:newSelected})\n\n }", "categorySelected(index) {\n\t\tconst transaction = isNaN(index) ? this.transaction : this.transaction.subtransactions[index];\n\t\tlet\ttype,\n\t\t\t\tdirection,\n\t\t\t\tparentId;\n\n\t\t// Check the category selection\n\t\tif (transaction.category && \"object\" === typeof transaction.category) {\n\t\t\tif (isNaN(index)) {\n\t\t\t\tswitch (transaction.category.id) {\n\t\t\t\t\tcase \"TransferTo\":\n\t\t\t\t\t\ttype = \"Transfer\";\n\t\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"TransferFrom\":\n\t\t\t\t\t\ttype = \"Transfer\";\n\t\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"SplitTo\":\n\t\t\t\t\t\ttype = \"Split\";\n\t\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"SplitFrom\":\n\t\t\t\t\t\ttype = \"Split\";\n\t\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"Payslip\":\n\t\t\t\t\t\ttype = \"Payslip\";\n\t\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"LoanRepayment\":\n\t\t\t\t\t\ttype = \"LoanRepayment\";\n\t\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttype = \"Basic\";\n\t\t\t\t\t\t({direction} = transaction.category);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * If we have switched to a Split, Payslip or Loan Repayment and there are currently no subtransactions,\n\t\t\t\t * create some stubs, copying the current transaction details into the first entry\n\t\t\t\t */\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase \"Split\":\n\t\t\t\t\tcase \"Payslip\":\n\t\t\t\t\tcase \"LoanRepayment\":\n\t\t\t\t\t\tif (!transaction.subtransactions) {\n\t\t\t\t\t\t\ttransaction.subtransactions = [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmemo: transaction.memo,\n\t\t\t\t\t\t\t\t\tamount: transaction.amount\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// No default\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (transaction.category.id) {\n\t\t\t\t\tcase \"TransferTo\":\n\t\t\t\t\t\ttype = \"Subtransfer\";\n\t\t\t\t\t\tdirection = \"outflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"TransferFrom\":\n\t\t\t\t\t\ttype = \"Subtransfer\";\n\t\t\t\t\t\tdirection = \"inflow\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttype = \"Sub\";\n\t\t\t\t\t\t({direction} = transaction.category);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tparentId = transaction.category.id;\n\t\t}\n\n\t\t// Update the transaction type & direction\n\t\ttransaction.transaction_type = type || (isNaN(index) ? \"Basic\" : \"Sub\");\n\t\ttransaction.direction = direction || \"outflow\";\n\n\t\t// Make sure the subcategory is still valid\n\t\tif (transaction.subcategory && transaction.subcategory.parent_id !== parentId) {\n\t\t\ttransaction.subcategory = null;\n\t\t}\n\t}", "componentDidMount() {\n\n Modal.setAppElement(\"body\");\n\n let selectedCategory = \"all\";\n\n if (this.props.match) {\n\n selectedCategory = this.props.match.params.category;\n }\n\n if (selectedCategory === \"all\") {\n this.props.fetchPosts();\n } else {\n this.props.fetchCategoryPosts(selectedCategory);\n };\n\n this.props.setSelectedCategory(selectedCategory);\n\n }", "setCategories(state, categories) {\n state.categories = categories;\n }", "async componentDidMount() {\n const data = await api.getCategoryById(this.props.match.params.id);\n // stored response in the state;\n this.setState({\n category: data,\n });\n }", "componentDidMount(){\n BooksAPI.getAll().then(data =>{\n this.setState({books : data, category : Utils.categoryTitle(data)})\n // const categories = data.map(data => data.shelf);\n // const getCategories = categories.filter((item,index)=> categories.indexOf(item) === index)\n\n })\n \n }", "getInitialState() {\n return {\n categories : [\n {\n 'name' : 'ALL',\n 'imgUrl' : './test.jpg'\n },\n {\n 'name' : 'SHOE',\n 'imgUrl' : './test.jpg'\n },\n {\n 'name' : 'SKIRT',\n 'imgUrl' : './test.jpg'\n },\n {\n 'name' : 'DRESS',\n 'imgUrl' : './test.jpg'\n },\n {\n 'name' : 'BAG',\n 'imgUrl' : './test.jpg'\n },\n {\n 'name' : 'BLOUSE',\n 'imgUrl' : './test.jpg'\n },\n {\n 'name' : 'COAT',\n 'imgUrl' : '../../../../../assets/images/test.jpg'\n }\n ]\n }\n }", "categoryFilter(recipe) {\n return recipe.category === this.state.category;\n }", "getCategories() {\n\t\tfetch(`https://maximum-arena-3000.codio-box.uk/api/categories/${this.state.prop_ID}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tbody: null,\n\t\t\theaders: {\n\t\t\t\t\"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n\t\t\t}\n\t\t})\n\t\t\t.then(status)\n\t\t\t.then(json)\n\t\t\t.then(dataFromServer => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcategories: dataFromServer,\n\t\t\t\t});\n\t\t\t\tconsole.log(dataFromServer, 'categories here')\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(error)\n\t\t\t\tmessage.error('Could not get the categories. Try Again!', 5);\n\t\t\t});\n\t}", "get category() {\n\t\treturn this.__category;\n\t}", "function Category() {\n const { categoryId } = useParams();\n\n const filteredCategories = categoriesArray.filter((category) => category.categoryId == categoryId);\n const category = filteredCategories[0];\n console.log(category)\n const breadcrumbPaths = [\n { link: '/', label: \"Home\" },\n { link: '/categories/', label: \"Categories\" },\n { label: category.name },\n ];\n\n\n const categoryCard =\n <div className=\"row\">\n <div className=\"col-md-4 justify-content-center align-self-center px-1 pb-3\">\n <NavLink to={`/categories/` + category.categoryId}>\n <img className=\"img-fluid\" src={category.image} />\n </NavLink>\n </div>\n <div className=\"col-md-8 \">\n <h5 className=\"card-title ps-3\">\n {category.name}\n </h5>\n <div className=\"card-text ps-3\">\n <p >{category.description} </p>\n <p >Lorem ipsum dolor, sit amet consectetur adipisicing elit. Odio, possimus. Reiciendis, placeat aliquid, velit nulla culpa voluptatibus nisi eum facilis corporis officiis, aperiam eligendi corrupti magni tempore deserunt ad! Reprehenderit. </p>\n <p >Lorem ipsum dolor, sit amet consectetur adipisicing elit. Odio, possimus. Reiciendis, placeat aliquid, velit nulla culpa voluptatibus nisi eum facilis corporis officiis, aperiam eligendi corrupti magni tempore deserunt ad! Reprehenderit. </p>\n </div>\n </div>\n </div>\n // const { categoryId } = useParams();\n // let location = useLocation();\n // console.log(location)\n\n // if (location.pathname === \"/categories/Landscapes\") {\n // categoryToShow = categoriesArray.filter(category => category.categoryId === \"Landscapes\")\n // } else if (location.pathname === \"/categories/Flowers\") {\n // categoryToShow = categoriesArray.filter(category => category.categoryId === \"Flowers\")\n // } else {\n // categoryToShow = categoriesArray.filter(category => category.categoryId === \"Cats\")\n // }\n\n return (\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col\">\n <Breadcrumb paths={breadcrumbPaths} />\n </div>\n </div>\n <div className=\"row\">\n <div className=\"col\">\n {categoryCard}\n </div>\n </div>\n </div>\n )\n}", "productSubcategoryOnChangeHandler(e) {\n const unProcesedKey = e._targetInst.key\n const ProductSubCategoryKey = unProcesedKey.split('PRODUCT_SUBCATEGORY_')[unProcesedKey.split('PRODUCT_').length - 1]\n this.props.fetchModeByProductIdWatcher({ makeId: this.state.makeId, categoryId: this.state.categoryId, subCategoryId: ProductSubCategoryKey })\n\n }", "componentWillReceiveProps(nextProps) {\n const url = `/catalog/${nextProps.match.params.category}`;\n this.setItemsState(url);\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}" ]
[ "0.753704", "0.7270922", "0.6834107", "0.67346513", "0.66304016", "0.6567567", "0.6545415", "0.65225726", "0.6500009", "0.64858115", "0.6455819", "0.64463675", "0.6436887", "0.6428612", "0.6424423", "0.6397571", "0.63922065", "0.6371321", "0.6355915", "0.63017786", "0.6300156", "0.6298633", "0.62981933", "0.6260553", "0.62586695", "0.62247497", "0.62128186", "0.6211947", "0.62043846", "0.62036115", "0.6196287", "0.61801213", "0.61801213", "0.6169387", "0.6157507", "0.6155231", "0.6148328", "0.61426896", "0.61128044", "0.6096102", "0.60934997", "0.6089756", "0.60841024", "0.60452616", "0.6034546", "0.60331035", "0.60074574", "0.59620476", "0.5959241", "0.5958132", "0.5952097", "0.5952097", "0.5934369", "0.59329176", "0.59314364", "0.59314364", "0.59314364", "0.59314364", "0.591946", "0.59177464", "0.5914229", "0.59116256", "0.5899914", "0.58976847", "0.5893516", "0.5886116", "0.5884995", "0.58786553", "0.5872328", "0.58630574", "0.5853906", "0.58528715", "0.58482236", "0.5841316", "0.5835611", "0.5812549", "0.58054686", "0.58024836", "0.58020097", "0.57986826", "0.57721514", "0.57688135", "0.576202", "0.574868", "0.57357115", "0.5733927", "0.57256687", "0.5724524", "0.57226264", "0.571733", "0.571493", "0.5711364", "0.57037413", "0.56982875", "0.56981266", "0.5681518", "0.5681323", "0.56749916", "0.5662397", "0.56605786" ]
0.6299497
21
This function binds the action creators to the this component and have them access as props selectMeal is the action when sub category is clicked
function matchDispatchToProps(dispatch) { return bindActionCreators({ selectMeal: selectMeal }, dispatch); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createListItems() {\n //This is used to give active class to the selected category\n jQuery('.active_cat').removeClass('active_cat');\n jQuery(\"#category_\" + this.props.category.cat_id).addClass(\"active_cat\");\n\n //Store the selected meal under sub category(sub menu) to get access in order page\n if (this.props.meal)\n sessionStorage.setItem(\"selected_meal\", JSON.stringify(this.props.meal));\n\n //creates the sub category(sub menu) cards layout, selectMeal is the action triggered when meal card is clicked\n return this.props.category.sub_cat.map((meal, index) => {\n return (\n <div key={index} className=\"col-md-4 col-lg-3 col-sm-6 col-xs-12 cards\" onClick={() => this.props.selectMeal(meal)}>\n <img src={meal.subcat_thumbnail} alt=\"meal pic\" />\n <div style={{ padding: '5px' }}>\n <label>{meal.subcat_name}</label>\n <p>{meal.subcat_desc}</p>\n <label style={{ right: '0', position: 'absolute', bottom: '0', marginRight: '20px', color: 'red' }}>{meal.subcat_price}</label>\n </div>\n </div>\n );\n });\n }", "function Categories() {\n const dispatch = useDispatch();\n const category = useSelector((state) => state.categories.categoryList);\n\n \n const activate = (category, description) => {\n dispatch(action.activated(category, description))\n }\n\n return (\n <div>\n <Typography>Browse our Categories</Typography>\n {category.map((item) => {\n return <Button key={item._id} onClick={() => activate(item.name, item.description)}>{ item.name }</Button>\n })}\n </div>\n );\n}", "onChangeCategory(e) {\n\t\tthis.props.onChangeCategory(e.target.value);\n\t}", "function App() {\n const [mealCategory, setmealCategory] = useState({ category: \"\", meals: []});\n\n const addmealCategory = (category) => {\n setmealCategory({ ...mealCategory, category})\n }\n\n const addMeal = (meal) => {\n let newMeals;\n if(!mealCategory.meals.includes(meal)) {\n newMeals = [...mealCategory.meals, meal];\n } else {\n newMeals = mealCategory.meals.filter(item => item !== meal);\n }\n setmealCategory({ ...mealCategory, meals:[newMeals]})\n }\n /*const [menuItems, setMenuItems] = useState(items);\n const [categories, setCategories] = useState(allCategories);\n\n const filterItems = (category) => {\n if (category === \"flex meal\") {\n setMenuItems(items);\n return console.log(setMenuItems(items));\n }\n const newItems = items.filter((item) => item.category === category);\n setMenuItems(newItems);\n }; */\n return (\n <>\n <Header />\n <div className=\"w-4/5 mx-auto\">\n \n <Switch>\n <Route path=\"/category\">\n <Category addmealCategory={addmealCategory} mealCategory={mealCategory} />\n </Route>\n <Route path=\"/flex\">\n <Flex addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/breakfast\">\n <Breakfast addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/lunch\">\n <Lunch addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/dinner\">\n <Dinner addMeal={addMeal} mealCategory={mealCategory}/>\n </Route>\n <Route path=\"/menu\">\n <Menu/>\n </Route>\n <Route path=\"/order\">\n <Order mealCategory={mealCategory} />\n </Route>\n <Route path=\"/\" component={Home}/>\n </Switch>\n </div>\n </>\n );\n}", "function CategorysList(props){\n if(props.category.length==0){\n props.dispatch(startSetCategorys())\n }\n const handleShow=(id)=>{\n props.history.push(`/category/show/${id}`)\n }\n // var i= false\n // const handleEdit=(id)=>{\n // i= true \n // }\n const handleRemove=(id)=>{\n Swal.fire({\n title:'Are you sure to remove this',\n text:\"Youn wont be able to recover this\",\n icon:\"warning\",\n showCancelButton:true,\n confirmButtonText:\"Yes, delete it\",\n cancelButtonText:\"No, keep it\"\n }).then((result)=>{\n if(result.value){\n props.dispatch(startDeleteCategory(id))\n }\n })\n \n }\n return(\n <div className=\"container\">\n <h2>Categories {props.category.length}</h2>\n \n {props.category.map(category=>{\n return(\n <div className=\"alert alert-success\" role=\"alert\">\n <ul key={category._id} className=\"list-group\">\n <li className=\"list-group-item\"><strong>{category.name} </strong>\n <br/>\n <button className=\"btn btn-primary\" onClick={()=>{handleShow(category._id)}}>Show</button>\n &nbsp;&nbsp;\n \n <button className=\"btn btn-danger\" onClick={()=>{handleRemove(category._id)}}>Remove</button></li>\n </ul>\n </div>\n )\n })}\n \n <button className=\"btn btn-link\"><Link to=\"/category/new\" >Add Category</Link></button>\n \n </div>\n )\n}", "setSub() {\n\t\tconsole.log('called constructor setSub');\n\t\tlet sub_category_selected_display = [],\n\t\t\tcategory_selected = this.state.category_selected;\n\t\tif ((this.state.category_selected && this.state.category_selected.length) || (this.state.sub_category_selected && this.state.sub_category_selected.length)) {\n\t\t\tif (this.state.category_selected && this.state.category_selected.length) {\n\t\t\t\tthis.state.category_selected.map((id) => {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\tif (id == op.id) {\n\t\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\t\tthis.state.sub_category_selected.map((sub_id) => {\n\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_id) === -1) {\n\t\t\t\t\t\t\tsub_category_selected_display.push(sub_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\tthis.state.sub_category_selected.map((data) => {\n\t\t\t\t\tif (sub_category_selected_display.indexOf(data) === -1) {\n\t\t\t\t\t\tsub_category_selected_display.push(data);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.props.location.search == '?cat=[]&subcat=[]&layer=[]') {\n\n\t\t\t} else {\n\t\t\t\t/*if (this.state.category_list && this.state.category_list.length) {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// this.setCategory(true, op.id);\n\t\t\t\t\t\tif (category_selected.indexOf(op.id) === -1) {\n\t\t\t\t\t\t\tcategory_selected.push(op.id);\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\tthis.setState({\n\t\t\tsub_category_selected_display: sub_category_selected_display,\n\t\t\tcategory_selected: category_selected\n\t\t});\n\t}", "constructor(props) {\n super(props);\n this.state = {\n categories: [\n {'name': 'gas', 'color': '#5fd8b9'},\n {'name': 'clothing', 'color': '#69698C'},\n {'name': 'food', 'color': '#F44E6A'},\n {'name': 'health', 'color': '#FC8FB4'},\n {'name': 'house', 'color': '#57D68A'},\n {'name': 'going out', 'color': '#B09EE5'}\n ],\n category: \"\",\n color: \"\",\n date: \"\",\n total: \"\",\n payee: \"\"\n }\n\n this.selectCategory = this.selectCategory.bind(this);\n this.handleInputChange = this.handleInputChange.bind(this);\n this.submitData = this.submitData.bind(this);\n }", "function selectCategoryClickHandler(ev) {\n selectCategory(ev.target);\n}", "constructor(props) {\n super(props);\n this.addAction = this.addAction.bind(this);\n }", "render(){\n let key = 0;\n let id = 0;\n return(\n <div className=\"app\">\n <h1 className=\"subHeader\">\n Meals:\n </h1>\n <p className='text'> For the days selected above please indicate the\n which meal you would like as well as the choices for each meal. We do\n require your group to have either a food and beverage component or\n reservations in our bungalows. Please note that if you do not have a\n coordinated food service prior to your arrival, the likelihood\n that we would be able to accommodate a large party in our dining\n room as a walk-in would be extremely limited. To see\n the choices available please look at our attached menus.\n </p>\n <div className=\"mealPeople\">\n Number Of People Eating:\n <input type=\"text\" name=\"Number of People Eating\"\n value={this.state.numPeople} onChange={this.handlePeople}>\n </input>\n </div>\n <ul className=\"meals\">\n {this.props.dates.map(date =>\n (<Meal key={key++} id={id++} date={date}\n handleMeals={this.handleMeals} />))}\n </ul>\n <div className=\"menuParent\">\n <Popup trigger={<button> Breakfast Menu</button>}\n modal position=\"center\">\n {close => (\n <div className=\"modal\">\n <button className=\"close\" onClick={close}>\n &times;\n </button>\n <img className=\"menu\" src={breakfast} alt=\"\" />\n </div>\n )}\n </Popup>\n <Popup trigger={<button> Lunch Menu </button>} modal position=\"center\">\n {close => (\n <div className=\"modal\">\n <button className=\"close\" onClick={close}>\n &times;\n </button>\n <img className=\"menu\" src={lunch} alt=\"\" />\n </div>\n )}\n </Popup>\n <Popup trigger={<button> Dinner Menu </button>} modal position=\"center\">\n {close => (\n <div className=\"modal\">\n <button className=\"close\" onClick={close}>\n &times;\n </button>\n <img className=\"menu\" src={dinner} alt=\"\" />\n </div>\n )}\n </Popup>\n </div>\n </div>\n )\n }", "addHotel() {\n\t\tthis.props.onClick()\n\t}", "function mapDispatchToProps(dispatch){\n //whenever selectBodyPart is called, the result should be passed to all of our reducers\n return bindActionCreators({selectPain: selectPain, selectSeverity: selectSeverity}, dispatch); //takes all actions and sends them to all reducers\n //this.props.selectBodyPart will call our action creator\n //selectBodyPart is a plain function that returns an object. The purpose of binding is to take selectBodyPart and give it to the reducers\n}", "showAddCategoryModalDialog() {\n var categoryModalHeader = \"Adding category to categories list\";\n var categoryData = {};\n\n categoryData = {\n name: ''\n };\n\n this.props.dispatch({type: CategoryActions.ActionTypes.CATEGORY.SHOW_ADD_EDIT_MODAL_DIALOG,\n categoryModalHeader: categoryModalHeader, categoryIndex: -1, categoryData: categoryData});\n }", "function HappyMealMenu() {\n \n const dispatch = useDispatch();\n const menu = useSelector(state => state.happyMeal.menu, shallowEqual);\n \n // use 'react-redux' to load in happy meals from backend. \n useEffect(() => {\n dispatch(fetchMenuFromAPI('LOAD_HAPPY_MEAL_MENU', 'happy-meal'));\n }, [dispatch]);\n \n return (\n // render happy meal items as a list of buttons. \n <div className=\"Happy-Meals-Container\">\n {menu && menu.map(food => \n <DessertButton \n key={uuidv4()}\n id={uuidv4()} \n name={food.name} \n image={food.imagesrc}\n />)\n }\n </div>\n )\n}", "init() {\n this.category = this.inputs.getProp('category');\n }", "onCategoryChange(category) {\n // Update the state\n this.setState({value: category});\n // Close the popup\n this.onClosePopup();\n // Callback\n if (this.props.onChange) this.props.onChange(category);\n }", "addAction() {\r\n\r\n // Show popup\r\n SelectActionPopup.show({ selectedID: this.state.triggerID, onSelect: plugin => {\r\n\r\n // Add new action\r\n var action = {}\r\n action.id = uuidv4()\r\n action.pluginID = plugin.pluginID\r\n action.options = {}\r\n this.state.actions.push(action)\r\n this.forceUpdate()\r\n\r\n }})\r\n\r\n }", "renderCategory(){\n return(\n <Category category={window.category} onClick={(product, isEnter) => this.handleClick(product, isEnter)} />\n );\n}", "componentWillMount() {\n this.props.actions.getListCategory();\n }", "constructor(props) {\n super(props);\n\n this.selectRecipe = this.selectRecipe.bind(this)\n }", "function Categories(props) {\n const { getAll, categories } = props;\n\n useEffect(() => {\n getAll();\n }, [getAll]);\n\n const catsToRender = [];\n\n if (categories) {\n categories.forEach((category, i) => {\n catsToRender.push(\n <MenuItem\n className=\"menu-item\"\n value={category.name}\n key={i}\n onClick={() => {\n props.changeCategory(category);\n }}\n >\n {category.displayName || category.name}\n </MenuItem>\n );\n });\n }\n\n return (\n <div id=\"categories\" className=\"cont-child\">\n <h2>Browse our Categories</h2>\n <Select\n value={props.currentCategory ? props.currentCategory.name : ''}\n className=\"cat-select\"\n >\n {catsToRender}\n </Select>\n </div>\n );\n}", "function categorySelect() {\n\t//카테고리 선택 안했을때 -> hamburger\n\tmenus.forEach((menu) => {\n\t\tif (menu.dataset.type !== \"hamburger\") {\n\t\t\t// console.log(menu.dataset.type);\n\t\t\tmenu.classList.add(\"invisible\");\n\t\t}\n\t});\n\n\t//카테고리 선택시\n\tcategory.addEventListener(\"click\", (event) => {\n\t\tconst filter = event.target.dataset.filter;\n\t\tif (filter == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t//선택 카테고리 색상 변경\n\t\tconst active = document.querySelector(\".category_btn.selected\");\n\t\tactive.classList.remove(\"selected\");\n\t\tevent.target.classList.add(\"selected\");\n\n\t\t//메뉴 선별\n\t\tmenus.forEach((menu) => {\n\t\t\tif (filter === menu.dataset.type) {\n\t\t\t\tmenu.classList.remove(\"invisible\");\n\t\t\t} else {\n\t\t\t\tmenu.classList.add(\"invisible\");\n\t\t\t}\n\t\t});\n\t});\n}", "handleClick(){\n\t\tthis.props.onSelect(this.props.name);\n\t}", "render(){\n return(\n <div>\n <h1 className = 'container' style={{marginLeft : '40%'}}>MANAGE CATEGORY</h1>\n <div className = 'container'>\n <div className='row'>\n <div className= 'col-md-1'><input type='button' value='Add User' style={{marginBottom:'10px'}} className='btn btn-primary' onClick={()=>this.setState({isAdd:true})}/></div>\n <div className= 'col-md-3'><input type='text' placeholder='Filter Kategory' ref= 'filtercategory' onChange={this.onBtnFilter} className= 'form-control'/></div>\n {/* <div className= 'col-md-1'><input type='button' value='Click' onClick={this.onBtnFilter} className= 'btn btn-info'/></div> */}\n </div>\n {\n this.state.isAdd===true?\n <div className='row'>\n <div className='col-3'>\n <input type='text' className='form-control' ref='category' placeholder='masukkan category'/>\n </div>\n <div className='col-3'>\n <input type='button' className='btn btn-primary' value='Save' onClick={this.addCategory}/>\n <input type='button' className='btn btn-danger' value='Cancel' onClick={this.cancelCategory}/>\n </div>\n \n \n </div>\n : null\n }\n <table className='table'>\n <thead>\n <th>NO</th>\n <th>CATEGORY</th>\n <th>EDIT</th>\n <th>DELET</th>\n </thead>\n <tbody>\n {this.renderCategory()}\n </tbody>\n </table>\n </div>\n </div>\n )\n }", "function mapDispatchToProps(dispatch) {\r\n // Whenever selectMenu is called the result should be passed to all of our reducers, dispatch pass selectMenu to all reducers\r\n return bindActionCreators(\r\n {\r\n SelectMenu: SelectMenu,\r\n desingSelected: desingSelected,\r\n logoSelected: logoSelected,\r\n SelectView: SelectView\r\n },\r\n dispatch\r\n );\r\n}", "function mapDispatchToProps (dispatch) {\n return {\n selectCategory: (data) => dispatch(selectCategory(data)),\n };\n}", "function addCategory(e) {\n if (e.value === 'entree') {\n createCategorySection('Entrees', 'entree', 'Add Entree')\n } else if (e.value === 'appetizer') {\n createCategorySection('Appetizers', 'appetizer', 'Add Appetizer')\n } else if (e.value === 'dessert') {\n createCategorySection('Desserts', 'dessert', 'Add Dessert')\n } else if (e.value === 'sides') {\n createCategorySection('Sides', 'sides', 'Add Side')\n } else if (e.value === 'addOn') {\n createCategorySection('Add-On', 'addOn', 'Add Add-On')\n } else if (e.value === 'soupOrSalad') {\n createCategorySection('Soups & Salads', 'soupOrSalad', 'Add Soup or Salad')\n } else if (e.value === 'kidsMenu') {\n createCategorySection('Kids Menu Item', 'kidsMenuItem', 'Add Kids Item')\n } else if (e.value === 'otherFood') {\n createCategorySection('Other Food', 'otherFood', 'Add Other Food')\n } else if (e.value === 'wine') {\n createCategorySection('Wine', 'wine', 'Add Wine')\n } else if (e.value === 'beer') {\n createCategorySection('Beer', 'beer', 'Add Beer')\n } else if (e.value === 'cocktails') {\n createCategorySection('Cocktails', 'cocktail', 'Add Cocktail')\n } else if (e.value === 'nonAlcoholic') {\n createCategorySection('Non-Alcoholic', 'nonAlcoholic', 'Add Non-Alcoholic')\n } else if (e.value === 'afterDinnerDrink') {\n createCategorySection('After Dinner Drinks', 'afterDinnerDrink', 'Add After Dinner Drink')\n } else if (e.value === 'otherDrink') {\n createCategorySection('Other Drinks', 'otherDrink', 'Add Other Drink')\n }\n $(\".categorySelector option[value='\" + e.value + \"']\").remove();\n $('select').material_select();\n //Found this line from stackoverflow and it fixed the \"need to click dropdown twice\" bug so I'm gonna keep it\n document.querySelectorAll('.select-wrapper').forEach(t => t.addEventListener('click', e=>e.stopPropagation()))\n}", "function FavoriteItem(props) {\n const dispatch = useDispatch();\n const [category, setCategory] = useState('none')\n const addCategory = (event) => {\n console.log(event.target.value)\n dispatch({type: 'ADD_CATEGORY', payload: props.id, catId: event.target.value})\n }\n useEffect(() => {\n checkCat();\n }, []);\n console.log(props.catId)\n const checkCat = () => {\n switch (props.catId) {\n case 1:\n setCategory('Funny');\n break;\n case 2:\n setCategory('Cohort');\n break;\n case 3:\n setCategory('Cartoon');\n break;\n case 4:\n setCategory('NSFW');\n break;\n case 5:\n setCategory('Meme');\n break;\n default:\n }\n }\n \n \n return(\n <div className=\"item\">\n <p><img src={props.image} /></p>\n <br />\n <p>Add Category</p>\n <img src={props.url}/>\n {category === \"none\" ? (\n <>\n <button value=\"1\" onClick={(event) => addCategory(event)}>Funny</button> \n <button value=\"2\" onClick={(event) => addCategory(event)}>Cohort</button> \n <button value=\"3\" onClick={(event) => addCategory(event)}>Cartoon</button> \n <button value=\"4\" onClick={(event) => addCategory(event)}>NSFW</button> \n <button value=\"5\" onClick={(event) => addCategory(event)}>Meme</button> \n </>\n ) : <p>{category}</p>}\n </div>\n )\n}", "setCategory(obj){\n console.log(\"setCategory : \" + obj.target.value)\n this.setState({category: obj.target.value}, function(){this.getSubCategoryList()});\n }", "componentDidMount() {\n\n Modal.setAppElement(\"body\");\n\n let selectedCategory = \"all\";\n\n if (this.props.match) {\n\n selectedCategory = this.props.match.params.category;\n }\n\n if (selectedCategory === \"all\") {\n this.props.fetchPosts();\n } else {\n this.props.fetchCategoryPosts(selectedCategory);\n };\n\n this.props.setSelectedCategory(selectedCategory);\n\n }", "render(){\n const {foods,sortTypes} = this.state\n const {category: {id, name, sub_categories}} = this.props\n let categories = []\n if (sub_categories.length > 0) {\n categories = [{id:id,name:'全部'},...sub_categories]\n }\n console.log(sub_categories.length)\n const ds = this.state.dataSource.cloneWithRows(foods)\n return (\n <View backgroundColor={gColors.background} style={{flex:1}}>\n <Header\n title={this.props.category.name}\n onBack={this._onBack.bind(this)}\n style={{zIndex: 3}}\n renderRightItem={this._renderRightItem.bind(this)}\n onRight={this._onRight.bind(this)}\n />\n {sortTypes.length>0 && <FoodSortTypesView customStyle={{zIndex:1}}\n sortTypes={sortTypes}\n clickSortTypes={this._clickSortTypes.bind(this)}/> }\n\n <ListView style={{backgroundColor: 'rgba(220, 220, 220, 0.2)'}}\n dataSource={ds}\n renderRow={this._renderRow.bind(this)}\n enableEmptySections\n renderSeparator={this._renderSeparator.bind(this)}\n onEndReached={this._loadMore.bind(this)}\n renderFooter={this._renderFooter.bind(this)}/>\n\n {categories.length>0 && <PopMenus ref={(pop)=>this.popMenus = pop}\n categories={categories}\n selectCatefory={this._selectCatefory.bind(this)}/>}\n <Toast ref={(toast)=>this.toast = toast}/>\n <Loading isShow={this.state.isFetching}/>\n </View>\n )\n }", "onCategoryChange(categorySelected) {\n this.setState({\n categorySelected\n });\n if (categorySelected === null) {\n this.state.props.categoryChangeListener(-1);\n } else {\n this.state.props.categoryChangeListener(categorySelected.value)\n }\n }", "render(){\n return(<div>\n <Grid textAlign='center'>\n <Button.Group>\n <Button value=\"All\" onClick={(event) => this.props.handleCategoryChange(event)}> All</Button>\n <Button.Or/>\n <Button value=\"Face\" onClick={(event) => this.props.handleCategoryChange(event)}> Face</Button>\n <Button.Or/>\n <Button value=\"Eye\" onClick={(event) => this.props.handleCategoryChange(event)}> Eye </Button>\n <Button.Or/>\n <Button value=\"Lip\" onClick={(event) => this.props.handleCategoryChange(event)}> Lip</Button>\n <Button.Or/>\n <Button value=\"Cheek\" onClick={(event) => this.props.handleCategoryChange(event)}> Cheek</Button>\n </Button.Group>\n </Grid>\n </div>\n )\n }", "render() {\n const {\n category,\n sel_cat,\n sel_Sub_cat,\n Sel_Child_Cat_edit,\n Sel_Child_Sub_Cat_edit,\n Sel_Child_Cat_Delete,\n Sel_Child_Sub_Cat_Delete\n } = this.state;\n return (\n <div className=\"Child_Category_Master\">\n <Router>\n <Container>\n <Row>\n <Col>\n <center>\n <img src=\"./images/logo2.png\" width=\"275px;\" alt=\"\" />\n </center>\n </Col>\n </Row>\n <Row>\n <Col>\n <div className=\"card\">\n <div>\n <Link to=\"/Dashboard_Admin\">\n <span>\n <i className=\"fas fa-reply-all font_size\" />\n </span>\n </Link>\n <span>\n <i className=\"fas fa-sign-out-alt font_size float-right\" />\n </span>\n </div>\n <h1 className=\"heading\">\n <center>Child Category Master</center>\n </h1>\n <Tabs defaultActiveKey=\"New\" id=\"uncontrolled-tab-example\">\n {/* create tab */}\n <Tab eventKey=\"New\" title=\"New\" className=\"text-center\">\n <div>\n <Form>\n <Form.Group as={Row} controlId=\"formPlaintextEmail\">\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Cat\"\n onChange={this.Sel_Child_Cat}\n >\n <option>Choose Category</option>\n {category.map(item => (\n <option value={item.id}>\n {item.CategoryName}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"2\" />\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Sub Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Sub_Cat\"\n onChange={this.Sel_Child_Sub_Cat}\n >\n <option>Choose Sub Category</option>\n {sel_cat.map(item => (\n <option value={item.id}>\n {item.Sub_Category_Name}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"2\" />\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Child Category Name\n </Form.Label>\n <Col sm=\"6\">\n <Form.Control\n type=\"text\"\n ref=\"myInput_child_cat_insert\"\n placeholder=\"Enter the Child Category Name\"\n />\n </Col>\n <Col sm=\"6\" />\n <Col sm=\"4\">\n <div className=\"btn_end\">\n <Button\n variant=\"success\"\n onClick={this.Child_Category_submit}\n >\n Save\n </Button>\n </div>\n </Col>\n </Form.Group>\n </Form>\n </div>\n </Tab>\n {/* create tab End */}\n\n {/* Edit tab start */}\n <Tab eventKey=\"Edit\" title=\"Edit\" className=\"text-center\">\n <div>\n <Form>\n <Form.Group as={Row} controlId=\"formPlaintextEmail\">\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Cat_Edit\"\n onChange={this.Sel_Child_Cat_edit}\n >\n <option>Choose Category</option>\n {category.map(item => (\n <option value={item.id}>\n {item.CategoryName}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"2\" />\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Sub Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Sub_Cat_Edit\"\n onChange={this.Sel_Child_Sub_Cat_edit}\n >\n <option>Choose Sub Category</option>\n {Sel_Child_Cat_edit.map(item => (\n <option value={item.id}>\n {item.Sub_Category_Name}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"2\" />\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Child Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Child_Cat_Edit\"\n >\n <option>Choose Child Category</option>\n\n {Sel_Child_Sub_Cat_edit.map(item => (\n <option value={item.id}>\n {item.Child_Category_Name}\n </option>\n ))}\n </Form.Control>\n </Col>\n </Form.Group>\n <Form.Group as={Row} controlId=\"formPlaintextEmail\">\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Replace With\n </Form.Label>\n <Col sm=\"6\">\n <Form.Control\n type=\"text\"\n ref=\"myInput_Child_cat_edit\"\n placeholder=\"Please Enter the Child Category name to edit\"\n />\n </Col>\n <Col sm=\"6\" />\n <Col sm=\"4\">\n <div className=\"btn_end\">\n <Button\n variant=\"primary\"\n onClick={this.Child_Category_Edit_submit}\n >\n Update\n </Button>\n </div>\n </Col>\n </Form.Group>\n </Form>\n </div>\n </Tab>\n {/* Edit tab End */}\n\n {/* Delete tab start */}\n <Tab\n eventKey=\"Delete\"\n title=\"Delete\"\n className=\"text-center\"\n >\n <div>\n <Form>\n <Form.Group as={Row} controlId=\"formPlaintextEmail\">\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Cat_Delete\"\n onChange={this.Sel_Child_Cat_Delete}\n >\n <option>Choose Category</option>\n {category.map(item => (\n <option value={item.id}>\n {item.CategoryName}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"2\" />\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Sub Category\n </Form.Label>\n <Col className=\"input_space_bot\" sm=\"6\">\n <Form.Control\n as=\"select\"\n ref=\"mySelect_child_Sub_Cat_Delete\"\n onChange={this.Sel_Child_Sub_Cat_Delete}\n >\n <option>Choose Sub Category</option>\n {Sel_Child_Cat_Delete.map(item => (\n <option value={item.id}>\n {item.Sub_Category_Name}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"2\" />\n <Col sm=\"2\" />\n <Form.Label column sm=\"2\">\n Choose Child Category\n </Form.Label>\n <Col sm=\"6\">\n <Form.Control as=\"select\" ref=\"Child_Cat_Delete\">\n <option>Choose Child Category</option>\n {Sel_Child_Sub_Cat_Delete.map(item => (\n <option value={item.id}>\n {item.Child_Category_Name}\n </option>\n ))}\n </Form.Control>\n </Col>\n <Col sm=\"6\" />\n <Col sm=\"4\">\n <div className=\"btn_end\">\n <Button\n variant=\"danger\"\n onClick={this.Child_Category_Delete}\n >\n Delete\n </Button>\n </div>\n </Col>\n </Form.Group>\n </Form>\n </div>\n </Tab>\n {/* Delete tab End */}\n </Tabs>\n </div>\n </Col>\n </Row>\n </Container>\n </Router>\n </div>\n );\n }", "addMeal(e, newFood) {\n e.preventDefault()\n\n console.log(newFood)\n let newState = { ...this.state };\n this.state.Foodie.push(newFood)\n this.setState(newState);\n\n this.switchMenu();\n\n }", "render() {\n const subtitle = 'Put your life in the hands of a computer';\n\n return (\n <div>\n <Header subtitle={subtitle} />\n <div className=\"container\">\n <Action\n hasOptions={this.state.options.length > 0}\n handlePick={this.handlePick}\n />\n <div className=\"widget\">\n {/* pass the handleDeleteOption from Options to Option */}\n <Options\n options={this.state.options}\n handleDeleteOptions={this.handleDeleteOptions}\n handleDeleteOption={this.handleDeleteOption}\n />\n <AddOption handleAddOption={this.handleAddOption} /> \n </div>\n </div>\n <OptionModal\n selectedOption={this.state.selectedOption}\n handleClearSelectedOption={this.handleClearSelectedOption}\n />\n </div>\n );\n }", "function mealReferenceAddEditMealDialog(selection,e) {\n console.log(e)\n // Add or Edit\n const entryType = e.target.dataset.type;\n console.log(entryType);\n // Grab 'meals-reference' div\n container = document.querySelector('.meals-reference');\n // Meal Object\n let originalMealObject;\n let newMealObject;\n\n // If Editing an existing meal\n if(entryType == 'edit-meal'){\n mealsReferenceData.forEach(meal => {\n meal.name == selection ? originalMealObject = meal : '';\n });\n }else{\n originalMealObject = {\n name: '',\n type: '',\n link: '',\n season: ''\n }\n }\n\n // *** Popup Creation\n // Overlay\n const editMealOverlay = document.createElement('div');\n editMealOverlay.classList.add('overlay');\n // Modal\n const editMealModal = document.createElement('div');\n editMealModal.classList.add('modal');\n\n // ** Heading\n const editMealModalHeading = document.createElement('h2');\n const editMealModalHeadingText = entryType == 'edit-meal' ? document.createTextNode(`Editing Meal: ${originalMealObject.name}`) : document.createTextNode(`Adding New Meal`);\n editMealModalHeading.appendChild(editMealModalHeadingText);\n editMealModal.appendChild(editMealModalHeading);\n\n // ** Labels & Inputs\n // * Meal Name - Text\n const editMealModalNameContainer = document.createElement('div');\n // Label\n const editMealModalNameLabel = document.createElement('label');\n const editMealModalNameLabelText = document.createTextNode('Meal Name: ');\n editMealModalNameLabel.appendChild(editMealModalNameLabelText);\n editMealModalNameContainer.appendChild(editMealModalNameLabel);\n // Text Input\n const editMealModalNameInput = document.createElement('input');\n editMealModalNameInput.setAttribute('type', 'text');\n editMealModalNameInput.value = originalMealObject.name;\n editMealModalNameContainer.appendChild(editMealModalNameInput);\n // Append name container to main container\n editMealModal.appendChild(editMealModalNameContainer);\n\n // * Meal Type - Select\n const editMealModalTypeContainer = document.createElement('div');\n // Label\n const editMealModalTypeLabel = document.createElement('label');\n const editMealModalTypeLabelText = document.createTextNode('Meal Type: ');\n editMealModalTypeLabel.appendChild(editMealModalTypeLabelText);\n editMealModalTypeContainer.appendChild(editMealModalTypeLabel);\n const editMealModalTypeSelect = document.createElement('select');\n // Select Input\n settingsData.mealTypes.forEach(type => {\n const option = document.createElement('option');\n option.value = type;\n const optionText = document.createTextNode(type);\n option.appendChild(optionText);\n editMealModalTypeSelect.appendChild(option)\n })\n // Set select input to original meal's type\n for (let i = 0; i < editMealModalTypeSelect.options.length; i++){\n editMealModalTypeSelect.options[i].value == originalMealObject.type ? editMealModalTypeSelect.selectedIndex = i : '';\n }\n editMealModalTypeContainer.appendChild(editMealModalTypeSelect);\n editMealModal.appendChild(editMealModalTypeContainer);\n\n // * Meal Link - URL\n const editMealModalLinkContainer = document.createElement('div');\n // Label\n const editMealModalLinkLabel = document.createElement('label');\n const editMealModalLinkLabelText = document.createTextNode('Meal Link: ');\n editMealModalLinkLabel.appendChild(editMealModalLinkLabelText);\n editMealModalLinkContainer.appendChild(editMealModalLinkLabel);\n // Text Input\n const editMealModalLinkInput = document.createElement('input');\n editMealModalLinkInput.setAttribute('type', 'url');\n editMealModalLinkInput.value = originalMealObject.link;\n editMealModalLinkContainer.appendChild(editMealModalLinkInput);\n // Append name container to main container\n editMealModal.appendChild(editMealModalLinkContainer);\n\n // * Meal Season - Select\n const editMealModalSeasonContainer = document.createElement('div');\n // Label\n const editMealModalSeasonLabel = document.createElement('label');\n const editMealModalSeasonLabelText = document.createTextNode('Meal Season: ');\n editMealModalSeasonLabel.appendChild(editMealModalSeasonLabelText);\n editMealModalSeasonContainer.appendChild(editMealModalSeasonLabel);\n const editMealModalSeasonSelect = document.createElement('select');\n // Select Input\n settingsData.mealSeasons.forEach(season => {\n const option = document.createElement('option');\n option.value = season;\n const optionText = document.createTextNode(season);\n option.appendChild(optionText);\n editMealModalSeasonSelect.appendChild(option)\n })\n // Set select input to original meal's type\n for (let i = 0; i < editMealModalSeasonSelect.options.length; i++) {\n editMealModalSeasonSelect.options[i].value == originalMealObject.season ? editMealModalSeasonSelect.selectedIndex = i : '';\n }\n editMealModalSeasonContainer.appendChild(editMealModalSeasonSelect);\n editMealModal.appendChild(editMealModalSeasonContainer);\n\n // Finish & Cancel Buttons\n const editMealModalButtonContainer = document.createElement('div');\n const editMealModalFinishButton = document.createElement('button');\n editMealModalFinishButton.textContent = 'Finish';\n editMealModalFinishButton.addEventListener('click', () => {\n // Grag input field entries\n const mealName = editMealModalNameInput.value;\n const mealType = editMealModalTypeSelect.value;\n const mealLink = editMealModalLinkInput.value;\n const mealSeason = editMealModalSeasonSelect.value\n \n // Create new meal object\n newMealObject = {\n name: mealName,\n type: mealType,\n link: mealLink,\n season: mealSeason\n }\n \n // If Editing Exisiting Meal\n if (entryType == 'edit-meal') {\n mealsReferenceData.forEach(meal => {\n if(originalMealObject.name == meal.name){\n meal.name = mealName;\n meal.type = mealType;\n meal.link = mealLink;\n meal.season = mealSeason;\n };\n })\n }\n\n // If adding a new meal\n if(entryType == 'add-meal'){\n mealsReferenceData.push(newMealObject);\n }\n\n // Set local storage to updated dataset\n localStorage.setItem('mealsReferenceData', JSON.stringify(mealsReferenceData));\n \n // Close Overlay/Modal\n document.querySelector('.overlay').remove();\n\n // Reload Meals Reference Section\n loadMealsReference(e)\n })\n editMealModalButtonContainer.appendChild(editMealModalFinishButton);\n const editMealModalCancelButton = document .createElement('button');\n editMealModalCancelButton.textContent = 'Cancel';\n editMealModalCancelButton.addEventListener('click', () => {\n document.querySelector('.overlay').remove();\n });\n // \n editMealModalButtonContainer.appendChild(editMealModalCancelButton);\n editMealModal.appendChild(editMealModalButtonContainer);\n\n // Append Modal to Overlay\n editMealOverlay.appendChild(editMealModal);\n editMealOverlay.classList.add('show')\n // Append Overlay to Container\n document.body.appendChild(editMealOverlay);\n\n }", "addCategoryClickListener() {\n const this_ = this;\n this.$categoryButtons.on('click', 'button', function (e) {\n clearTimeout(this_.keyupTimer);\n $('.spinner-zone').show();\n IndexAnimationsObj.category = e.target.value;\n $('.cat-display').text(e.target.textContent);\n this_.turnActiveOffCatBtns();\n $(this).addClass('active');\n this_.keyupTimer = setTimeout(function () {\n IndexSearchObj.searchYelp();\n }, this_.autoSearchDelay);\n });\n }", "choosenCat (category) {\n\t\tthis.setState({\n\t\t\tisFiltering: true,\n\t\t});\n\t\tif ( this.state.isLocationBased ){\n\t\t\tthis.filterOnCat(this.props.data.allRestaurantses, category).then((resturants) => {\n\t\t\t\tthis.filterOnLocation(resturants).then((resturants) => {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tstep: 2,\n\t\t\t\t\t\tselectedCategory: category,\n\t\t\t\t\t\trestaurantsList: resturants,\n\t\t\t\t\t\tisFiltering: false,\n\t\t\t\t\t\tisLoading: true\n\t\t\t\t\t});\n\t\t\t\t\tthis.shouldPosBeUpdated();\n\t\t\t\t})\n\t\t\t})\n\t\t\t\n\t\t} else {\n\t\t\tthis.filterOnCat(this.props.data.allRestaurantses, category).then((resturants) => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tstep: 2,\n\t\t\t\t\tselectedCategory: category,\n\t\t\t\t\trestaurantsList: resturants,\n\t\t\t\t\tisFiltering: false,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}", "clickAction(item) {\n this.selected = item.template;\n this.selected.args = [...item.args];\n }", "render() {\n let row = null;\n if (Object.keys(this.state.categoryDetails).length != 0 && this.state.categoryDetails != Object) {\n if (Object.keys(this.state.categoryDetails.destinations).length !== 0 && this.state.categoryDetails.destinations != Object) {\n row = this.state.categoryDetails.destinations.map(function (item, index) {\n if (true) {\n let col = null, colDesc = null;\n if (item.name == \"\") {\n col = (<Col componentClass=\"td\" colSpan={2} sm={6} >\n <FormGroup controlId={index.toString()} validationState=\"error\">\n <Select\n searchable={true}\n simpleValue className=\"category-select-control\"\n options={this.state.options}\n onChange={(event) => this.handleChange(index, event)}\n value={item.name} />\n </FormGroup>\n </Col>\n );\n }\n else {\n col = (\n <Col componentClass=\"td\" bsClass=\"col-height col\" sm={3}>\n <p> {item.name} </p>\n </Col>\n );\n colDesc = (\n <Col componentClass=\"td\" bsClass=\"col-height col\" sm={3} >\n <p> {item.description} </p>\n </Col>\n );\n }\n\n var actionTh =null;\n if (this.props.permissions.canAddOrEdit) {\n actionTh = <Col componentClass=\"td\">\n <button disabled={this.isActionbuttonEnabled(item, index)} type=\"button\" class=\"btn-link img-height\" title=\"Add/Edit Filter\" onClick={(event) => this.openPropertiesFilter(item, index, event)} ><i class=\"fa fa-filter\"></i></button>\n <button disabled={this.isActionbuttonEnabled(item, index)} type=\"button\" class=\"btn-link img-height\" title=\"Delete Destination\" onClick={(event) => this.removeDestinationModel(index)} ><i class=\"fa fa-trash\"></i></button>\n </Col>;\n }\n\n return (<Row componentClass=\"tr\" key={index} bsClass={item.categories[0].removed == undefined ? \"row row-margin\" : \"row row-margin strikeout\"}>\n {col}\n {colDesc}\n <Col componentClass=\"td\">{this.categoryBrandImageConstruct(item, index)}</Col>\n <Col componentClass=\"td\">{this.titleDetailConstruct(item, index)}</Col>\n {actionTh}\n\n </Row>)\n }\n }.bind(this));\n }\n }\n \n var addButton = null;\n\n if (this.props.permissions.canAddOrEdit) {\n addButton = <div>\n <button class=\"btn-link pull-right addMarginRight\" title=\"Add New Destination\" onClick={(event) => this.addNewDestination(event)}>\n <i class=\"fa fa-plus-square fa-2x\"></i>\n <span class=\"addVertialAlign\"> New Destination</span>\n </button>\n </div>;\n }\n\n var actionCol = null;\n\n if (this.props.permissions.canAddOrEdit) {\n actionCol = <Col componentClass=\"th\" rowSpan={2} className=\"actionsColumn\" ><label>Actions</label></Col>;\n }\n\n return ( \n\n <div>\n <div>\n {addButton}\n </div>\n \n <div className=\"clearBoth modelTableContainerWithSelect\" ref=\"categoryScroll\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <Grid componentClass=\"table\" bsClass=\"modalTable\">\n <thead>\n <Row componentClass=\"tr\" >\n <Col componentClass=\"th\" rowSpan={2} sm={3} ><label>Destination</label></Col>\n <Col componentClass=\"th\" rowSpan={2} sm={3} ><label>Description</label></Col>\n <Col componentClass=\"th\" colSpan={2} className=\"filterColumn\" ><label>Filters</label></Col>\n {actionCol}\n </Row>\n <Row componentClass=\"tr\">\n <Col componentClass=\"th\" className=\"brandsColumn\" ><label>Brands</label></Col>\n <Col componentClass=\"th\" ><label>Title/Series</label></Col>\n </Row>\n </thead>\n <tbody>\n {row}\n </tbody>\n </Grid>\n </div>\n </div>\n </div>\n <PropertiesFilter data={this.state} handleClose={this.closePropertiesFilter.bind(this)} handleSave={this.SavePropertiesFilterData.bind(this)} />\n <RemoveDestinationModal data={this.state} handleClose={this.closeDestinationDeleteModel.bind(this)} handleRemoveAndClose={this.removeDestinationModel.bind(this)} />\n </div>\n \n )\n }", "getChildLookups(lookups) {\n var actions = [];\n lookups.forEach(lookupObj => {\n actions.push(\n <li onClick={this.onLkpOptionSelected(lookupObj)}\n data={lookupObj} style={{color:'blue',fontSize:10,cursor:'pointer'}}\n >{lookupObj['label'] }\n </li>\n )\n })\n return actions;\n}", "actAsMenu_() {\n return this;\n }", "handleClickCat(id) {\n console.log('click')\n this.setState({selectedCat: this.state.catData[id]})\n }", "componentDidMount() {\n this.props.actions.getCarsByCategory(this.state.SelectedMake.value);\n }", "handleCatClick(categoria, e) {\n const { activeCat } = this.state;\n\n // prevent navigation through this button\n e.preventDefault();\n\n // if this category is already selected this unselects it\n if (activeCat === categoria) {\n return this.setState({\n activeCat: \"\",\n });\n }\n\n // otherwise we keep category name in state\n this.setState({\n activeCat: categoria,\n });\n }", "handleClickChoice(e) { \n e.preventDefault();\n this.setState({isModalOpen: true});\n this.props.handleChange('softdrink', e);\n }", "constructor(props) {\n super(props)\n this.onClick = this.onClick.bind(this)\n this.state = {\n description: '',\n category: '',\n }\n }", "function mapDispatchToProps(dispatch){\r\n // Second selectbook is the actioncreator imported\r\n // First one is the key\r\n // Whenever selecBook is called the result should be passed\r\n // to all our reducers\r\n return bindActionCreators({selectBook: selectBook }, dispatch)\r\n}", "function handleAdd(props: WrappedActionProps) {\n props.setForm('Recipe', '')\n props.setForm('Ingredients', '')\n props.selectRecipe(null)\n props.setModal('Add_Recipe_Modal')\n}", "function getCategory(e) {\n filter(e.target.value); //filter function send which button we click\n if(e.target.value == \"all\"){\n bringFoods(); // bringFoods run when we click \"all button\" & form loaded\n }\n\n}", "onCategoryInputChange(e) {\n const selectValue = e.target.value;\n\n this.setState({category: selectValue});\n }", "supCategory(v) {\n\t\tthis.setState({\n\t\t\tspecfic: v\n\t\t});\n\t}", "renderCatButtons(data, filteredCategory)\n {\n if(filteredCategory === undefined)\n return null;\n \n if(data.category === filteredCategory[0].category)\n {\n return(\n\n <div id=\"open-note\" key={\"render\" + data.noteId}>\n <p className=\"menu-p\">{data.title}</p>\n <span className=\"note-time\">Last edited:&nbsp;</span><Moment className=\"note-time\" format=\"DD MMM YYYY, HH:mm:ss\">{data.timestamp}</Moment>\n <br/>\n <CatBtn className=\"edit-btn btn\" id=\"catBtn\" label=\"E\" key={\"btn\" + data.noteId} onClick={() => { this.props.handleSingleNote(data.noteId, \"edit\"); this.props.setOpen(false); }}>\n\n {data.body}\n </CatBtn>&nbsp;&nbsp;&nbsp;\n <CatBtn className=\"delete-btn btn\" label=\"E\" key={\"delBtn\" + data.noteId} id={\"delBtn\" + data.noteId} onClick={() => { this.props.handleSingleNote(data.noteId, \"delete\") }}>\n Delete\n </CatBtn>\n </div>\n )\n }\n }", "function clickCategories(e) {\n setList(PRODUCTS[e.target.dataset.category]);\n }", "_MarkerTool() {\n // select the drawing tool\n let action = { type: \"Marker\", value: \"Marker\" }\n this.props.dispatch(action)\n\n // select the panel drawing tool\n let action2 = { type: \"MarkerPan\", value: \"MarkerPan\" }\n this.props.dispatch(action2)\n }", "deleteMeal() {\n this.props.deleteMeal()\n this.hide()\n }", "showEditCategoriesModal() {\n this.props.dispatch({type: LocationActions.ActionTypes.LOCATION.SHOW_LOCATION_EDIT_CATEGORY_MODAL,\n actionType: 'edit'});\n }", "categ(state,data)\n {\n return state.category=data\n }", "function App() {\n const [showMenu, setShowMenu] = useState(listItem); //listmenu\n const [categoryFilter, setCategoriFilter] = useState(AllCategories);\n\n // filterMenu\n const filterMenu = (categoryItem) => {\n //if clicked All\n if (categoryItem === 'All') {\n // update perubahan tampilkan original obj\n setShowMenu(listItem);\n return;\n }\n // jika button yg dipilih maka tampilkan sesuai argument\n const newItem = listItem.filter((item) => item.category === categoryItem);\n // update perubahan\n setShowMenu(newItem);\n };\n\n const removeItem = (id) => {\n // remember showMenu should be filter not original obj data\n const removeId = showMenu.filter((listId) => listId.id !== id);\n setShowMenu(removeId);\n };\n\n // if obj data null\n if (showMenu.length === 0) {\n return (\n <section className='center-text'>\n <div className='title'>\n <h3>No option </h3>\n <div className='button-filter'>\n <button className='btn' onClick={() => setShowMenu(listItem)}>\n refresh again\n </button>\n </div>\n </div>\n </section>\n );\n }\n\n return (\n <section>\n <div className='title_pages'>\n <h2>food menu</h2>\n <div className='underline'></div>\n </div>\n <Categori filterMenu={filterMenu} categoryBtn={categoryFilter} />\n <Menu menuItem={showMenu} removeItem={removeItem} />\n </section>\n );\n}", "launchEditPrompt(e) {\n e.preventDefault();\n const categoryToBeEdited = this.props.data.filter((category) => {\n return category.name === e.target.name;\n });\n this.setState({\n categoryId: categoryToBeEdited[0].id,\n categoryName: categoryToBeEdited[0].name,\n categoryDescription: categoryToBeEdited[0].description,\n displayEditModal: 'block',\n });\n }", "onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }", "setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }", "function mapDispatchToProps(dispatch) {\n // Whenever selectIngredient is called, the result shoudl be passed\n // to all of our reducers\n return bindActionCreators({ selectIngredient: selectIngredient, removeIngredient: removeIngredient}, dispatch);\n}", "function mapDispatchToProps(dispatch) { //dispatch allows the action executed to be DISPATCHED to all the reducers\n return bindActionCreators ({ selectBook: selectBook}, dispatch); //whenever selectBook is called (upon selection), the action associated here is called\n}", "function handleChange(evt){\r\n var temp = evt.target.value;\r\n fetchRecipesByCategory(temp);\r\n }", "handleMealTypeChange(event) {\n\t\tlet newMealType = event.target.value;\n\t\tlet filters = Object.assign({}, this.state.filters);\n\t\tfilters.mealType = newMealType;\n\t\tthis.setState({filters:filters}, this.loadSearchResults);\n\t}", "function mapDispatchToProps(dispatch){\n return bindActionCreators(\n //whenever select book is called the result should be passed to\n //all reduxers\n {selectBook: selectBook}, dispatch\n );\n}", "constructor(props) {\n super(props)\n this.state = {\n action: (id, dato, operation) => props.onClick(id, dato, operation),\n operationsButton: props.value[0],\n inputOperation: props.value[1],\n def:props.def,\n id: props.id,\n \n }\n }", "function DetailFish() {\n const fish = useSelector((state) => state.keranjang.fish);\n const dispatch = useDispatch();\n const buyClick = (e) => {\n const newData = {\n id: fish.id,\n name: fish.name,\n harga: fish.harga,\n }\n dispatch(tambahKeranjang(newData));\n }\n console.log(fish);\n return (\n <div>\n <NavALogin />\n <div className={styles.body}>\n <div className={styles.contentBox}>\n <div className={styles.title}>\n Detail Product\n </div>\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-6 d-flex justify-content-center\">\n <img className={styles.ItemImg} src={fish.imgUrl} alt=\"\" />\n </div>\n <div className=\"col-6\">\n <div>Name: {fish.name}</div>\n <div>Stock: {fish.stock}</div>\n <div>Price: Rp.{fish.harga}</div>\n <br></br>\n <div>Desscription:</div>\n <div>{fish.description}</div>\n \n <div className={styles.buy} onClick={buyClick}>\n Buy\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}", "bindActions() {\n\t\t// @props\n\t\t// onComplete\n\t\t// buttons\n\t\t// cancelIndex\n\t\t// title\n\t\t// &\n\t\t// this will be an abstraction\n\t\t// so we don't have to worry about\n\t\t// changing props AND showing\n\t\t// the action sheet within other\n\t\t// parts of the app\n\t\t// the action sheet will be shown\n\t\t// after required props have been mounted \n\t\t// to the component\n\t\tActions.ActionSheet = props => this.fromGlobalActionSheet(props)\n\t}", "startCreation() {\n ActionsForCreator.create(this.state); //**! Place Action Method Here and pass the state of the component */\n }", "function mapDispatchToProps(dispatch){\n \n // Whenever selectBook is called dispatch the result to all the reduces\n return bindActionCreators({\n selectBook:selectBook\n },dispatch);\n}", "function mapDispatchToProps(dispatch) {\n //when selectBeatle is called, it goes through reducers\n return bindActionCreators({ selectBeatle: selectBeatle }, dispatch);\n}", "handleClick(e){\n e.preventDefault();\n e.stopPropagation();\n return store.dispatch(clickCreator(this.props.data.id));\n }", "constructor(props) {\n super(props);\n this.state = {\n selectedOption: '',\n recipes: [],\n recipeQty: '1',\n subAssyList: [],\n rawMatList: [],\n activeImage: 'default.png',\n activeRecipe: '',\n renderMat: false\n };\n\n this.loadRecipes = this.loadRecipes.bind(this);\n this.getRecipe = this.getRecipe.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.parseRecipe = this.parseRecipe.bind(this);\n this.newQuantity = this.newQuantity.bind(this);\n }", "function addActionContainer() {\n\t\t// create the location for the actions\n\t\t$overview.append('<span style=\"margin-bottom: 1em;\" id=\"overview_actions\">Acties</span>');\n\t\t\n\t\t// add the show invoices button, since the invoices won't do that themselves\n\t\t$('#overview_actions').append('<button data-click-switch=\"invoices\" class=\"active\">Facturen tonen</button>');\n\t}", "setSubCategory(obj){\n console.log(\"setSubCategory : \" + obj.target.value)\n this.setState({subcate: obj.target.value});\n }", "handleRecipeClick(popupState, recipeData) {\n //recipeData - data of the recipe that was clicked\n this.setState({\n showPopup: popupState,\n recipeData: recipeData,\n });\n }", "handleAction(action) {\n switch(action.type){\n case 'ADD_TODO':\n this.addTodo(action.item)\n break\n case 'REMOVE_TODO':\n this.removeTodo(action.item)\n break\n case 'TOGGLE_TODO':\n this.toggleTodo(action.item)\n break\n case 'SET_FILTER':\n this.setFilter(action.item)\n break\n default:\n break\n }\n this.emitChange()\n }", "clicked(e){\n //only applies to elements, not children inside elements\n if(e.target.className === \"element\"){\n let i = parseInt(e.target.getAttribute(\"i\"))\n let category = e.target.getAttribute(\"category\")\n let year = store.getState().tabs.selectedYr\n store.dispatch(changeSelectedElem({year, i, category}))\n }\n }", "constructor(props) {\n super(props);\n\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\n this.state = {\n selectedDish: null\n }\n console.log('menu constructor is invoke')\n \n }", "componentDidMount() {\n if(this.props.data_food)\n this.setState({\n id: this.props.data_food.id,\n food_name: this.props.data_food.food_name,\n price: this.props.data_food.price,\n description: this.props.data_food.description, \n active: this.props.data_food.active,\n category_name: this.props.data_food.category_name\n })\n else{\n this.setState({\n category_name: this.props.categories[0].category_name\n })\n }\n }", "function initEditCategoryDialog(){\r\n\t\t\r\n\t\tif(!g_objCats)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tg_objCats.events.onOpenCategoryDialog = openCategoryDialog; \r\n\t\t\r\n\t\tjQuery(\"#uc_dialog_edit_category_action\").on(\"click\",onUpdateCategoryClick);\r\n\t\t\r\n\t}", "function mapDispatchToProps(dispatch) {\r\n //Whenever selectBook is called the result has to be passed\r\n //to all the reducers\r\n return bindActionCreators({ selectBook : selectBook}, dispatch); \r\n}", "function manageCategories(){\n \n //determine clicked button \n switch(this.id){\n case 'add-category':\n \n //get category name input\n var categoryName = ($(\"input[name='newCategoryName']\").val()).trim(); \n \n //check if user input is valid\n if(categoryName === ''){\n setError( $(\"#error-new-category\"),\"*Category name cannot be empty\");\n break;\n }else{\n resetError( $(\"#error-new-category\"));\n }\n \n //verify if input name already exist\n var existentCategory = $(\"select\").has(\"option:contains('\" + categoryName + \"')\");\n \n if(existentCategory.length !== 0){\n setError( $(\"#error-new-category\"),\"*Category already exist!\");\n break; \n }else{\n resetError($(\"#error-new-category\"));\n }\n \n //add category request \n var newCategory = new Category();\n newCategory.add(categoryName).done(doneModifyCategory);\n \n break;\n \n case 'delete-category':\n \n //get selected category\n var selectedCategory = $(\"#categories-cat-section\").val().trim();\n \n //validate selected category \n if(selectedCategory === ''){\n setError($(\"#error-delete-category\"),\"*Choose the category that you wish to delete\");\n break;\n }else{\n resetError($(\"#error-delete-category\"));\n }\n \n //delete category request\n var category = new Category();\n category.delete(selectedCategory).done(doneModifyCategory);\n break;\n }\n } //END manageCategories function", "handleClick(value) {\n this.setState({\n category: value\n })\n //console.log(this.state.category);\n }", "openModalWithData(id,input_value, model_id){\n\n ModalManager.open(<CreateCategoryModel title = \"\" \n json_data = {this.state.json_product_cate} \n id = {id} \n input_value = {input_value} \n setCreatedCategory = {this.setCreatedCategory.bind(this)}\n handleClose = {this.handleCloseCatrgoryModal.bind(this)} \n onRequestClose = {() => true}\n modal_id = \"product_cate_Model\"/>);\n }", "sendTherapist() {\n this.props.handleClick(this.state.selectedName)\n }", "function selectedAction(action) {\n switch (action) {\n case \"View Products for Sale\":\n displayProducts();\n break;\n case \"View Low Inventory\":\n displayLowStock();\n break;\n case \"Add to Inventory\":\n addMore();\n break;\n default:\n addProduct();\n break;\n };\n}", "handleClickEmployee() {\n this.props.changeEmployee(this.props.employee, this.props.employeeName);\n this.props.changePanel(\"Trip Management\");\n }", "function onClick(event) {\n const id = event.target.id;\n fecthMeal(id);\n}", "function AdoptionAnimal(props) {\n const classes = useStyles();\n const [openModal, setOpenModal] = useState(false);\n const handleOpen = () => {\n setOpenModal(true)\n };\n const handleClose = () => {\n setOpenModal(false)\n };\n const toRegister = () => {\n props.dispatch({\n type: 'SET_INTERESTED',\n payload: {\n id: props.animal.id,\n name: props.animal.name\n }\n })\n props.history.push('/register')\n }\n// Modal info\n const moreInfo = ( \n <Grid \n container \n className={classes.paper} \n direction='column' \n alignItems='center'\n >\n <Grid item>\n <Grid \n container \n direction='column' \n alignItems='center'\n >\n <ColorButton2 \n color='primary' \n onClick={toRegister}\n >\n Interested in Adopting\n </ColorButton2>\n <Typography variant='h3'>\n {props.animal.name}\n </Typography>\n <img \n className={classes.picture} \n src={props.animal.picture} \n alt={props.animal.name}\n />\n {/* Animal properties */}\n <Typography>\n Age: {props.animal.age} old\n </Typography>\n <Typography>\n Size: {props.animal.size}\n </Typography>\n <Typography>\n Color: {props.animal.color}\n </Typography> \n <Typography>\n Breed: {props.animal.breed}\n </Typography> \n <Typography>\n Coat: {props.animal.coat_length}\n </Typography>\n <Typography>\n Personality: {props.animal.personality}\n </Typography>\n <Typography>\n Price: ${props.animal.price}\n </Typography>\n </Grid> \n </Grid>\n </Grid>\n );\n return (\n <Grid \n container \n direction=\"row\" \n justify=\"space-evenly\" \n alignItems=\"center\" \n className='slightpadding'\n >\n <Grid \n item \n style={{paddingBottom: '1em'}}\n >\n <img \n style={{height: '15rem', width: '15rem'}} \n src={props.animal.picture} \n alt={props.animal.name}\n />\n <Typography>\n Name: {props.animal.name}\n </Typography>\n <Typography>\n Age: {props.animal.age}\n </Typography>\n <Typography>\n Breed: {props.animal.breed}\n </Typography>\n </Grid>\n <ColorButton \n variant='outlined' \n color='primary' \n onClick={handleOpen}\n >\n More Info About\n <br/> \n {props.animal.name}\n </ColorButton>\n <Modal\n className={classes.modal}\n open={openModal}\n onClose={handleClose}\n >\n {moreInfo}\n </Modal>\n </Grid>\n );\n}", "category(event){\n this.setState({\n category:event.target.value\n })\n }", "category(event){\n this.setState({\n category:event.target.value\n })\n }", "onChangeEvent(c) {\n this.selectedCategory = c;\n }", "selectRecipe(e) {\n e.preventDefault();\n console.log('recipe ' + e.target.dataset.index + ' selected!');\n this.props.selectRecipe(e.target.dataset.index);\n }", "function mapStateToProps(state) {\n return {\n category: state.activeCategory,\n meal: state.activeMeal\n };\n}", "function App() {\n // Состояние\n const [mealCount, setMealCount] = useState(0)\n const [mealArray, setMealArray] = useState([])\n\n // Покупка блюда, наполнение карзины\n const buyMeal = (item) => {\n setMealCount(prev => prev + 1);\n // console.log(item)\n const helpArr = mealArray\n const element = helpArr.find(elem => elem.id === item.id)\n if(element) {\n element.count = element.count + 1\n } else {\n helpArr.push(item)\n } \n setMealArray(helpArr)\n }\n\n // Удаление блюда из карзины\n function removeMeal(id) {\n const element = mealArray.find(elem => elem.id === id)\n const helpArr = mealArray.filter(item => item.id !== id)\n setMealCount(prev => prev - element.count);\n setMealArray(helpArr)\n }\n\n return (\n <>\n <Router >\n <Header mealCount={mealCount}/>\n <div className=\"content\">\n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route exact path=\"/category/:catName\">\n <MealsByCategory buyMeal={buyMeal} />\n </Route> \n <Route exact path=\"/meals/:areaName\">\n <MealsByCountry buyMeal={buyMeal} />\n </Route> \n <Route exact path=\"/check\">\n <Check mealCount={mealCount} mealArray={mealArray} removeMeal={removeMeal}/>\n </Route>\n <Route exact path=\"/meal-recipe/:mealId\">\n <MealRecipe />\n </Route> \n <Route exact path=\"/countries\">\n <Countries />\n </Route> \n <Redirect to=\"/\" />\n </Switch> \n </div>\n <Footer/>\n </Router>\n </>\n );\n}", "function matchDispatchToProps(dispatch) { // dispatch => call a function\n return bindActionCreators({\n // you can register all your actions here\n selectUser: selectUser\n }, dispatch)\n}" ]
[ "0.6636004", "0.59603053", "0.5856939", "0.5851976", "0.57318884", "0.5690823", "0.5663616", "0.56277084", "0.56063336", "0.55818176", "0.5558048", "0.55423146", "0.55381244", "0.5508489", "0.55062497", "0.5488537", "0.54855204", "0.5481426", "0.54811525", "0.5481072", "0.54786164", "0.5471842", "0.5470332", "0.54379517", "0.53748035", "0.53631616", "0.5356616", "0.53470194", "0.5328605", "0.532805", "0.5327845", "0.53074753", "0.5306011", "0.53013873", "0.5291597", "0.52900213", "0.5264392", "0.5259602", "0.5250699", "0.5242524", "0.5239379", "0.52376723", "0.52341294", "0.52311766", "0.5215274", "0.5214291", "0.5213837", "0.5203616", "0.51982373", "0.5183177", "0.51764613", "0.517203", "0.51594096", "0.51411927", "0.513319", "0.51147985", "0.5104273", "0.5103948", "0.5103085", "0.509719", "0.5094166", "0.5089454", "0.50824225", "0.5079395", "0.50768733", "0.5076468", "0.50728464", "0.5069418", "0.5066662", "0.5064875", "0.5064149", "0.50619006", "0.5060734", "0.5053904", "0.5052629", "0.5048988", "0.5044671", "0.50332177", "0.50324667", "0.50321835", "0.5031314", "0.5028569", "0.50249046", "0.50203794", "0.50176173", "0.50168437", "0.5014341", "0.5013051", "0.5009108", "0.5006325", "0.50061995", "0.5006115", "0.5001992", "0.49983162", "0.49983162", "0.49963033", "0.49961168", "0.4989967", "0.49870962", "0.4984655" ]
0.63745886
1
start initialise the buffer and GL
function start() { glcanvas = document.getElementById("glcanvas"); gl=initWebGL(glcanvas); // Initialize the GL context if (!gl) return;//Web GL is not available so, quit! mvMatrix = mat4.create();//create the model matrix pMatrix = mat4.create();//create the projection matrx modelRotationMatrix=mat4.create(); mat4.identity(modelRotationMatrix,modelRotationMatrix); //------- mat4.rotate(modelRotationMatrix,modelRotationMatrix,degToRad(90),[0,1,0]);//side view //------- initShaders(); //initialise the shaders initBuffers(); init_Skeleton(gl,shoulder_width,upper_arm_length,arm_diameter,upper_arm_y_offset,upper_arm_z_offset, lower_arm_length,lower_arm_diameter,lower_arm_x_offset,lower_arm_y_offset,lower_arm_z_offset, hand_length,hand_diameter,hip_width,thigh_y_offset,thigh_length,thigh_diameter, shin_length,shin_diameter, foot_length,foot_diameter); gl.clearColor(0.0,0.0,0.0,1.0);//clear the canvas gl.enable(gl.DEPTH_TEST); //enable depth test -> d glcanvas.onmousedown=handleMouseDown; glcanvas.onmouseup=handleMouseUp; document.onmousemove=handleMouseMove; drawScene();//draw the scene again document.onkeydown=handleKeyDown;//handle key down events document.onkeyup=handleKeyUp;//handle key up events setAnimatinonTimer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "initBuffer() {\n\t\tlet data = this.model.mesh.concat(this.model.normals).concat(this.model.texCoord)\n\n\t\tgl.useProgram(program)\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.vbo)\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW)\n\t}", "function init() {\n // Set the clear color to fully transparent black\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n \n gl.enable(gl.DEPTH_TEST);\n gl.depthMask(true);\n gl.disable(gl.BLEND);\n \n // Create the model-view matrix and projection matrix\n mvmat = mat4.create();\n projmat = mat4.create();\n nmat = mat3.create();\n \n // Create all buffer objects and reset their lengths\n vbo = gl.createBuffer();\n lineIndices = gl.createBuffer();\n triIndices = gl.createBuffer();\n vbo.length = 0;\n lineIndices.length = 0;\n \n // Initialize the shaders\n initShaders();\n \n // Reshape the canvas, and setup the viewport and projection\n reshape();\n}", "function initBuffers() {\n buffer = gl.createBuffer();\n bufferColor = gl.createBuffer();\n \n pos = gl.getAttribLocation(program, \"position\");\n color = gl.getAttribLocation(program, \"color\");\n\n perspective = gl.getUniformLocation(program, \"perspective\");\n translation = gl.getUniformLocation(program, \"translation\");\n rotation = gl.getUniformLocation(program, \"rotation\");\n scale = gl.getUniformLocation(program, \"scale\");\n size = 3;\n\n gl.enableVertexAttribArray(pos);\n gl.enableVertexAttribArray(color);\n mat4.translate(perscaleMatrix, perscaleMatrix, [0, 0, -2]);\n\n refreshBuffers()\n}", "function init(){\n\tconsole.log('Running');\n\trenderer = new RenderManager(\"game_canvas\");\n\tgl = renderer.gl;\n\tkeyboard = new KeyBoard();\n\n\tshaderName = 'triangle';\n\tvar triangleShader = new CreateShader(gl);\n\ttextureName = 'blue_sky';\n\ttextureObj = new Texture('bluecloud_bk.jpg', gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.LINEAR, gl.LINEAR);\n\ttextureObj.loadTexture();\n\ttriangleShader.makeProgram(\"vertShader.txt\", \"fragShader.txt\");\n\tvar delay = 150;\n\tif(navigator.userAgent.indexOf(\"Firefox\") != -1){\n\t\tdelay = 450;\n\t}\n\tsetTimeout(start, delay);\n}", "initBuffer () {\n gl.useProgram(program);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesVBO);\n\n // TODO: Übergebe hier sowohl das Mesh, als auch die Normalen an das VBO\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.mesh.concat(this.normals).concat(this.textureCoordinates)), gl.STATIC_DRAW);\n gl.uniformMatrix4fv(modelMatrixLoc, false, new Float32Array(this.modelMatrix));\n gl.uniformMatrix4fv(normalMatrixLoc, false, new Float32Array(this.normalMatrix));\n }", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n setupWorldCoordinates();\n gl.clearColor(0.1, 0.1, 0.1, 1);\n startLoop();\n}", "initBuffers() {\n this.vertices = [\n this.x1, this.y1, 0,\n this.x2, this.y1, 0,\n this.x2, this.y2, 0,\n this.x1, this.y2, 0\n ];\n\n this.indices = [\n 0, 1, 3,\n 2, 3, 1\n ];\n\n this.normals = [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1\n ];\n\n let maxS = (this.x2 - this.x1) / this.ls;\n let maxT = (this.y2 - this.y1) / this.lt;\n\n this.texCoords = [\n 0, maxT,\n maxS, maxT,\n maxS, 0,\n 0, 0\n ];\n\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "start() {\n this.program.use();\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n for (let elem of this.drawables) {\n elem.use(this.program);\n elem.draw();\n }\n\n window.requestAnimationFrame(() => this.start());\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 init() {\n\tcanvas = $(\"#canvas\")[0];\n\tgl = tdl.webgl.setupWebGL(canvas);\n\n\twindow.onresize = function() { scaleViewport(canvas, gl, quality); };\n\n\t$('#canvas').bind( 'mousewheel', wheelzoom);\n\t$('#canvas').bind( 'mousemove', focusmouse);\n\t$('#canvas').bind( 'mousedown', function(evt) { mouse_down = true; } );\n\t$('#canvas').bind( 'mouseup', function(evt) { mouse_down = false; } );\n\n\tscaleViewport(canvas, gl, quality);\n\n\tstats = setUpStats();\n\tclock = tdl.clock.createClock();\n\n\n\t// Setup Buffers\n\tlifeBuffer = new DoubleBuffer(width,height);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_WRAP_S, gl.REPEAT);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_WRAP_T, gl.REPEAT);\n\n\t//set up projection matrix\n\ttdl.fast.matrix4.ortho(projection, -1, 1, -1, 1, 0, -1);\n\t\n\t// Load the programs.\n\tAJAXProgramLoader(\n\t\t{\n\t\t\tlife: { vert: 'glsl/identity.vert', frag: 'glsl/life.frag' },\n\t\t\tscreen: { vert: 'glsl/wvp.vert', frag: 'glsl/tex2frag.frag' },\n\t\t\trandom: { vert: 'glsl/identity.vert', frag: 'glsl/random.frag' } \n\t\t}, \n\t\tstart\n\t)\n\n}", "function init() {\r\n\t\tvar canvas = document.getElementById(\"gremlinCanvas\");\r\n try {\r\n\t\t _initGL(canvas);\r\n\t\t _initShaders();\r\n Audio.init();\r\n } catch (error) {\r\n throw error;\r\n }\r\n\t\t_gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t_gl.enable(_gl.DEPTH_TEST);\r\n\t}", "function initBuffers() {\n //3 stk 3D vertekser:\n let positions = new Float32Array([\n 0.0, 0.5, 0,\n -0.5, -0.5, 0,\n 0.5, -0.5, 0]);\n\n //Farge til verteksene:\n let colors = new Float32Array([\n 1.0, 0.0, 0.0, 1.0,\t\t//Rød (RgbA)\n 0.0, 1.0, 0.0, 1.0,\t\t//Grønn (rGbA)\n 0.0, 0.0, 1.0, 1.0]);\t//Blå \t(rgBA)\n\n //POSISJONSBUFRET: oppretter, binder og skriver data til bufret:\n positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n //Setter antall floats per verteks og antall vertekser i dette bufret:\n positionBuffer.itemSize = 3;\n positionBuffer.numberOfItems = positions.length / 3;\n\n //COLORBUFRET: oppretter, binder og skriver data til bufret:\n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);\n //Setter antall floats per verteks og antall vertekser i dette bufret:\n colorBuffer.itemSize = 4; // NB!!\n colorBuffer.numberOfItems = colors.length / 4; // NB!!\n\n // Kople fra.\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n light = vec4.fromValues(0.,0,10.,1.);\n setupShadersPot();\n setupShaders();\n setupReflectiveShader();\n setupBuffers();\n setupTextures();\n tick();\n}", "function start() {\n let canvas = document.getElementById(\"myCanvas\");\n gl = prepareWebGL(canvas);\n context.shaderProgram = gl.createProgram();\n\n loadShader(gl, context.shaderProgram)\n .finally(() => {\n prepareGlVariables();\n prepareClearColor();\n texture.object = loadTexture(gl, texture.imgSource);\n prepareScene();\n window.requestAnimationFrame(drawAnimated);\n })\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders();\n setupBuffers();\n gl.clearColor(0.0, 0.4, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n \n var uints_for_indices = gl.getExtension(\"OES_element_index_uint\");\n \n // set up event listener for keystrokes\n document.onkeydown = handleKeyDown;\n\n // kick off animation loop\n tick();\n}", "function initBuffers() {\n // Create and bind VAO\n gl.vectorsVAO = gl.createVertexArray();\n gl.bindVertexArray(gl.vectorsVAO);\n\n // Load the vertex coordinate data onto the GPU and associate with attribute\n gl.posBuffer = gl.createBuffer(); // create position buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.posBuffer); // bind the position buffer\n gl.bufferData(gl.ARRAY_BUFFER, 100000*2*Float32Array.BYTES_PER_ELEMENT, gl.DYNAMIC_DRAW); // load the data into the position buffer\n gl.vertexAttribPointer(gl.program.aPosition, 2, gl.FLOAT, false, 0, 0); // associate the buffer with \"aPosition\" as length-2 vectors of floats\n gl.enableVertexAttribArray(gl.program.aPosition); // enable this set of data\n\n // Load the vertex color data onto the GPU and associate with attribute\n gl.colorBuffer = gl.createBuffer(); \n gl.bindBuffer(gl.ARRAY_BUFFER, gl.colorBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, 100000*3*Float32Array.BYTES_PER_ELEMENT, gl.DYNAMIC_DRAW);\n gl.vertexAttribPointer(gl.program.aColor, 3, gl.FLOAT, false, 0, 0); // associate the buffer with \"aColor\" as length-3 vectors of floats\n gl.enableVertexAttribArray(gl.program.aColor);\n \n // Cleanup\n gl.bindVertexArray(null);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n loadTexture();\n}", "function initGL(canvas){\r\n\ttry{\r\n\t\tctx.viewportWidth = canvas.width;\r\n\t\tctx.viewportHeight = canvas.height;\r\n\t\tinitBuffers(ctx);\r\n\t\t\r\n\t\t//Initialize default shader\r\n\t\tfragShader = compileShader(ctx, defaultFragSrc);\r\n\t\tvertShader = compileShader(ctx, defaultVertSrc);\r\n\t\tshaderProgram = createShaderProgram();\r\n\t\tsetupSpriteShader(shaderProgram);\r\n\t\tspriteShader = shaderProgram;\r\n\t\t\r\n\t\tcolorBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\tstateBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\t\r\n\t\tctx.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t\r\n\t\tctx.blendFunc(ctx.SRC_ALPHA, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\tctx.enable(ctx.BLEND);\r\n\t}catch(e){\r\n\t}\r\n}", "function initBuffers() {\n\n var vertices,\n textureCoords,\n vertexIndices,\n _w = t.tex.image.width / inst.parent.w,\n _h = t.tex.image.height / inst.parent.h;\n\n vertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n vertices = [\n _w, _h, 0.0, -_w, _h, 0.0,\n _w, -_h, 0.0, -_w, -_h, 0.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n vertexPositionBuffer.itemSize = 3;\n vertexPositionBuffer.numItems = 4;\n\n vertexTextureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexTextureCoordBuffer);\n textureCoords = [\n // Front face\n 1.0, 0.0,\n 0.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoords), gl.STATIC_DRAW);\n vertexTextureCoordBuffer.itemSize = 2;\n vertexTextureCoordBuffer.numItems = 6;\n\n vertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, vertexIndexBuffer);\n vertexIndices = [\n 0, 1, 2, 0, 2, 3, // Front face\n ];\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vertexIndices), gl.STATIC_DRAW);\n vertexIndexBuffer.itemSize = 1;\n vertexIndexBuffer.numItems = 6;\n }", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(\"shader-blinn-phong-vs\",\"shader-blinn-phong-fs\");\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n previousT = Date.now();\n tick();\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n //setupShaders(\"shader-vs\",\"shader-fs\");\n //setPhongShader();\n setGouraudShader();\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "async function startup() {\n const canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n await initGL();\n\n requestAnimationFrame(draw);\n}", "initialize() {\n // TODO: Add your initialization logic here\n var gl = this.graphics.GraphicsDevice.Adapter.DefaultAdapter;\n this.positionBuffer = gl.createBuffer();\n \n super.initialize(); //This is the function we override in the parent.\n }", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n\r\n setupShaders();\r\n setupTeapotShaders();\r\n\r\n setupBuffers();\r\n\r\n setupTextures();\r\n\r\n readTextFile(\"teapot_0.obj\",setupTeapotBuffers);\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = handleKeyUp;\r\n\r\n tick();\r\n}", "function init() {\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n setupGeometry();\n render();\n}", "function startup() {\n console.log(\"Startup Function Called\");\n\n // get canvas to render model on\n canvas = document.getElementById(\"myGLCanvas\");\n\n // create context\n gl = createGLContext(canvas);\n\n // Setup the shaders and buffers\n setupShaders();\n setupBuffers();\n\n // Set the clear color to white\n gl.clearColor(1, 1, 1, 1);\n\n gl.enable(gl.DEPTH_TEST);\n\n // Call tick function, which will then be called every subsequent animation frame\n tick();\n}", "drawStart()\n {\n let gl=this.core.gl;\n\n // using the skeleton shader\n\n gl.useProgram(this.program);\n\n // matrix\n\n gl.uniformMatrix4fv(this.perspectiveMatrixUniform,false,this.core.perspectiveMatrix.data);\n gl.uniformMatrix4fv(this.viewMatrixUniform,false,this.core.viewMatrix.data);\n\n // enable the vertex attributes\n\n gl.enableVertexAttribArray(this.vertexPositionAttribute);\n }", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders();\n setupSkybox();\n setupMesh(\"teapot_0.obj\");\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n }", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0, 0, 0, 1);\n}", "function start() {\n var canvas = document.getElementById('glCanvas');\n\n gl = initWebGL(canvas);\n\n if (!gl) {\n return;\n }\n\n // set color to green;\n gl.clearColor(0.0, 0.5, 0.0, 1.0);\n // this draws a rectangle bar;\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(40, 20, 60, 130);\n //depth testing:\n gl.enable(gl.DEPTH_TEST);\n gl.depthFunc(gl.LEQUAL);\n //clear colors and depth buffer;\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n // to resize:\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n}", "async function initBuffers(gl) {\n\tconsole.log(\"loading texture\");\n\tconst texture = await loadTexture(gl, 'textures/cubetexture.png');\n\n\tconsole.log(\"creating positions\");\n\tconst positions = new Float32Array([\n\t\t// Front face\n\t\t-1.0, -1.0, 1.0,\n\t\t1.0, -1.0, 1.0,\n\t\t1.0, 1.0, 1.0,\n\t\t-1.0, 1.0, 1.0,\n\n\t\t// Back face\n\t\t-1.0, -1.0, -1.0,\n\t\t-1.0, 1.0, -1.0,\n\t\t1.0, 1.0, -1.0,\n\t\t1.0, -1.0, -1.0,\n\n\t\t// Top face\n\t\t-1.0, 1.0, -1.0,\n\t\t-1.0, 1.0, 1.0,\n\t\t1.0, 1.0, 1.0,\n\t\t1.0, 1.0, -1.0,\n\n\t\t// Bottom face\n\t\t-1.0, -1.0, -1.0,\n\t\t1.0, -1.0, -1.0,\n\t\t1.0, -1.0, 1.0,\n\t\t-1.0, -1.0, 1.0,\n\n\t\t// Right face\n\t\t1.0, -1.0, -1.0,\n\t\t1.0, 1.0, -1.0,\n\t\t1.0, 1.0, 1.0,\n\t\t1.0, -1.0, 1.0,\n\n\t\t// Left face\n\t\t-1.0, -1.0, -1.0,\n\t\t-1.0, -1.0, 1.0,\n\t\t-1.0, 1.0, 1.0,\n\t\t-1.0, 1.0, -1.0,\n\t]);\n\tconst positionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n\n\tconsole.log(\"creating indices\");\n\tconst indexBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n\tconst indices = [\n\t\t0, 1, 2, 0, 2, 3, // front\n\t\t4, 5, 6, 4, 6, 7, // back\n\t\t8, 9, 10, 8, 10, 11, // top\n\t\t12, 13, 14, 12, 14, 15, // bottom\n\t\t16, 17, 18, 16, 18, 19, // right\n\t\t20, 21, 22, 20, 22, 23, // left\n\t];\n\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n\n\tconsole.log(\"creating texture coordinates\");\n\tconst textureCoordBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer);\n\tconst textureCoordinates = [\n\t\t// Front\n\t\t0.0, 0.0,\n\t\t1.0, 0.0,\n\t\t1.0, 1.0,\n\t\t0.0, 1.0,\n\t\t// Back\n\t\t0.0, 0.0,\n\t\t1.0, 0.0,\n\t\t1.0, 1.0,\n\t\t0.0, 1.0,\n\t\t// Top\n\t\t0.0, 0.0,\n\t\t1.0, 0.0,\n\t\t1.0, 1.0,\n\t\t0.0, 1.0,\n\t\t// Bottom\n\t\t0.0, 0.0,\n\t\t1.0, 0.0,\n\t\t1.0, 1.0,\n\t\t0.0, 1.0,\n\t\t// Right\n\t\t0.0, 0.0,\n\t\t1.0, 0.0,\n\t\t1.0, 1.0,\n\t\t0.0, 1.0,\n\t\t// Left\n\t\t0.0, 0.0,\n\t\t1.0, 0.0,\n\t\t1.0, 1.0,\n\t\t0.0, 1.0,\n\t];\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates), gl.STATIC_DRAW);\n\n\treturn {\n\t\ttexture: texture,\n\t\tposition: positionBuffer,\n\t\tindices: indexBuffer,\n\t\ttextureCoord: textureCoordBuffer,\n\t};\n}", "function start()\n{\n\tworldMatrix = new Float32Array(16);\n\tmat4.identity(worldMatrix);\n\n\tidentityMatrix = new Float32Array(16);\n\tmat4.identity(identityMatrix);\n\tangle = 0;\n\tskyTexture = textures['blue_sky'];\n\tshader = shaderPrograms['triangle'];\n\ttriangle = new Triangle(gl, renderer.ext, shader.programID);\n\ttriangle.init();\n\tgl.enable(gl.DEPTH_TEST);\n\tlast = Date.now();\n\trenderLoop(last);\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders();\n setupBuffers_aff();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick()\n}", "function runBeforeInit() {\n Device_1.default.Instance.init();\n DrawEngine_1.G_DrawEngine.init(Device_1.default.Instance.gl);\n ShaderFactory_1.G_ShaderFactory.init(Device_1.default.Instance.gl);\n BufferManager_1.G_BufferManager.init(Device_1.default.Instance.gl);\n ShaderCenter_1.G_ShaderCenter.init();\n LightCenter_1.G_LightCenter.init();\n LightModel_1.G_LightModel.init();\n UiSetting_1.G_UISetting.setUI();\n}", "function initGL() {\r\n \"use strict\";\r\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\r\n setUpAttributesAndUniforms();\r\n setUpBuffers();\r\n gl.clearColor(1,0,0,0.5);\r\n}", "function init() {\n \n // Retrieve the canvas\n const canvas = document.getElementById('webgl-canvas');\n if (!canvas) {\n console.error(`There is no canvas with id ${'webgl-canvas'} on this page.`);\n return null;\n }\n\n\n // Retrieve a WebGL context\n gl = canvas.getContext('webgl2');\n if (!gl) {\n console.error(`There is no WebGL 2.0 context`);\n return null;\n }\n \n // Set the clear color to be black\n gl.clearColor(0, 0, 0, 1);\n \n // some GL initialization\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n \n gl.cullFace(gl.BACK);\n gl.frontFace(gl.CCW);\n gl.clearColor(0.0,0.0,0.0,1.0)\n gl.depthFunc(gl.LEQUAL)\n gl.clearDepth(1.0)\n\n // Read, compile, and link your shaders\n initProgram();\n \n // create and bind your current object\n createShapes();\n \n // set up your camera\n setUpCamera();\n \n // do a draw\n draw();\n }", "function initBuffers(gl) {\n return { positions: gl.createBuffer(),\n offsets: gl.createBuffer(),\n normals: gl.createBuffer(),\n randomSeeds: gl.createBuffer(),\n rotationAxes: gl.createBuffer() };\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n \"use strict\";\n canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick();\n}", "init()\n\t{\n\t\tinitVerticesNormalsTexturesIndexes();\n\n //Converts the values to buffers\n\t\tthis.vertexBuffer = getVertexBufferWithVertices(this.vertices);\n\t\tthis.colorBuffer = getVertexBufferWithVertices(this.colors);\n\t\tthis.indexBuffer = getIndexBufferWithIndices(this.indices);\n\n\t\t//Defines the position matrix of the object\n\t\tmat4.identity(this.mvMatrix);\n\t\tmat4.translate(this.mvMatrix, this.mvMatrix, vec3.fromValues(this.x, this.y, 0.0));\n\t}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0.1, 0.1, 0.1, 1);\n}", "function initBuffers(gl) {\n // create buffer to store objects' position\n const positionBuffer = gl.createBuffer();\n // select it to perform operations\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n // create array of positions\n const positions = [\n // front face\n -1.0, -1.0, 1.0,\n 1.0, -1.0, 1.0,\n 1.0, 1.0, 1.0,\n -1.0, 1.0, 1.0,\n // back face\n -1.0, -1.0, -1.0,\n -1.0, 1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, -1.0, -1.0,\n // top face\n -1.0, 1.0, -1.0,\n -1.0, 1.0, 1.0,\n 1.0, 1.0, 1.0,\n 1.0, 1.0, -1.0,\n // bottom face\n -1.0, -1.0, -1.0,\n 1.0, -1.0, -1.0,\n 1.0, -1.0, 1.0,\n -1.0, -1.0, 1.0,\n // right face\n 1.0, -1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, 1.0, 1.0,\n 1.0, -1.0, 1.0,\n // left face\n -1.0, -1.0, -1.0,\n -1.0, -1.0, 1.0,\n -1.0, 1.0, 1.0,\n -1.0, 1.0, -1.0,\n ];\n // pass array of positions to WebGL as a Float32Array and fill the current buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n\n // set up normals for vertices to compute lighting\n const normalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer);\n\n const vertexNormal = [\n // front\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n // back\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n // top\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n // bottom\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n // right\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n // left\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexNormal), gl.STATIC_DRAW);\n\n // set up texture coordinates for each face\n const textureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer);\n\n const textureCoordinates = [\n // front\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // back\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // top\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // bottom\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // right\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // left\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n ];\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates), gl.STATIC_DRAW);\n\n // build element array buffer\n const indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n // define each face as two triangles\n const indices = [\n 0, 1, 2, 0, 2, 3, // front\n 4, 5, 6, 4, 6, 7, // back\n 8, 9, 10, 8, 10, 11, // top\n 12, 13, 14, 12, 14, 15, // bottom\n 16, 17, 18, 16, 18, 19, // right\n 20, 21, 22, 20, 22, 23, // left\n ];\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n\n return {\n position: positionBuffer,\n normal: normalBuffer,\n textureCoord: textureCoordBuffer,\n indices: indexBuffer,\n };\n}", "function initBuffers() {\n\n\t// Vertex Coordinates\n\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = vertices.length / 3;\n\n\t// Associating to the vertex shader\n\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute,\n\t\ttriangleVertexPositionBuffer.itemSize,\n\t\tgl.FLOAT, false, 0, 0);\n\n\t// Vertex Normal Vectors\n\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = normals.length / 3;\n\n\t// Associating to the vertex shader\n\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute,\n\t\ttriangleVertexNormalBuffer.itemSize,\n\t\tgl.FLOAT, false, 0, 0);\n}", "function startup() {\r\n console.log(\"Startup started\")\r\n \"use strict\";\r\n var canvas = document.getElementById(\"myCanvas\");\r\n gl = createGLContext(canvas);\r\n initGL();\r\n draw();\r\n}", "function startup() {\n\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n\n // -- 1. Create context from canvas\n gl = createGLContext(canvas);\n\n // -- 2. Initialize the GL object (global)\n initGL();\n\n // -- 3. Draw objects\n draw();\n\n}", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function init() {\n canvas = document.createElement('canvas');\n gl = canvas.getContext('webgl');\n ratio = window.devicePixelRatio || 1;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\n update();\n createProgram();\n blankTexture = getBlankTexture();\n initQuad();\n\n document.body.appendChild(canvas);\n window.addEventListener('resize', update, false);\n initialized = true;\n }", "function start(gl, canvas) {\r\n // initialize shaders\r\n if (!initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)) {\r\n console.log('Failed to intialize shaders.');\r\n return;\r\n }\r\n\r\n // specify the color for clearing <canvas>\r\n gl.clearColor(0, 0, 0, 1);\r\n // clear <canvas>\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n // Register function event handlers\r\n canvas.onmousedown = function(ev){ dragFlag(canvas, ev, gl, 0); };\r\n canvas.onmousemove = function(ev){ dragFlag(canvas, ev, gl, 1); };\r\n canvas.onmouseup = function(ev){ changeMovement(canvas, ev, gl, 1); };\r\n window.onkeypress = function(ev){ keypress(canvas, ev, gl); };\r\n window.onkeydown = function(ev){ keydown(canvas, ev, gl); };\r\n document.getElementById('update_screen').onclick = function(){ updateScreen(canvas, gl); };\r\n document.getElementById('save_canvas').onclick = function(){ saveCanvas(); };\r\n // setup SOR object reading/writing\r\n setupIOSOR(\"fileinput\"); \r\n\r\n // Set the vertex coordinates, the color and the normal\r\n n = initVertexBuffers(gl);\r\n if (n < 0) {\r\n console.log('Failed to set the vertex information');\r\n return;\r\n }\r\n\r\n // Set the clear color and enable the depth test\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n // Get the storage locations of uniform variables and so on\r\n var u_ModelMatrix = gl.getUniformLocation(gl.program, 'u_ModelMatrix');\r\n var u_NormalMatrix = gl.getUniformLocation(gl.program, 'u_NormalMatrix');\r\n\r\n var u_ViewMatrix = gl.getUniformLocation(gl.program, 'u_ViewMatrix');\r\n var u_ProjectionMatrix = gl.getUniformLocation(gl.program, 'u_ProjectionMatrix');\r\n\r\n var u_LightColor = gl.getUniformLocation(gl.program, 'u_LightColor');\r\n var u_LightPosition = gl.getUniformLocation(gl.program, 'u_LightPosition');\r\n var u_AmbientLight = gl.getUniformLocation(gl.program, 'u_AmbientLight');\r\n var u_SpecularLight = gl.getUniformLocation(gl.program, 'u_SpecularLight');\r\n var u_shade_toggle = gl.getUniformLocation(gl.program, 'u_shade_toggle');\r\n var u_shine = gl.getUniformLocation(gl.program, 'u_shine');\r\n var u_Picked = gl.getUniformLocation(gl.program, 'u_Picked');\r\n \r\n if (!u_NormalMatrix || !u_ProjectionMatrix || !u_ViewMatrix || !u_LightColor || !u_LightPosition || !u_AmbientLight || !u_SpecularLight || !u_shade_toggle || !u_Picked) { \r\n console.log('Failed to get the storage location');\r\n return;\r\n }\r\n\r\n // Set the light color (white)\r\n gl.uniform3f(u_LightColor, 1.0, 1.0, 1.0);\r\n // Set the light direction (in the world coordinate)\r\n gl.uniform3f(u_LightPosition, 3.3, 4.0, 3.5);\r\n // Set the ambient light\r\n gl.uniform3f(u_AmbientLight, 0.0, 0.0, 0.2);\r\n // Set specular light\r\n gl.uniform3f(u_SpecularLight, 0.0, 1.0, 0.0);\r\n //Set shading type, Gouraud initially\r\n gl.uniform1i(u_shade_toggle, 0);\r\n //Set shininess\r\n gl.uniform1f(u_shine, 25.0);\r\n // Init selected object\r\n gl.uniform1i(u_Picked, 0);\r\n\r\n\r\n transModelMatrix = new Matrix4(); // Model matrix\r\n rotModelMatrix = new Matrix4();\r\n scaleModelMatrix = new Matrix4();\r\n \r\n var normalMatrix = new Matrix4(); // Transformation matrix for normals\r\n var viewMatrix = new Matrix4();\r\n var projectionMatrix = new Matrix4();\r\n\r\n nearPlane = 1;\r\n\r\n // Pass the model matrix to u_ModelMatrix\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, transModelMatrix.elements);\r\n\r\n // Calculate projection and view matrices\r\n viewMatrix.setLookAt(6, 6, 10, 0, 0, 0, 0, 1, 0);\r\n projectionMatrix.setPerspective(60, canvas.width/canvas.height, nearPlane, 100);\r\n \r\n gl.uniformMatrix4fv(u_ViewMatrix, false, viewMatrix.elements);\r\n gl.uniformMatrix4fv(u_ProjectionMatrix, false, projectionMatrix.elements);\r\n\r\n // Pass the matrix to transform the normal based on the model matrix to u_NormalMatrix\r\n normalMatrix.setInverseOf(transModelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n\r\n // Clear color and depth buffer\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n\r\n // Draw the cube\r\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_BYTE, 0);\r\n}", "function initVertexBuffers(ev, gl, canvas, a_Position, n) {\n n = g_lines.length / 2; //Number of (x,y) pairs\n\n if (end === true) {\n n = g_points.length; //(x,y) point pairs\n }\n\n //Create buffer object\n var vertexBuffer = gl.createBuffer();\n if (!vertexBuffer) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\n //Bind buffer to target and write data into buffer object\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(g_lines), gl.STATIC_DRAW);\n\n //Initialize a_Position for shader\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n if (a_Position < 0) {\n console.log('Failed to get the storage location of a_Position');\n return -1;\n }\n\n gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_Position);\n return n;\n}", "function webGLStart() {\n var canvas = document.getElementById(\"canvas\");\t//Lade Canvas Element von HTML ins javascript\n \n if (!canvas) {\n \tconsole.log('Failed to retrieve the <canvas> element ');\n \treturn false;\n }\n \n initGL(canvas);\n initShaders();\n initT();\n \n //gl.vertexAttrib1f(shaderProgram.pointSize, 20.0);\t//Setzte die default Punktgroesse auf 20px \n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.enable(gl.DEPTH_TEST);\n\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n \n tick();\n \n }", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(\n gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n gl.clearColor(0.8, 0.8, 0.8, 1);\n}", "function initGL() {\r\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\r\n gl.useProgram(prog);\r\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\r\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\r\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\r\n u_projection = gl.getUniformLocation(prog, \"projection\");\r\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\r\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\r\n u_lightPositionA= gl.getUniformLocation(prog, \"lightPositionA\");\r\n u_lightPositionB= gl.getUniformLocation(prog, \"lightPositionB\");\r\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\r\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\r\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\r\n u_color = gl.getUniformLocation(prog, \"color\");\r\n u_spotLightDir = gl.getUniformLocation(prog, \"spotLightDir\");\r\n u_day = gl.getUniformLocation(prog, \"day\");\r\n a_coords_buffer = gl.createBuffer();\r\n a_normal_buffer = gl.createBuffer();\r\n index_buffer = gl.createBuffer();\r\n gl.enable(gl.DEPTH_TEST);\r\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5);\r\n gl.uniform4f(u_diffuseColor, 1, 1, 1, 1);\r\n gl.uniform1f(u_specularExponent, 10); \r\n gl.uniform4f(u_lightPosition, lightPositions[0][0], lightPositions[0][1], lightPositions[0][2], lightPositions[0][3]); \r\n gl.uniform4f(u_lightPositionA, lightPositions[1][0], lightPositions[1][1], lightPositions[1][2], lightPositions[1][3]);\r\n gl.uniform4f(u_lightPositionB, lightPositions[2][0], lightPositions[2][1], lightPositions[2][2], lightPositions[2][3]);\r\n}", "function createBuffers() {\n\n indexBuffer = gl.createBuffer();\n verticesBuffer = gl.createBuffer();\n normalsBuffer = gl.createBuffer();\n texCoordBuffer = gl.createBuffer();\n}", "function startup(){\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupSkyboxShaders()\n setupSkyboxBuffers()\n setupTeapotShaders()\n setupMesh(\"teapot.obj\")\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n mat4.scale(mvMatrix,mvMatrix,[.02,.02,.02])\n gl.enable(gl.DEPTH_TEST)\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "createBuffers() {\n this.createBuffer('COLOR')\n this.createBuffer('POSITION')\n }", "_initContext()\n {\n const gl = this.gl;\n\n // create a texture manager...\n this.textureManager = new TextureManager(this);\n this.textureGC = new TextureGarbageCollector(this);\n\n this.state.resetToDefault();\n\n this.rootRenderTarget = new RenderTarget(gl, this.width, this.height, null, this.resolution, true);\n this.rootRenderTarget.clearColor = this._backgroundColorRgba;\n\n this.bindRenderTarget(this.rootRenderTarget);\n\n this.emit('context', gl);\n\n // setup the width/height properties and gl viewport\n this.resize(this.width, this.height);\n }", "function initBuffer(gl) {\n // Create a buffer for the square's positions.\n const positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n \n // Now create an array of positions for the square.\n const positions = [\n 1.0, 1.0,\n -1.0, 1.0,\n 1.0, -1.0,\n -1.0, -1.0,\n ];\n \n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array(positions),\n gl.STATIC_DRAW);\n \n return positionBuffer;\n}", "function startup() {\r\n \tcanvas = document.getElementById(\"myGLCanvas\");\r\n \tgl = createGLContext(canvas);\r\n \tsetupShaders(); \r\n \tsetupBuffers();\r\n \tgl.clearColor(1.0, 1.0, 1.0, 1.0);\t//white background\r\n \tgl.enable(gl.DEPTH_TEST);\r\n \ttick();\r\n}", "function setupBuffers_NAff() {\n\n //Generate the vertex positions\n loadVertices();\n\n //Generate the vertex colors\n loadColors();\n}", "function initPos(){\n //todo: get location, create buffer stays; bind-enable could leave?\n //get location of attribute variable\n a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n if (a_Position < 0 ){\n console.log('Failed to get storage location for a_position');\n return;\n }\n //initialize vertex buffer object\n g_vertexBuffer = gl.createBuffer();\n if(!g_vertexBuffer){\n console.log('failed to create vertexbuffer');\n return;\n }\n\n}", "function WebGLStart(){\n\n\t//reset the window title\n\tif (viewerParams.parts.hasOwnProperty('options')){\n\t\tif (viewerParams.parts.options.hasOwnProperty('title')){\n\t\t\twindow.document.title = viewerParams.parts.options.title\n\t\t}\n\t}\n\n\tdocument.addEventListener('mousedown', handleMouseDown);\n\n\t//initialize various values for the parts dict from the input data file, \n\tinitPVals();\n\n\tinitScene();\n\t\n\tinitColumnDensity();\n\n\t//draw everything\n\tPromise.all([\n\t\tcreatePartsMesh(),\n\t]).then(function(){\n\t\t\n\t\t//begin the animation\n\t\t// keep track of runtime for crashing the app rather than the computer\n\t\tvar currentTime = new Date();\n\t\tvar seconds = currentTime.getTime()/1000;\n\t\tviewerParams.currentTime = seconds;\n\n\t\tviewerParams.pauseAnimation = false;\n\t\tanimate();\n\n\t})\n\n\n\n}", "function InitBuffers(gl) {with(gl)\n{\n\t// Bind vertices (A rectangle)\n\tgl.verticesBuffer = createBuffer();\n\tbindBuffer(ARRAY_BUFFER, verticesBuffer);\n\tbufferData(ARRAY_BUFFER, new Float32Array([-1,-1, 1,-1, 1,1, -1,1]), STATIC_DRAW);\n\n\t// Bind vertex indices\n\tgl.verticesIndexBuffer = createBuffer();\n\tbindBuffer(ELEMENT_ARRAY_BUFFER, verticesIndexBuffer);\n\t\n\t // indices of vertices of two triangles that make a square \n\tvar indices = [0,1,2, 0,3,2];\n\tbufferData(ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), STATIC_DRAW);\n\t\n\t// Bind texture vertices\n\tgl.verticesTextureCoordBuffer = createBuffer();\n\tbindBuffer(gl.ARRAY_BUFFER, verticesTextureCoordBuffer);\n\tbufferData(gl.ARRAY_BUFFER, new Float32Array([0,1, 1,1, 1,0, 0,0]), STATIC_DRAW);\n}}", "async function init(){\n\t// retrieve shader using path\n\tvar path = window.location.pathname;\n\tvar page = path.split(\"/\").pop();\n\tbaseDir = window.location.href.replace(page, '');\n\tshaderDir = baseDir + \"shaders/\";\n\n\t// create canvas\n\tvar canvas = document.getElementById(\"c\");\n\tgl = canvas.getContext(\"webgl2\");\n\tconsole.log(gl);\n\tif (!gl) {\n\t\tdocument.write(\"GL context not opened\");\n\t\treturn;\n\t}\n\t\n\t// Loading the shaders and creating programs\n\tawait utils.loadFiles([shaderDir + 'texture_vs.vert', shaderDir + 'texture_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\ttextureProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_texcoord\", \"a_normal\"]);\n\t});\n\tawait utils.loadFiles([shaderDir + 'color_vs.vert', shaderDir + 'color_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\tcolorProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_normal\"]);\n\t});\n\n\t/*\n\t* Loading the obj models\n\t*/\n\tlet tailWrapper = new ObjectWrapper(baseDir + tailPath);\n\tlet bodyWrapper = new ObjectWrapper(baseDir + bodyPath);\n\tlet leftEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet rightEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet hoursClockhandWrapper = new ObjectWrapper(baseDir + hoursClockhandPath);\n\tlet minutesClockhandWrapper = new ObjectWrapper(baseDir + minutesClockhandPath);\n\t// Set the local matrix for each object and the program to draw them\n\ttailWrapper.setLocalMatrix(tailLocalMatrix).setProgramInfo(colorProgramInfo);\n\tbodyWrapper.setLocalMatrix(bodyLocalMatrix).setProgramInfo(textureProgramInfo);\n\tleftEyeWrapper.setLocalMatrix(leftEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\trightEyeWrapper.setLocalMatrix(rightEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\thoursClockhandWrapper.setLocalMatrix(clockHand2LocalMatrix).setProgramInfo(colorProgramInfo);\n\tminutesClockhandWrapper.setLocalMatrix(clockHand1LocalMatrix).setProgramInfo(colorProgramInfo);\n\n\t// Save each object wrapper in a unique array of objects to draw\n\tobj = [tailWrapper, leftEyeWrapper, rightEyeWrapper, bodyWrapper, hoursClockhandWrapper, minutesClockhandWrapper];\n\n\tobj.forEach(async (wrapper) => { await wrapper.loadModel(); });\n\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\n\tresetShaderParams();\n\tmain();\n}", "loadBuffers()\n {\n // Specify the vertex coordinates\n this.VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\n this.VertexPositionBuffer.itemSize = 3;\n this.VertexPositionBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\n \n // Specify normals to be able to do lighting calculations\n this.VertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\n gl.STATIC_DRAW);\n this.VertexNormalBuffer.itemSize = 3;\n this.VertexNormalBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\n \n // Specify faces of the terrain \n this.IndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\n gl.STATIC_DRAW);\n this.IndexTriBuffer.itemSize = 1;\n this.IndexTriBuffer.numItems = this.fBuffer.length;\n console.log(\"Loaded \", this.IndexTriBuffer.numItems/3, \" triangles\");\n \n //Setup Edges \n this.IndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\n gl.STATIC_DRAW);\n this.IndexEdgeBuffer.itemSize = 1;\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\n }", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n HP();\n draw();\n}", "initGL() {\n \"use strict\";\n this.ctx.shaderProgram = loadAndCompileShaders(\n this.gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n this.setUpAttributesAndUniforms();\n this.setUpShapes();\n\n // set the clear color here\n this.gl.clearColor(0.2, 0.2, 0.2, 1); //-> damit wird alles übermalen (erst wenn clear)\n\n // add more necessary commands here\n }", "function startup() {\n let canvas = document.getElementById(renderSettings.viewPort.canvasId);\n\n gl = createGLContext(canvas);\n initGL();\n resizeWindow();\n\n window.addEventListener(\"keyup\", onKeyup, false);\n window.addEventListener(\"keydown\", onKeydown, false);\n window.addEventListener(\"resize\", resizeWindow, false);\n window.addEventListener(\"visibilityChange\", handleVisibilityChange, false);\n\n drawAnimated(0);\n}", "function startup() {\r\n \r\n //create the translation matrix\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders();\r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function setupBuffers() {\n myTerrain = new Terrain(64,-1,1,-1,1);\n myTerrain.loadBuffers();\n}", "function initGL() {\n \n \"use strict\";\n\n // -- 1. Add shaders (load / compile)\n ctx.shaderProgram = loadAndCompileShaders(gl, \"VertexShader.glsl\", \"FragmentShader.glsl\");\n\n // -- 2. Assign attribute-index to context\n setUpAttributesAndUniforms();\n\n // -- 3. Setup buffers\n setUpBuffers();\n\n // -- 4. Set color ??\n gl.clearColor(0.4688,0.1512,0.0000,0.2725);\n\n}", "init() {\n this.gl = this.canvas.getContext(\"webgl\") || this.canvas.getContext(\"experimental-webgl\");\n\n // Setup Up shader Programs;\n let shaderProg = this.createShaderProgram_(vertexShader(), fragmentShader());\n this.gl.useProgram(shaderProg);\n\n // Set Buffer Data for coordinates\n this.setImageCoords(shaderProg);\n\n this.uPatternWidth = this.gl.getUniformLocation(shaderProg, \"u_patternWidth\");\n\n let self = this;\n this.loadImage(self.image0Src)\n .then(function(image) {\n // Set image up image 1 texture\n self.texImage0 = self.loadTexture(image);\n return self.loadImage(self.image1Src);\n })\n .then(function(image) {\n self.texImage1 = self.loadTexture(image);\n return self.loadImage(self.patternSrc);\n })\n .then(function(image){\n self.texPattern = self.loadTexture(image);\n self.bindTexturesToTextureUnits(shaderProg);\n self.draw();\n })\n .catch(function(err) {\n console.error(\"Error Caught: \", err);\n });\n }", "function start(gl, canvas) {\r\n // initialize shaders\r\n if (!initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)) {\r\n console.log('Failed to intialize shaders.');\r\n return;\r\n }\r\n\r\n // specify the color for clearing <canvas>\r\n gl.clearColor(0, 0, 0, 1);\r\n // clear <canvas>\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n // Register function event handlers\r\n \r\n window.onkeypress = function(ev){ keypress(canvas, ev, gl); };\r\n document.getElementById('update_screen').onclick = function(){ updateScreen(canvas, gl); };\r\n document.getElementById('save_canvas').onclick = function(){ saveCanvas(); };\r\n // setup SOR object reading/writing\r\n setupIOSOR(\"fileinput\"); \r\n\r\n // Set the vertex coordinates, the color and the normal\r\n n = initVertexBuffers(gl);\r\n if (n < 0) {\r\n console.log('Failed to set the vertex information');\r\n return;\r\n }\r\n\r\n // Set the clear color and enable the depth test\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n // Get the storage locations of uniform variables and so on\r\n var u_ModelMatrix = gl.getUniformLocation(gl.program, 'u_ModelMatrix');\r\n var u_MvpMatrix = gl.getUniformLocation(gl.program, 'u_MvpMatrix');\r\n var u_NormalMatrix = gl.getUniformLocation(gl.program, 'u_NormalMatrix');\r\n var u_LightColor = gl.getUniformLocation(gl.program, 'u_LightColor');\r\n var u_LightPosition = gl.getUniformLocation(gl.program, 'u_LightPosition');\r\n var u_AmbientLight = gl.getUniformLocation(gl.program, 'u_AmbientLight');\r\n var u_SpecularLight = gl.getUniformLocation(gl.program, 'u_SpecularLight');\r\n var u_shade_toggle = gl.getUniformLocation(gl.program, 'u_shade_toggle');\r\n var u_shine = gl.getUniformLocation(gl.program, 'u_shine');\r\n \r\n if (!u_MvpMatrix || !u_NormalMatrix || !u_LightColor || !u_LightPosition|| !u_AmbientLight || !u_SpecularLight || !u_shade_toggle) { \r\n console.log('Failed to get the storage location');\r\n return;\r\n }\r\n\r\n // Set the light color (white)\r\n gl.uniform3f(u_LightColor, 1.0, 1.0, 1.0);\r\n // Set the light direction (in the world coordinate)\r\n gl.uniform3f(u_LightPosition, 3.3, 4.0, 3.5);\r\n // Set the ambient light\r\n gl.uniform3f(u_AmbientLight, 0.0, 0.0, 0.2);\r\n // Set specular light\r\n gl.uniform3f(u_SpecularLight, 0.0, 1.0, 0.0);\r\n //Set shading type, Gouraud initially\r\n gl.uniform1i(u_shade_toggle, 0);\r\n //Set shininess\r\n gl.uniform1f(u_shine, 25.0);\r\n\r\n var modelMatrix = new Matrix4(); // Model matrix\r\n var mvpMatrix = new Matrix4(); // Model view projection matrix\r\n var normalMatrix = new Matrix4(); // Transformation matrix for normals\r\n\r\n // Calculate the model matrix\r\n modelMatrix.setRotate(90, 0, 1, 0); // Rotate around the y-axis\r\n // Pass the model matrix to u_ModelMatrix\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n\r\n // Pass the model view projection matrix to u_MvpMatrix\r\n mvpMatrix.setPerspective(30, canvas.width/canvas.height, 1, 100);\r\n mvpMatrix.lookAt(6, 6, 14, 0, 0, 0, 0, 1, 0);\r\n mvpMatrix.multiply(modelMatrix);\r\n gl.uniformMatrix4fv(u_MvpMatrix, false, mvpMatrix.elements);\r\n\r\n // Pass the matrix to transform the normal based on the model matrix to u_NormalMatrix\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n\r\n // Clear color and depth buffer\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n\r\n // Draw the cube\r\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_BYTE, 0);\r\n}", "function WebGLStart(){\n\n//initialize everything\n\tinit();\n\n//define the tweens\n\tdefineTweens();\n\n//draw everything\n\tdrawScene();\n\n//begin the animation\n\tanimate();\n}", "function startup() {\n canvas = document.getElementById(\"glCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n loadTexture();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function initBuffers() {\r\n // The vertices and indices for a sphere\r\n let [coords, indices] = unit_sphere();\r\n obj = createObject(coords, indices, false);\r\n}", "init(context, sceneMatrix) {\n if(!this.isInit) {\n this.isInit = true;\n this.posBuffer = gl.createBuffer();\n this.colorBuffer = gl.createBuffer();\n this.sizeBuffer = gl.createBuffer();\n\n /*set the attributes uniforms*/\n this.a_position = gl.getAttribLocation(context.shader, 'a_position');\n this.a_color = gl.getAttribLocation(context.shader, 'a_color');\n this.a_size = gl.getAttribLocation(context.shader, 'a_size');\n this.u_modelView = gl.getUniformLocation(context.shader, 'u_modelView');\n this.u_projection = gl.getUniformLocation(context.shader, 'u_projection');\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);\n gl.enableVertexAttribArray(this.a_color);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.posBuffer);\n gl.enableVertexAttribArray(this.a_position);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.sizeBuffer);\n gl.enableVertexAttribArray(this.a_size);\n\n this.wind = vec3.fromValues(0,0,0);\n\n this.moveVec = vec3.create();\n this.oldPos = this.getPosition(sceneMatrix);\n }\n }", "initBuffers() {\n let tmp;\n const gl = this.gl;\n\n // Create vertex position buffer.\n this.quadVPBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVPBuffer);\n tmp = [1.0, 1.0, 0.0, -1.0, 1.0, 0.0, 1.0, -1.0, 0.0, -1.0, -1.0, 0.0];\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tmp), gl.STATIC_DRAW);\n this.quadVPBuffer.itemSize = 3;\n this.quadVPBuffer.numItems = 4;\n\n /*\n +--------------------+\n | -1,1 (1) | 1,1 (0)\n | |\n | |\n | |\n | |\n | |\n | -1,-1 (3) | 1,-1 (2)\n +--------------------+\n */\n\n const scaleX = 1.0;\n const scaleY = 1.0;\n\n // Create vertex texture coordinate buffer.\n this.quadVTCBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVTCBuffer);\n tmp = [scaleX, 0.0, 0.0, 0.0, scaleX, scaleY, 0.0, scaleY];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tmp), gl.STATIC_DRAW);\n }", "function initializeTerrainBuffers() {\n /* Initialize vertex buffer */\n vertexBufferProgram = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBufferProgram);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexBuffer), gl.STATIC_DRAW);\n vertexBufferProgram.itemSize = 3;\n vertexBufferProgram.numItems = numVertices;\n console.log(\"Loaded \", vertexBufferProgram.numItems, \" vertices\");\n\n /* Initialize normals buffer */\n normalBufferProgram = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBufferProgram);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalBuffer),\n gl.STATIC_DRAW);\n normalBufferProgram.itemSize = 3;\n normalBufferProgram.numItems = numVertices;\n console.log(\"Loaded \", normalBufferProgram.numItems, \" normals\");\n\n /* Initialize triangle face buffer */\n triangleBufferProgram = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBufferProgram);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(triangleBuffer),\n gl.STATIC_DRAW);\n triangleBufferProgram.itemSize = 1;\n triangleBufferProgram.numItems = triangleBuffer.length;\n console.log(\"Loaded \", triangleBufferProgram.numItems, \" triangles\");\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 }", "RenderInit() {\n this.canvas.width = this.size;\n this.canvas.height = this.size;\n this.context = this.canvas.getContext(\"2d\");\n this.buffer = this.size / this.gamestate.layout.length;\n this.draw();\n this.drawKey();\n this.drawExit();\n this.drawPlayers();\n this.drawAdversaries();\n }", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n window.addEventListener('keyup', onKeyup, false);\n window.addEventListener('keydown', onKeydown, false);\n draw();\n draw2();\n draw3();\n}", "function initScene(gl) {\r\n\r\n //////////////////////////////////////////\r\n //////// set up geometry - plane ////////\r\n //////////////////////////////////////////\r\n\r\n var vPlane = [];\r\n\r\n for (var j = height - 1; j >= 0; j--) {\r\n for (var i = 0; i < width; i++) {\r\n var A = vec3.fromValues(i - (width - 1) * 0.5,\r\n height - 1 - j - (height - 1) * 0.5,\r\n 0);\r\n // push the vertex coordinates\r\n vPlane.push(A[0]);\r\n vPlane.push(A[1]);\r\n vPlane.push(A[2]);\r\n // push the normal coordinates\r\n vPlane.push(0);\r\n vPlane.push(0);\r\n vPlane.push(1);\r\n vPlane.push(i);\r\n vPlane.push(j);\r\n }\r\n }\r\n\r\n var iPlane = [];\r\n\r\n for (var j = 0; j < height - 1; j++) {\r\n for (var i = 0; i < width - 1; i++) {\r\n iPlane.push(j * width + i);\r\n iPlane.push((j + 1) * width + i);\r\n iPlane.push(j * width + i + 1);\r\n iPlane.push(j * width + i + 1);\r\n iPlane.push((j + 1) * width + i);\r\n iPlane.push((j + 1) * width + i + 1);\r\n }\r\n }\r\n\r\n // create vertex buffer on the gpu\r\n vboPlane = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vboPlane);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vPlane), gl.STATIC_DRAW);\r\n\r\n // create index buffer on the gpu\r\n iboPlane = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboPlane);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(iPlane), gl.STATIC_DRAW);\r\n\r\n iboNPlane = iPlane.length;\r\n\r\n ///////////////////////////////////////////////\r\n //////// set up geometry - light source //////\r\n ///////////////////////////////////////////////\r\n\r\n var vLight = [0.0, 0.0, 0.0];\r\n\r\n var iLight = [0];\r\n\r\n // create vertex buffer on the gpu\r\n vboLight = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vboLight);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vLight), gl.STATIC_DRAW);\r\n\r\n // create index buffer on the gpu\r\n iboLight = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboLight);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(iLight), gl.STATIC_DRAW);\r\n\r\n iboNLight = iLight.length;\r\n\r\n ////////////////////////////////\r\n //////// set up shaders //////\r\n ////////////////////////////////\r\n shaderProgramPlane = shaderProgram(gl, \"shader-vs-phong\", \"shader-fs-phong\");\r\n shaderProgramLight = shaderProgram(gl, \"shader-vs-light\", \"shader-fs-light\");\r\n\r\n /////////////////////////////////\r\n //////// set up textures //////\r\n /////////////////////////////////\r\n var image = document.getElementById('checkerboard');\r\n textureCheckerboard = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, textureCheckerboard);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n\r\n \r\n // TODO 6.3a): Set up the texture containing the checkerboard\r\n // image. Have a look at the functions gl.bindTexture(),\r\n // gl.texImage2D() and gl.texParameteri(). Also do not\r\n // forget to generate the mipmap pyramid using \r\n // gl.generateMipmap(). Note: Both format and internal\r\n // format parameter should be gl.RGBA, the data type\r\n // used should be gl.UNSIGNED_BYTE.\r\n gl.bindTexture(gl.TEXTURE_2D,textureCheckerboard);\r\n gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n var image = document.getElementById('cobblestone');\r\n textureCobblestone = gl.createTexture();\r\n\r\n \r\n // TODO 6.3b): Set up the texture containing the cobblestone\r\n // image, also using gl.bindTexture() and gl.texImage2D().\r\n // We do not need mipmapping here, so do not forget to \r\n // use gl.texParameteri() to set the minification filter \r\n // to gl.LINEAR. Format, internal format and type should\r\n // be the same as for the checkerboard texture.\r\n gl.bindTexture(gl.TEXTURE_2D, textureCobblestone);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n\r\n \r\n\r\n }", "function onReady() {\n shader = new ShaderBuilder(gl, \"vertexShader\", \"fragmentShader\")\n .prepareUniforms(\n \"uMVMatrix\", \"mat4\" // only model matrix is regular uniform\n ).prepareUniformBlocks(\n // remainder of matrices in UBO\n UBO.Cache[\"MatTransform\"], 0 // block index 0\n );\n\n model = Terrain.createModel(gl, true);\n\n mDebug = new LineDebugger(gl);\n mDebug.addColor(\"#00FF00\")\n .addMeshNormal(0.0, 0.3, model.mesh)\n .finalize();\n\n // start drawing frames now\n rendLoop.start();\n}", "function webGLStart() {\n var canvas = document.getElementById(\"webglcanvas\");\n initGL(canvas);\n initShaders();\n initBuffers();\n \n // Prior to drawing the scene , clear color\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n \n drawScene();\n }", "function initBuffers() {\n // 3 stk 3D vertekser:\n let trianglePositions = new Float32Array([ //NB! ClockWise!!\n -10, -10, 0, //0\n 0, -5, 0,\n 10, -8, 0,\n -1, -8, 0,\n 3, 4, 0,\n 7, -6, 0,\n -15, -10, 0,\n 0, 5, 0,\n 10, -7, -5,\n 2, 5, 0,\n 5, -7, -5, //10\n\n -25, 9, 0, //11 triangle\n -25, -15, 0,\n -10, 8, -2,\n\n -26, 11, 0, //14 line\n -29, -16, 0,\n\n -30, -25, 0, //16 line\n 6, -20, 0,\n\n -15, -25, 0, //18 LINE_STRIP\n 6, -10, 0,\n 8, -15, 0,\n -15, -25, 0,\n\n -8, -25, 0, //22 TRIANGLE_STRIP\n -6, -10, 0,\n -9, -15, 0,\n\n -15, -20, 0,\n -12, -22, 0,\n\n -9, -30, 0,\n -15, -29, 0,\n\n -12, -18, 0,\n -12, -17, 0, //30\n\n\n ]);\n\n // Verteksbuffer:\n positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, trianglePositions, gl.STATIC_DRAW);\n\n positionBuffer.itemSize = 3; // NB!!\n positionBuffer.numberOfItems = 3; // NB!!\n\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n}", "function init()\n {\n\tcanvas = document.getElementById( \"gl-canvas\" );\n\t\n\t// gl = WebGLUtils.setupWebGL( canvas ); // More efficient\n\tgl = WebGLDebugUtils.makeDebugContext( canvas.getContext(\"webgl\") ); // For debugging\n\tif ( !gl ) { alert( \"WebGL isn't available\" ); }\n\n\tcolorCube();\n\n\tgl.viewport( 0, 0, canvas.width, canvas.height );\n\tgl.clearColor( 0.0, 0.0, 0.0, 1.0 );\n\t\n\tgl.enable(gl.DEPTH_TEST);\n\n\t//\n\t// Load shaders and initialize attribute buffers\n\t//\n\tprogram = initShaders( gl, \"vertex-shader\", \"fragment-shader\" );\n\tgl.useProgram( program );\n\t\n\tcBuffer = gl.createBuffer();\n\tgl.bindBuffer( gl.ARRAY_BUFFER, cBuffer );\n\tgl.bufferData( gl.ARRAY_BUFFER, flatten(colors), gl.STATIC_DRAW );\n\n\tvColor = gl.getAttribLocation( program, \"vColor\" );\n\tgl.vertexAttribPointer( vColor, 4, gl.FLOAT, false, 0, 0 );\n\tgl.enableVertexAttribArray( vColor );\n\n\tvBuffer = gl.createBuffer();\n\tgl.bindBuffer( gl.ARRAY_BUFFER, vBuffer );\n\tgl.bufferData( gl.ARRAY_BUFFER, flatten(points), gl.STATIC_DRAW );\n\n\tvPosition = gl.getAttribLocation( program, \"vPosition\" );\n\tgl.vertexAttribPointer( vPosition, 3, gl.FLOAT, false, 0, 0 );\n\tgl.enableVertexAttribArray( vPosition );\n\n\tmodelViewMatrixLoc = gl.getUniformLocation( program, \"modelViewMatrix\" );\n\tprojectionMatrixLoc = gl.getUniformLocation( program, \"projectionMatrix\" );\n\n\t//event listeners for buttons -- now added below instead of in init\n\t\n\t// document.getElementById( \"xButton\" ).onclick = function () {\n\t// axis = xAxis;\n\t// \trender();\n\t// };\n\t// document.getElementById( \"yButton\" ).onclick = function () {\n\t// axis = yAxis;\n\t// \trender();\n\t// };\n\t// document.getElementById( \"zButton\" ).onclick = function () {\n\t// axis = zAxis;\n\t// \trender();\n\t// };\n\t// \n\trender();\n }", "function setUpBuffers(){\r\n \"use strict\";\r\n\r\n\r\n var vertices = [\r\n //Pos X, Y, Z\r\n 0, 0, 0,\r\n 1, 0, 0,\r\n 1, 1, 0,\r\n 0, 1, 0,\r\n\r\n 0, 0, 1,\r\n 1, 0, 1,\r\n 1, 1, 1,\r\n 0, 1, 1,\r\n ];\r\n\r\n vertexBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\r\n\r\n var vertexIndices = [ //Welche vertices sind mit welchen anderen vertices verbunden?\r\n 0, 1,\r\n 0, 3,\r\n 0, 4,\r\n 1, 2,\r\n 1, 5,\r\n 2, 3,\r\n 2, 6,\r\n 3, 7,\r\n 4, 5,\r\n 4, 7,\r\n 5, 6,\r\n 6, 7,\r\n ];\r\n edgeBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, edgeBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vertexIndices), gl.STATIC_DRAW);\r\n\r\n\r\n\r\n}", "function onReady() {\n shader = new ShaderBuilder(gl, \"vertexShader\", \"fragmentShader\")\n .prepareUniforms(\n \"uPMatrix\", \"mat4\",\n \"uMVMatrix\", \"mat4\",\n \"uCameraMatrix\", \"mat4\",\n ).setUniforms(\n \"uPMatrix\", camera.projectionMatrix\n );\n\n model = Terrain.createModel(gl, true);\n\n mDebug = new LineDebugger(gl);\n mDebug.addColor(\"#00FF00\")\n .addMeshNormal(0.0, 0.3, model.mesh)\n .finalize();\n\n // start drawing frames now\n rendLoop.start();\n}", "function initVertexBuffers(ev,gl,canvas,a_Position,n){ \n var n = xy_points.length/2; //Number of coordinate pairs\n \n if(right_clicked == true){\n n= g_points.length/2;\n }\n //Create buffer object\n var vertexBuffer = gl.createBuffer();\n if (!vertexBuffer){\n console.log('Failed to create the buffer object');\n return -1;\n }\n \n //Bind buffer to target and write data into buffer object\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, xy_points, gl.STATIC_DRAW);\n \n //Initialize a_Position for shader\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n if (a_Position < 0){\n console.log('Failed to get the storage location of a_Position');\n return -1;\n }\n\n gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_Position);\n return n; \n}", "initBuffers() {\n let controlPoints =\n //grau 1 em u e grau 1 em v\n [\n // u=1\n [\n [-0.5, 0, 0.5, 1],\n [-0.5, 0, -0.5, 1]\n\n ],\n //u=2\n [\n [0.5, 0, 0.5, 1],\n [0.5, 0, -0.5, 1]\n\n ],\n\n ];\n\n let surface = new CGFnurbsSurface(1, 1, controlPoints);\n this.object = new CGFnurbsObject(this.scene, this.npartsU, this.npartsV, surface);\n }", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST); //check the draw is right\n // gl.enable(gl.CULL_FACE); //check the draw is right\n //gl.cullFace(gl.BACK); \n tick();\n}", "function initBuffers1(gl, program) {\n var o = new Object();\n\n o.vertexBuffer = gl.createBuffer();\n o.vertexBuffer.num = 3;\n o.vertexBuffer.type = gl.FLOAT;\n\n o.normalBuffer = gl.createBuffer();\n o.normalBuffer.num = 3;\n o.normalBuffer.type = gl.FLOAT;\n\n o.colorBuffer = gl.createBuffer();\n o.colorBuffer.num = 4;\n o.colorBuffer.type = gl.FLOAT;\n\n o.indexBuffer = gl.createBuffer();\n \n return o;\n}", "function start(gl) {\r\n // retrieve <canvas> element\r\n var canvas = document.getElementById('webgl');\r\n // initialize shaders\r\n if (!initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)) {\r\n console.log('Failed to intialize shaders.');\r\n return;\r\n }\r\n // Get the storage location of a_Position\r\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\r\n if (a_Position < 0) {\r\n console.log('Failed to get the storage location of a_Position');\r\n return;\r\n }\r\n const surfaceCheckbox = document.getElementById('surfacenormalcheckbox')\r\n checkBox=surfaceCheckbox\r\n const shiftX = document.getElementById('shiftX')\r\n const moveLight = document.getElementById('moveLight') \r\n const rotateAlongY = document.getElementById('rotateAlongY') \r\n const whitebox = document.getElementById('whitebox')\r\n whiteLightBox = whitebox\r\n const redbox = document.getElementById('redbox')\r\n redLightBox = redbox\r\n surfaceCheckbox.onclick = function (ev){checkBoxClick(ev, gl, canvas, a_Position)}\r\n whitebox.onclick = function (ev){checkBoxClick(ev, gl, canvas, a_Position)}\r\n redbox.onclick = function (ev){checkBoxClick(ev, gl, canvas, a_Position)}\r\n const da10 = document.getElementById('da10')\r\n // initialize buffers\r\n var success = initVertexBuffer(gl);\r\n success = success && initIndexBuffer(gl);\r\n success = success && initAttributes(gl); \r\n if (!success) {\r\n console.log('Failed to initialize buffers.');\r\n return;\r\n }\r\n\r\n canvas.onmousedown = function(ev){ leftclick(ev, gl, canvas, a_Position); };\r\n canvas.onmousemove = function(ev){ move(ev, gl, canvas, a_Position); };\r\n canvas.oncontextmenu = function(ev){ rightclick(ev, gl, canvas, a_Position); };\r\n shiftX.onclick = function(ev){ shift(ev, gl, canvas, a_Position); };\r\n moveLight.onclick = function(ev){ mvlight(ev, gl, canvas, a_Position); };\r\n rotateAlongY.onclick = function(ev){ rotateY(ev, gl, canvas, a_Position); };\r\n da10.onclick = function(ev){ max300(ev, gl, canvas, a_Position,0); };\r\n // specify the color for clearing <canvas>\r\n gl.clearColor(0, 0, 0, 1);\r\n // clear <canvas>\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n for (var i= 0 ; i<4 ; i++){\r\n light1C.push(1)\r\n }\r\n for (var i= 0 ; i<3 ; i++){\r\n light1V.push(1)\r\n light2V.push(1)\r\n }\r\n light2C.push(1)\r\n light2C.push(0)\r\n light2C.push(0)\r\n light2C.push(1)\r\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n gl.frontFace(gl.CCW);\n gl.cullFace(gl.BACK);\n\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function initBuffers(gl) {\n\n // Create a buffer for the square's positions.\n\n const positionBuffer = gl.createBuffer();\n\n // Select the positionBuffer as the one to apply buffer\n // operations to from here out.\n\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n // Now create an array of positions for the square.\n\n const positions = [\n ];\n\n const I = scope.N;\n const J = scope.N;\n\tconst {sin, cos} = Math;\n\n for (let i = 0; i < I; i++)\n for (let j = 0; j < J; j++)\n {\n\tconst phi = x => x / I * Math.PI * 2;\n\tconst theta = x => x / J * Math.PI - Math.PI/2;\n//\tconst X = (p, t) => cos(phi(p)) * cos(theta(t));\n//\tconst Y = (p, t) => sin(phi(p)) * cos(theta(t));\n//\tconst Z = (p, t) => sin(theta(t));\n\tconst pushPoint = (p, t) => {\n\t\t//positions.push(X(p, t), Y(p, t), Z(p, t));\n\t\tpositions.push(phi(p), theta(t));\n\t};\n\n\tpushPoint(i, j);\n\tpushPoint(i+1, j+1);\n\tpushPoint(i+1, j);\n\tpushPoint(i, j);\n\tpushPoint(i, j+1);\n\tpushPoint(i+1, j+1);\n }\n\n // Now pass the list of positions into WebGL to build the\n // shape. We do this by creating a Float32Array from the\n // JavaScript array, then use it to fill the current buffer.\n\n gl.bufferData(gl.ARRAY_BUFFER,\n new Float32Array(positions),\n gl.STATIC_DRAW);\n\n return {\n position: positionBuffer,\n };\n}", "function setUpBuffers() {\n //\n // Create a buffer for the square's vertices.\n\n squareVerticesBuffer = renderingContext.createBuffer();\n\n // Select the squareVerticesBuffer as the one to apply vertex\n // operations to from here out.\n\n renderingContext.bindBuffer (\n renderingContext.ARRAY_BUFFER,\n squareVerticesBuffer\n );\n\n // Now create an array of vertices for the square. Note that the Z\n // coordinate is always 0 here.\n\n var vertices = [\n 50.0, 50.0, 0.0,\n -50.0, 50.0, 0.0,\n 50.0, -50.0, 0.0,\n -50.0, -50.0, 0.0\n ];\n\n // Now pass the list of vertices into WebGL to build the shape. We\n // do this by creating a Float32Array from the JavaScript array,\n // then use it to fill the current vertex buffer.\n\n renderingContext.bufferData (\n renderingContext.ARRAY_BUFFER,\n new Float32Array(vertices),\n renderingContext.STATIC_DRAW\n );\n }" ]
[ "0.78950685", "0.78402084", "0.75048673", "0.7350822", "0.7333553", "0.7283233", "0.7274882", "0.7215834", "0.7184787", "0.7170557", "0.7167841", "0.71632725", "0.71518654", "0.7132437", "0.71322155", "0.70979", "0.7080388", "0.70771796", "0.70739985", "0.7060015", "0.7035884", "0.70131093", "0.699202", "0.6983995", "0.6982089", "0.69790035", "0.6975022", "0.6972971", "0.69682735", "0.69579834", "0.69276685", "0.6919457", "0.69111556", "0.69066834", "0.6906282", "0.689553", "0.6893121", "0.68700844", "0.6868795", "0.6868795", "0.68619585", "0.6857715", "0.6856732", "0.68553436", "0.68504155", "0.6841119", "0.6830077", "0.6826136", "0.6813071", "0.68127555", "0.6810177", "0.6803579", "0.68005824", "0.67919534", "0.6791839", "0.6790765", "0.67800117", "0.6778785", "0.67760074", "0.6773687", "0.6768487", "0.67597353", "0.6755061", "0.67548084", "0.67543", "0.67512494", "0.6736208", "0.6732194", "0.67313004", "0.67278594", "0.6724073", "0.67221403", "0.6719219", "0.6718957", "0.6718517", "0.671372", "0.6705466", "0.66737765", "0.6668522", "0.6654899", "0.6635692", "0.6633606", "0.66295934", "0.6626409", "0.66255814", "0.6621519", "0.6620152", "0.66190696", "0.66172105", "0.66171956", "0.6611441", "0.65988266", "0.6588642", "0.65876263", "0.6585539", "0.6584262", "0.65822184", "0.65796953", "0.65761083", "0.65738875", "0.657123" ]
0.0
-1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> initWebGL Initialize WebGL, returning the GL context or null if WebGL isn't available or could not be initialized.
function initWebGL() { var gl = null; try { gl = glcanvas.getContext("experimental-webgl");//load the web GL onto the canvas gl.viewportWidth=glcanvas.width;//find out the size of the canvas gl.viewportHeight=glcanvas.height; } catch(e) { console.log("exception caught when getting the webGL context"); } // If we don't have a GL context, give up now if (!gl) alert("Unable to initialize WebGL. Your browser may not support it."); return gl;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initWebGL() {\n gl = null;\n\n try {\n gl = canvas.getContext(Constants.WEBGL_CANVAS_CONTEXT);\n } catch (e) {\n log(Constants.WEBGL_CREATION_ERR);\n }\n\n if (!gl) {\n alert(Constants.WEBGL_UNSUPPORTED_ERR); // eslint-disable-line\n }\n}", "function initWebGL(canvas) {\n gl = null;\n\n // Try to grab the standard context. If it fails, fallback to experimental.\n gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');\n\n // If we don't have a GL context, give up now\n if (!gl) {\n alert(\"Unable to initialize WebGL. Your browser may not support it.\");\n }\n\n return gl;\n}", "function initWebGL(canvas){\n\tvar glContext = null;\n\t\n\ttry{\n\t\tglContext = canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\");\n\t}catch(e){\n\t\talert(\"Unable to initialize WebGL. Your browser may not support it.\");\n\t}\n\t\n\tif(glContext == null){\n\t\talert(\"WebGL context not inicialized\");\n\t}\n\t\n\treturn glContext;\n}", "function initWebGL(canvas) {\n gl = null;\n\n try {\n // Try to grab the standard context. If it fails, fallback to experimental.\n gl = canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\");\n }\n catch (e) { }\n\n // If we don't have a GL context, give up now\n if (!gl) {\n alert(\"Unable to initialize WebGL. Your browser may not support it.\");\n gl = null;\n }\n\n return gl;\n}", "function initWebGL(canvas) {\n gl = null;\n\n //grab standard context:\n gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');\n\n if (!gl) {\n alert(\"Unable to initialize webGL. Browser unsupported.\");\n }\n\n return(gl);\n}", "function initWebGL(canvas)\n{\n let gl = null;\n let msg = \"Your browser does not support WebGL, \" +\n \"or it is not enabled by default.\";\n try \n {\n gl = canvas.getContext(\"experimental-webgl\");\n } \n catch (e)\n {\n msg = \"Error creating WebGL Context!: \" + e.toString();\n }\n\n if (!gl)\n {\n alert(msg);\n throw new Error(msg);\n }\n\n return gl; \n}", "_initWebGL() {\n\n // Default context attribute values\n\n if (!this.gl) {\n for (let i = 0; !this.gl && i < WEBGL_CONTEXT_NAMES.length; i++) {\n try {\n this.gl = this.canvas.getContext(WEBGL_CONTEXT_NAMES[i], this.contextAttr);\n } catch (e) { // Try with next context name\n }\n }\n }\n\n if (!this.gl) {\n\n this.error('Failed to get a WebGL context');\n\n /**\n * Fired whenever the canvas failed to get a WebGL context, which probably means that WebGL\n * is either unsupported or has been disabled.\n * @event webglContextFailed\n */\n this.fire(\"webglContextFailed\", true, true);\n }\n\n if (this.gl) {\n // Setup extension (if necessary) and hints for fragment shader derivative functions\n if (this.webgl2) {\n this.gl.hint(this.gl.FRAGMENT_SHADER_DERIVATIVE_HINT, this.gl.FASTEST);\n } else if (WEBGL_INFO.SUPPORTED_EXTENSIONS[\"OES_standard_derivatives\"]) {\n const ext = this.gl.getExtension(\"OES_standard_derivatives\");\n this.gl.hint(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES, this.gl.FASTEST);\n }\n }\n }", "function initGL(canvas) {\r\n console.log(\"init webGL\");\r\n // http://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html\r\n var gl;\r\n try {\r\n gl = canvas.getContext(\"experimental-webgl\");\r\n } catch (e) { }\r\n if (!gl) alert(\"Could not initialise WebGL, sorry :-(\");\r\n return gl;\r\n }", "function initGL(canvas) {\n var gl = null;\n try {\n // Try to grab the standard context. If it fails, fallback to experimental.\n gl = canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\");\n gl.viewportWidth = canvas.width;\n gl.viewportHeight = canvas.height;\n } catch(e) {}\n\n // If we don't have a GL context, give up now\n if (!gl) {\n alert(\"Unable to initialize WebGL. Your browser may not support it.\");\n }\n return gl;\n}", "function initGL(canvas) {\r\n var gl = null;\r\n try {\r\n // Try to grab the standard context. If it fails, fallback to experimental.\r\n gl = canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n } catch(e) {}\r\n\r\n // If we don't have a GL context, give up now\r\n if (!gl) {\r\n alert(\"Unable to initialize WebGL. Your browser may not support it.\");\r\n }\r\n return gl;\r\n}", "function initializeWebGL(canvas) {\r\n var gl = canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n if (!gl) {\r\n alert(\"Error! Your browser may not support WebGL.\");\r\n }\r\n return gl;\r\n}", "function initializeWebGL() {\n\ttry {\n\t\tgl = canvas.getContext(\"webgl2\");\n\t} catch(e) {\n\t\tconsole.log(e);\n\t}\n\n\tif(gl) {\n\t\tprogram = compileAndLink(program,vs,fs);\n\t\tgl.useProgram(program);\n\n\t\t// Link mesh attributes to shader attributes and enable them\n\t\tprogram = linkMeshAttr(program,false);\n\n\t\t// Init world view and projection matrices\n\t\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\t\tgl.viewport(0.0, 0.0, canvas.clientWidth, canvas.clientHeight);\n\t\taspectRatio = canvas.clientWidth/canvas.clientHeight;\n\n\t\t// Turn on depth testing\n\t\tgl.enable(gl.DEPTH_TEST);\n\t\tgl.enable(gl.CULL_FACE);\n\t} else {\n\t\talert(\"Error: WebGL not supported by your browser!\");\n\t}\n}", "function initWebGl()\n {\n canvas = document.getElementById(\"gl-canvas\");\n gl = WebGLUtils.setupWebGL(canvas);\n if (!gl)\n {\n alert(\"Unable to setup WebGL!\");\n return;\n }\n gl.viewport(0, 0, canvas.clientWidth, canvas.clientHeight);\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n var vertexShader = initShader(gl, 'vertex-shader', gl.VERTEX_SHADER);\n var fragmentShader = initShader(gl, 'fragment-shader', gl.FRAGMENT_SHADER);\n var boxShader = initShader(gl, 'block-fragment-shader', gl.FRAGMENT_SHADER);\n var boxVShader = initShader(gl, 'block-vertex-shader', gl.VERTEX_SHADER);\n\n program = gl.createProgram();\n gl.attachShader(program, fragmentShader);\n gl.attachShader(program, vertexShader);\n gl.linkProgram(program);\n\n boxShaderProgram = gl.createProgram();\n gl.attachShader(boxShaderProgram, boxVShader);\n gl.attachShader(boxShaderProgram, boxShader);\n gl.linkProgram(boxShaderProgram);\n }", "function initGL(canvas) {\n var names = [\"webgl\", \"experimental-webgl\", \"moz-webgl\", \"webkit-3d\"];\n var i;\n for (i=0; names.length > i; i++) {\n try {\n gl = canvas.getContext(names[i]);\n //_gl = gl // UNCOMMENT FOR A GLOBAL REF TO GL\n if (gl) {\n // UNCOMMENT FOR WEBGL DEBUGGING\n // Debug wrapper is currently nesting in HTML file.\n //gl = WebGLDebugUtils.makeDebugContext(gl, function(a,b,c) {\n //console.warn(a,b,c);\n //});\n break;\n }\n } catch(e) {}\n }\n if (!gl) {\n alert(\"Could not initialise WebGL, sorry :-(\");\n }\n }", "function initGL( canvas )\n{\n\n try\n {\n\n gl = canvas.getContext( \"webgl\", { premultipliedAlpha: false } ) ||\n canvas.getContext( \"experimental-webgl\", { premultipliedAlpha: false } );\n gl.viewportWidth = canvas.width;\n gl.viewportHeight = canvas.height;\n\n }\n catch ( error )\n {\n\n // Browser cannot initialize a WebGL context.\n\n window.location.assign( \"http://get.webgl.org/\" );\n\n }\n\n if ( !gl )\n {\n\n // Browser cannot initialize a WebGL context.\n\n window.location.assign( \"http://get.webgl.org/\" );\n\n }\n\n}", "function getGLContext() {\n var canvas = document.getElementById(\"canvas\");\n if (canvas == null) {\n alert(\"Canvas not found\");\n return;\n }\n \n var names = [\"webgl\", \"experimental-webgl\", \"webkit-3d\", \"moz-webgl\"];\n for (var i = 0; i < names.length; i++) {\n try {\n gl = canvas.getContext(names[i]);\n } catch(e) {\n \n }\n \n if (gl) {\n break;\n }\n }\n \n if (gl == null) {\n alert(\"WebGL is not available\");\n } else {\n alert(\"You have WebGL\");\n }\n \n return gl;\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 initGL(canvas) {\n\n\tgl = canvas.getContext(\"webgl\");\n\tif (!gl) { \n\t\talert(\"Could not initialise WebGL, sorry :-(\");\n\t\treturn gl;\n\t\t}\n\tgl.viewportWidth = canvas.width;\n\tgl.viewportHeight = canvas.height;\n\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\tgl.enable(gl.DEPTH_TEST);\n\t\n\treturn gl;\n}", "function initWebGL() {\n try { \n gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); \n } catch(e) {\n }\n \n if (gl) {\n WIDTH = canvas.clientWidth.toFixed(1);\n HEIGHT = canvas.clientHeight.toFixed(1);\n ui = new UI();\n ui.setObjects(generateScene());\n\t\tresult.ui = ui;\n var start = new Date();\n setInterval(function(){ tick((new Date() - start) * 0.001); }, 1000 / 60);\n } else {\n alert('Your browser does not support WebGL.');\n }\n}", "function getGLContext(){\n var canvas = document.getElementById(\"canvas_webgl\");\n if(canvas == null)\n {\n alert(\"there is no canvas on this page\");\n return;\n }\n var names = [\"experimental-webgl\",\"webgl\",\"moz-webgl\",\"webkit-3d\"];\n\n for(var i = 0; i < names.length; i++)\n {\n try{\n ctx = canvas.getContext(names[i]);\n }catch(e){\n console(e);\n }\n if(ctx) break;\n } \n \n if( ctx == null){\n alert(\"WebGL is not available\");\n }else{\n console.log(\"Hooray! you got a WebGL context in a js file\");\n }\n\n c_width = canvas.width;\n c_height = canvas.height;\n return ctx;\n}", "function initGL(canvas) {\n try {\n gl = canvas.getContext(\"experimental-webgl\");\n gl.viewportWidth = canvas.width;\n gl.viweportHeight = canvas.height; \n } catch (e) {\n }\n if (!gl) {\n alert(\"Could not initialise WebGL, sorry :-(\");\n }\n}", "function initGLScene()\n{\n // Initialize the WebGL Context - the gl engine for drawing things.\n var gl = initWebGLContext(\"graphicsCanvas\"); // The id of the Canvas Element\n if (!gl) // if fails simply return\n {\n return;\n }\n // succeeded in initializing WebGL system\n return gl;\n}", "function setupWebGL(canvasID, vertexShaderID, fragmentShaderID) {\n /* Get the WebGL context */\n gl = twgl.getWebGLContext(document.getElementById(canvasID));\n\n /* Initialize the WebGL environment */\n if (gl) {\n gl.clearColor(0, 0, 0, 1);\n\n gl.enable(gl.DEPTH_TEST);\n gl.depthFunc(gl.LEQUAL);\n \n maximizeCanvas(gl);\n document.body.onresize = () => maximizeCanvas(gl);\n\n Promise.all([\n loadShader(vertexShaderID),\n loadShader(fragmentShaderID)\n ]).then(() => {\n /* Create the programs */\n programInfo = twgl.createProgramInfo(gl, [vertexShaderID, fragmentShaderID]);\n gl.useProgram(programInfo.program);\n\n /* Create the primitive */\n twgl.setDefaults({ attribPrefix: 'a_' });\n var arrays = primitives.createSphereVertices(500, 50, 50);\n createSphereTangents(arrays, 50, 50);\n sphere = twgl.createBufferInfoFromArrays(gl, arrays);\n\n colorMap = twgl.createTexture(gl, { src: './images/colormap.png', flipY: false });\n normalMap = twgl.createTexture(gl, { src: './images/normalmap.png', flipY: false });\n faceMap = twgl.createTexture(gl, { src: './images/me.png' });\n\n /* Initialize the mouse and keys */\n initMouseEvents();\n initKeyEvents();\n\n /* Clear the matrix stack */\n matrixstack.clear();\n\n /* Update the canvas content */\n window.requestAnimationFrame(render);\n });\n }\n}", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl2\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function setupWebGL() {\r\n\r\n // Get the canvas and context\r\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\r\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\r\n \r\n try {\r\n if (gl == null) {\r\n throw \"unable to create gl context -- is your browser gl ready?\";\r\n } else {\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\r\n gl.clearDepth(1.0); // use max when we clear the depth buffer\r\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\r\n }\r\n } // end try\r\n \r\n catch(e) {\r\n console.log(e);\r\n } // end catch\r\n \r\n} // end setupWebGL", "function initializeGL() {\n // the \"GLCanvas\" defined in the index.html file\n var canvas = document.getElementById(\"GLCanvas\");\n\n // Get standard webgl, or experimental\n // binds webgl to the Canvas area on the web-page to the global variable \"Gloabl.gGL\"\n Gloabl.gGL = canvas.getContext(\"webgl\") ||\n canvas.getContext(\"experimental-webgl\");\n\n if (Gloabl.gGL !== null) {\n Gloabl.gGL.clearColor(0.0, 0.8, 0.0, 1.0); // set the color to be cleared\n\n // 1. initialize the buffer with the vertex positions for the unit square\n initSquareBuffer(); // This function is defined in the VertexBuffer.js file\n\n // 2. now load and compile the vertex and fragment shaders\n initSimpleShader(\"VertexShader\", \"FragmentShader\");\n // the two shaders are defined in the index.html file\n // InitSimpleShader() function is defined in ShaderSupport.js file\n\n } else {\n document.write(\"<br><b>WebGL is not supported!</b>\");\n }\n}", "function init() {\n \n // Retrieve the canvas\n const canvas = document.getElementById('webgl-canvas');\n if (!canvas) {\n console.error(`There is no canvas with id ${'webgl-canvas'} on this page.`);\n return null;\n }\n\n\n // Retrieve a WebGL context\n gl = canvas.getContext('webgl2');\n if (!gl) {\n console.error(`There is no WebGL 2.0 context`);\n return null;\n }\n \n // Set the clear color to be black\n gl.clearColor(0, 0, 0, 1);\n \n // some GL initialization\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n \n gl.cullFace(gl.BACK);\n gl.frontFace(gl.CCW);\n gl.clearColor(0.0,0.0,0.0,1.0)\n gl.depthFunc(gl.LEQUAL)\n gl.clearDepth(1.0)\n\n // Read, compile, and link your shaders\n initProgram();\n \n // create and bind your current object\n createShapes();\n \n // set up your camera\n setUpCamera();\n \n // do a draw\n draw();\n }", "function initWebGL() {\r\n c = document.getElementById(\"c\");\r\n gl = c.getContext(\"webgl2\") || c.getContext(\"experimental-webgl2\");\r\n gl.enable(gl.DEPTH_TEST);\r\n //spector.displayUI();\r\n}", "function createGLContext() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n opts = Object.assign({}, contextDefaults, opts);\n var _opts = opts,\n canvas = _opts.canvas,\n width = _opts.width,\n height = _opts.height,\n throwOnError = _opts.throwOnError,\n manageState = _opts.manageState,\n debug = _opts.debug;\n\n // Error reporting function, enables exceptions to be disabled\n\n function onError(message) {\n if (throwOnError) {\n throw new Error(message);\n }\n // log.log(0, message);\n return null;\n }\n\n var gl = void 0;\n if (__WEBPACK_IMPORTED_MODULE_6__utils__[\"isBrowser\"]) {\n // Make sure we have a real canvas (\"canvas\" can a string, a canvas or null)\n var realCanvas = void 0;\n if (!canvas) {\n realCanvas = Object(__WEBPACK_IMPORTED_MODULE_2__webgl_utils__[\"a\" /* createCanvas */])({ id: 'lumagl-canvas', width: width, height: height, onError: onError });\n } else if (typeof canvas === 'string') {\n realCanvas = Object(__WEBPACK_IMPORTED_MODULE_2__webgl_utils__[\"c\" /* getCanvas */])({ id: canvas });\n } else {\n realCanvas = canvas;\n }\n // Create a WebGL context in the canvas\n gl = Object(__WEBPACK_IMPORTED_MODULE_2__webgl_utils__[\"b\" /* createContext */])({ canvas: realCanvas, opts: opts });\n } else {\n // Create a headless-gl context under Node.js\n gl = _createHeadlessContext({ width: width, height: height, opts: opts, onError: onError });\n }\n if (!gl) {\n return null;\n }\n\n // Install context state tracking\n if (manageState) {\n Object(__WEBPACK_IMPORTED_MODULE_1__webgl_utils_track_context_state__[\"a\" /* default */])(gl, {\n copyState: false,\n log: function log() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return __WEBPACK_IMPORTED_MODULE_6__utils__[\"log\"].log.apply(__WEBPACK_IMPORTED_MODULE_6__utils__[\"log\"], [1].concat(args));\n }\n });\n }\n\n // Add debug instrumentation to the context\n if (__WEBPACK_IMPORTED_MODULE_6__utils__[\"isBrowser\"] && debug) {\n gl = Object(__WEBPACK_IMPORTED_MODULE_3__context_debug__[\"a\" /* makeDebugContext */])(gl, { debug: debug });\n // Debug forces log level to at least 1\n __WEBPACK_IMPORTED_MODULE_6__utils__[\"log\"].priority = Math.max(__WEBPACK_IMPORTED_MODULE_6__utils__[\"log\"].priority, 1);\n // Log some debug info about the context\n logInfo(gl);\n }\n\n // Add to seer integration\n\n return gl;\n}", "function initShader(gl)\n{\n // load and compile the fragment and vertex shader\n let fragmentShader = createShader(gl, fragmentShaderSource, \"fragment\");\n let vertexShader = createShader(gl, vertexShaderSource, \"vertex\");\n\n // link them together into a new program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // get pointers to the shader params\n shaderVertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"vertexPos\");\n gl.enableVertexAttribArray(shaderVertexPositionAttribute);\n\n shaderVertexColorAttribute = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(shaderVertexColorAttribute);\n \n shaderProjectionMatrixUniform = gl.getUniformLocation(shaderProgram, \"projectionMatrix\");\n shaderModelViewMatrixUniform = gl.getUniformLocation(shaderProgram, \"modelViewMatrix\");\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Could not initialise shaders\");\n }\n}", "function _init_level_0() {\n\t\tmedeactx.canvas = document.getElementById(where);\n\t\t// #if DEBUG\n\t\t//medeactx.Assert(medeactx.canvas != null, \"element with #id \\\"\" + where + \"\\\" not found\");\n\t\t// #endif\n\n\t\t// create a webgl context\n\t\t// try out all the names under which webgl might be available\n\t\tvar candidates = [\"webgl\", \"experimental-webgl\", \"webkit-3d\", \"moz-webgl\"]\n\t\t,\ti\n\t\t,\tcontext = null\n\t\t;\n\n\t\tfor (i = 0; i < candidates.length; ++i) {\n\t\t\ttry {\n\t\t\t\t// Request a stencil buffer by default (D24S8 should be\n\t\t\t\t// universally available, if not this needs to be revised)\n\t\t\t\tcontext = medeactx.canvas.getContext(candidates[i], {\n\t\t\t\t\tstencil : true\n\t\t\t\t});\n\t\t\t} catch(ex) {\n\n\t\t\t}\n\t\t\t// no matter what happens, we take the first non-null context we get\n\t\t\tif (context) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!context) {\n\t\t// #if LOG\n\t\t\tmedealib.Log('webgl initialization failed','error');\n\t\t// #endif\n\t\t\tif(user_on_failure) {\n\t\t\t\tuser_on_failure();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// automatically create debug context if webgl-debug.js is present\n\t\tif (window.WebGLDebugUtils !== undefined) {\n\t\t\tcontext = WebGLDebugUtils.makeDebugContext(context);\n\t\t}\n\n\t// #ifdef LOG\n\t\tmedealib.LogDebug('webgl context successfully created');\n\t// #endif\n\n\t\tmedeactx.gl = context;\n\t\treturn true;\n\t}", "function initWebGLProgram(webGLContext, vertexShaders, fragmentShaders) {\n vertexShaders = R.unless(R.is(Object), vShader => [vShader])(vertexShaders);\n fragmentShaders = R.unless(R.is(Object), fShader => [fShader])(fragmentShaders);\n\n const webGLProgram = webGLContext.createProgram();\n\n prepareShaders(webGLContext.VERTEX_SHADER, vertexShaders);\n prepareShaders(webGLContext.FRAGMENT_SHADER, fragmentShaders);\n\n webGLContext.linkProgram(webGLProgram);\n\n if (!webGLContext.getProgramParameter(webGLProgram, webGLContext.LINK_STATUS)) {\n alert('Could not initialise shaders');\n }\n\n webGLContext.useProgram(webGLProgram);\n\n webGLProgram.vertexPositionAttribute = webGLContext.getAttribLocation(webGLProgram, 'aVertexPosition');\n webGLProgram.pMatrixUniform = webGLContext.getUniformLocation(webGLProgram, 'uPMatrix');\n webGLProgram.mvMatrixUniform = webGLContext.getUniformLocation(webGLProgram, 'uMVMatrix');\n\n return webGLProgram;\n}", "function createGLContext(canvas) {\n var context = canvas.getContext(\"webgl\");\n if (!context) {\n alert(\"Unable to initialize WebGL.\");\n return;\n }\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n return context;\n}", "function requireGLContext() {\n if (!gl)\n throw \"No active WebGL context\";\n}", "enableWebGL () {\n if (typeof (GL) === undefined)\n throw (\"litegl.js must be included to use a WebGL canvas\");\n if (typeof (enableWebGLCanvas) === undefined)\n throw (\"webglCanvas.js must be included to use this feature\");\n\n this.d_gl = this.d_ctx = enableWebGLCanvas(this.d_canvas);\n this.d_ctx.webgl = true;\n this.d_bgcanvas = this.d_canvas;\n this.d_bgctx = this.d_gl;\n }", "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i=0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch(e) {}\n if (context) {\n break;\n }\n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i = 0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch (e) { }\n if (context) {\n break;\n } \n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "function createGLContext(canvas) {\r\n\tvar names = [\"webgl\", \"experimental-webgl\"];\r\n\tvar context = null;\r\n\tfor (var i = 0; i < names.length; i++) {\r\n\t\ttry {\r\n\t\t\tcontext = canvas.getContext(names[i]);\r\n\t\t} catch(e) {}\r\n\t\tif (context) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif (context) {\r\n\t\tcontext.viewportWidth = canvas. width;\r\n\t\tcontext.viewportHeight = canvas.height;\r\n\t} else {\r\n\t\talert(\"Failed to create WebGL context!\");\r\n\t}\r\n\treturn context;\r\n}", "function createGLContext(canvas) {\r\n var names = [\"webgl\", \"experimental-webgl\"];\r\n var context = null;\r\n for (var i=0; i < names.length; i++) {\r\n try {\r\n context = canvas.getContext(names[i]);\r\n } catch(e) {}\r\n if (context) {\r\n break;\r\n }\r\n }\r\n if (context) {\r\n context.viewportWidth = canvas.width;\r\n context.viewportHeight = canvas.height;\r\n } else {\r\n alert(\"Failed to create WebGL context!\");\r\n }\r\n return context;\r\n}", "function setupWebGL() {\n \n // Set up keys\n document.onkeydown = handleKeyDown; // call this when key pressed\n \n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0, 0, 0, 1);\n}", "get WebGLPlayer() {}", "function ContextGL(canvas,options){\n options = validateOption(options,DefaultConfig);\n\n if(options.version !== WEBGL_1_VERSION &&\n options.version !== WEBGL_2_VERSION){\n throw new Error(`Invalid context version ${options.version}.`);\n }\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // gl\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this._glVersion = -1;\n this._gl = null;\n\n //capabiliies for context version\n let glCapabilities;\n\n //WebGLRenderingContext\n if(options.version === WEBGL_1_VERSION){\n glCapabilities = {\n INSTANCED_ARRAYS : false,\n VERTEX_ARRAYS : false,\n ELEMENT_INDEX_UINT : false,\n DRAW_BUFFERS: false,\n DEPTH_TEXTURE : false,\n FLOAT_TEXTURE : false,\n HALF_FLOAT: false,\n FLOAT_TEXTURE_LINEAR: false,\n HALF_FLOAT_TEXTURE_LINEAR : false\n };\n this._glVersion = options.version;\n this._gl = getWebGLRenderingContext(canvas,WEBGL_1_CONTEXT_IDS,options);\n\n //WebGL2RenderingContext\n } else {\n glCapabilities = {\n DEPTH_TEXTURE : false,\n FLOAT_TEXTURE : false,\n HALF_FLOAT : false,\n FLOAT_TEXTURE_LINEAR : false,\n HALF_FLOAT_TEXTURE_LINEAR : false\n };\n this._glVersion = options.version;\n this._gl = getWebGLRenderingContext(canvas,WEBGL_2_CONTEXT_IDS,options);\n\n //not available, use allowed fallback version\n if(!this._gl && options.fallback){\n this._glVersion = WEBGL_1_VERSION;\n this._gl = getWebGLRenderingContext(canvas,WEBGL_1_CONTEXT_IDS,options);\n }\n }\n\n //WebGLRenderingContext creation failed\n if(!this._gl){\n const msgFallback = options.version === WEBGL_2_VERSION ? !options.fallback ? ' No fallback set.' : ' Fallback version 1 not available.' : '';\n const msgError = `ContextGL not available. Requested WebGL version ${options.version} not available.${msgFallback}`;\n throw new Error(msgError);\n }\n\n if(options.warn && this._glVersion !== options.version){\n console.info('Requested WebGL version 2 not available. Using fallback version 1.');\n }\n\n // check config request\n if(options.warn){\n const contextAttributes = this._gl.getContextAttributes();\n for(let option in options){\n if(option === 'warn' || option === 'version' || option === 'fallback'){\n continue;\n }\n if(options[option] !== contextAttributes[option]){\n console.warn(`${option} requested but not available.`);\n }\n }\n }\n\n // EXTENSIONS\n\n // instanced arrays\n if(!this._gl.drawElementsInstanced){\n const ext = this._gl.getExtension('ANGLE_instanced_arrays');\n if(!ext){\n this._gl.drawElementsInstanced =\n this._gl.drawArraysInstanced =\n this._gl.vertexAttribDivisor = function(){\n throw new Error('ANGLE_instanced_arrays not supported.');\n };\n } else {\n this._gl.drawElementsInstanced = ext.drawElementsInstancedANGLE.bind(ext);\n this._gl.drawArraysInstanced = ext.drawArraysInstancedANGLE.bind(ext);\n this._gl.vertexAttribDivisor = ext.vertexAttribDivisorANGLE.bind(ext);\n glCapabilities.INSTANCED_ARRAYS = true;\n }\n }\n\n //vertex arrays\n if(!this._gl.createVertexArray){\n const ext = this._gl.getExtension('OES_vertex_array_object');\n if(!ext){\n this.createVertexArray = this._createVertexArrayShim;\n this.deleteVertexArray = this._deleteVertexArrayShim;\n this.setVertexArray = this._setVertexArrayShim;\n this.invalidateVertexArray = this._invalidateVertexArrayShim;\n } else {\n this._gl.VERTEX_ARRAY_BINDING = ext.VERTEX_ARRAY_BINDING_OES;\n this._gl.createVertexArray = ext.createVertexArrayOES.bind(ext);\n this._gl.deleteVertexArray = ext.deleteVertexArrayOES.bind(ext);\n this._gl.bindVertexArray = ext.bindVertexArrayOES.bind(ext);\n this.createVertexArray = this._createVertexArrayNative;\n this.deleteVertexArray = this._deleteVertexArrayNative;\n this.setVertexArray = this._setVertexArrayNative;\n this.invalidateVertexArray = this._invalidateVertexArrayNative;\n glCapabilities.VERTEX_ARRAYS = true;\n }\n } else {\n this.createVertexArray = this._createVertexArrayNative;\n this.deleteVertexArray = this._deleteVertexArrayNative;\n this.setVertexArray = this._setVertexArrayNative;\n this.invalidateVertexArray = this._invalidateVertexArrayNative;\n }\n\n //draw buffers, no shim\n if(!this._gl.drawBuffers){\n const ext = this._gl.getExtension('WEBGL_draw_buffers');\n let maxDrawBuffers = 1;\n let maxColorAttachments = 1;\n if(ext){\n maxDrawBuffers = this._gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL);\n maxColorAttachments = this._gl.getParameter(ext.MAX_COLOR_ATTACHMENTS_WEBGL);\n this._gl.drawBuffers = ext.drawBuffersWEBGL.bind(ext);\n this._setFramebufferColorAttachment = this._setFramebufferColorAttachmentDrawBuffersSupported;\n this.drawBuffers = this._drawBuffersSupported;\n glCapabilities.DRAW_BUFFERS = true;\n } else {\n this._setFramebufferColorAttachment = this._setFramebufferColorAttachmentDrawBuffersNotSupported;\n this.drawBuffers = this._drawBuffersNotSupported;\n }\n this.MAX_DRAW_BUFFERS = maxDrawBuffers;\n this.MAX_COLOR_ATTACHMENTS = maxColorAttachments;\n } else {\n this.MAX_DRAW_BUFFERS = this._gl.MAX_DRAW_BUFFERS;\n this.MAX_COLOR_ATTACHMENTS = this._gl.MAX_COLOR_ATTACHMENTS;\n this._setFramebufferColorAttachment = this._setFramebufferColorAttachmentDrawBuffersSupported;\n this.drawBuffers = this._drawBuffersSupported;\n }\n\n //depth texture, no shim\n //TODO: angle?\n const extDepthTexture = this._gl.getExtension('WEBGL_depth_texture');\n if(extDepthTexture){\n this.UNSIGNED_INT_24_8 = extDepthTexture.UNSIGNED_INT_24_8_WEBGL;\n }\n glCapabilities.DEPTH_TEXTURE = !!extDepthTexture;\n\n //float texture\n const extFloatTexture = this._gl.getExtension('OES_texture_float');\n glCapabilities.FLOAT_TEXTURE = !!extFloatTexture;\n\n //half float texture\n if(!this._gl.HALF_FLOAT){\n const ext = this._gl.getExtension('OES_texture_half_float');\n if(ext){\n this.HALF_FLOAT = ext.HALF_FLOAT_OES;\n }\n glCapabilities.HALF_FLOAT = !!ext;\n } else {\n this.HALF_FLOAT = this._gl.HALF_FLOAT;\n }\n\n //float texture linear\n const extFloatTextureLinear = this._gl.getExtension('OES_texture_float_linear');\n glCapabilities.FLOAT_TEXTURE_LINEAR = !!extFloatTextureLinear;\n\n //half float texture linear\n const extHalfFloatTextureLinear = this._gl.getExtension('OES_texture_half_float_linear');\n glCapabilities.HALF_FLOAT_TEXTURE_LINEAR = !!extHalfFloatTextureLinear;\n\n //anisotropy\n glCapabilities.ELEMENT_INDEX_UINT = !!this._gl.getExtension('OES_element_index_uint');\n this._glCapabilites = Object.freeze(glCapabilities);\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Overall\n /*----------------------------------------------------------------------------------------------------------------*/\n\n //internal object counter, with offset for internal ids\n this._uid = 64;\n this._mask = -1;\n this._maskStack = [];\n\n this._clearBitMap = {};\n this._clearBitMap[DEPTH_BIT] = this._gl.DEPTH_BUFFER_BIT;\n this._clearBitMap[COLOR_BIT] = this._gl.COLOR_BUFFER_BIT;\n this._clearBitMap[STENCIL_BIT] = this._gl.STENCIL_BUFFER_BIT;\n this._clearBitMap[DEPTH_BIT | COLOR_BIT] = this._gl.DEPTH_BUFFER_BIT | this._gl.COLOR_BUFFER_BIT;\n this._clearBitMap[DEPTH_BIT | STENCIL_BIT] = this._gl.DEPTH_BUFFER_BIT | this._gl.STENCIL_BUFFER_BIT;\n this._clearBitMap[COLOR_BIT | STENCIL_BIT] = this._gl.COLOR_BUFFER_BIT | this._gl.STENCIL_BUFFER_BIT;\n\n this.ALL_BIT = ALL_BIT;\n\n this.ALIASED_LINE_WIDTH_RANGE = glObjToArray(this._gl.getParameter(this._gl.ALIASED_LINE_WIDTH_RANGE));\n this.ALIASED_POINT_SIZE_RANGE = glObjToArray(this._gl.getParameter(this._gl.ALIASED_POINT_SIZE_RANGE));\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Viewport\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.VIEWPORT_BIT = VIEWPORT_BIT;\n this._viewportState = new ViewportState(glObjToArray(this._gl.getParameter(this._gl.VIEWPORT)).slice(0, 4));\n this._viewportStack = [];\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Culling\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.CULLING_BIT = CULLING_BIT;\n this._cullingState = new CullingState(\n this._gl.getParameter(this._gl.CULL_FACE),\n this._gl.getParameter(this._gl.CULL_FACE_MODE)\n );\n this._cullingStateDefault = this._cullingState.copy();\n this._cullStack = [];\n\n this.FRONT = this._gl.FRONT;\n this.BACK = this._gl.BACK;\n this.FRONT_AND_BACK = this._gl.FRONT_AND_BACK;\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Scissor\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.SCISSOR_BIT = SCISSOR_BIT;\n this._scissorState = new ScissorState(\n this._gl.getParameter(this._gl.SCISSOR_TEST),\n glObjToArray(this._gl.getParameter(this._gl.SCISSOR_BOX)).slice(0, 4)\n );\n this._scissorStateDefault = this._scissorState.copy();\n this._scissorStack = [];\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Stencil\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.STENCIL_BIT = STENCIL_BIT;\n this._stencilState = new StencilState(\n this._gl.getParameter(this._gl.STENCIL_TEST),[\n //front\n this._gl.getParameter(this._gl.STENCIL_FUNC),\n this._gl.getParameter(this._gl.STENCIL_REF),\n this._gl.getParameter(this._gl.STENCIL_VALUE_MASK),\n //back\n this._gl.getParameter(this._gl.STENCIL_FUNC),\n this._gl.getParameter(this._gl.STENCIL_REF),\n this._gl.getParameter(this._gl.STENCIL_VALUE_MASK)\n ], [\n //front\n this._gl.getParameter(this._gl.STENCIL_FAIL),\n this._gl.getParameter(this._gl.STENCIL_PASS_DEPTH_FAIL),\n this._gl.getParameter(this._gl.STENCIL_PASS_DEPTH_PASS),\n //back\n this._gl.getParameter(this._gl.STENCIL_FAIL),\n this._gl.getParameter(this._gl.STENCIL_PASS_DEPTH_FAIL),\n this._gl.getParameter(this._gl.STENCIL_PASS_DEPTH_PASS)\n ]\n );\n this._stencilStateDefault = this._stencilState.copy();\n this._stencilStack = [];\n\n this.NEVER = this._gl.NEVER;\n this.LESS = this._gl.LESS;\n this.LEQUAL = this._gl.LEQUAL;\n this.GREATER = this._gl.GREATER;\n this.GEQUAL = this._gl.GEQUAL;\n this.EQUAL = this._gl.EQUAL;\n this.NOTEQUAL = this._gl.NOTEQUAL;\n this.ALWAYS = this._gl.ALWAYS;\n\n this.KEEP = this._gl.KEEP;\n this.REPLACE = this._gl.REPLACE;\n this.INCR = this._gl.INCR;\n this.INCR_WRAP = this._gl.INCR_WRAP;\n this.DECR = this._gl.DECR;\n this.DECR_WRAP = this._gl.DECR_WRAP;\n this.INVERT = this._gl.INVERT;\n this.REPLACE = this._gl.REPLACE;\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Depth\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.DEPTH_BIT = DEPTH_BIT;\n this._depthState = new DepthState(\n this._gl.getParameter(this._gl.DEPTH_TEST),\n this._gl.getParameter(this._gl.DEPTH_WRITEMASK),\n this._gl.getParameter(this._gl.DEPTH_FUNC),\n this._gl.getParameter(this._gl.DEPTH_CLEAR_VALUE),\n glObjToArray(this._gl.getParameter(this._gl.DEPTH_RANGE)).slice(0, 2),[\n this._gl.getParameter(this._gl.POLYGON_OFFSET_FACTOR),\n this._gl.getParameter(this._gl.POLYGON_OFFSET_UNITS)\n ]\n );\n this._depthStateDefault = this._depthState.copy();\n this._depthStack = [];\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Color\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.COLOR_BIT = COLOR_BIT;\n this._colorState = new ColorState(\n glObjToArray(this._gl.getParameter(this._gl.COLOR_CLEAR_VALUE)),\n glObjToArray(this._gl.getParameter(this._gl.COLOR_WRITEMASK))\n );\n this._colorStateDefault = this._colorState.copy();\n this._colorStack = [];\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Line Width\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.LINE_WIDTH_BIT = LINE_WIDTH_BIT;\n this._lineWidthState = new LineWidthState(this._gl.getParameter(this._gl.LINE_WIDTH));\n this._lineWidthStateDefault = this._lineWidthState.copy();\n this._lineWidthStack = [];\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Blend\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.BLEND_BIT = BLEND_BIT;\n this._blendState = new BlendState(\n this._blend = this._gl.getParameter(this._gl.BLEND),\n glObjToArray(this._gl.getParameter(this._gl.BLEND_COLOR)).slice(0, 4),[\n this._gl.getParameter(this._gl.BLEND_EQUATION_RGB),\n this._gl.getParameter(this._gl.BLEND_EQUATION_ALPHA)\n ],[\n this._gl.getParameter(this._gl.BLEND_SRC_RGB),\n this._gl.getParameter(this._gl.BLEND_DST_RGB),\n this._gl.getParameter(this._gl.BLEND_SRC_ALPHA),\n this._gl.getParameter(this._gl.BLEND_DST_ALPHA)\n ]\n );\n this._blendStateDefault = this._blendState.copy();\n this._blendStack = [];\n\n this.FUNC_ADD = this._gl.FUNC_ADD;\n this.FUNC_SUBTRACT = this._gl.FUNC_SUBTRACT;\n this.FUNC_REVERSE_SUBTRACT = this._gl.FUNC_REVERSE_SUBTRACT;\n this.ZERO = this._gl.ZERO;\n this.ONE = this._gl.ONE;\n this.SRC_COLOR = this._gl.SRC_COLOR;\n this.ONE_MINUS_SRC_COLOR = this._gl.ONE_MINUS_SRC_COLOR;\n this.DST_COLOR = this._gl.DST_COLOR;\n this.ONE_MINUS_DST_COLOR = this._gl.ONE_MINUS_DST_COLOR;\n this.SRC_ALPHA = this._gl.SRC_ALPHA;\n this.ONE_MINUS_SRC_ALPHA = this._gl.ONE_MINUS_SRC_ALPHA;\n this.DST_ALPHA = this._gl.DST_ALPHA;\n this.ONE_MINUS_DST_ALPHA = this._gl.ONE_MINUS_DST_ALPHA;\n this.SRC_ALPHA_SATURATE = this._gl.SRC_ALPHA_SATURATE;\n this.CONSTANT_COLOR = this._gl.CONSTANT_COLOR;\n this.ONE_MINUS_CONSTANT_COLOR = this._gl.ONE_MINUS_CONSTANT_COLOR;\n this.CONSTANT_ALPHA = this._gl.CONSTANT_ALPHA;\n this.ONE_MINUS_CONSTANT_ALPHA = this._gl.ONE_MINUS_CONSTANT_ALPHA;\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Program\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.PROGRAM_BINDING_BIT = PROGRAM_BINDING_BIT;\n this._programs = {};\n this._programActive = null;\n this._programStack = [];\n\n this.UNIFORM_PROJECTION_MATRIX = ProgramMatrixUniform.PROJECTION_MATRIX;\n this.UNIFORM_VIEW_MATRIX = ProgramMatrixUniform.VIEW_MATRIX;\n this.UNIFORM_MODEL_MATRIX = ProgramMatrixUniform.MODEL_MATRIX;\n this.UNIFORM_NORMAL_MATRIX = ProgramMatrixUniform.NORMAL_MATRIX;\n this.UNIFORM_INVERSE_VIEW_MATRIX = ProgramMatrixUniform.INVERSE_VIEW_MATRIX;\n\n this.ATTRIB_LOCATION_POSITION = ATTRIB_LOCATION_POSITION;\n this.ATTRIB_LOCATION_COLOR = ATTRIB_LOCATION_COLOR;\n this.ATTRIB_LOCATION_TEX_COORD = ATTRIB_LOCATION_TEX_COORD;\n this.ATTRIB_LOCATION_NORMAL = ATTRIB_LOCATION_NORMAL;\n\n this.ATTRIB_NAME_POSITION = ATTRIB_NAME_POSITION;\n this.ATTRIB_NAME_COLOR = ATTRIB_NAME_COLOR;\n this.ATTRIB_NAME_TEX_COORD = ATTRIB_NAME_TEX_COORD;\n this.ATTRIB_NAME_NORMAL = ATTRIB_NAME_NORMAL;\n\n this.MAX_VERTEX_ATTRIBS = this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS);\n this.MAX_VERTEX_UNIFORM_VECTORS = this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS);\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\n this.MAX_VARYING_VECTORS = this._gl.getParameter(this._gl.MAX_VARYING_VECTORS);\n this.MAX_FRAGMENT_UNIFORM_VECTORS = this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS);\n\n if(this._glVersion == WEBGL_2_VERSION){\n this.MAX_VERTEX_UNIFORM_BLOCKS = this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_BLOCKS);\n this.MAX_FRAGMENT_UNIFORM_BLOCKS = this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_BLOCKS);\n this.MAX_COMBINED_UNIFORM_BLOCKS = this._gl.getParameter(this._gl.MAX_COMBINED_UNIFORM_BLOCKS);\n this.MAX_UNIFORM_BUFFER_BINDINGS = this._gl.getParameter(this._gl.MAX_UNIFORM_BUFFER_BINDINGS);\n this.MAX_UNIFORM_BLOCK_SIZE = this._gl.getParameter(this._gl.MAX_UNIFORM_BLOCK_SIZE);\n this.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = this._gl.getParameter(this._gl.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS);\n this.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = this._gl.getParameter(this._gl.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS);\n }\n\n console.assert(this.getGLError());\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Buffers\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.ARRAY_BUFFER_BINDING_BIT = ARRAY_BUFFER_BINDING_BIT;\n this.ELEMENT_ARRAY_BUFFER_BINDING_BIT = ELEMENT_ARRAY_BUFFER_BINDING_BIT;\n this._buffers = {};\n this._buffers[this._gl.ARRAY_BUFFER] = {};\n this._buffers[this._gl.ELEMENT_ARRAY_BUFFER] = {};\n this._bufferActive = {};\n this._bufferActive[this._gl.ARRAY_BUFFER] = INVALID_ID;\n this._bufferActive[this._gl.ELEMENT_ARRAY_BUFFER] = INVALID_ID;\n this._bufferStack = {};\n this._bufferStack[this._gl.ARRAY_BUFFER] = [];\n this._bufferStack[this._gl.ELEMENT_ARRAY_BUFFER] = [];\n\n this.STATIC_DRAW = this._gl.STATIC_DRAW;\n this.DYNAMIC_DRAW = this._gl.DYNAMIC_DRAW;\n this.STREAM_DRAW = this._gl.STREAM_DRAW;\n\n this.ARRAY_BUFFER = this._gl.ARRAY_BUFFER;\n this.ELEMENT_ARRAY_BUFFER = this._gl.ELEMENT_ARRAY_BUFFER;\n\n this.BYTE = this._gl.BYTE;\n this.UNSIGNED_BYTE = this._gl.UNSIGNED_BYTE;\n this.SHORT = this._gl.SHORT;\n this.UNSIGNED_SHORT = this._gl.UNSIGNED_SHORT;\n this.INT = this._gl.INT;\n this.UNSIGNED_INT = this._gl.UNSIGNED_INT;\n this.FLOAT = this._gl.FLOAT;\n\n if(this._glVersion == WEBGL_2_VERSION){\n this.UNIFORM_BUFFER_BINDING_BIT = UNIFORM_BUFFER_BINDING_BIT;\n this._buffers[this._gl.UNIFORM_BUFFER] = {};\n this._bufferActive[this._gl.UNIFORM_BUFFER] = INVALID_ID;\n this._bufferStack[this._gl.UNIFORM_BUFFER] = [];\n //TODO: move to state\n this._uniformBufferBindingActive = new Array(this.MAX_UNIFORM_BUFFER_BINDINGS);\n for(let i = 0; i < this._uniformBufferBindingActive.length; ++i){\n this._uniformBufferBindingActive[i] = INVALID_ID;\n }\n } else {\n this.createUniformBuffer =\n this.deleteUniformBuffer =\n this.setUniformBuffer =\n this.getUniformBuffer =\n this.setUniformBufferData =\n this.setUniformBufferSubData =\n this.updateUniformBufferData =\n this.setUniformBufferUsage =\n this.getUniformBufferUsage =\n this.getUniformBufferDataLength =\n this.getUniformBufferDataByteLength =\n this.getUniformBufferInfo =\n this.setProgramUniformBlock = ()=>{\n throw new Error('Uniform buffers not supported in WebGL 1.');\n };\n }\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Vertex Arrays\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.VERTEX_ARRAY_BINDING_BIT = VERTEX_ARRAY_BINDING_BIT;\n\n this._vertexArrays = {};\n this._vertexArrayState = new VertexArrayBindingState(INVALID_ID);\n this._vertexArrayHasIndexBuffer = false;\n this._vertexArrayIndexBufferDataType = null;\n this._vertexArrayHasDivisor = false;\n\n this._vertexArrayStack = [];\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Texture2d & TextureCube\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.TEXTURE_BINDING_BIT = TEXTURE_BINDING_BIT;\n this.MAX_TEXTURE_IMAGE_UNITS = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS);\n\n this._textures = {};\n this._textureState = new TextureState(new Array(this.MAX_TEXTURE_IMAGE_UNITS),0);\n this._textureStack = [];\n\n //bind empty texture\n const textureNullConfig = validateOption({width:1,height:1},DefaultConfigTexture2d);\n const textureNullDataConfig = {};\n for(const key in DefaultConfigTexture2dData){\n textureNullDataConfig[key] = textureNullConfig[key];\n }\n this._texturesNull = new Array(this.MAX_TEXTURE_IMAGE_UNITS);\n for(let i = this.MAX_TEXTURE_IMAGE_UNITS - 1; i > -1; --i){\n const texture = this._texturesNull[i] = this._createTexture(this._gl.TEXTURE_2D);\n this._textures[texture].level = 0;\n this.setTexture2d(texture,i);\n this.setTexture2dData(null,textureNullDataConfig);\n }\n console.assert(this.getGLError());\n\n this.NEAREST = this._gl.NEAREST;\n this.LINEAR = this._gl.LINEAR;\n this.NEAREST_MIPMAP_NEAREST = this._gl.NEAREST_MIPMAP_NEAREST;\n this.LINEAR_MIPMAP_NEAREST = this._gl.LINEAR_MIPMAP_NEAREST;\n this.NEAREST_MIPMAP_LINEAR = this._gl.NEAREST_MIPMAP_LINEAR;\n this.LINEAR_MIPMAP_LINEAR = this._gl.LINEAR_MIPMAP_LINEAR;\n this.TEXTURE_MAG_FILTER = this._gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = this._gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = this._gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = this._gl.TEXTURE_WRAP_T;\n this.TEXTURE_2D = this._gl.TEXTURE_2D;\n this.TEXTURE = this._gl.TEXTURE;\n this.TEXTURE_CUBE_MAP = this._gl.TEXTURE_CUBE_MAP;\n this.TEXTURE_BINDING_CUBE_MAP = this._gl.TEXTURE_BINDING_CUBE_MAP;\n this.TEXTURE_CUBE_MAP_POSITIVE_X = this._gl.TEXTURE_CUBE_MAP_POSITIVE_X;\n this.TEXTURE_CUBE_MAP_NEGATIVE_X = this._gl.TEXTURE_CUBE_MAP_NEGATIVE_X;\n this.TEXTURE_CUBE_MAP_POSITIVE_Y = this._gl.TEXTURE_CUBE_MAP_POSITIVE_Y;\n this.TEXTURE_CUBE_MAP_NEGATIVE_Y = this._gl.TEXTURE_CUBE_MAP_NEGATIVE_Y;\n this.TEXTURE_CUBE_MAP_POSITIVE_Z = this._gl.TEXTURE_CUBE_MAP_POSITIVE_Z;\n this.TEXTURE_CUBE_MAP_NEGATIVE_Z = this._gl.TEXTURE_CUBE_MAP_NEGATIVE_Z;\n this.MAX_CUBE_MAP_TEXTURE_SIZE = this._gl.MAX_CUBE_MAP_TEXTURE_SIZE;\n this.TEXTURE0 = this._gl.TEXTURE0;\n this.REPEAT = this._gl.REPEAT;\n this.CLAMP_TO_EDGE = this._gl.CLAMP_TO_EDGE;\n this.MIRRORED_REPEAT = this._gl.MIRRORED_REPEAT;\n\n this.MAX_TEXTURE_SIZE = this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE);\n this.MAX_CUBE_MAP_TEXTURE_SIZE = this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n \n this.ALPHA = this._gl.ALPHA;\n this.RGB = this._gl.RGB;\n this.RGBA = this._gl.RGBA;\n this.LUMINANCE = this._gl.LUMINANCE;\n this.LUMINANCE_ALPHA = this._gl.LUMINANCE_ALPHA;\n\n console.assert(this.getGLError());\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Renderbuffers\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this._renderbuffers = {};\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Framebuffers\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.FRAMEBUFFER_BINDING_BIT = FRAMEBUFFER_BINDING_BIT;\n this._framebuffers = {};\n this._framebufferActive = null;\n this._framebufferStack = [];\n\n //max color buffers\n this.RED_BITS = this._gl.getParameter(this._gl.RED_BITS);\n this.GREEN_BITS = this._gl.getParameter(this._gl.GREEN_BITS);\n this.BLUE_BITS = this._gl.getParameter(this._gl.BLUE_BITS);\n this.ALPHA_BITS = this._gl.getParameter(this._gl.ALPHA_BITS);\n this.DEPTH_BITS = this._gl.getParameter(this._gl.DEPTH_BITS);\n this.STENCIL_BITS = this._gl.getParameter(this._gl.STENCIL_BITS);\n this.MAX_RENDERBUFFER_SIZE = this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE);\n this.MAX_VIEWPORT_DIMS = glObjToArray(this._gl.getParameter(this._gl.MAX_VIEWPORT_DIMS));\n console.assert(this.getGLError());\n\n this.DEPTH_ATTACHMENT = this._gl.DEPTH_ATTACHMENT;\n this.DEPTH_STENCIL_ATTACHMENT = this._gl.DEPTH_STENCIL_ATTACHMENT;\n this.DEPTH_COMPONENT = this._gl.DEPTH_COMPONENT;\n this.DEPTH_STENCIL = this._gl.DEPTH_STENCIL;\n this.COLOR_ATTACHMENT0 = this._gl.COLOR_ATTACHMENT0;\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Matrix\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.MATRIX_PROJECTION_BIT = MATRIX_PROJECTION_BIT;\n this.MATRIX_VIEW_BIT = MATRIX_VIEW_BIT;\n this.MATRIX_MODEL_BIT = MATRIX_MODEL_BIT;\n\n this._matrix = {};\n this._matrix[MATRIX_PROJECTION] = Mat44.create();\n this._matrix[MATRIX_VIEW] = Mat44.create();\n this._matrix[MATRIX_MODEL] = Mat44.create();\n this._matrix[MATRIX_NORMAL] = Mat33.create();\n this._matrix[MATRIX_INVERSE_VIEW] = Mat44.create();\n\n this._matrixStack = {};\n this._matrixStack[MATRIX_PROJECTION_BIT] = [];\n this._matrixStack[MATRIX_VIEW_BIT] = [];\n this._matrixStack[MATRIX_MODEL_BIT] = [];\n\n this._matrixTypeByUniformNameMap = {};\n this._matrixTypeByUniformNameMap[ProgramMatrixUniform.PROJECTION_MATRIX] = MATRIX_PROJECTION;\n this._matrixTypeByUniformNameMap[ProgramMatrixUniform.VIEW_MATRIX] = MATRIX_VIEW;\n this._matrixTypeByUniformNameMap[ProgramMatrixUniform.MODEL_MATRIX] = MATRIX_MODEL;\n this._matrixTypeByUniformNameMap[ProgramMatrixUniform.NORMAL_MATRIX] = MATRIX_NORMAL;\n this._matrixTypeByUniformNameMap[ProgramMatrixUniform.INVERSE_VIEW_MATRIX] = MATRIX_INVERSE_VIEW;\n\n // MATRIX TEMP\n\n this._matrix44Temp = Mat44.create();\n this._matrix44TempF32 = new Float32Array(16);\n this._matrix33TempF32 = new Float32Array(9);\n\n this._matrixTempByTypeMap = {};\n this._matrixTempByTypeMap[MATRIX_PROJECTION] =\n this._matrixTempByTypeMap[MATRIX_VIEW] =\n this._matrixTempByTypeMap[MATRIX_MODEL] =\n this._matrixTempByTypeMap[MATRIX_INVERSE_VIEW] = this._matrix44TempF32;\n this._matrixTempByTypeMap[MATRIX_NORMAL] = this._matrix33TempF32;\n\n this._matrixSend = {};\n this._matrixSend[MATRIX_PROJECTION] = false;\n this._matrixSend[MATRIX_VIEW] = false;\n this._matrixSend[MATRIX_MODEL] = false;\n this._matrixSend[MATRIX_NORMAL] = false;\n this._matrixSend[MATRIX_INVERSE_VIEW] = false;\n\n this._matrixTypesByUniformInProgram = {};\n this._matrixTypesByUniformInProgramToUpdate = {};\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Data Types & Sizes\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this.POINTS = this._gl.POINTS;\n this.LINES = this._gl.LINES;\n this.LINE_STRIP = this._gl.LINE_STRIP;\n this.LINE_LOOP = this._gl.LINE_LOOP;\n this.TRIANGLES = this._gl.TRIANGLES;\n this.TRIANGLE_STRIP = this._gl.TRIANGLE_STRIP;\n this.TRIANGLE_FAN = this._gl.TRIANGLE_FAN;\n\n this.SIZE_VEC2 = 2;\n this.SIZE_VEC3 = 3;\n this.SIZE_VEC4 = 4;\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Quickdraw\n /*----------------------------------------------------------------------------------------------------------------*/\n\n this._programHasAttribPosition = false;\n this._programHasAttribNormal = false;\n this._programHasAttribColor = false;\n this._programHasAttribTexCoord = false;\n this._programHasUniformPointSize = false;\n\n\n /*----------------------------------------------------------------------------------------------------------------*/\n // Blit\n /*----------------------------------------------------------------------------------------------------------------*/\n\n //blit\n this._bufferBlitRectPosition = this.createVertexBuffer(\n new Float32Array([0,0, 1,0, 1,1, 0,1]),this.STATIC_DRAW,false\n );\n this._bufferBlitRectTexCoord = this.createVertexBuffer(\n new Float32Array([0,0, 1,0, 1,1, 0,1]),this.DYNAMIC_DRAW,true\n );\n this._vertexArrayBlitRect = this.createVertexArray([\n {location: this.ATTRIB_LOCATION_POSITION, buffer: this._bufferBlitRectPosition, size: this.SIZE_VEC2},\n {location: this.ATTRIB_LOCATION_TEX_COORD, buffer: this._bufferBlitRectTexCoord, size: this.SIZE_VEC2}\n ]);\n\n this._programBlit = this.createProgram(glslBlitScreen);\n this.pushProgramBinding();\n this.setProgram(this._programBlit);\n this.setProgramUniform('uTexture',0);\n this.setProgramUniform('uOffsetScale',0,0,1,1);\n this.popProgramBinding();\n}", "function initContext() {\n\tvar names = [\"experimental-webgl\", \"webkit-3d\", \"moz-webgl\", \"webgl\"];\n\tvar context;\n\n\tvar canvas = document.getElementById('canvas');\n canvas.width = window.innerWidth - 50;\n\tcanvas.height = window.innerHeight;\n\tfor (var x = 0; x < names.length; x++) {\n\t\ttry {\n\t\t\tcontext = canvas.getContext(names[x]);\n\t\t\tif (context) {\n\t\t\t\tbreak; \n\t\t\t}\n\t \t} catch (e) {\n\t\t\tconsole.log(context);\n\t \t}\n\t}\n\treturn context;\n}", "function initGL(canvas, flags) {\n var gl = canvas.getContext(\"webgl\", flags);\n if (!gl) {\n gl = canvas.getContext(\"experimental-webgl\", flags);\n if (!gl) {\n alert(\"Your browser or device does not seem to support WebGL.\");\n return null;\n }\n alert(\"Your browser or device only supports experimental WebGL.\\n\" + \"The simulation may not run as expected.\");\n }\n gl.disable(gl.CULL_FACE);\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.BLEND);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n __WEBPACK_IMPORTED_MODULE_0__gl_utils_utils__[\"a\" /* resizeCanvas */](gl, false);\n return gl;\n}", "function initDemo() {\n const canvas = document.getElementById('c');\n\n // Resize canvas HTML element to window size\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight-100;\n \n gl = canvas.getContext('webgl2');\n\n if (!gl) {\n // Some browsers have only experimental support.\n console.log('WebGL not supported. Using Experimental WebGL.');\n gl = canvas.getContext('experimental-webgl');\n }\n\n if (!gl) {\n alert('Your browser does not support WebGL!');\n return;\n }\n\n // Adjust viewport to window size\n gl.viewport(0, 0, canvas.width, canvas.heigh5);\n\n // Clear window in purple\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n // Create shaders\n // Prior to drawing, we need to compile the shaders.\n // This is due to OpenGL ES being a programmable shading interface\n\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\n gl.shaderSource(vertexShader, vertexShaderCode);\n gl.shaderSource(fragmentShader, fragmentShaderCode);\n\n gl.compileShader(vertexShader);\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n console.log(\n 'Error compiling vertexShader',\n gl.getShaderInfoLog(vertexShader),\n );\n return;\n }\n\n gl.compileShader(fragmentShader);\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n console.log(\n 'Error compiling fragmentShader',\n gl.getShaderInfoLog(fragmentShader),\n );\n return;\n }\n\n // Attach shaders to a GL program\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n gl.useProgram(program);\n // Additional checking if everything went fine\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error(\n 'Error linking program',\n gl.getProgramInfoLog(program),\n );\n return;\n }\n\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error(\n 'Error validating program',\n gl.getProgramInfoLog(program),\n );\n return;\n }\n\n\n // Create screen corners in a buffer\n // As this application relies on the fragment fragment buffer,\n // we only need to tell OpenGL to draw the whole area and the\n // pixels are processed individually (and in parallel) in the\n // fragment shader\n const screenCorners = [\n // X, Y,\n /* */1.0, /* */1.0,\n /**/-1.0, /* */1.0,\n /**/-1.0, /**/-1.0,\n /* */1.0, /**/-1.0,\n ];\n\n const screenCornersVertexBufferObject = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, screenCornersVertexBufferObject);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(screenCorners), gl.STATIC_DRAW);\n\n // Vertices\n const vertexPositionAttribLocation =\n gl.getAttribLocation(program, 'vertexPosition');\n\n gl.vertexAttribPointer(\n vertexPositionAttribLocation, // index\n 2, // size\n gl.FLOAT, // type\n gl.FALSE, // normalized\n 0, // stride\n 0, // offset\n );\n\n gl.enableVertexAttribArray(vertexPositionAttribLocation);\n\n const nearVertexBufferObject = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, nearVertexBufferObject);\n\n // Near vertices on attribute\n const nearPositionAttribLocation = gl.getAttribLocation(program, 'plotPosition');\n gl.vertexAttribPointer(\n nearPositionAttribLocation, // index\n 3, // size\n gl.FLOAT, // type\n gl.FALSE, // normalized\n 0, // stride\n 0, // offset\n );\n\n gl.enableVertexAttribArray(nearPositionAttribLocation);\n\n // Bind program to WebGL\n gl.useProgram(program);\n\n // Set properties\n const cameraPositionLocation = gl.getUniformLocation(program, 'cameraPosition');\n const sphereCenterLocation1 = gl.getUniformLocation(program, 'sphere1');\n const sphereCenterLocation2 = gl.getUniformLocation(program, 'sphere2');\n\n const cubeCenterLocation1 = gl.getUniformLocation(program, 'cube1');\n const cubeCenterLocation2 = gl.getUniformLocation(program, 'cube2');\n\n const floorRadiusLocation = gl.getUniformLocation(program, 'floorRadius');\n const floorLocationLocation = gl.getUniformLocation(program, 'floorLocation');\n const planeDirectionLocation = gl.getUniformLocation(program, 'norPlane');\n\n const lighPosLocation = gl.getUniformLocation(program, 'lightPos');\n\n //Set Perlin parameters\n scalePerlinFactor = gl.getUniformLocation(program, 'scalePerlin');\n transPerlinFactor = gl.getUniformLocation(program, 'transPerlin');\n anglePerlinFactor = gl.getUniformLocation(program, 'anglePerlin');\n scalePerlinFactor1 = gl.getUniformLocation(program, 'scalePerlin1');\n transPerlinFactor1 = gl.getUniformLocation(program, 'transPerlin1');\n anglePerlinFactor1 = gl.getUniformLocation(program, 'anglePerlin1');\n scalePerlinFactor2 = gl.getUniformLocation(program, 'scalePerlin2');\n transPerlinFactor2 = gl.getUniformLocation(program, 'transPerlin2');\n anglePerlinFactor2 = gl.getUniformLocation(program, 'anglePerlin2');\n\n brightPerlin1 = gl.getUniformLocation(program, 'brightPerlin1');\n brightPerlin2 = gl.getUniformLocation(program, 'brightPerlin2');\n brightPerlin3 = gl.getUniformLocation(program, 'brightPerlin3');\n\n weightPerlin1 = gl.getUniformLocation(program, 'weightPerlin1');\n weightPerlin2 = gl.getUniformLocation(program, 'weightPerlin2');\n weightPerlin3 = gl.getUniformLocation(program, 'weightPerlin3');\n\n //Set other input fields\n modeSh = gl.getUniformLocation(program, 'mode');\n reflectionOn = gl.getUniformLocation(program, 'reflectingOn');\n gridOn = gl.getUniformLocation(program, 'gridOn');\n\n //Set geometry locations\n var sphere1 = [5.0, 2, 0.0]\n var cube1 = [-5.0, 2, 0.0]\n\n gl.uniform3f(sphereCenterLocation1, sphere1[0], sphere1[1], sphere1[2]);\n //gl.uniform3f(sphereCenterLocation2, sphere2[0], sphere2[1], sphere2[2]);\n\n gl.uniform3f(cubeCenterLocation1, cube1[0], cube1[1], cube1[2]);\n //gl.uniform3f(cubeCenterLocation2, cube2[0], cube2[1], cube2[2]);\n \n gl.uniform1f(floorRadiusLocation, 30.0);\n gl.uniform3f(floorLocationLocation, 0.0, -1.0, 0.0);\n\n var lightPos =[0, 9, 10]\n gl.uniform3f(lighPosLocation, lightPos[0], lightPos[1], lightPos[2]);\n\n gl.uniform3f(scalePerlinFactor, 1.0,1.0,1.0);\n gl.uniform3f(transPerlinFactor, 1.0,1.0,1.0);\n gl.uniform3f(anglePerlinFactor, 0.0,0.0,0.0);\n\n //Set variables for modes\n var prevMod = 0;\n gl.uniform1i(modeSh, 0);\n var prevReflection = true;\n gl.uniform1i(reflectionOn, true);\n var prevGrid = true;\n gl.uniform1i(gridOn, true);\n\n let ratio = canvas.width / canvas.height;\n var prevrealImageOn = false\n\n //Camera parameters\n const up = vec3.fromValues(0.0, 1.0, 0.0);\n const cameraTo = vec3.fromValues(0.0, 0.0, 0.0);\n const cameraInitialPosition = vec3.fromValues(0.0, 0.0, 10.0);\n const cameraPosition = new Float32Array(3);\n\n const cameraDirection = new Float32Array(3);\n const cameraUp = new Float32Array(3);\n const cameraLeft = new Float32Array(3);\n\n const nearCenter = new Float32Array(3);\n const nearTopLeft = new Float32Array(3);\n const nearBottomLeft = new Float32Array(3);\n const nearTopRight = new Float32Array(3);\n const nearBottomRight = new Float32Array(3);\n\n function renderLoop() {\n prevrealImageOn = realImageOn\n\n //Change modes\n var modecur = parseFloat(document.getElementById(\"mode\").value);\n if(modecur != prevMod || prevrealImageOn == true){\n //Perlin grid and interpolation\n if(modecur == 0 || modecur == 1 ){\n document.getElementById(\"perx\").value = 1.0\n document.getElementById(\"pery\").value = 1.0\n document.getElementById(\"perz\").value = 1.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n realImageOn == false \n }\n //Marble\n else if(modecur == 2){\n document.getElementById(\"perx\").value = 10.0\n document.getElementById(\"pery\").value = 10.0\n document.getElementById(\"perz\").value = 10.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }\n //Grass\n else if(modecur == 3){\n document.getElementById(\"perx\").value = 60.0\n document.getElementById(\"pery\").value = 20.0\n document.getElementById(\"perz\").value = 60.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }\n //Wood\n else if(modecur == 4){\n document.getElementById(\"perx\").value = 4.0\n document.getElementById(\"pery\").value = 80.0\n document.getElementById(\"perz\").value = 4.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }else if(modecur == 5){\n document.getElementById(\"brR\").disabled = false\n document.getElementById(\"brG\").disabled = false\n document.getElementById(\"brB\").disabled = false\n document.getElementById(\"wR\").disabled = false\n document.getElementById(\"wG\").disabled = false\n document.getElementById(\"wB\").disabled = false\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }\n gl.uniform1i(modeSh, modecur)\n prevMod = modecur\n\n //Real image when using a model\n if(prevrealImageOn == true ){\n document.getElementById(\"perx\").disabled = true\n document.getElementById(\"pery\").disabled = true\n document.getElementById(\"perz\").disabled = true\n document.getElementById(\"perxrot\").disabled = true\n document.getElementById(\"peryrot\").disabled = true\n document.getElementById(\"perzrot\").disabled = true\n\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n realImageOn = false\n gl.uniform1i(modeSh, 10)\n }\n }\n\n\n //Reflection on\n var reflection = document.getElementById(\"reflectionCheck\").checked\n if(reflection != prevReflection){\n gl.uniform1i(reflectionOn, reflection)\n }\n prevReflection = reflection\n\n\n //Plane direction\n var dirx = parseFloat(document.getElementById(\"dirx\").value);\n var diry = parseFloat(document.getElementById(\"diry\").value);\n var dirz = parseFloat(document.getElementById(\"dirz\").value);\n if(dirx != NaN && diry != NaN && dirz != NaN ){\n var mgnt = Math.sqrt(dirx*dirx + diry*diry + dirz*dirz)\n\n gl.uniform3f(planeDirectionLocation, dirx/mgnt, diry/mgnt, dirz/mgnt);\n }\n\n //Perlin scale parameters\n if(!document.getElementById(\"perx\").disabled && !document.getElementById(\"pery\").disabled && !document.getElementById(\"perz\").disabled){\n var perlinx = parseFloat(document.getElementById(\"perx\").value);\n var perliny = parseFloat(document.getElementById(\"pery\").value);\n var perlinz = parseFloat(document.getElementById(\"perz\").value);\n if(perlinx != NaN && perliny != NaN && perlinz != NaN){\n gl.uniform3f(scalePerlinFactor, perlinx, perliny, perlinz);\n }\n }\n\n //Perlin translation parameters\n var perlinxTr = parseFloat(document.getElementById(\"perxTr\").value);\n var perlinyTr = parseFloat(document.getElementById(\"peryTr\").value);\n var perlinzTr = parseFloat(document.getElementById(\"perzTr\").value);\n if(perlinxTr != NaN && perlinyTr != NaN && perlinzTr != NaN ){\n gl.uniform3f(transPerlinFactor, perlinxTr, perlinyTr, perlinzTr);\n }\n\n //Perlin rotation parameters\n if(!document.getElementById(\"perxrot\").disabled && !document.getElementById(\"peryrot\").disabled && !document.getElementById(\"perzrot\").disabled){\n var perlinx = parseFloat(document.getElementById(\"perxrot\").value)*Math.PI/180;\n var perliny = parseFloat(document.getElementById(\"peryrot\").value)*Math.PI/180;\n var perlinz = parseFloat(document.getElementById(\"perzrot\").value)*Math.PI/180;\n if(perlinx != NaN && perliny != NaN && perlinz != NaN ){\n if(perlinx >= Math.PI*2 ){\n document.getElementById(\"perxrot\").value = 0.0\n }if(perliny >= Math.PI*2 ){\n document.getElementById(\"peryrot\").value = 0.0\n }if(perlinz >= Math.PI*2 ){\n document.getElementById(\"perzrot\").value = 0.0\n }\n gl.uniform3f(anglePerlinFactor, perlinx, perliny, perlinz);\n }\n }\n\n //Perlin brightness RGB parameters\n if(!document.getElementById(\"brR\").disabled && !document.getElementById(\"brG\").disabled && !document.getElementById(\"brB\").disabled){\n var brR = parseFloat(document.getElementById(\"brR\").value);\n var brG = parseFloat(document.getElementById(\"brG\").value);\n var brB = parseFloat(document.getElementById(\"brB\").value);\n if(brR != NaN && brG != NaN && brB != NaN){\n gl.uniform3f(brightPerlin1, brR, brG, brB);\n }\n }\n\n //Perlin weight RGB parameters\n if(!document.getElementById(\"wR\").disabled && !document.getElementById(\"wG\").disabled && !document.getElementById(\"wB\").disabled){\n var wR = parseFloat(document.getElementById(\"wR\").value);\n var wG = parseFloat(document.getElementById(\"wG\").value);\n var wB = parseFloat(document.getElementById(\"wB\").value);\n if(wR != NaN && wG != NaN && wB != NaN ){\n gl.uniform3f(weightPerlin1, wR, wG, wB);\n }\n }\n\n\n // resize canvas in case window size has changed\n if (canvas.width !== window.innerWidth\n || canvas.height !== window.innerHeight) {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n gl.viewport(0, 0, canvas.width, canvas.height);\n ratio = canvas.width / canvas.height;\n }\n\n //const angle = 2 * Math.PI * ((performance.now() / 1000.0) / 6.0);\n var cam = parseFloat(document.getElementById(\"cam\").value) * (Math.PI/180);\n var angle;\n if(cam != NaN ){\n angle = cam;\n }else{\n angle = Math.Pi/4;\n }\n // Calc new camera position\n vec3.rotateY(cameraPosition, cameraInitialPosition, cameraTo, angle);\n\n \n //const angle = 2 * Math.PI * ((performance.now() / 1000.0) / 6.0);\n var camz = parseFloat(document.getElementById(\"camz\").value) * (Math.PI/180);\n var anglez;\n if(camz != NaN ){\n anglez = camz;\n }else{\n anglez = Math.Pi/4;\n }\n // Calc new camera position\n vec3.rotateX(cameraPosition, cameraPosition, cameraTo, anglez);\n\n gl.uniform3f(\n cameraPositionLocation,\n cameraPosition[0],\n cameraPosition[1],\n cameraPosition[2],\n );\n\n // Calc new camera direction\n vec3.subtract(cameraDirection, cameraTo, cameraPosition);\n vec3.normalize(cameraDirection, cameraDirection);\n\n // Calc camera left vector\n vec3.cross(cameraLeft, up, cameraDirection);\n vec3.normalize(cameraLeft, cameraLeft);\n // Calc camera up vector\n vec3.cross(cameraUp, cameraDirection, cameraLeft);\n vec3.normalize(cameraUp, cameraUp);\n\n // Calc near plane center\n vec3.add(nearCenter, cameraPosition, cameraDirection);\n\n // Scale camera left to keep ratio\n vec3.scale(cameraLeft, cameraLeft, ratio);\n\n // Calc near corners\n // TopLeft\n vec3.add(nearTopLeft, nearCenter, cameraUp);\n vec3.add(nearTopLeft, nearTopLeft, cameraLeft);\n // BottomLeft\n vec3.subtract(nearBottomLeft, nearCenter, cameraUp);\n vec3.add(nearBottomLeft, nearBottomLeft, cameraLeft);\n // TopRight\n vec3.add(nearTopRight, nearCenter, cameraUp);\n vec3.subtract(nearTopRight, nearTopRight, cameraLeft);\n // BottomRight\n vec3.subtract(nearBottomRight, nearCenter, cameraUp);\n vec3.subtract(nearBottomRight, nearBottomRight, cameraLeft);\n\n const corners = new Float32Array(12);\n corners.set(nearTopRight, 0);\n corners.set(nearTopLeft, 3);\n corners.set(nearBottomLeft, 6);\n corners.set(nearBottomRight, 9);\n\n gl.bufferData(gl.ARRAY_BUFFER, corners, gl.STATIC_DRAW);\n gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);\n\n\n requestAnimationFrame(renderLoop);\n }\n\n requestAnimationFrame(renderLoop);\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n setupWorldCoordinates();\n gl.clearColor(0.1, 0.1, 0.1, 1);\n startLoop();\n}", "function createContext(_ref) {\n var canvas = _ref.canvas,\n _ref$opts = _ref.opts,\n opts = _ref$opts === undefined ? {} : _ref$opts,\n _ref$onError = _ref.onError,\n onError = _ref$onError === undefined ? function (message) {\n return null;\n } : _ref$onError;\n\n // See if we can extract any extra information about why context creation failed\n function onContextCreationError(error) {\n onError('WebGL context: ' + (error.statusMessage || 'Unknown error'));\n }\n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n\n var _opts$webgl = opts.webgl1,\n webgl1 = _opts$webgl === undefined ? true : _opts$webgl,\n _opts$webgl2 = opts.webgl2,\n webgl2 = _opts$webgl2 === undefined ? true : _opts$webgl2;\n\n var gl = null;\n // Prefer webgl2 over webgl1, prefer conformant over experimental\n if (webgl2) {\n gl = gl || canvas.getContext('webgl2', opts);\n gl = gl || canvas.getContext('experimental-webgl2', opts);\n }\n if (webgl1) {\n gl = gl || canvas.getContext('webgl', opts);\n gl = gl || canvas.getContext('experimental-webgl', opts);\n }\n\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n\n if (!gl) {\n return onError('Failed to create ' + (webgl2 && !webgl1 ? 'WebGL2' : 'WebGL') + ' context');\n }\n\n return gl;\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0.1, 0.1, 0.1, 1);\n}", "function initShaders() {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, VERTEX_SHADER_SOURCE);\n gl.compileShader(vertexShader);\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, FRAGMENT_SHADER_SOURCE);\n gl.compileShader(fragmentShader);\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 throw new Error('Unable to initialize the shader program!');\n }\n\n gl.useProgram(shaderProgram);\n\n vertexPositionAttribute = gl.getAttribLocation(shaderProgram, 'aVertexPosition');\n gl.enableVertexAttribArray(vertexPositionAttribute);\n\n textureCoordAttribute = gl.getAttribLocation(shaderProgram, 'aTextureCoord');\n gl.enableVertexAttribArray(textureCoordAttribute);\n}", "function initShaders( )\n{\n\n var fragmentShader = getShader( gl, \"shader-fs\" );\n var vertexShader = getShader( gl, \"shader-vs\" );\n\n shaderProgram = gl.createProgram( );\n gl.attachShader( shaderProgram, vertexShader );\n gl.attachShader( shaderProgram, fragmentShader );\n gl.linkProgram( shaderProgram );\n\n if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) )\n {\n\n console.error( \"Could not initialize shaders.\" );\n\n }\n\n gl.useProgram( shaderProgram );\n\n // Acquire handles to shader program variables in order to pass data to the shaders.\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation( shaderProgram, \"aVertexPosition\" );\n gl.enableVertexAttribArray( shaderProgram.vertexPositionAttribute );\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation( shaderProgram, \"aVertexColor\" );\n gl.enableVertexAttribArray( shaderProgram.vertexColorAttribute );\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation( shaderProgram, \"aVertexNormal\" );\n gl.enableVertexAttribArray( shaderProgram.vertexNormalAttribute );\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation( shaderProgram, \"uPMatrix\" );\n shaderProgram.mvMatrixUniform = gl.getUniformLocation( shaderProgram, \"uMVMatrix\" );\n shaderProgram.nMatrixUniform = gl.getUniformLocation( shaderProgram, \"uNMatrix\" );\n\n shaderProgram.ambientColorUniform = gl.getUniformLocation( shaderProgram, \"uAmbientColor\" );\n shaderProgram.pointLightLocationUniform = gl.getUniformLocation( shaderProgram, \"uPointLightLocation\" );\n shaderProgram.pointLightColorUniform = gl.getUniformLocation( shaderProgram, \"uPointLightColor\" );\n shaderProgram.screenSizeUniform = gl.getUniformLocation( shaderProgram, \"uSreenSize\" );\n\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(\n gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n gl.clearColor(0.8, 0.8, 0.8, 1);\n}", "function initGL() {\r\n \"use strict\";\r\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\r\n setUpAttributesAndUniforms();\r\n setUpBuffers();\r\n gl.clearColor(1,0,0,0.5);\r\n}", "function createWebGLContext(glAttribs) {\n glAttribs = glAttribs || { alpha: false };\n\n let webglCanvas = document.getElementById(\"xr-canvas\");\n let contextTypes = glAttribs.webgl2\n ? [\"webgl2\"]\n : [\"webgl\", \"experimental-webgl\"];\n let context = null;\n\n for (let contextType of contextTypes) {\n context = webglCanvas.getContext(contextType, glAttribs);\n if (context) {\n break;\n }\n }\n\n if (!context) {\n let webglType = glAttribs.webgl2 ? \"WebGL 2\" : \"WebGL\";\n console.error(\"This browser does not support \" + webglType + \".\");\n return null;\n }\n\n return context;\n}", "function initShaders(gl, wgl) {\n // Initialize shader program with the specified shader\n const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // Alert if it failed\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS) && !gl.isContextLost()) {\n alert(\"Unable to initialize shader program: \" + gl.getProgramInfoLog(shaderProgram));\n return null;\n }\n\n gl.useProgram(shaderProgram); // Use the program\n \n // Get attribute and uniform locations\n const vertexPosition = gl.getAttribLocation(shaderProgram, 'aVertexPosition');\n const vertexNormal = gl.getAttribLocation(shaderProgram, 'aVertexNormal');\n const vertexColor = gl.getAttribLocation(shaderProgram, 'aVertexColor');\n const shininess = gl.getUniformLocation(shaderProgram, 'shininess');\n const mvMatrix = gl.getUniformLocation(shaderProgram, 'uMVMatrix');\n const pMatrix = gl.getUniformLocation(shaderProgram, 'uPMatrix');\n const nMatrix = gl.getUniformLocation(shaderProgram, 'uNMatrix');\n const lightPosition = gl.getUniformLocation(shaderProgram, 'uLightPosition');\n const ambientLightColor = gl.getUniformLocation(shaderProgram, 'uAmbientLightColor');\n const diffuseLightColor = gl.getUniformLocation(shaderProgram, 'uDiffuseLightColor');\n const specularLightColor = gl.getUniformLocation(shaderProgram, 'uSpecularLightColor');\n\n // Put the program info in the wgl object\n wgl.shaderProgram = shaderProgram;\n wgl.attribLocations = { \n vertexPosition: vertexPosition,\n vertexNormal: vertexNormal,\n vertexColor: vertexColor, \n };\n wgl.uniformLocations = {\n shininess: shininess,\n mvMatrix: mvMatrix,\n pMatrix: pMatrix,\n nMatrix: nMatrix,\n lightPosition: lightPosition,\n ambientLightColor: ambientLightColor,\n diffuseLightColor: diffuseLightColor,\n specularLightColor: specularLightColor,\n };\n}", "function initShaders()\n{\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\t//create and link shader program\n\tshaderProgram = 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{\n\t\tconsole.log(\"Could not link shaders\");\n\t\treturn;\n\t}\n\n\t//register shader\n\tgl.useProgram(shaderProgram);\n\n\tshaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tgl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n\tshaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoordinate\");\n\tgl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n\n\tconsole.log(\"Initialized shaders\");\n}", "function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, 'shader/VertexShader.glsl',\n 'shader/FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpScene();\n\n gl.clearColor(renderSettings.viewPort.backgroundColor[0],\n renderSettings.viewPort.backgroundColor[1],\n renderSettings.viewPort.backgroundColor[2],\n renderSettings.viewPort.backgroundColor[3]);\n\n gl.frontFace(gl.CCW); // Defines the orientation of front-faces\n gl.cullFace(gl.BACK); // Defines which face should be culled\n gl.enable(gl.CULL_FACE); // Enables culling\n gl.enable(gl.DEPTH_TEST); // Enable z-test\n}", "function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, 'shader/VertexShader.glsl',\n 'shader/FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpScene();\n\n gl.clearColor(renderSettings.viewPort.backgroundColor[0],\n renderSettings.viewPort.backgroundColor[1],\n renderSettings.viewPort.backgroundColor[2],\n renderSettings.viewPort.backgroundColor[3]);\n\n gl.frontFace(gl.CCW); // Defines the orientation of front-faces\n gl.cullFace(gl.BACK); // Defines which face should be culled\n gl.enable(gl.CULL_FACE); // Enables culling\n gl.enable(gl.DEPTH_TEST); // Enable z-test\n}", "function getRenderingContext() {\n var canvas = document.querySelector(\"canvas\");\n canvas.width = canvas.clientWidth;\n canvas.height = canvas.clientHeight;\n var gl = canvas.getContext(\"webgl\") || canvas.getContext('experimental-webgl');\n if (!gl) {\n alert(\"Your browser isn't supported!\");\n return null;\n }\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return gl;\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n loadTexture();\n}", "function setupWebGL() {\n \n // Set up keys\n document.onkeydown = handleKeyDown; // call this when key pressed\n\n // Get the image canvas, render an image in it\n var imageCanvas = document.getElementById(\"myImageCanvas\"); // create a 2d canvas\n var cw = imageCanvas.width, ch = imageCanvas.height; \n imageContext = imageCanvas.getContext(\"2d\"); \n var bkgdImage = new Image(); \n bkgdImage.crossOrigin = \"Anonymous\";\n bkgdImage.src = TEXTURES_URL + \"Game_Start.jpg\";\n bkgdImage.onload = function(){\n var iw = bkgdImage.width, ih = bkgdImage.height;\n imageContext.drawImage(bkgdImage,0,0,iw,ih,0,0,cw,ch); \n } // end onload callback\n \n // create a webgl canvas and set it up\n var webGLCanvas = document.getElementById(\"myWebGLCanvas\"); // create a webgl canvas\n gl = webGLCanvas.getContext(\"webgl\"); // get a webgl object from it\n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n //gl.clearColor(0.0, 0.0, 0.0, 1.0); // set bg to black\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setupWebGL", "function gl_init(gl, vertexShader, fragmentShader) {\n\n // Create and link the gl program, using the application's vertex and fragment shaders.\n\n var program = gl.createProgram();\n addshader(gl, program, gl.VERTEX_SHADER , vertexShader );\n addshader(gl, program, gl.FRAGMENT_SHADER, fragmentShader);\n gl.linkProgram(program);\n if (! gl.getProgramParameter(program, gl.LINK_STATUS))\n console.log(\"Could not link the shader program!\");\n gl.useProgram(program);\n\n // Create a square as a strip of two triangles.\n\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0 ]), gl.STATIC_DRAW);\n\n // Assign attribute aPosition to each of the square's vertices.\n\n gl.aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.enableVertexAttribArray(gl.aPosition);\n gl.vertexAttribPointer(gl.aPosition, 3, gl.FLOAT, false, 0, 0);\n\n // Remember the address within the fragment shader of each of my uniform variables.\n\n gl.uTime = gl.getUniformLocation(program, \"uTime\" );\n gl.uCursor = gl.getUniformLocation(program, \"uCursor\");\n}", "function initGL(canvas) {\n\n function setupFocusTracking() {\n function isHidden() {\n return document.hidden || document.webkitHidden || document.msHidden;\n }\n function focusChanged() {\n window.isHidden = isHidden();\n }\n document.addEventListener(\"visibilitychange\", focusChanged);\n document.addEventListener(\"webkitvisibilitychange\", focusChanged);\n document.addEventListener(\"msvisibilitychange\", focusChanged);\n }\n\n function setupGL() {\n var gl = canvas.getContext(\"webgl\");\n gl.clearColor(0.2, 0.3, 0.4, 1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.depthFunc(gl.LEQUAL);\n gl.viewport(0, 0, canvas.width, canvas.height);\n return gl;\n }\n\n setupFocusTracking();\n return setupGL();\n}", "function initShader(gl, vertexSource, fragmentSource) {\n\n var shaderInfo = {};\n \n // load and compile the fragment and vertex shader\n var fragmentShader = createShader(gl, fragmentSource, \"fragment\");\n var vertexShader = createShader(gl, vertexSource, \"vertex\");\n\n // link them together into a new program\n shaderInfo.shaderProgram = gl.createProgram();\n gl.attachShader(shaderInfo.shaderProgram, vertexShader);\n gl.attachShader(shaderInfo.shaderProgram, fragmentShader);\n gl.linkProgram(shaderInfo.shaderProgram);\n\n // get pointers to the shader params\n shaderInfo.shaderVertexPositionAttribute = gl.getAttribLocation(shaderInfo.shaderProgram, \"vertexPos\");\n gl.enableVertexAttribArray(shaderInfo.shaderVertexPositionAttribute);\n\n shaderInfo.shaderVertexColorAttribute = gl.getAttribLocation(shaderInfo.shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(shaderInfo.shaderVertexColorAttribute);\n\n shaderInfo.shaderProjectionMatrixUniform = gl.getUniformLocation(shaderInfo.shaderProgram, \"projectionMatrix\");\n shaderInfo.shaderModelViewMatrixUniform = gl.getUniformLocation(shaderInfo.shaderProgram, \"modelViewMatrix\");\n\n\n if (!gl.getProgramParameter(shaderInfo.shaderProgram, gl.LINK_STATUS)) {\n alert(\"Could not initialise shaders\");\n }\n \n return shaderInfo;\n}", "function initShaders() {\n // Load the shaders and compile them (shaders are located in the HTML)\n var vertexShader = loadShader( gl.VERTEX_SHADER, document.getElementById('vshader').innerHTML );\n var fragmentShader = loadShader( gl.FRAGMENT_SHADER, document.getElementById('fshader').innerHTML );\n \n // Create the program object\n var programObject = gl.createProgram();\n gl.attachShader(programObject, vertexShader);\n gl.attachShader(programObject, fragmentShader);\n gl_program = programObject;\n \n // link the program\n gl.linkProgram(gl_program);\n \n // verify link\n var linked = gl.getProgramParameter(gl_program, gl.LINK_STATUS);\n if( !linked && !gl.isContextLost()) {\n var infoLog = gl.getProgramInfoLog(gl_program);\n window.console.log(\"Error linking program:\\n\" + infoLog);\n gl.deleteProgram(gl_program);\n return;\n }\n \n // Get the uniform/attribute locations\n gl_program_loc.uMVMatrix = gl.getUniformLocation(gl_program, \"uMVMatrix\");\n gl_program_loc.uPMatrix = gl.getUniformLocation(gl_program, \"uPMatrix\");\n gl_program_loc.uNMatrix = gl.getUniformLocation(gl_program, \"uNMatrix\");\n gl_program_loc.uColor = gl.getUniformLocation(gl_program, \"uColor\");\n gl_program_loc.uLighting = gl.getUniformLocation(gl_program, \"uLighting\");\n gl_program_loc.aPosition = gl.getAttribLocation(gl_program, \"aPosition\");\n}", "function _createHeadlessContext(_ref) {\n var width = _ref.width,\n height = _ref.height,\n opts = _ref.opts,\n onError = _ref.onError;\n var webgl1 = opts.webgl1,\n webgl2 = opts.webgl2;\n\n if (webgl2 && !webgl1) {\n return onError('headless-gl does not support WebGL2');\n }\n if (!__WEBPACK_IMPORTED_MODULE_0__api__[\"f\" /* webGLTypesAvailable */]) {\n return onError(ERR_WEBGL_MISSING_NODE);\n }\n if (!__WEBPACK_IMPORTED_MODULE_7__init__[\"default\"].globals.headlessGL) {\n return onError(ERR_HEADLESSGL_NOT_AVAILABLE);\n }\n var gl = __WEBPACK_IMPORTED_MODULE_7__init__[\"default\"].globals.headlessGL(width, height, opts);\n if (!gl) {\n return onError(ERR_HEADLESSGL_FAILED);\n }\n return gl;\n}", "function init() {\n canvas = document.createElement('canvas');\n gl = canvas.getContext('webgl');\n ratio = window.devicePixelRatio || 1;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\n update();\n createProgram();\n blankTexture = getBlankTexture();\n initQuad();\n\n document.body.appendChild(canvas);\n window.addEventListener('resize', update, false);\n initialized = true;\n }", "function initGL() {\n \n \"use strict\";\n\n // -- 1. Add shaders (load / compile)\n ctx.shaderProgram = loadAndCompileShaders(gl, \"VertexShader.glsl\", \"FragmentShader.glsl\");\n\n // -- 2. Assign attribute-index to context\n setUpAttributesAndUniforms();\n\n // -- 3. Setup buffers\n setUpBuffers();\n\n // -- 4. Set color ??\n gl.clearColor(0.4688,0.1512,0.0000,0.2725);\n\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}", "function init() {\r\n\t\tvar canvas = document.getElementById(\"gremlinCanvas\");\r\n try {\r\n\t\t _initGL(canvas);\r\n\t\t _initShaders();\r\n Audio.init();\r\n } catch (error) {\r\n throw error;\r\n }\r\n\t\t_gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t_gl.enable(_gl.DEPTH_TEST);\r\n\t}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function initShaders() {\n console.log('init shader');\n var vertexShaderSource = loadText(\"vertex.glsl\");\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexShaderSource);\n\n gl.compileShader(vertexShader);\n\n var fragmentShaderSource = loadText(\"fragment.glsl\");\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentShaderSource);\n\n gl.compileShader(fragmentShader);\n program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n gl.useProgram(program)\n}", "function webGLStart(fragShader) {\n\tvar canvas = document.getElementById(\"opengl-canvas\");\n\tinitGL(canvas);\n\n\tvar fragmentShaderResult = makeShader(gl, fragShader, \"fragment\");\n\tif (fragmentShaderResult.shader == null) {\n\t\tvar error = \"Failed making fragment shader.\";\n\t\tconsole.log(error);\n\t\treturn {\n\t\t\tsucceeded: false,\n\t\t\terror: \"COMPILE_ERROR\",\n\t\t\tlog: error + \"\\n\" + fragmentShaderResult.log\n\t\t};\n\t}\n\n\tvar vertexShaderResult = makeShader(gl, getShaderFromURL(\"shaders/shader.vert\"), \"vertex\");\n\tif (vertexShaderResult.shader == null) {\n\t\tvar error = \"Failed making vertex shader.\";\n\t console.log(error);\n\t\treturn {\n\t\t\tsucceeded: false,\n\t\t\terror: \"COMPILE_ERROR\",\n\t\t\tlog: error + \"\\n\" + vertexShaderResult.log\n\t\t};\n\t}\n\n\tvar initResult = initShaders(fragmentShaderResult.shader, vertexShaderResult.shader);\n\tif (!initResult.succeeded) {\n\t\treturn {\n\t\t\tsucceeded: false,\n\t\t\terror: \"LINK_ERROR\",\n\t\t\tlog: initResult.log\n\t\t};\n\t}\n\n\tinitBuffers();\n\n\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\tdrawScene(initResult.shaderProgram);\n\tgl.finish();\n\n\treturn {\n\t\tsucceeded: true,\n\t\tlog: \"\"\n\t};\n}", "function setupWebGL() {\n \n // Set up keys\n document.onkeydown = handleKeyDown; // call this when key pressed\n\n // Get the image canvas, render an image in it\n var imageCanvas = document.getElementById(\"myImageCanvas\"); // create a 2d canvas\n var cw = imageCanvas.width, ch = imageCanvas.height; \n imageContext = imageCanvas.getContext(\"2d\"); \n var bkgdImage = new Image(); \n bkgdImage.src = \"https://ncsucgclass.github.io/prog3/stars.jpg\";\n bkgdImage.onload = function(){\n var iw = bkgdImage.width, ih = bkgdImage.height;\n imageContext.drawImage(bkgdImage,0,0,iw,ih,0,0,cw,ch); \n } // end onload callback\n \n // create a webgl canvas and set it up\n var webGLCanvas = document.getElementById(\"myWebGLCanvas\"); // create a webgl canvas\n gl = webGLCanvas.getContext(\"webgl\"); // get a webgl object from it\n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function startup() {\n \"use strict\";\n canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n\n // -- 1. Create context from canvas\n gl = createGLContext(canvas);\n\n // -- 2. Initialize the GL object (global)\n initGL();\n\n // -- 3. Draw objects\n draw();\n\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 webGLStart() {\n\t\n\tvar canvas = document.getElementById(\"WebGL-test\");\n\n\t//on fait d'abord la rotation et ensuite la translation \n\t//dans opengl ce n'est pas la caméra qui bouge ce sont les objets\n\n\tcanvas.onmousedown = handleMouseDown;\n\tdocument.onmouseup = handleMouseUp;\n\tdocument.onmousemove = handleMouseMove;\n\tcanvas.onwheel = handleMouseWheel;\n\tdocument.onkeydown = checkKey;\n\tdocument.onkeyup = checkDefault;\n\n\tinitGL(canvas);\n\tmat4.perspective(45, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0, pMatrix);//pMatrix = matrice de projection perspective\n\t\n\tmat4.identity(rotMatrix); //initialise à l'identité\n\tmat4.rotate(rotMatrix, rotX, [1, 0, 0]); //rotation en X\n\tmat4.rotate(rotMatrix, rotY, [0, 0, 1]); //rotation en Y\n\t//rotMatrix permet de gérer la rotation de la scène \n\t//il faut donc ajouter une autre matrice pour ajouter \n\t//chaque objet obj devront avoir leur propre matrice de rotation et de translation \n\n\tdistCENTER = vec3.create([0,-0.2,-3]); //distance entre mon oeil et le centre de la scène\n\n\n\tPlane3D.initAll();\n\tfor(var key in tabObj) {\n\t\ttabObj[key].initAll();\n\t}\n\n\ttick();\n}", "function webGLStart() {\n var canvas = document.getElementById(\"webglcanvas\");\n initGL(canvas);\n initShaders();\n initBuffers();\n \n // Prior to drawing the scene , clear color\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n \n drawScene();\n }", "function init(gl, wgl) {\n initShaders(gl, wgl); // Setup the shader program and program info\n initModels(gl, wgl); // Build objects to be drawn and their buffers\n initLights(gl, wgl); // Setup lighting\n initGl(gl, wgl); // Setup gl properties\n}", "function hasWebGL() {\n try {\n var canvas = document.createElement('canvas');\n return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));\n } catch (x) {\n return false;\n }\n}", "function initGL() {\r\n var canvas = document.getElementById(\"webGLcanvas\");\r\n canvas.width = window.innerWidth - 30;\r\n canvas.height = Math.floor(window.innerHeight - 0.25 * window.innerHeight);\r\n try {\r\n gl = canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n } catch (e) {\r\n }\r\n if (!gl) {\r\n alert(\"cannot initialize webGL\");\r\n }\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = handleKeyUp;\r\n canvas.onmousedown = handleMouseDown;\r\n document.onmouseup = handleMouseUp;\r\n document.onmousemove = handleMouseMove;\r\n\r\n // fragprogram = initShaders(\"perfrag-shader-fs\", \"perfrag-shader-vs\");\r\n vertprogram = initShaders(\"shader-fs\", \"shader-vs\");\r\n currentProgram = vertprogram;\r\n gl.clearColor(0.13, 0.13, 0.13, 1);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n fpsInterval = 1000 / 15;\r\n then = Date.now();\r\n startTime = then;\r\n // initBuffer();\r\n cornerVertexPosBuffer = gl.createBuffer();\r\n pointLightPos = [\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n ];\r\n pointLightColor = [\r\n rand(0, 0.5),rand(0.4, 1),rand(0.4, 1),\r\n rand(0.4, 1),rand(0.4, 1),rand(0, 0.5),\r\n rand(0.4, 1),rand(0.4, 1),rand(0.4, 1),\r\n rand(0, 0.5),rand(0, 0.5),rand(0, 0.5),\r\n rand(0.4, 1),rand(0, 0.5),rand(0.4, 1),\r\n ];\r\n \r\n numPtLights = 5;\r\n\r\n animate();\r\n}", "function initShaders()\n{\n var vertexShader=get_shader(shader_vertex_source, gl.VERTEX_SHADER, \"VERTEX\");\n var fragmentShader=get_shader(shader_fragment_source, gl.FRAGMENT_SHADER, \"FRAGMENT\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))\n {\n alert(\"Could not initialise shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n shaderProgram.sampler2Uniform = gl.getUniformLocation(shaderProgram, \"uSampler2\");\n shaderProgram.dualTex = gl.getUniformLocation(shaderProgram,\"uDualTex\")\n\n //lighting\n shaderProgram.useLightingUniform = gl.getUniformLocation(shaderProgram, \"uUseLighting\");\n shaderProgram.ambientColorUniform = gl.getUniformLocation(shaderProgram, \"uAmbientColor\");\n shaderProgram.pointLightingLocationUniform = gl.getUniformLocation(shaderProgram, \"uPointLightingLocation\");\n shaderProgram.pointLightingColorUniform = gl.getUniformLocation(shaderProgram, \"uPointLightingColor\");\n\n //transparency\n shaderProgram.alphaUniform = gl.getUniformLocation(shaderProgram, \"uAlpha\");\n shaderProgram.useBlending = gl.getUniformLocation(shaderProgram, \"uUseBlending\");\n\n}", "function CreateContext(canvasID) {\n var canvas = document.getElementById(canvasID);\n var glContext = canvas.getContext(\"webgl2\");\n\n if(!glContext) {\n console.error(\"WebGL 2 não está disponivel ...\");\n return null;\n }\n\n /*\n Definimos a cor padrão na qual queremos a tela e definimos alguns metodos auxiliares aqui.\n Algumas opções de renderização tambem são definidas aqui\n */\n\n /* Habilita teste de profundidade */\n glContext.enable(glContext.DEPTH_TEST);\n /* Descarta fragmentos com valores menor ou igual ao fragmento atual */\n glContext.depthFunc(glContext.LEQUAL);\n /* Define a função de blending para 1 - alpha e a habilita */\n glContext.blendFunc(glContext.SRC_ALPHA, glContext.ONE_MINUS_SRC_ALPHA);\n glContext.enable( glContext.BLEND );\n\n /* Limpa a tela com a cor padrão */\n glContext.clearColor(1.0, 1.0, 1.0, 1.0);\n\n /* Emcapsulamento de funcionalidade WebGL */\n glContext.setClearColor = function (r, g, b) {\n this.clearColor(r, g, b, 1.0);\n }\n\n glContext.clearScreen = function () {\n this.clear(this.COLOR_BUFFER_BIT | this.DEPTH_BUFFER_BIT);\n }\n\n glContext.setSize = function (w, h) {\n if(w === undefined || h === undefined){\n w = window.innerWidth;\n h = window.innerHeight;\n }\n\n this.canvas.style.width = w + \"px\";\n this.canvas.style.height = h + \"px\";\n this.canvas.width = w\n this.canvas.height = h;\n\n this.viewport(0, 0, w, h);\n }\n\n glContext.createArrayBuffer = function (vextexArray, isStatic) {\n /* Valor default para variavel */\n if(isStatic === undefined) isStatic = true;\n\n var vertexBuffer = this.createBuffer();\n\n this.bindBuffer(this.ARRAY_BUFFER, vertexBuffer);\n this.bufferData(this.ARRAY_BUFFER, vextexArray, isStatic ? this.STATIC_DRAW : this.DYNAMIC_DRAW);\n this.bindBuffer(this.ARRAY_BUFFER, null);\n\n return vertexBuffer;\n }\n\n glContext.createTextureBufferObject = function (img, flipY) {\n var tbo = this.createTexture();\n\n if(flipY == true) {\n this.pixelStorei(this.UNPACK_FLIP_Y_WEBGL, true);\n }\n\n this.bindTexture(this.TEXTURE_2D, tbo);\n this.texImage2D(this.TEXTURE_2D, 0, this.RGBA, this.RGBA, this.UNSIGNED_BYTE, img);\n\n /* Configura opções de filtragem para quando o zoom estiver muito alto */\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_MAG_FILTER, this.LINEAR);\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_MIN_FILTER, this.LINEAR_MIPMAP_NEAREST);\n\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_WRAP_S, this.CLAMP_TO_EDGE);\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_WRAP_T, this.CLAMP_TO_EDGE);\n\n this.generateMipmap(this.TEXTURE_2D);\n this.bindTexture(this.TEXTURE_2D, null);\n\n if(flipY == true) {\n this.pixelStorei(this.UNPACK_FLIP_Y_WEBGL, false);\n }\n\n return tbo;\n }\n \n glContext.createVertexArrayObjectMesh = function (indices, vertices, uvs) {\n var vao = {drawMode : this.TRIANGLES};\n\n vao.id = this.createVertexArray();\n this.bindVertexArray(vao.id);\n\n if(vertices !== undefined && vertices != null) {\n vao.vertexBuffer = this.createBuffer();\n this.bindBuffer(this.ARRAY_BUFFER, vao.vertexBuffer);\n this.bufferData(this.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n this.enableVertexAttribArray(ATTR_POSITION);\n this.vertexAttribPointer(ATTR_POSITION, 3, this.FLOAT, false, 0, 0);\n\n vao.vertexCount = vertices.length / 3;\n }\n\n if(uvs !== undefined && uvs != null) {\n vao.uvBuffer = this.createBuffer();\n\n this.bindBuffer(this.ARRAY_BUFFER, vao.uvBuffer);\n this.bufferData(this.ARRAY_BUFFER, new Float32Array(uvs), gl.STATIC_DRAW);\n this.enableVertexAttribArray(ATTR_UV);\n this.vertexAttribPointer(ATTR_UV, 2, this.FLOAT, false, 0, 0);\n\n vao.uvCount = uvs.length / 2;\n }\n\n if(indices !== undefined && indices != null) {\n vao.indexBuffer = this.createBuffer();\n\n this.bindBuffer(this.ELEMENT_ARRAY_BUFFER, vao.indexBuffer);\n this.bufferData(this.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n \n vao.indexCount = indices.length;\n }\n\n /*\n Os objetos devem ser desvinculados na ordem reverssa para não sejam removidos os estado do VAO\n */\n \n this.bindVertexArray(null);\n this.bindBuffer(this.ARRAY_BUFFER, null);\n if(indices !== undefined && indices != null)\n this.bindBuffer(this.ELEMENT_ARRAY_BUFFER, null);\n\n return vao;\n }\n\n glContext.bindContext = function () {\n gl = this;\n }\n\n glContext.bindContext();\n glContext.setSize();\n window.addEventListener(\"resize\", function (e) { glContext.setSize() });\n\n return glContext;\n}", "async function init(){\n\t// retrieve shader using path\n\tvar path = window.location.pathname;\n\tvar page = path.split(\"/\").pop();\n\tbaseDir = window.location.href.replace(page, '');\n\tshaderDir = baseDir + \"shaders/\";\n\n\t// create canvas\n\tvar canvas = document.getElementById(\"c\");\n\tgl = canvas.getContext(\"webgl2\");\n\tconsole.log(gl);\n\tif (!gl) {\n\t\tdocument.write(\"GL context not opened\");\n\t\treturn;\n\t}\n\t\n\t// Loading the shaders and creating programs\n\tawait utils.loadFiles([shaderDir + 'texture_vs.vert', shaderDir + 'texture_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\ttextureProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_texcoord\", \"a_normal\"]);\n\t});\n\tawait utils.loadFiles([shaderDir + 'color_vs.vert', shaderDir + 'color_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\tcolorProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_normal\"]);\n\t});\n\n\t/*\n\t* Loading the obj models\n\t*/\n\tlet tailWrapper = new ObjectWrapper(baseDir + tailPath);\n\tlet bodyWrapper = new ObjectWrapper(baseDir + bodyPath);\n\tlet leftEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet rightEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet hoursClockhandWrapper = new ObjectWrapper(baseDir + hoursClockhandPath);\n\tlet minutesClockhandWrapper = new ObjectWrapper(baseDir + minutesClockhandPath);\n\t// Set the local matrix for each object and the program to draw them\n\ttailWrapper.setLocalMatrix(tailLocalMatrix).setProgramInfo(colorProgramInfo);\n\tbodyWrapper.setLocalMatrix(bodyLocalMatrix).setProgramInfo(textureProgramInfo);\n\tleftEyeWrapper.setLocalMatrix(leftEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\trightEyeWrapper.setLocalMatrix(rightEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\thoursClockhandWrapper.setLocalMatrix(clockHand2LocalMatrix).setProgramInfo(colorProgramInfo);\n\tminutesClockhandWrapper.setLocalMatrix(clockHand1LocalMatrix).setProgramInfo(colorProgramInfo);\n\n\t// Save each object wrapper in a unique array of objects to draw\n\tobj = [tailWrapper, leftEyeWrapper, rightEyeWrapper, bodyWrapper, hoursClockhandWrapper, minutesClockhandWrapper];\n\n\tobj.forEach(async (wrapper) => { await wrapper.loadModel(); });\n\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\n\tresetShaderParams();\n\tmain();\n}", "function initShaderProgram(gl) {\n const vsh = loadShader(gl, gl.VERTEX_SHADER, vsh_src);\n const fsh = loadShader(gl, gl.FRAGMENT_SHADER, fsh_src);\n\n // Create the shader program\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vsh);\n gl.attachShader(shaderProgram, fsh);\n gl.linkProgram(shaderProgram);\n\n // Check for errors in setup\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Shader program initialization failed: ' + gl.getProgramInfoLog(shaderProgram));\n return;\n }\n \n return shaderProgram;\n}", "function InitShaders(gl) {with(gl)\n{\n\tvar fragmentShader = GetShader(gl, \"shader-fs\");\n\tvar vertexShader = GetShader(gl, \"shader-vs\");\n \n\t// Create the shader program\n\tgl.shaderProgram = createProgram();\n\tattachShader(shaderProgram, vertexShader);\n\tattachShader(shaderProgram, fragmentShader);\n\tlinkProgram(shaderProgram);\n\t\n\t// If creating the shader program failed, alert\n\tif (!getProgramParameter(shaderProgram, LINK_STATUS)) \n\t{\n\t\talert(\"Unable to initialize the shader program.\");\n\t}\n \tuseProgram(shaderProgram);\n\t\n\t// Texture attributes\n\tgl.aTextureCoord = getAttribLocation(shaderProgram, \"aTextureCoord\");\n\tenableVertexAttribArray(aTextureCoord);\n\t\n\t// Vertex attributes\n\tgl.aVertexPosition = getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tenableVertexAttribArray(aVertexPosition); \n\t\t\n\t// Set uniforms\n\tgl.uPosition = getUniformLocation(shaderProgram, \"uPosition\");\n\tgl.uAspectRatio = getUniformLocation(shaderProgram, \"uAspectRatio\");\n\tgl.uScale = getUniformLocation(shaderProgram, \"uScale\");\n\tgl.uColour = getUniformLocation(shaderProgram, \"uColour\");\n\tuniform4f(uColour, 1,1,1,1);\n\t// Set it\n\t//gl.uniform1f(uAspectRatio, canvas.width/canvas.height);\n\tuniform1f(uAspectRatio, 1);\n}}", "function initShader(gl, vsSource, fsSource) {\n \n const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n // Create the shader program\n\n const 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\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n return null;\n }\n\n return shaderProgram;\n}", "function startup() {\r\n console.log(\"Startup started\")\r\n \"use strict\";\r\n var canvas = document.getElementById(\"myCanvas\");\r\n gl = createGLContext(canvas);\r\n initGL();\r\n draw();\r\n}", "function initGL(){\n canvas=document.getElementById(\"webglCanvas\") ;\n gl=canvas.getContext(\"experimental-webgl\"); \n if(!gl){\n alert(\"cant initialize webgl context\");\n } else {\n console.log(gl.getParameter(gl.VERSION) + \" | \" + gl.getParameter(gl.VENDOR) + \" | \" + gl.getParameter(gl.RENDERER) + \" | \" + gl.getParameter(gl.SHADING_LANGUAGE_VERSION ));\n gl.clearColor(0,0,0,1);\n gl.clearDepth(1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); \n }\n \n projection = new Mat4();\n modelView = new Mat4();\n modelView.setIdentity();\n\n modelView.translate(0,0,-4) ;\n projection.setFrustum(-0.1, 0.1, -0.1, 0.1, 0.1, 1000);\n\n \n}", "initWebGl () {\n this.camera = new OrthographicCamera(\n this.plotElDim.width / -2, // left\n this.plotElDim.width / 2, // right\n this.plotElDim.height / 2, // top\n this.plotElDim.height / -2, // bottom\n 1, // near\n 11 // far\n );\n\n this.cameraPosOrgX = (this.plotElDim.width / 2);\n this.cameraPosOrgY = MARGIN_TOP - (this.plotElDim.height / 2);\n\n this.camera.position.x = this.cameraPosOrgX;\n this.camera.position.y = this.cameraPosOrgY;\n this.camera.position.z = 10;\n\n this.scrollLimitTop = this.cameraPosOrgY;\n\n this.renderer = new WebGLRenderer(WEB_GL_CONFIG);\n this.renderer.setPixelRatio(window.devicePixelRatio || 1);\n this.renderer.setSize(\n this.plotElDim.width,\n this.plotElDim.height\n );\n this.renderer.setClearColor(0xffffff, 0);\n\n this.canvas = this.renderer.domElement;\n\n this.origin = new Vector3();\n this.mouse = new Vector2();\n this.raycaster = new Raycaster();\n\n fgmState.scene.add(this.camera);\n }", "function initGL(canvas){\r\n\ttry{\r\n\t\tctx.viewportWidth = canvas.width;\r\n\t\tctx.viewportHeight = canvas.height;\r\n\t\tinitBuffers(ctx);\r\n\t\t\r\n\t\t//Initialize default shader\r\n\t\tfragShader = compileShader(ctx, defaultFragSrc);\r\n\t\tvertShader = compileShader(ctx, defaultVertSrc);\r\n\t\tshaderProgram = createShaderProgram();\r\n\t\tsetupSpriteShader(shaderProgram);\r\n\t\tspriteShader = shaderProgram;\r\n\t\t\r\n\t\tcolorBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\tstateBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\t\r\n\t\tctx.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t\r\n\t\tctx.blendFunc(ctx.SRC_ALPHA, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\tctx.enable(ctx.BLEND);\r\n\t}catch(e){\r\n\t}\r\n}", "function SigmaEnableWebGL() { return null }", "function initGl(gl, wgl) {\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.clearDepth(1.0);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n // gl.depthFunc(gl.LEQUAL); // Near things obscure far things\n\n // For perspective matrix setup\n wgl.fovy = 60 * Math.PI / 180;\n wgl.aspect = gl.viewportWidth / gl.viewportHeight;\n wgl.zNear = 0.1;\n wgl.zFar = 100.0;\n\n wgl.eye = [ 8, 5, -10 ];\n wgl.lookAt = [ 0, 0, 0 ];\n wgl.up = [ 0, 1, 0 ];\n\n // Camera movement setup\n wgl.upVec = vec3.fromValues(0, 1, 0); // Up axis for camera movement\n wgl.rightVec = vec3.create(); // Right axis for camera movement\n { // \"Right vector\" for camera movement\n var eyeToOrigin = vec3.fromValues(-wgl.eye[0], -wgl.eye[1], -wgl.eye[2]);\n vec3.normalize(eyeToOrigin, eyeToOrigin);\n vec3.cross(wgl.rightVec, wgl.upVec, eyeToOrigin);\n }\n wgl.viewMatrix = mat4.create(); // For rotation of view\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n gl.frontFace(gl.CCW);\n gl.cullFace(gl.BACK);\n\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n light = vec4.fromValues(0.,0,10.,1.);\n setupShadersPot();\n setupShaders();\n setupReflectiveShader();\n setupBuffers();\n setupTextures();\n tick();\n}", "function initShaderProgram(gl, vsSource, fsSource) {\n // NOTE: Load any WebGL extensions before calling this\n\n const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert( 'Unable to initialize the shader program: \\n' +\n gl.getProgramInfoLog(shaderProgram) );\n // This is not very good error handling... should be returning the error\n return null;\n }\n\n return {\n program: shaderProgram,\n attributeSetters: createAttributeSetters(gl, shaderProgram),\n uniformSetters: createUniformSetters(gl,shaderProgram),\n };\n}" ]
[ "0.8517223", "0.848254", "0.8469585", "0.84507793", "0.835966", "0.82854426", "0.81050926", "0.7903838", "0.78570324", "0.783045", "0.7805917", "0.77039444", "0.744647", "0.7345004", "0.73029953", "0.7292262", "0.72825015", "0.724285", "0.72253054", "0.7213555", "0.71579796", "0.7157342", "0.7058881", "0.700141", "0.69943476", "0.69943476", "0.68869513", "0.68218875", "0.68194294", "0.6809889", "0.6801133", "0.675911", "0.6733305", "0.67214507", "0.6707248", "0.6696774", "0.66839373", "0.6666358", "0.6659923", "0.6651536", "0.66495985", "0.66157407", "0.6614296", "0.6604729", "0.65940225", "0.65829337", "0.65651256", "0.655819", "0.6537747", "0.65358096", "0.65302217", "0.64982826", "0.649319", "0.64930606", "0.6492814", "0.6484627", "0.64591134", "0.6458824", "0.6406038", "0.6406038", "0.63938326", "0.6385171", "0.63679296", "0.6365164", "0.6360081", "0.6351755", "0.63126415", "0.62999314", "0.6270545", "0.626988", "0.62548375", "0.6241943", "0.6224977", "0.6224977", "0.61586404", "0.6152755", "0.61503524", "0.61468697", "0.6135371", "0.613377", "0.6130364", "0.6125813", "0.61204785", "0.61102396", "0.6106231", "0.6084351", "0.6071166", "0.6062536", "0.60612965", "0.6054023", "0.604481", "0.6042385", "0.6039289", "0.6030009", "0.6025697", "0.6022853", "0.60202163", "0.6011298", "0.5969811", "0.59688723" ]
0.8609813
0
initShaders Initialize the shaders, so WebGL knows how to light our scene.
function initShaders() { no_light_shaderProgram=loadShaders("nolighting_shader-fs","nolighting_shader-vs",false); shaderProgram=loadShaders( "shader-fs","shader-vs",true);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initShaders()\n{\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\t//create and link shader program\n\tshaderProgram = 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{\n\t\tconsole.log(\"Could not link shaders\");\n\t\treturn;\n\t}\n\n\t//register shader\n\tgl.useProgram(shaderProgram);\n\n\tshaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tgl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n\tshaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoordinate\");\n\tgl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n\n\tconsole.log(\"Initialized shaders\");\n}", "function initShaders() {\n console.log('init shader');\n var vertexShaderSource = loadText(\"vertex.glsl\");\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexShaderSource);\n\n gl.compileShader(vertexShader);\n\n var fragmentShaderSource = loadText(\"fragment.glsl\");\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentShaderSource);\n\n gl.compileShader(fragmentShader);\n program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n gl.useProgram(program)\n}", "function initShaders() {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, VERTEX_SHADER_SOURCE);\n gl.compileShader(vertexShader);\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, FRAGMENT_SHADER_SOURCE);\n gl.compileShader(fragmentShader);\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 throw new Error('Unable to initialize the shader program!');\n }\n\n gl.useProgram(shaderProgram);\n\n vertexPositionAttribute = gl.getAttribLocation(shaderProgram, 'aVertexPosition');\n gl.enableVertexAttribArray(vertexPositionAttribute);\n\n textureCoordAttribute = gl.getAttribLocation(shaderProgram, 'aTextureCoord');\n gl.enableVertexAttribArray(textureCoordAttribute);\n}", "function initShaders( )\n{\n\n var fragmentShader = getShader( gl, \"shader-fs\" );\n var vertexShader = getShader( gl, \"shader-vs\" );\n\n shaderProgram = gl.createProgram( );\n gl.attachShader( shaderProgram, vertexShader );\n gl.attachShader( shaderProgram, fragmentShader );\n gl.linkProgram( shaderProgram );\n\n if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) )\n {\n\n console.error( \"Could not initialize shaders.\" );\n\n }\n\n gl.useProgram( shaderProgram );\n\n // Acquire handles to shader program variables in order to pass data to the shaders.\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation( shaderProgram, \"aVertexPosition\" );\n gl.enableVertexAttribArray( shaderProgram.vertexPositionAttribute );\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation( shaderProgram, \"aVertexColor\" );\n gl.enableVertexAttribArray( shaderProgram.vertexColorAttribute );\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation( shaderProgram, \"aVertexNormal\" );\n gl.enableVertexAttribArray( shaderProgram.vertexNormalAttribute );\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation( shaderProgram, \"uPMatrix\" );\n shaderProgram.mvMatrixUniform = gl.getUniformLocation( shaderProgram, \"uMVMatrix\" );\n shaderProgram.nMatrixUniform = gl.getUniformLocation( shaderProgram, \"uNMatrix\" );\n\n shaderProgram.ambientColorUniform = gl.getUniformLocation( shaderProgram, \"uAmbientColor\" );\n shaderProgram.pointLightLocationUniform = gl.getUniformLocation( shaderProgram, \"uPointLightLocation\" );\n shaderProgram.pointLightColorUniform = gl.getUniformLocation( shaderProgram, \"uPointLightColor\" );\n shaderProgram.screenSizeUniform = gl.getUniformLocation( shaderProgram, \"uSreenSize\" );\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}", "function initShaders (){\n\tvar vertexShader = createShaderFromScriptElement(gl, \"vertex-shader\");\n\tvar fragmentShader = createShaderFromScriptElement(gl, \"fragment-shader\");\n\tprogram = createProgram(gl, [vertexShader, fragmentShader]);\n\tgl.useProgram(program);\n\n\tvertexPositionAttribute = gl.getAttribLocation(program, \"aVertexPosition\");\n\tgl.enableVertexAttribArray(vertexPositionAttribute);\n\t\n\tvertexColorAttribute = gl.getAttribLocation(program, \"aVertexColor\");\n\tgl.enableVertexAttribArray(vertexColorAttribute);\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}", "function initShaders() {\n\n\t// init model-view and projection matrices\n\tmvMatrix = mat4.create();\n\tpMatrix = mat4.create();\n\tmvMatrixStack = [];\n\n\t// create the shader program\n\tshaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, getShader(\"shader-fs\"));\n\tgl.attachShader(shaderProgram, getShader(\"shader-vs\"));\n\tgl.linkProgram(shaderProgram);\n\n\tif (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\t\tthrow gl.getProgramInfoLog(shaderProgram);\n\t}\n\n\t// use shader program\n\tgl.useProgram(shaderProgram);\n\n\t// store some shader hooks\n\t// vertex positions !\n\tshaderProgram.vertexPosAttrib = gl.getAttribLocation(shaderProgram, 'aVertexPos');\n\tgl.enableVertexAttribArray(shaderProgram.vertexPosAttrib);\n\n\t// vertex colors !\n\tshaderProgram.vertexColorAttrib = gl.getAttribLocation(shaderProgram, 'aVertexColor');\n\tgl.enableVertexAttribArray(shaderProgram.vertexColorAttrib);\n\n\t// set perspective and modelview matrices\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, 'uPMatrix');\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, 'uMVMatrix');\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 initShaders() {\n // Load the shaders and compile them (shaders are located in the HTML)\n var vertexShader = loadShader( gl.VERTEX_SHADER, document.getElementById('vshader').innerHTML );\n var fragmentShader = loadShader( gl.FRAGMENT_SHADER, document.getElementById('fshader').innerHTML );\n \n // Create the program object\n var programObject = gl.createProgram();\n gl.attachShader(programObject, vertexShader);\n gl.attachShader(programObject, fragmentShader);\n gl_program = programObject;\n \n // link the program\n gl.linkProgram(gl_program);\n \n // verify link\n var linked = gl.getProgramParameter(gl_program, gl.LINK_STATUS);\n if( !linked && !gl.isContextLost()) {\n var infoLog = gl.getProgramInfoLog(gl_program);\n window.console.log(\"Error linking program:\\n\" + infoLog);\n gl.deleteProgram(gl_program);\n return;\n }\n \n // Get the uniform/attribute locations\n gl_program_loc.uMVMatrix = gl.getUniformLocation(gl_program, \"uMVMatrix\");\n gl_program_loc.uPMatrix = gl.getUniformLocation(gl_program, \"uPMatrix\");\n gl_program_loc.uNMatrix = gl.getUniformLocation(gl_program, \"uNMatrix\");\n gl_program_loc.uColor = gl.getUniformLocation(gl_program, \"uColor\");\n gl_program_loc.uLighting = gl.getUniformLocation(gl_program, \"uLighting\");\n gl_program_loc.aPosition = gl.getAttribLocation(gl_program, \"aPosition\");\n}", "function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, 'shader/VertexShader.glsl',\n 'shader/FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpScene();\n\n gl.clearColor(renderSettings.viewPort.backgroundColor[0],\n renderSettings.viewPort.backgroundColor[1],\n renderSettings.viewPort.backgroundColor[2],\n renderSettings.viewPort.backgroundColor[3]);\n\n gl.frontFace(gl.CCW); // Defines the orientation of front-faces\n gl.cullFace(gl.BACK); // Defines which face should be culled\n gl.enable(gl.CULL_FACE); // Enables culling\n gl.enable(gl.DEPTH_TEST); // Enable z-test\n}", "function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, 'shader/VertexShader.glsl',\n 'shader/FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpScene();\n\n gl.clearColor(renderSettings.viewPort.backgroundColor[0],\n renderSettings.viewPort.backgroundColor[1],\n renderSettings.viewPort.backgroundColor[2],\n renderSettings.viewPort.backgroundColor[3]);\n\n gl.frontFace(gl.CCW); // Defines the orientation of front-faces\n gl.cullFace(gl.BACK); // Defines which face should be culled\n gl.enable(gl.CULL_FACE); // Enables culling\n gl.enable(gl.DEPTH_TEST); // Enable z-test\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 setupShaders() {\n // Load shaders from document\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n\n // Create shader program and attach both vertex and fragment shaders\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n // Enable vertex positions\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n \n // Enable vertex colors\n shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\n gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\n\n // Enable vertex normals\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n // Set up uniforms (matricies and lighting vectors)\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\"); \n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\"); \n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n}", "function InitShaders(gl) {with(gl)\n{\n\tvar fragmentShader = GetShader(gl, \"shader-fs\");\n\tvar vertexShader = GetShader(gl, \"shader-vs\");\n \n\t// Create the shader program\n\tgl.shaderProgram = createProgram();\n\tattachShader(shaderProgram, vertexShader);\n\tattachShader(shaderProgram, fragmentShader);\n\tlinkProgram(shaderProgram);\n\t\n\t// If creating the shader program failed, alert\n\tif (!getProgramParameter(shaderProgram, LINK_STATUS)) \n\t{\n\t\talert(\"Unable to initialize the shader program.\");\n\t}\n \tuseProgram(shaderProgram);\n\t\n\t// Texture attributes\n\tgl.aTextureCoord = getAttribLocation(shaderProgram, \"aTextureCoord\");\n\tenableVertexAttribArray(aTextureCoord);\n\t\n\t// Vertex attributes\n\tgl.aVertexPosition = getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tenableVertexAttribArray(aVertexPosition); \n\t\t\n\t// Set uniforms\n\tgl.uPosition = getUniformLocation(shaderProgram, \"uPosition\");\n\tgl.uAspectRatio = getUniformLocation(shaderProgram, \"uAspectRatio\");\n\tgl.uScale = getUniformLocation(shaderProgram, \"uScale\");\n\tgl.uColour = getUniformLocation(shaderProgram, \"uColour\");\n\tuniform4f(uColour, 1,1,1,1);\n\t// Set it\n\t//gl.uniform1f(uAspectRatio, canvas.width/canvas.height);\n\tuniform1f(uAspectRatio, 1);\n}}", "function setupShaders() {\n __shaders.vertexShader_normal = document.getElementById(\"vertexShader_normal\").text;\n __shaders.fragmentShader_normal = document.getElementById(\"fragmentShader_normal\").text;\n}", "function initShaders(gl, wgl) {\n // Initialize shader program with the specified shader\n const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // Alert if it failed\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS) && !gl.isContextLost()) {\n alert(\"Unable to initialize shader program: \" + gl.getProgramInfoLog(shaderProgram));\n return null;\n }\n\n gl.useProgram(shaderProgram); // Use the program\n \n // Get attribute and uniform locations\n const vertexPosition = gl.getAttribLocation(shaderProgram, 'aVertexPosition');\n const vertexNormal = gl.getAttribLocation(shaderProgram, 'aVertexNormal');\n const vertexColor = gl.getAttribLocation(shaderProgram, 'aVertexColor');\n const shininess = gl.getUniformLocation(shaderProgram, 'shininess');\n const mvMatrix = gl.getUniformLocation(shaderProgram, 'uMVMatrix');\n const pMatrix = gl.getUniformLocation(shaderProgram, 'uPMatrix');\n const nMatrix = gl.getUniformLocation(shaderProgram, 'uNMatrix');\n const lightPosition = gl.getUniformLocation(shaderProgram, 'uLightPosition');\n const ambientLightColor = gl.getUniformLocation(shaderProgram, 'uAmbientLightColor');\n const diffuseLightColor = gl.getUniformLocation(shaderProgram, 'uDiffuseLightColor');\n const specularLightColor = gl.getUniformLocation(shaderProgram, 'uSpecularLightColor');\n\n // Put the program info in the wgl object\n wgl.shaderProgram = shaderProgram;\n wgl.attribLocations = { \n vertexPosition: vertexPosition,\n vertexNormal: vertexNormal,\n vertexColor: vertexColor, \n };\n wgl.uniformLocations = {\n shininess: shininess,\n mvMatrix: mvMatrix,\n pMatrix: pMatrix,\n nMatrix: nMatrix,\n lightPosition: lightPosition,\n ambientLightColor: ambientLightColor,\n diffuseLightColor: diffuseLightColor,\n specularLightColor: specularLightColor,\n };\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 }", "function setupShaders() {\r\n\tvertexShader = loadShaderFromDOM(\"shader-vs\");\r\n\tfragmentShader = loadShaderFromDOM(\"shader-fs\");\r\n\tshaderProgram = gl.createProgram();\r\n\tgl.attachShader(shaderProgram, vertexShader);\r\n\tgl.attachShader(shaderProgram, fragmentShader);\r\n\tgl.linkProgram(shaderProgram);\r\n\tif(!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\r\n\t\talert(\"Failed to setup shaders\");\r\n\t}\r\n\tgl.useProgram(shaderProgram);\r\n\tshaderProgram.vertexPositionAttribute =gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n\tgl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\tshaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\r\n\tgl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\r\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n}", "function setupShaders() {\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 shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\r\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\r\n\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\r\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\r\n\r\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\");\r\n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\");\r\n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\r\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\r\n\r\n shaderProgram.uniformAmbientMatColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientMatColor\");\r\n shaderProgram.uniformDiffuseMatColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseMatColor\");\r\n shaderProgram.uniformSpecularMatColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularMatColor\");\r\n}", "function initShader(gl)\n{\n // load and compile the fragment and vertex shader\n let fragmentShader = createShader(gl, fragmentShaderSource, \"fragment\");\n let vertexShader = createShader(gl, vertexShaderSource, \"vertex\");\n\n // link them together into a new program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // get pointers to the shader params\n shaderVertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"vertexPos\");\n gl.enableVertexAttribArray(shaderVertexPositionAttribute);\n\n shaderVertexColorAttribute = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(shaderVertexColorAttribute);\n \n shaderProjectionMatrixUniform = gl.getUniformLocation(shaderProgram, \"projectionMatrix\");\n shaderModelViewMatrixUniform = gl.getUniformLocation(shaderProgram, \"modelViewMatrix\");\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Could not initialise shaders\");\n }\n}", "function setupShaders() {\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n \n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\n gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n }", "function setupShaders() {\r\n var vertexShader = loadShaderFromDOM(\"shader-vs\");\r\n var 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 shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\r\n gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n \r\n}", "function setupShaders() {\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\n gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n}", "function setupShaders() {\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 shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"a_Position\");\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\r\n gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\r\n\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"u_MVMatrix\");\r\n\r\n}", "function setupShaders() {\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\");\n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\");\n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n shaderProgram.uniformShininessLoc = gl.getUniformLocation(shaderProgram, \"uShininess\");\n shaderProgram.uniformAmbientMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKAmbient\");\n shaderProgram.uniformDiffuseMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKDiffuse\");\n shaderProgram.uniformSpecularMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKSpecular\");\n\n shaderProgram.uSkyboxSampler = gl.getUniformLocation(shaderProgram, \"uSkyboxSampler\");\n shaderProgram.ucheckSky = gl.getUniformLocation(shaderProgram, \"ucheckSky\");\n\n\n}", "function setupShaders() {\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n \n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, \"aVertexColor\");\n gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0, 0, 0, 1);\n}", "function initShaders()\n{\n var vertexShader=get_shader(shader_vertex_source, gl.VERTEX_SHADER, \"VERTEX\");\n var fragmentShader=get_shader(shader_fragment_source, gl.FRAGMENT_SHADER, \"FRAGMENT\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))\n {\n alert(\"Could not initialise shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n shaderProgram.sampler2Uniform = gl.getUniformLocation(shaderProgram, \"uSampler2\");\n shaderProgram.dualTex = gl.getUniformLocation(shaderProgram,\"uDualTex\")\n\n //lighting\n shaderProgram.useLightingUniform = gl.getUniformLocation(shaderProgram, \"uUseLighting\");\n shaderProgram.ambientColorUniform = gl.getUniformLocation(shaderProgram, \"uAmbientColor\");\n shaderProgram.pointLightingLocationUniform = gl.getUniformLocation(shaderProgram, \"uPointLightingLocation\");\n shaderProgram.pointLightingColorUniform = gl.getUniformLocation(shaderProgram, \"uPointLightingColor\");\n\n //transparency\n shaderProgram.alphaUniform = gl.getUniformLocation(shaderProgram, \"uAlpha\");\n shaderProgram.useBlending = gl.getUniformLocation(shaderProgram, \"uUseBlending\");\n\n}", "function initGL() {\r\n \"use strict\";\r\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\r\n setUpAttributesAndUniforms();\r\n setUpBuffers();\r\n gl.clearColor(1,0,0,0.5);\r\n}", "function left_foot_initShaders() {\n left_foot_shaderProgram=loadShaders(left_foot_gl, \"shader-fs\",\"shader-vs\",true); \n left_foot_no_light_shaderProgram=loadShaders(left_foot_gl, \"nolighting_shader-fs\",\"nolighting_shader-vs\",false);}", "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 initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0.1, 0.1, 0.1, 1);\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 }", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n setupWorldCoordinates();\n gl.clearColor(0.1, 0.1, 0.1, 1);\n startLoop();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(\n gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n gl.clearColor(0.8, 0.8, 0.8, 1);\n}", "function initScene() {\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.clearColor(0.3921, 0.5843, 0.9294, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n // INIT WEBGL SHADERS AND BUFFERS\n baseProgram = initShaders(gl, \"vertex-shader-base\", \"fragment-shader-base\");\n shadingProgram = initShaders(gl, \"vertex-shader-shading\", \"fragment-shader-shading\");\n\n // Attribute & uniform locations\n baseProgram.vPosition = gl.getAttribLocation(baseProgram, \"vPosition\");\n baseProgram.vColor = gl.getAttribLocation(baseProgram, \"vColor\");\n baseProgram.u_ProjectionMatrix = gl.getUniformLocation(baseProgram, 'u_ProjectionMatrix');\n baseProgram.u_ViewMatrix = gl.getUniformLocation(baseProgram, 'u_ViewMatrix');\n baseProgram.u_ModelMatrix = gl.getUniformLocation(baseProgram, 'u_ModelMatrix');\n\n shadingProgram.vPosition = gl.getAttribLocation(shadingProgram, \"vPosition\");\n shadingProgram.vColor = gl.getAttribLocation(shadingProgram, \"vColor\");\n shadingProgram.vNormal = gl.getAttribLocation(shadingProgram, \"vNormal\");\n shadingProgram.u_ProjectionMatrix = gl.getUniformLocation(shadingProgram, 'u_ProjectionMatrix');\n shadingProgram.u_ViewMatrix = gl.getUniformLocation(shadingProgram, 'u_ViewMatrix');\n shadingProgram.u_ModelMatrix = gl.getUniformLocation(shadingProgram, 'u_ModelMatrix');\n\n shadingProgram.light_position = gl.getUniformLocation(shadingProgram, \"light_position\");\n shadingProgram.u_kaLoc = gl.getUniformLocation(shadingProgram, \"ka\");\n shadingProgram.u_kdLoc = gl.getUniformLocation(shadingProgram, \"kd\");\n shadingProgram.u_ksLoc = gl.getUniformLocation(shadingProgram, \"ks\");\n shadingProgram.u_alphaLoc = gl.getUniformLocation(shadingProgram, \"alpha\");\n shadingProgram.intensity=gl.getUniformLocation(shadingProgram, \"intensity\");\n shadingProgram.u_NormalMatrix = gl.getUniformLocation(shadingProgram, 'u_NormalMatrix');\n\n\n shadingProgram.u_ShadowMap = gl.getUniformLocation(shadingProgram, 'u_ShadowMap');\n shadingProgram.u_MvpMatrixFromLight = gl.getUniformLocation(shadingProgram, 'u_MvpMatrixFromLight');\n\n // Buffers\n var vBuffer = gl.createBuffer();\n vBuffer.type = gl.FLOAT;\n vBuffer.num = 3;\n\n var cBuffer = gl.createBuffer();\n cBuffer.type = gl.FLOAT;\n cBuffer.num = 4;\n\n var nBuffer = gl.createBuffer();\n nBuffer.type = gl.FLOAT;\n nBuffer.num = 3;\n\n\n cubeBuffers.vBuffer = vBuffer;\n cubeBuffers.cBuffer = cBuffer;\n cubeBuffers.nBuffer = nBuffer;\n\n // POSITION CAMERA\n var eye = vec3(\n r * Math.sin(theta) * Math.sin(phi) + x,\n r * Math.cos(theta) + y,\n r * Math.sin(theta) * Math.cos(phi)\n );\n var at = vec3(x, y, 0.0);\n var up = vec3(0, 1, 0);\n viewMatrix = lookAt(eye, at, up);\n\n // CUBE & FACE LOOK UP MAP\n // Initialize a framebuffer object\n lookUpMapFbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, lookUpMapFbo);\n var renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, canvas.width, canvas.height);\n\n lookUpTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, lookUpTexture);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\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\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, lookUpTexture, 0);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);\n\n var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if (status !== gl.FRAMEBUFFER_COMPLETE) {\n alert('Framebuffer Not Complete');\n }\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n\n // INITIALIZE CUBES LIST AND DRAW SCENE\n allCubes.push(firstCube);\n allCubes = Array.from(chicken);\n\n // Draw current look up map\n drawCubes(allCubes, 1);\n\n // Draw cubes and shadows\n drawScene();\n}", "function initializeShaders(){\n //Load shaders and initialize attribute buffers\n program = initShaders(gl, \"shader-vs\", \"shader-fs\");\n gl.useProgram(program);\n\n //Associate attributes to vertex shader\n _Pmatrix = gl.getUniformLocation(program, \"Pmatrix\");\n _Vmatrix = gl.getUniformLocation(program, \"Vmatrix\");\n _Mmatrix = gl.getUniformLocation(program, \"Mmatrix\");\n _Nmatrix = gl.getUniformLocation(program, \"normalMatrix\");\n\n //Bind vertex buffer with position attribute \n gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer);\n var _position = gl.getAttribLocation(program, \"position\");\n gl.vertexAttribPointer(_position, 3, gl.FLOAT, false,0,0);\n gl.enableVertexAttribArray(_position); \n\n //Attributes\n textureCoordAttribute = gl.getAttribLocation(program, \"aTextureCoord\");\n gl.enableVertexAttribArray(textureCoordAttribute);\n\n normalAttribute = gl.getAttribLocation(program, \"normal\");\n gl.enableVertexAttribArray(normalAttribute);\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 //Load the vertex and fragment shaders\n vertexShader =loadShaderFromDOM(\"blinn-phong-vs\");\n fragmentShader =loadShaderFromDOM(\"blinn-phong-fs\");\n\n //Create the shader program and attach the vertex/fragment shaders\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n //Alert if shaders not set up properly\n alert(\"Failed to setup shaders\");\n console.log(gl.getProgramInfoLog(shaderProgram));\n }\n\n // Use the shaderProgram just created\n gl.useProgram(shaderProgram);\n\n // Get attributes from shaders and enable arrays that will be needed later\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n // Get the uniforms\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\");\n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\");\n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n shaderProgram.uniformShininessLoc = gl.getUniformLocation(shaderProgram, \"uShininess\");\n shaderProgram.uniformAmbientMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKAmbient\");\n shaderProgram.uniformDiffuseColorLoc1 = gl.getUniformLocation(shaderProgram, \"kDiffuse1\");\n shaderProgram.uniformDiffuseColorLoc2 = gl.getUniformLocation(shaderProgram, \"kDiffuse2\");\n shaderProgram.uniformDiffuseColorLoc3 = gl.getUniformLocation(shaderProgram, \"kDiffuse3\");\n shaderProgram.uniformDiffuseColorLoc4 = gl.getUniformLocation(shaderProgram, \"kDiffuse4\");\n shaderProgram.uniformSpecularMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKSpecular\");\n\n}", "function setupShaders(vshader,fshader) {\n vertexShader = loadShaderFromDOM(vshader);\n fragmentShader = loadShaderFromDOM(fshader);\n \n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\"); \n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\"); \n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n shaderProgram.uniformDiffuseMaterialColor = gl.getUniformLocation(shaderProgram, \"uDiffuseMaterialColor\");\n shaderProgram.uniformAmbientMaterialColor = gl.getUniformLocation(shaderProgram, \"uAmbientMaterialColor\");\n shaderProgram.uniformSpecularMaterialColor = gl.getUniformLocation(shaderProgram, \"uSpecularMaterialColor\");\n\n shaderProgram.uniformShininess = gl.getUniformLocation(shaderProgram, \"uShininess\"); \n}", "function setupShaders(vshader,fshader) {\n vertexShader = loadShaderFromDOM(vshader);\n fragmentShader = loadShaderFromDOM(fshader);\n \n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\"); \n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\"); \n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n shaderProgram.uniformDiffuseMaterialColor = gl.getUniformLocation(shaderProgram, \"uDiffuseMaterialColor\");\n shaderProgram.uniformAmbientMaterialColor = gl.getUniformLocation(shaderProgram, \"uAmbientMaterialColor\");\n shaderProgram.uniformSpecularMaterialColor = gl.getUniformLocation(shaderProgram, \"uSpecularMaterialColor\");\n\n shaderProgram.uniformShininess = gl.getUniformLocation(shaderProgram, \"uShininess\"); \n}", "function initShaders() {\n //get shader source\n \n var fs_source = fragmentShaderSource;\n var vs_source = vertexShaderSource;\n\n //compile shaders \n vertexShader = makeShader(vs_source, gl.VERTEX_SHADER);\n fragmentShader = makeShader(fs_source, gl.FRAGMENT_SHADER);\n \n //create program\n glProgram_terreno = gl.createProgram();\n \n //attach and link shaders to the program\n gl.attachShader(glProgram_terreno, vertexShader);\n gl.attachShader(glProgram_terreno, fragmentShader);\n gl.linkProgram(glProgram_terreno);\n\n if (!gl.getProgramParameter(glProgram_terreno, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n\n //use program\n gl.useProgram(glProgram_terreno);\n \n\n glProgram_terreno.vertexPositionAttribute = gl.getAttribLocation(glProgram_terreno, \"aPosition\");\n gl.enableVertexAttribArray(glProgram_terreno.vertexPositionAttribute);\n\n glProgram_terreno.textureCoordAttribute = gl.getAttribLocation(glProgram_terreno, \"aUv\");\n gl.enableVertexAttribArray(glProgram_terreno.textureCoordAttribute);\n\n glProgram_terreno.vertexNormalAttribute = gl.getAttribLocation(glProgram_terreno, \"aNormal\");\n if (glProgram_terreno.vertexNormalAttribute != -1){ //Por optimizaciones del compilador que elimina variables no utilizadas\n gl.enableVertexAttribArray(glProgram_terreno.vertexNormalAttribute);\n }\n\n glProgram_terreno.pMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uPMatrix\");\n glProgram_terreno.mMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uMMatrix\");\n glProgram_terreno.vMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uVMatrix\");\n glProgram_terreno.nMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uNMatrix\");\n glProgram_terreno.traslacionTextura = gl.getUniformLocation(glProgram_terreno, \"traslacionTextura\");\n glProgram_terreno.samplerUniform = gl.getUniformLocation(glProgram_terreno, \"uSampler\");\n glProgram_terreno.useLightingUniform = gl.getUniformLocation(glProgram_terreno, \"uUseLighting\");\n glProgram_terreno.uColor = gl.getUniformLocation(glProgram_terreno, \"uAmbientColor\");\n glProgram_terreno.frameUniform = gl.getUniformLocation(glProgram_terreno, \"time\");\n glProgram_terreno.lightingDirectionUniform = gl.getUniformLocation(glProgram_terreno, \"uLightPosition\");\n glProgram_terreno.directionalColorUniform = gl.getUniformLocation(glProgram_terreno, \"uDirectionalColor\");\n\n glProgram_terreno.lightingDirectionUniform2 = gl.getUniformLocation(glProgram_terreno, \"uLightPosition2\");\n glProgram_terreno.directionalColorUniform2 = gl.getUniformLocation(glProgram_terreno, \"uDirectionalColor2\");\n //glProgram_terreno.uColor = gl.getUniformLocation(glProgram_terreno, \"uColor\");\n\n var fs_source2 = fragmentShaderSource2;\n var vs_source2 = vertexShaderSource2;\n\n //compile shaders \n vertexShader = makeShader(vs_source2, gl.VERTEX_SHADER);\n fragmentShader = makeShader(fs_source2, gl.FRAGMENT_SHADER);\n \n //create program\n glProgram_helicoptero = gl.createProgram();\n \n //attach and link shaders to the program\n gl.attachShader(glProgram_helicoptero, vertexShader);\n gl.attachShader(glProgram_helicoptero, fragmentShader);\n gl.linkProgram(glProgram_helicoptero);\n\n if (!gl.getProgramParameter(glProgram_helicoptero, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n\n //use program\n gl.useProgram(glProgram_helicoptero);\n \n glProgram_helicoptero.textureCoordAttribute = gl.getAttribLocation(glProgram_helicoptero, \"aUv\");\n gl.enableVertexAttribArray(glProgram_helicoptero.textureCoordAttribute);\n\n glProgram_helicoptero.vertexPositionAttribute = gl.getAttribLocation(glProgram_helicoptero, \"aPosition\");\n gl.enableVertexAttribArray(glProgram_helicoptero.vertexPositionAttribute);\n\n glProgram_helicoptero.vertexNormalAttribute = gl.getAttribLocation(glProgram_helicoptero, \"aNormal\");\n gl.enableVertexAttribArray(glProgram_helicoptero.vertexNormalAttribute); \n \n glProgram_helicoptero.uColor = gl.getUniformLocation(glProgram_helicoptero, \"uColor\");\n\n glProgram_helicoptero.lightingDirectionUniform = gl.getUniformLocation(glProgram_helicoptero, \"uLightPosition\");\n glProgram_helicoptero.directionalColorUniform = gl.getUniformLocation(glProgram_helicoptero, \"uDirectionalColor\");\n}", "function initWebGl()\n {\n canvas = document.getElementById(\"gl-canvas\");\n gl = WebGLUtils.setupWebGL(canvas);\n if (!gl)\n {\n alert(\"Unable to setup WebGL!\");\n return;\n }\n gl.viewport(0, 0, canvas.clientWidth, canvas.clientHeight);\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n var vertexShader = initShader(gl, 'vertex-shader', gl.VERTEX_SHADER);\n var fragmentShader = initShader(gl, 'fragment-shader', gl.FRAGMENT_SHADER);\n var boxShader = initShader(gl, 'block-fragment-shader', gl.FRAGMENT_SHADER);\n var boxVShader = initShader(gl, 'block-vertex-shader', gl.VERTEX_SHADER);\n\n program = gl.createProgram();\n gl.attachShader(program, fragmentShader);\n gl.attachShader(program, vertexShader);\n gl.linkProgram(program);\n\n boxShaderProgram = gl.createProgram();\n gl.attachShader(boxShaderProgram, boxVShader);\n gl.attachShader(boxShaderProgram, boxShader);\n gl.linkProgram(boxShaderProgram);\n }", "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 }", "function initGL() {\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\n gl.useProgram(prog);\n gl.enable(gl.DEPTH_TEST);\n \n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n gl.enableVertexAttribArray(a_coords_loc);\n gl.enableVertexAttribArray(a_normal_loc);\n \n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_material = {\n diffuseColor: gl.getUniformLocation(prog, \"material.diffuseColor\"),\n specularColor: gl.getUniformLocation(prog, \"material.specularColor\"),\n emissiveColor: gl.getUniformLocation(prog, \"material.emissiveColor\"),\n specularExponent: gl.getUniformLocation(prog, \"material.specularExponent\")\n };\n u_lights = new Array(10);\n for (var i = 0; i < 10; i++) {\n u_lights[i] = {\n enabled: gl.getUniformLocation(prog, \"lights[\" + i + \"].enabled\"),\n position: gl.getUniformLocation(prog, \"lights[\" + i + \"].position\"),\n color: gl.getUniformLocation(prog, \"lights[\" + i + \"].color\"),\n spotDirection: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotDirection\"),\n spotCosineCutoff: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotCosineCutoff\"),\n spotExponent: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotExponent\"),\n attenuation: gl.getUniformLocation(prog, \"lights[\" + i + \"].attenuation\")\n };\n }\n for (var i = 1; i < 10; i++) { // set defaults for lights\n gl.uniform1i( u_lights[i].enabled, 1 ); \n\n }\n\n //ambient light - off by default\n gl.uniform4f( u_lights[0].position, 0,0,0,1 ); \n gl.uniform3f( u_lights[0].color, 0.2,0.2,0.2 );\n \n}", "function SetUpShaders(gl) {\r\n DefaultShader=LoadShaderFromFiles(gl, \"shaders/default_vs.glsl\", \"shaders/default_fs.glsl\");\r\n IndexShader=LoadShaderFromFiles(gl, \"shaders/default_vs.glsl\", \"shaders/selection_fs.glsl\");\r\n DepthShader=LoadShaderFromFiles(gl, \"shaders/default_vs.glsl\", \"shaders/depth_fs.glsl\");\r\n\r\n //iconTextures[\"simple\"]=new CTexture(gl, \"images/iphonecopy.png\");\r\n iconTextures[\"Object\"]=new CTexture(gl, \"images/Object1.png\");\r\n iconTextures[\"PartWhole\"]=new CTexture(gl, \"images/PartWhole1.png\");\r\n iconTextures[\"Reference\"]=new CTexture(gl, \"images/Reference1.png\");\r\n iconTextures[\"Creative\"]=new CTexture(gl, \"images/Creative1.png\");\r\n}", "function initProgram(id) {\n var programShader = gl.createProgram();\n var vert = compileShader(id + \"-vs\");\n var frag = compileShader(id + \"-fs\");\n gl.attachShader(programShader, vert);\n gl.attachShader(programShader, frag);\n gl.linkProgram(programShader);\n if (!gl.getProgramParameter(programShader, gl.LINK_STATUS)) {\n alert(gl.getProgramInfoLog(programShader));\n return null;\n }\n return programShader;\n}", "function setUpShaders() {\n //\n var vertexShader = scene.assetManager.loadShader (\n ShaderType.VERTEX_SHADER,\n PositionColor.VERTEX_SHADER_SOURCE\n );\n\n var fragmentShader = scene.assetManager.loadShader (\n ShaderType.FRAGMENT_SHADER,\n PositionColor.FRAGMENT_SHADER_SOURCE\n );\n\n shaderProgram =\n shaderHelper.setUpShaderProgram(vertexShader, fragmentShader);\n\n vertexPositionAttributeLocation =\n scene.graphicsManager.getAttributeLocation(shaderProgram, 'vertexPosition');\n\n transformUniformLocation =\n scene.graphicsManager.getUniformLocation(shaderProgram, 'transform');\n }", "function initTestShaders( vertexShaderName, fragmentShaderName, context )\n{\n var vertexShader = getShader( gl, vertexShaderName );\n var fragmentShader = getShader( gl, fragmentShaderName );\n var vPos;\n var mvMatrix;\n var pMatrix;\n\n shaderProgram = gl.createProgram();\n gl.attachShader( shaderProgram, vertexShader );\n gl.attachShader( shaderProgram, fragmenstShader );\n gl.linkProgram( shaderProgram );\n\n // Check if linking succeeded\n if (!gl.getProgramParameter( shaderProgram, gl.LINK_STATUS )) {\n alert( gl.getProgramInfoLog( shaderProgram ) );\n return 0;\n }\n \n gl.useProgram( shaderProgram );\n vPos = gl.getAttributeLocation( shaderProgram, 'a_vPos' );\n gl.enableVertexAttribArray( vPos );\n\n mvMatrix = gl.getAttributeLocation( shaderProgram, 'u_mvMatrix' );\n pMatrix = gl.getAttributeLocation( shaderProgram, 'u_pMatrix' );\n\n // Update shader data in the context\n context.shaderData.shaderProgram = shaderProgram;\n context.shaderData.vertexPositionAttribute = vPos;\n context.shaderData.modelViewMatrixUniform = mvMatrix;\n context.shaderData.projectionMatrixUniform = pMatrix;\n}", "function initGL() {\r\n var canvas = document.getElementById(\"webGLcanvas\");\r\n canvas.width = window.innerWidth - 30;\r\n canvas.height = Math.floor(window.innerHeight - 0.25 * window.innerHeight);\r\n try {\r\n gl = canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n } catch (e) {\r\n }\r\n if (!gl) {\r\n alert(\"cannot initialize webGL\");\r\n }\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = handleKeyUp;\r\n canvas.onmousedown = handleMouseDown;\r\n document.onmouseup = handleMouseUp;\r\n document.onmousemove = handleMouseMove;\r\n\r\n // fragprogram = initShaders(\"perfrag-shader-fs\", \"perfrag-shader-vs\");\r\n vertprogram = initShaders(\"shader-fs\", \"shader-vs\");\r\n currentProgram = vertprogram;\r\n gl.clearColor(0.13, 0.13, 0.13, 1);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n fpsInterval = 1000 / 15;\r\n then = Date.now();\r\n startTime = then;\r\n // initBuffer();\r\n cornerVertexPosBuffer = gl.createBuffer();\r\n pointLightPos = [\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n ];\r\n pointLightColor = [\r\n rand(0, 0.5),rand(0.4, 1),rand(0.4, 1),\r\n rand(0.4, 1),rand(0.4, 1),rand(0, 0.5),\r\n rand(0.4, 1),rand(0.4, 1),rand(0.4, 1),\r\n rand(0, 0.5),rand(0, 0.5),rand(0, 0.5),\r\n rand(0.4, 1),rand(0, 0.5),rand(0.4, 1),\r\n ];\r\n \r\n numPtLights = 5;\r\n\r\n animate();\r\n}", "function initShaderProgram(gl) {\n const vsh = loadShader(gl, gl.VERTEX_SHADER, vsh_src);\n const fsh = loadShader(gl, gl.FRAGMENT_SHADER, fsh_src);\n\n // Create the shader program\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vsh);\n gl.attachShader(shaderProgram, fsh);\n gl.linkProgram(shaderProgram);\n\n // Check for errors in setup\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Shader program initialization failed: ' + gl.getProgramInfoLog(shaderProgram));\n return;\n }\n \n return shaderProgram;\n}", "function initShaders(gl) {\n\n var vertexShaderSource = \"\\\n\tattribute vec3 a_position; \\n\\\n\tattribute vec3 a_color; \\n\\\n\tvarying vec3 vertexcolor; \\n\\\n\tvoid main(void) \\n\\\n\t{ \\n\\\n\t vertexcolor = a_color; \\n\\\n\t\tgl_Position = vec4(a_position, 1.0); \\n\\\n\t} \\n\\\n\t\";\n\n var fragmentShaderSource = \"\\\n\tprecision highp float; \\n\\\n\tvarying vec3 vertexcolor; \\n\\\n\tvoid main(void) \\n\\\n\t{ \\n\\\n\t\tgl_FragColor = vec4(vertexcolor, 1.0); \\n\\\n\t} \\n\\\n\t\";\n\n // create the vertex shader\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexShaderSource);\n gl.compileShader(vertexShader);\n\n // create the fragment shader\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentShaderSource);\n gl.compileShader(fragmentShader);\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, we show compilation and linking errors.\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n var str = \"\";\n str += \"VS:\\n\" + gl.getShaderInfoLog(vertexShader) + \"\\n\\n\";\n str += \"FS:\\n\" + gl.getShaderInfoLog(fragmentShader) + \"\\n\\n\";\n str += \"PROG:\\n\" + gl.getProgramInfoLog(shaderProgram);\n alert(str);\n }\n}", "function initShader(gl, vsSource, fsSource) {\n \n const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n // Create the shader program\n\n const 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\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n return null;\n }\n\n return shaderProgram;\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n light = vec4.fromValues(0.,0,10.,1.);\n setupShadersPot();\n setupShaders();\n setupReflectiveShader();\n setupBuffers();\n setupTextures();\n tick();\n}", "function init() {\n // Set the clear color to fully transparent black\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n \n gl.enable(gl.DEPTH_TEST);\n gl.depthMask(true);\n gl.disable(gl.BLEND);\n \n // Create the model-view matrix and projection matrix\n mvmat = mat4.create();\n projmat = mat4.create();\n nmat = mat3.create();\n \n // Create all buffer objects and reset their lengths\n vbo = gl.createBuffer();\n lineIndices = gl.createBuffer();\n triIndices = gl.createBuffer();\n vbo.length = 0;\n lineIndices.length = 0;\n \n // Initialize the shaders\n initShaders();\n \n // Reshape the canvas, and setup the viewport and projection\n reshape();\n}", "function setupShadersMesh() {\r\n vertexShader = loadShaderFromDOM(\"shader-vs-mesh\");\r\n fragmentShader = loadShaderFromDOM(\"shader-fs-mesh\");\r\n\r\n shaderProgramMesh = gl.createProgram();\r\n gl.attachShader(shaderProgramMesh, vertexShader);\r\n gl.attachShader(shaderProgramMesh, fragmentShader);\r\n gl.linkProgram(shaderProgramMesh);\r\n\r\n if (!gl.getProgramParameter(shaderProgramMesh, gl.LINK_STATUS)) {\r\n alert(\"Failed to setup mesh shaders\");\r\n }\r\n\r\n gl.useProgram(shaderProgramMesh);\r\n\r\n shaderProgramMesh.vertexPositionAttribute = gl.getAttribLocation(shaderProgramMesh, \"aVertexPosition\");\r\n gl.enableVertexAttribArray(shaderProgramMesh.vertexPositionAttribute);\r\n\r\n shaderProgramMesh.vertexNormalAttribute = gl.getAttribLocation(shaderProgramMesh, \"aVertexNormal\");\r\n gl.enableVertexAttribArray(shaderProgramMesh.vertexNormalAttribute);\r\n\r\n shaderProgramMesh.mvMatrixUniform = gl.getUniformLocation(shaderProgramMesh, \"uMVMatrix\");\r\n shaderProgramMesh.pMatrixUniform = gl.getUniformLocation(shaderProgramMesh, \"uPMatrix\");\r\n shaderProgramMesh.nMatrixUniform = gl.getUniformLocation(shaderProgramMesh, \"uNMatrix\");\r\n shaderProgramMesh.uniformLightPositionLoc = gl.getUniformLocation(shaderProgramMesh, \"uLightPosition\");\r\n shaderProgramMesh.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgramMesh, \"uAmbientLightColor\");\r\n shaderProgramMesh.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgramMesh, \"uDiffuseLightColor\");\r\n shaderProgramMesh.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgramMesh, \"uSpecularLightColor\");\r\n shaderProgramMesh.uniformShininessLoc = gl.getUniformLocation(shaderProgramMesh, \"uShininess\");\r\n shaderProgramMesh.uniformAmbientMaterialColorLoc = gl.getUniformLocation(shaderProgramMesh, \"uKAmbient\");\r\n shaderProgramMesh.uniformDiffuseMaterialColorLoc = gl.getUniformLocation(shaderProgramMesh, \"uKDiffuse\");\r\n shaderProgramMesh.uniformSpecularMaterialColorLoc = gl.getUniformLocation(shaderProgramMesh, \"uKSpecular\");\r\n\r\n console.log(\"Mesh shaders succesfully set up.\");\r\n}", "function initShaders() {\n\tvar promises = [];\n\tfor (i = 0; i < vertShaderNames.length; i++) {\n\t\t// vertex shader promise\n\t\tpromises[i*2] = new Promise(function(resolve, reject) {\n\t\t\tvar req = new XMLHttpRequest();\n\t\t\tvar filename = \"./shaders/\" + vertShaderNames[i] + \".vert\";\n\t\t\treq.open(\"GET\", filename, true);\n\t\t\treq.responseType = \"text\";\n\t\t\treq.onreadystatechange = function () {\n\t\t\t\tif(req.readyState === 4) {\n\t\t\t\t\tif (req.status === 200 || req.status == 0) {\n\t\t\t\t\t\tresolve(req.responseText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treject(Error(\"Failed to load \" + filename));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treq.send(null);\t\t\t\n\t\t});\n\t\t// fragment shader promise\n\t\tpromises[i*2 + 1] = new Promise(function(resolve, reject) {\n\t\t\tvar req = new XMLHttpRequest();\n\t\t\tvar filename = \"./shaders/\" + fragShaderNames[i] + \".frag\";\n\t\t\treq.open(\"GET\", filename, true);\n\t\t\treq.responseType = \"text\";\n\t\t\treq.onreadystatechange = function () {\n\t\t\t\tif(req.readyState === 4) {\n\t\t\t\t\tif (req.status === 200 || req.status == 0) {\n\t\t\t\t\t\tresolve(req.responseText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treject(Error(\"Failed to load \" + filename));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treq.send(null);\n\t\t});\n\t}\n\tPromise.all(promises).then(function(values) {\n\t\tpostInitShaders(values);\n\t}, function() {\n\t\tconsole.err(\"A promise has has rejected, so an XMLHttpRequest failed.\");\n\t});\n}", "function initDemo() {\n const canvas = document.getElementById('c');\n\n // Resize canvas HTML element to window size\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight-100;\n \n gl = canvas.getContext('webgl2');\n\n if (!gl) {\n // Some browsers have only experimental support.\n console.log('WebGL not supported. Using Experimental WebGL.');\n gl = canvas.getContext('experimental-webgl');\n }\n\n if (!gl) {\n alert('Your browser does not support WebGL!');\n return;\n }\n\n // Adjust viewport to window size\n gl.viewport(0, 0, canvas.width, canvas.heigh5);\n\n // Clear window in purple\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n // Create shaders\n // Prior to drawing, we need to compile the shaders.\n // This is due to OpenGL ES being a programmable shading interface\n\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\n gl.shaderSource(vertexShader, vertexShaderCode);\n gl.shaderSource(fragmentShader, fragmentShaderCode);\n\n gl.compileShader(vertexShader);\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n console.log(\n 'Error compiling vertexShader',\n gl.getShaderInfoLog(vertexShader),\n );\n return;\n }\n\n gl.compileShader(fragmentShader);\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n console.log(\n 'Error compiling fragmentShader',\n gl.getShaderInfoLog(fragmentShader),\n );\n return;\n }\n\n // Attach shaders to a GL program\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n gl.useProgram(program);\n // Additional checking if everything went fine\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error(\n 'Error linking program',\n gl.getProgramInfoLog(program),\n );\n return;\n }\n\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error(\n 'Error validating program',\n gl.getProgramInfoLog(program),\n );\n return;\n }\n\n\n // Create screen corners in a buffer\n // As this application relies on the fragment fragment buffer,\n // we only need to tell OpenGL to draw the whole area and the\n // pixels are processed individually (and in parallel) in the\n // fragment shader\n const screenCorners = [\n // X, Y,\n /* */1.0, /* */1.0,\n /**/-1.0, /* */1.0,\n /**/-1.0, /**/-1.0,\n /* */1.0, /**/-1.0,\n ];\n\n const screenCornersVertexBufferObject = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, screenCornersVertexBufferObject);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(screenCorners), gl.STATIC_DRAW);\n\n // Vertices\n const vertexPositionAttribLocation =\n gl.getAttribLocation(program, 'vertexPosition');\n\n gl.vertexAttribPointer(\n vertexPositionAttribLocation, // index\n 2, // size\n gl.FLOAT, // type\n gl.FALSE, // normalized\n 0, // stride\n 0, // offset\n );\n\n gl.enableVertexAttribArray(vertexPositionAttribLocation);\n\n const nearVertexBufferObject = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, nearVertexBufferObject);\n\n // Near vertices on attribute\n const nearPositionAttribLocation = gl.getAttribLocation(program, 'plotPosition');\n gl.vertexAttribPointer(\n nearPositionAttribLocation, // index\n 3, // size\n gl.FLOAT, // type\n gl.FALSE, // normalized\n 0, // stride\n 0, // offset\n );\n\n gl.enableVertexAttribArray(nearPositionAttribLocation);\n\n // Bind program to WebGL\n gl.useProgram(program);\n\n // Set properties\n const cameraPositionLocation = gl.getUniformLocation(program, 'cameraPosition');\n const sphereCenterLocation1 = gl.getUniformLocation(program, 'sphere1');\n const sphereCenterLocation2 = gl.getUniformLocation(program, 'sphere2');\n\n const cubeCenterLocation1 = gl.getUniformLocation(program, 'cube1');\n const cubeCenterLocation2 = gl.getUniformLocation(program, 'cube2');\n\n const floorRadiusLocation = gl.getUniformLocation(program, 'floorRadius');\n const floorLocationLocation = gl.getUniformLocation(program, 'floorLocation');\n const planeDirectionLocation = gl.getUniformLocation(program, 'norPlane');\n\n const lighPosLocation = gl.getUniformLocation(program, 'lightPos');\n\n //Set Perlin parameters\n scalePerlinFactor = gl.getUniformLocation(program, 'scalePerlin');\n transPerlinFactor = gl.getUniformLocation(program, 'transPerlin');\n anglePerlinFactor = gl.getUniformLocation(program, 'anglePerlin');\n scalePerlinFactor1 = gl.getUniformLocation(program, 'scalePerlin1');\n transPerlinFactor1 = gl.getUniformLocation(program, 'transPerlin1');\n anglePerlinFactor1 = gl.getUniformLocation(program, 'anglePerlin1');\n scalePerlinFactor2 = gl.getUniformLocation(program, 'scalePerlin2');\n transPerlinFactor2 = gl.getUniformLocation(program, 'transPerlin2');\n anglePerlinFactor2 = gl.getUniformLocation(program, 'anglePerlin2');\n\n brightPerlin1 = gl.getUniformLocation(program, 'brightPerlin1');\n brightPerlin2 = gl.getUniformLocation(program, 'brightPerlin2');\n brightPerlin3 = gl.getUniformLocation(program, 'brightPerlin3');\n\n weightPerlin1 = gl.getUniformLocation(program, 'weightPerlin1');\n weightPerlin2 = gl.getUniformLocation(program, 'weightPerlin2');\n weightPerlin3 = gl.getUniformLocation(program, 'weightPerlin3');\n\n //Set other input fields\n modeSh = gl.getUniformLocation(program, 'mode');\n reflectionOn = gl.getUniformLocation(program, 'reflectingOn');\n gridOn = gl.getUniformLocation(program, 'gridOn');\n\n //Set geometry locations\n var sphere1 = [5.0, 2, 0.0]\n var cube1 = [-5.0, 2, 0.0]\n\n gl.uniform3f(sphereCenterLocation1, sphere1[0], sphere1[1], sphere1[2]);\n //gl.uniform3f(sphereCenterLocation2, sphere2[0], sphere2[1], sphere2[2]);\n\n gl.uniform3f(cubeCenterLocation1, cube1[0], cube1[1], cube1[2]);\n //gl.uniform3f(cubeCenterLocation2, cube2[0], cube2[1], cube2[2]);\n \n gl.uniform1f(floorRadiusLocation, 30.0);\n gl.uniform3f(floorLocationLocation, 0.0, -1.0, 0.0);\n\n var lightPos =[0, 9, 10]\n gl.uniform3f(lighPosLocation, lightPos[0], lightPos[1], lightPos[2]);\n\n gl.uniform3f(scalePerlinFactor, 1.0,1.0,1.0);\n gl.uniform3f(transPerlinFactor, 1.0,1.0,1.0);\n gl.uniform3f(anglePerlinFactor, 0.0,0.0,0.0);\n\n //Set variables for modes\n var prevMod = 0;\n gl.uniform1i(modeSh, 0);\n var prevReflection = true;\n gl.uniform1i(reflectionOn, true);\n var prevGrid = true;\n gl.uniform1i(gridOn, true);\n\n let ratio = canvas.width / canvas.height;\n var prevrealImageOn = false\n\n //Camera parameters\n const up = vec3.fromValues(0.0, 1.0, 0.0);\n const cameraTo = vec3.fromValues(0.0, 0.0, 0.0);\n const cameraInitialPosition = vec3.fromValues(0.0, 0.0, 10.0);\n const cameraPosition = new Float32Array(3);\n\n const cameraDirection = new Float32Array(3);\n const cameraUp = new Float32Array(3);\n const cameraLeft = new Float32Array(3);\n\n const nearCenter = new Float32Array(3);\n const nearTopLeft = new Float32Array(3);\n const nearBottomLeft = new Float32Array(3);\n const nearTopRight = new Float32Array(3);\n const nearBottomRight = new Float32Array(3);\n\n function renderLoop() {\n prevrealImageOn = realImageOn\n\n //Change modes\n var modecur = parseFloat(document.getElementById(\"mode\").value);\n if(modecur != prevMod || prevrealImageOn == true){\n //Perlin grid and interpolation\n if(modecur == 0 || modecur == 1 ){\n document.getElementById(\"perx\").value = 1.0\n document.getElementById(\"pery\").value = 1.0\n document.getElementById(\"perz\").value = 1.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n realImageOn == false \n }\n //Marble\n else if(modecur == 2){\n document.getElementById(\"perx\").value = 10.0\n document.getElementById(\"pery\").value = 10.0\n document.getElementById(\"perz\").value = 10.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }\n //Grass\n else if(modecur == 3){\n document.getElementById(\"perx\").value = 60.0\n document.getElementById(\"pery\").value = 20.0\n document.getElementById(\"perz\").value = 60.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }\n //Wood\n else if(modecur == 4){\n document.getElementById(\"perx\").value = 4.0\n document.getElementById(\"pery\").value = 80.0\n document.getElementById(\"perz\").value = 4.0\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }else if(modecur == 5){\n document.getElementById(\"brR\").disabled = false\n document.getElementById(\"brG\").disabled = false\n document.getElementById(\"brB\").disabled = false\n document.getElementById(\"wR\").disabled = false\n document.getElementById(\"wG\").disabled = false\n document.getElementById(\"wB\").disabled = false\n\n document.getElementById(\"perx\").disabled = false\n document.getElementById(\"pery\").disabled = false\n document.getElementById(\"perz\").disabled = false\n document.getElementById(\"perxrot\").disabled = false\n document.getElementById(\"peryrot\").disabled = false\n document.getElementById(\"perzrot\").disabled = false\n\n realImageOn == false \n }\n gl.uniform1i(modeSh, modecur)\n prevMod = modecur\n\n //Real image when using a model\n if(prevrealImageOn == true ){\n document.getElementById(\"perx\").disabled = true\n document.getElementById(\"pery\").disabled = true\n document.getElementById(\"perz\").disabled = true\n document.getElementById(\"perxrot\").disabled = true\n document.getElementById(\"peryrot\").disabled = true\n document.getElementById(\"perzrot\").disabled = true\n\n document.getElementById(\"brR\").disabled = true\n document.getElementById(\"brG\").disabled = true\n document.getElementById(\"brB\").disabled = true\n document.getElementById(\"wR\").disabled = true\n document.getElementById(\"wG\").disabled = true\n document.getElementById(\"wB\").disabled = true\n\n realImageOn = false\n gl.uniform1i(modeSh, 10)\n }\n }\n\n\n //Reflection on\n var reflection = document.getElementById(\"reflectionCheck\").checked\n if(reflection != prevReflection){\n gl.uniform1i(reflectionOn, reflection)\n }\n prevReflection = reflection\n\n\n //Plane direction\n var dirx = parseFloat(document.getElementById(\"dirx\").value);\n var diry = parseFloat(document.getElementById(\"diry\").value);\n var dirz = parseFloat(document.getElementById(\"dirz\").value);\n if(dirx != NaN && diry != NaN && dirz != NaN ){\n var mgnt = Math.sqrt(dirx*dirx + diry*diry + dirz*dirz)\n\n gl.uniform3f(planeDirectionLocation, dirx/mgnt, diry/mgnt, dirz/mgnt);\n }\n\n //Perlin scale parameters\n if(!document.getElementById(\"perx\").disabled && !document.getElementById(\"pery\").disabled && !document.getElementById(\"perz\").disabled){\n var perlinx = parseFloat(document.getElementById(\"perx\").value);\n var perliny = parseFloat(document.getElementById(\"pery\").value);\n var perlinz = parseFloat(document.getElementById(\"perz\").value);\n if(perlinx != NaN && perliny != NaN && perlinz != NaN){\n gl.uniform3f(scalePerlinFactor, perlinx, perliny, perlinz);\n }\n }\n\n //Perlin translation parameters\n var perlinxTr = parseFloat(document.getElementById(\"perxTr\").value);\n var perlinyTr = parseFloat(document.getElementById(\"peryTr\").value);\n var perlinzTr = parseFloat(document.getElementById(\"perzTr\").value);\n if(perlinxTr != NaN && perlinyTr != NaN && perlinzTr != NaN ){\n gl.uniform3f(transPerlinFactor, perlinxTr, perlinyTr, perlinzTr);\n }\n\n //Perlin rotation parameters\n if(!document.getElementById(\"perxrot\").disabled && !document.getElementById(\"peryrot\").disabled && !document.getElementById(\"perzrot\").disabled){\n var perlinx = parseFloat(document.getElementById(\"perxrot\").value)*Math.PI/180;\n var perliny = parseFloat(document.getElementById(\"peryrot\").value)*Math.PI/180;\n var perlinz = parseFloat(document.getElementById(\"perzrot\").value)*Math.PI/180;\n if(perlinx != NaN && perliny != NaN && perlinz != NaN ){\n if(perlinx >= Math.PI*2 ){\n document.getElementById(\"perxrot\").value = 0.0\n }if(perliny >= Math.PI*2 ){\n document.getElementById(\"peryrot\").value = 0.0\n }if(perlinz >= Math.PI*2 ){\n document.getElementById(\"perzrot\").value = 0.0\n }\n gl.uniform3f(anglePerlinFactor, perlinx, perliny, perlinz);\n }\n }\n\n //Perlin brightness RGB parameters\n if(!document.getElementById(\"brR\").disabled && !document.getElementById(\"brG\").disabled && !document.getElementById(\"brB\").disabled){\n var brR = parseFloat(document.getElementById(\"brR\").value);\n var brG = parseFloat(document.getElementById(\"brG\").value);\n var brB = parseFloat(document.getElementById(\"brB\").value);\n if(brR != NaN && brG != NaN && brB != NaN){\n gl.uniform3f(brightPerlin1, brR, brG, brB);\n }\n }\n\n //Perlin weight RGB parameters\n if(!document.getElementById(\"wR\").disabled && !document.getElementById(\"wG\").disabled && !document.getElementById(\"wB\").disabled){\n var wR = parseFloat(document.getElementById(\"wR\").value);\n var wG = parseFloat(document.getElementById(\"wG\").value);\n var wB = parseFloat(document.getElementById(\"wB\").value);\n if(wR != NaN && wG != NaN && wB != NaN ){\n gl.uniform3f(weightPerlin1, wR, wG, wB);\n }\n }\n\n\n // resize canvas in case window size has changed\n if (canvas.width !== window.innerWidth\n || canvas.height !== window.innerHeight) {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n gl.viewport(0, 0, canvas.width, canvas.height);\n ratio = canvas.width / canvas.height;\n }\n\n //const angle = 2 * Math.PI * ((performance.now() / 1000.0) / 6.0);\n var cam = parseFloat(document.getElementById(\"cam\").value) * (Math.PI/180);\n var angle;\n if(cam != NaN ){\n angle = cam;\n }else{\n angle = Math.Pi/4;\n }\n // Calc new camera position\n vec3.rotateY(cameraPosition, cameraInitialPosition, cameraTo, angle);\n\n \n //const angle = 2 * Math.PI * ((performance.now() / 1000.0) / 6.0);\n var camz = parseFloat(document.getElementById(\"camz\").value) * (Math.PI/180);\n var anglez;\n if(camz != NaN ){\n anglez = camz;\n }else{\n anglez = Math.Pi/4;\n }\n // Calc new camera position\n vec3.rotateX(cameraPosition, cameraPosition, cameraTo, anglez);\n\n gl.uniform3f(\n cameraPositionLocation,\n cameraPosition[0],\n cameraPosition[1],\n cameraPosition[2],\n );\n\n // Calc new camera direction\n vec3.subtract(cameraDirection, cameraTo, cameraPosition);\n vec3.normalize(cameraDirection, cameraDirection);\n\n // Calc camera left vector\n vec3.cross(cameraLeft, up, cameraDirection);\n vec3.normalize(cameraLeft, cameraLeft);\n // Calc camera up vector\n vec3.cross(cameraUp, cameraDirection, cameraLeft);\n vec3.normalize(cameraUp, cameraUp);\n\n // Calc near plane center\n vec3.add(nearCenter, cameraPosition, cameraDirection);\n\n // Scale camera left to keep ratio\n vec3.scale(cameraLeft, cameraLeft, ratio);\n\n // Calc near corners\n // TopLeft\n vec3.add(nearTopLeft, nearCenter, cameraUp);\n vec3.add(nearTopLeft, nearTopLeft, cameraLeft);\n // BottomLeft\n vec3.subtract(nearBottomLeft, nearCenter, cameraUp);\n vec3.add(nearBottomLeft, nearBottomLeft, cameraLeft);\n // TopRight\n vec3.add(nearTopRight, nearCenter, cameraUp);\n vec3.subtract(nearTopRight, nearTopRight, cameraLeft);\n // BottomRight\n vec3.subtract(nearBottomRight, nearCenter, cameraUp);\n vec3.subtract(nearBottomRight, nearBottomRight, cameraLeft);\n\n const corners = new Float32Array(12);\n corners.set(nearTopRight, 0);\n corners.set(nearTopLeft, 3);\n corners.set(nearBottomLeft, 6);\n corners.set(nearBottomRight, 9);\n\n gl.bufferData(gl.ARRAY_BUFFER, corners, gl.STATIC_DRAW);\n gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);\n\n\n requestAnimationFrame(renderLoop);\n }\n\n requestAnimationFrame(renderLoop);\n}", "function initWebGLProgram(webGLContext, vertexShaders, fragmentShaders) {\n vertexShaders = R.unless(R.is(Object), vShader => [vShader])(vertexShaders);\n fragmentShaders = R.unless(R.is(Object), fShader => [fShader])(fragmentShaders);\n\n const webGLProgram = webGLContext.createProgram();\n\n prepareShaders(webGLContext.VERTEX_SHADER, vertexShaders);\n prepareShaders(webGLContext.FRAGMENT_SHADER, fragmentShaders);\n\n webGLContext.linkProgram(webGLProgram);\n\n if (!webGLContext.getProgramParameter(webGLProgram, webGLContext.LINK_STATUS)) {\n alert('Could not initialise shaders');\n }\n\n webGLContext.useProgram(webGLProgram);\n\n webGLProgram.vertexPositionAttribute = webGLContext.getAttribLocation(webGLProgram, 'aVertexPosition');\n webGLProgram.pMatrixUniform = webGLContext.getUniformLocation(webGLProgram, 'uPMatrix');\n webGLProgram.mvMatrixUniform = webGLContext.getUniformLocation(webGLProgram, 'uMVMatrix');\n\n return webGLProgram;\n}", "function initializeWebGL() {\n\n // If we don't have a GL context, give up now\n\n if (!gl) {\n alert('Unable to initialize WebGL. Your browser or machine may not support it.');\n return;\n }\n\n // Vertex shader program\n\n const vsSource = `\n attribute vec4 aVertexPosition;\n attribute vec4 aVertexColor;\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n varying lowp vec4 vColor;\n void main(void) {\n gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;\n vColor = aVertexColor;\n }\n `;\n\n // Fragment shader program\n\n const fsSource = `\n varying lowp vec4 vColor;\n void main(void) {\n gl_FragColor = vColor;\n }\n `;\n\n // Initialize a shader program; this is where all the lighting\n // for the vertices and so forth is established.\n const shaderProgram = initShaderProgram(gl, vsSource, fsSource);\n\n // Collect all the info needed to use the shader program.\n // Look up which attributes our shader program is using\n // for aVertexPosition, aVevrtexColor and also\n // look up uniform locations.\n programInfo = {\n program: shaderProgram,\n attribLocations: {\n vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'),\n vertexColor: gl.getAttribLocation(shaderProgram, 'aVertexColor'),\n },\n uniformLocations: {\n projectionMatrix: gl.getUniformLocation(shaderProgram, 'uProjectionMatrix'),\n modelViewMatrix: gl.getUniformLocation(shaderProgram, 'uModelViewMatrix'),\n },\n };\n\n // Try to load a sample data and visualize it.\n // Load and draw model\n appState.grid = service.generateDataGrid(appState.NX, appState.NY, appState.NZ);\n appState.allQuads = service.buildQuadsForWholeCube(appState.grid, appState.NX, appState.NY, appState.NZ);\n draw();\n\n // Draw the scene repeatedly\n function render(now) {\n\n if (!drag) {\n dX *= AMORTIZATION, dY *= AMORTIZATION;\n transform.angleY += dX, transform.angleX += dY;\n }\n\n drawScene();\n requestAnimationFrame(render);\n }\n\n requestAnimationFrame(render);\n\n}", "function webGLStart() {\n var canvas = document.getElementById(\"webglcanvas\");\n initGL(canvas);\n initShaders();\n initBuffers();\n \n // Prior to drawing the scene , clear color\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n \n drawScene();\n }", "function init() {\r\n\t\tvar canvas = document.getElementById(\"gremlinCanvas\");\r\n try {\r\n\t\t _initGL(canvas);\r\n\t\t _initShaders();\r\n Audio.init();\r\n } catch (error) {\r\n throw error;\r\n }\r\n\t\t_gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t_gl.enable(_gl.DEPTH_TEST);\r\n\t}", "function initGL() {\n \n \"use strict\";\n\n // -- 1. Add shaders (load / compile)\n ctx.shaderProgram = loadAndCompileShaders(gl, \"VertexShader.glsl\", \"FragmentShader.glsl\");\n\n // -- 2. Assign attribute-index to context\n setUpAttributesAndUniforms();\n\n // -- 3. Setup buffers\n setUpBuffers();\n\n // -- 4. Set color ??\n gl.clearColor(0.4688,0.1512,0.0000,0.2725);\n\n}", "function initGL() {\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\n gl.useProgram(prog);\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n a_texcoords_loc = gl.getAttribLocation(prog, \"a_texcoords\");\n\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\n u_lightPositions = gl.getUniformLocation(prog, \"lightPositions\");\n u_attenuation = gl.getUniformLocation(prog, \"attenuation\");\n u_lightDir = gl.getUniformLocation(prog, \"lightDir\");\n u_drawMode = gl.getUniformLocation(prog, \"drawMode\");\n u_lightAngleLimit = gl.getUniformLocation(prog, \"lightAngleLimit\");\n u_lightEnable = gl.getUniformLocation(prog, \"enable\");\n u_texture = gl.getUniformLocation(prog, \"texture\");\n\n gl.clearColor(0.0,0.0,0.0,1.0);\n gl.enable(gl.DEPTH_TEST);\n\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5); \n gl.uniform1f(u_specularExponent, 10);\n texture0 = gl.createTexture();\n\n}", "async function init(){\n\t// retrieve shader using path\n\tvar path = window.location.pathname;\n\tvar page = path.split(\"/\").pop();\n\tbaseDir = window.location.href.replace(page, '');\n\tshaderDir = baseDir + \"shaders/\";\n\n\t// create canvas\n\tvar canvas = document.getElementById(\"c\");\n\tgl = canvas.getContext(\"webgl2\");\n\tconsole.log(gl);\n\tif (!gl) {\n\t\tdocument.write(\"GL context not opened\");\n\t\treturn;\n\t}\n\t\n\t// Loading the shaders and creating programs\n\tawait utils.loadFiles([shaderDir + 'texture_vs.vert', shaderDir + 'texture_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\ttextureProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_texcoord\", \"a_normal\"]);\n\t});\n\tawait utils.loadFiles([shaderDir + 'color_vs.vert', shaderDir + 'color_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\tcolorProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_normal\"]);\n\t});\n\n\t/*\n\t* Loading the obj models\n\t*/\n\tlet tailWrapper = new ObjectWrapper(baseDir + tailPath);\n\tlet bodyWrapper = new ObjectWrapper(baseDir + bodyPath);\n\tlet leftEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet rightEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet hoursClockhandWrapper = new ObjectWrapper(baseDir + hoursClockhandPath);\n\tlet minutesClockhandWrapper = new ObjectWrapper(baseDir + minutesClockhandPath);\n\t// Set the local matrix for each object and the program to draw them\n\ttailWrapper.setLocalMatrix(tailLocalMatrix).setProgramInfo(colorProgramInfo);\n\tbodyWrapper.setLocalMatrix(bodyLocalMatrix).setProgramInfo(textureProgramInfo);\n\tleftEyeWrapper.setLocalMatrix(leftEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\trightEyeWrapper.setLocalMatrix(rightEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\thoursClockhandWrapper.setLocalMatrix(clockHand2LocalMatrix).setProgramInfo(colorProgramInfo);\n\tminutesClockhandWrapper.setLocalMatrix(clockHand1LocalMatrix).setProgramInfo(colorProgramInfo);\n\n\t// Save each object wrapper in a unique array of objects to draw\n\tobj = [tailWrapper, leftEyeWrapper, rightEyeWrapper, bodyWrapper, hoursClockhandWrapper, minutesClockhandWrapper];\n\n\tobj.forEach(async (wrapper) => { await wrapper.loadModel(); });\n\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\n\tresetShaderParams();\n\tmain();\n}", "function initShader(gl, vertexSource, fragmentSource) {\n\n var shaderInfo = {};\n \n // load and compile the fragment and vertex shader\n var fragmentShader = createShader(gl, fragmentSource, \"fragment\");\n var vertexShader = createShader(gl, vertexSource, \"vertex\");\n\n // link them together into a new program\n shaderInfo.shaderProgram = gl.createProgram();\n gl.attachShader(shaderInfo.shaderProgram, vertexShader);\n gl.attachShader(shaderInfo.shaderProgram, fragmentShader);\n gl.linkProgram(shaderInfo.shaderProgram);\n\n // get pointers to the shader params\n shaderInfo.shaderVertexPositionAttribute = gl.getAttribLocation(shaderInfo.shaderProgram, \"vertexPos\");\n gl.enableVertexAttribArray(shaderInfo.shaderVertexPositionAttribute);\n\n shaderInfo.shaderVertexColorAttribute = gl.getAttribLocation(shaderInfo.shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(shaderInfo.shaderVertexColorAttribute);\n\n shaderInfo.shaderProjectionMatrixUniform = gl.getUniformLocation(shaderInfo.shaderProgram, \"projectionMatrix\");\n shaderInfo.shaderModelViewMatrixUniform = gl.getUniformLocation(shaderInfo.shaderProgram, \"modelViewMatrix\");\n\n\n if (!gl.getProgramParameter(shaderInfo.shaderProgram, gl.LINK_STATUS)) {\n alert(\"Could not initialise shaders\");\n }\n \n return shaderInfo;\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 _init() {\n\n _gl = canvasModalWidget.getGLContext();\n\n if (!_gl) {\n throw new Error('Could not run lightingExample() WebGL Demo!');\n }\n\n // Set clear color to black, fully opaque\n _gl.clearColor(0.0, 0.0, 0.0, 1.0);\n\n // dealing with 3D space geometry so make sure this feature is enabled\n _gl.enable(_gl.DEPTH_TEST);\n\n // get the shaders and compile them - the resultant will be a program that is automatically joined to the gl context in the background\n _glProgram = canvasModalWidget.setGLVertexAndFragmentShaders('#v-shader-pong', '#f-shader-pong');\n _glProgram.customAttribs = {};\n\n // Get the storage locations of all the customizable shader variables\n _glProgram.customAttribs.a_PositionRef = _gl.getAttribLocation(_glProgram, 'a_Position'),\n _glProgram.customAttribs.a_VertexNormalRef = _gl.getAttribLocation(_glProgram, 'a_VertexNormal'),\n\n _glProgram.customAttribs.u_FragColourRef = _gl.getUniformLocation(_glProgram, 'u_FragColour'),\n _glProgram.customAttribs.u_PVMMatrixRef = _gl.getUniformLocation(_glProgram, 'u_PVMMatrix'),\n _glProgram.customAttribs.u_NormalMatrixRef = _gl.getUniformLocation(_glProgram, 'u_NormalMatrix'),\n\n _glProgram.customAttribs.u_AmbientColourRef = _gl.getUniformLocation(_glProgram, 'u_AmbientColour'),\n _glProgram.customAttribs.u_LightingDirectionRef = _gl.getUniformLocation(_glProgram, 'u_LightingDirection'),\n _glProgram.customAttribs.u_DirectionalColourRef = _gl.getUniformLocation(_glProgram, 'u_DirectionalColour');\n\n _glProgram.customAttribs.eyePosition = vec3.fromValues(0, 0, 5);\n _glProgram.customAttribs.centerPoint = vec3.fromValues(0, 0, -50);\n\n var perspectiveMatrix = mat4.create(), // get the identity matrix\n viewMatrix = mat4.create(),\n modelMatrix = mat4.create(),\n PVMMatrix = mat4.create();\n\n mat4.perspective(perspectiveMatrix, glMatrix.toRadian(45.0), canvasModalWidget.getGLViewportAspectRatio(), 1, 1000);\n mat4.lookAt(viewMatrix, _glProgram.customAttribs.eyePosition, _glProgram.customAttribs.centerPoint, vec3.fromValues(0, 1, 0));\n\n _glProgram.customAttribs.viewMatrix = viewMatrix;\n _glProgram.customAttribs.modelMatrix = modelMatrix;\n _glProgram.customAttribs.perspectiveMatrix = perspectiveMatrix;\n\n mat4.multiply(PVMMatrix, perspectiveMatrix, viewMatrix);\n\n _glProgram.customAttribs.PVMMatrix = PVMMatrix;\n\n _gl.uniformMatrix4fv(_glProgram.customAttribs.u_PVMMatrixRef, false, _glProgram.customAttribs.PVMMatrix);\n\n // set our directional light which is pointing 10 units to the left 10 units upwards away 5 units from the user \n _glProgram.customAttribs.lightingDirection = _setLightingDirection(-10.0, 10.0, -5.0);\n\n _gl.uniform3fv(_glProgram.customAttribs.u_LightingDirectionRef, _glProgram.customAttribs.lightingDirection);\n _gl.uniform3f(_glProgram.customAttribs.u_AmbientColourRef, 0.5, 0.5, 0.5);\n\n _gl.uniform3f(_glProgram.customAttribs.u_DirectionalColourRef, 1.0, 1.0, 1.0);\n\n // start the game!!\n _game = new _Game();\n\n }", "function initGL() {\r\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\r\n gl.useProgram(prog);\r\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\r\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\r\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\r\n u_projection = gl.getUniformLocation(prog, \"projection\");\r\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\r\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\r\n u_lightPositionA= gl.getUniformLocation(prog, \"lightPositionA\");\r\n u_lightPositionB= gl.getUniformLocation(prog, \"lightPositionB\");\r\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\r\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\r\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\r\n u_color = gl.getUniformLocation(prog, \"color\");\r\n u_spotLightDir = gl.getUniformLocation(prog, \"spotLightDir\");\r\n u_day = gl.getUniformLocation(prog, \"day\");\r\n a_coords_buffer = gl.createBuffer();\r\n a_normal_buffer = gl.createBuffer();\r\n index_buffer = gl.createBuffer();\r\n gl.enable(gl.DEPTH_TEST);\r\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5);\r\n gl.uniform4f(u_diffuseColor, 1, 1, 1, 1);\r\n gl.uniform1f(u_specularExponent, 10); \r\n gl.uniform4f(u_lightPosition, lightPositions[0][0], lightPositions[0][1], lightPositions[0][2], lightPositions[0][3]); \r\n gl.uniform4f(u_lightPositionA, lightPositions[1][0], lightPositions[1][1], lightPositions[1][2], lightPositions[1][3]);\r\n gl.uniform4f(u_lightPositionB, lightPositions[2][0], lightPositions[2][1], lightPositions[2][2], lightPositions[2][3]);\r\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n gl.frontFace(gl.CCW);\n gl.cullFace(gl.BACK);\n\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\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 }", "function init(){\n\tconsole.log('Running');\n\trenderer = new RenderManager(\"game_canvas\");\n\tgl = renderer.gl;\n\tkeyboard = new KeyBoard();\n\n\tshaderName = 'triangle';\n\tvar triangleShader = new CreateShader(gl);\n\ttextureName = 'blue_sky';\n\ttextureObj = new Texture('bluecloud_bk.jpg', gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.LINEAR, gl.LINEAR);\n\ttextureObj.loadTexture();\n\ttriangleShader.makeProgram(\"vertShader.txt\", \"fragShader.txt\");\n\tvar delay = 150;\n\tif(navigator.userAgent.indexOf(\"Firefox\") != -1){\n\t\tdelay = 450;\n\t}\n\tsetTimeout(start, delay);\n}", "function webGLStart(fragShader) {\n\tvar canvas = document.getElementById(\"opengl-canvas\");\n\tinitGL(canvas);\n\n\tvar fragmentShaderResult = makeShader(gl, fragShader, \"fragment\");\n\tif (fragmentShaderResult.shader == null) {\n\t\tvar error = \"Failed making fragment shader.\";\n\t\tconsole.log(error);\n\t\treturn {\n\t\t\tsucceeded: false,\n\t\t\terror: \"COMPILE_ERROR\",\n\t\t\tlog: error + \"\\n\" + fragmentShaderResult.log\n\t\t};\n\t}\n\n\tvar vertexShaderResult = makeShader(gl, getShaderFromURL(\"shaders/shader.vert\"), \"vertex\");\n\tif (vertexShaderResult.shader == null) {\n\t\tvar error = \"Failed making vertex shader.\";\n\t console.log(error);\n\t\treturn {\n\t\t\tsucceeded: false,\n\t\t\terror: \"COMPILE_ERROR\",\n\t\t\tlog: error + \"\\n\" + vertexShaderResult.log\n\t\t};\n\t}\n\n\tvar initResult = initShaders(fragmentShaderResult.shader, vertexShaderResult.shader);\n\tif (!initResult.succeeded) {\n\t\treturn {\n\t\t\tsucceeded: false,\n\t\t\terror: \"LINK_ERROR\",\n\t\t\tlog: initResult.log\n\t\t};\n\t}\n\n\tinitBuffers();\n\n\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\tdrawScene(initResult.shaderProgram);\n\tgl.finish();\n\n\treturn {\n\t\tsucceeded: true,\n\t\tlog: \"\"\n\t};\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST); //check the draw is right\n // gl.enable(gl.CULL_FACE); //check the draw is right\n //gl.cullFace(gl.BACK); \n tick();\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 WebGLStart(){\n\n//initialize everything\n\tinit();\n\n//define the tweens\n\tdefineTweens();\n\n//draw everything\n\tdrawScene();\n\n//begin the animation\n\tanimate();\n}", "function initShaderProgram(gl, vsSource, fsSource) {\t\n const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\t\t\n // Create the shader program\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, fragmentShader);\n gl.attachShader(shaderProgram, vertexShader);\n gl.linkProgram(shaderProgram);\n\n // If creating the shader program failed, alert\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n return null;\n }\n\n return shaderProgram;\n}", "function initGL(canvas){\r\n\ttry{\r\n\t\tctx.viewportWidth = canvas.width;\r\n\t\tctx.viewportHeight = canvas.height;\r\n\t\tinitBuffers(ctx);\r\n\t\t\r\n\t\t//Initialize default shader\r\n\t\tfragShader = compileShader(ctx, defaultFragSrc);\r\n\t\tvertShader = compileShader(ctx, defaultVertSrc);\r\n\t\tshaderProgram = createShaderProgram();\r\n\t\tsetupSpriteShader(shaderProgram);\r\n\t\tspriteShader = shaderProgram;\r\n\t\t\r\n\t\tcolorBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\tstateBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\t\r\n\t\tctx.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t\r\n\t\tctx.blendFunc(ctx.SRC_ALPHA, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\tctx.enable(ctx.BLEND);\r\n\t}catch(e){\r\n\t}\r\n}", "function initScene(gl) {\r\n\r\n //////////////////////////////////////////\r\n //////// set up geometry - plane ////////\r\n //////////////////////////////////////////\r\n\r\n var vPlane = [];\r\n\r\n for (var j = height - 1; j >= 0; j--) {\r\n for (var i = 0; i < width; i++) {\r\n var A = vec3.fromValues(i - (width - 1) * 0.5,\r\n height - 1 - j - (height - 1) * 0.5,\r\n 0);\r\n // push the vertex coordinates\r\n vPlane.push(A[0]);\r\n vPlane.push(A[1]);\r\n vPlane.push(A[2]);\r\n // push the normal coordinates\r\n vPlane.push(0);\r\n vPlane.push(0);\r\n vPlane.push(1);\r\n vPlane.push(i);\r\n vPlane.push(j);\r\n }\r\n }\r\n\r\n var iPlane = [];\r\n\r\n for (var j = 0; j < height - 1; j++) {\r\n for (var i = 0; i < width - 1; i++) {\r\n iPlane.push(j * width + i);\r\n iPlane.push((j + 1) * width + i);\r\n iPlane.push(j * width + i + 1);\r\n iPlane.push(j * width + i + 1);\r\n iPlane.push((j + 1) * width + i);\r\n iPlane.push((j + 1) * width + i + 1);\r\n }\r\n }\r\n\r\n // create vertex buffer on the gpu\r\n vboPlane = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vboPlane);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vPlane), gl.STATIC_DRAW);\r\n\r\n // create index buffer on the gpu\r\n iboPlane = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboPlane);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(iPlane), gl.STATIC_DRAW);\r\n\r\n iboNPlane = iPlane.length;\r\n\r\n ///////////////////////////////////////////////\r\n //////// set up geometry - light source //////\r\n ///////////////////////////////////////////////\r\n\r\n var vLight = [0.0, 0.0, 0.0];\r\n\r\n var iLight = [0];\r\n\r\n // create vertex buffer on the gpu\r\n vboLight = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vboLight);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vLight), gl.STATIC_DRAW);\r\n\r\n // create index buffer on the gpu\r\n iboLight = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboLight);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(iLight), gl.STATIC_DRAW);\r\n\r\n iboNLight = iLight.length;\r\n\r\n ////////////////////////////////\r\n //////// set up shaders //////\r\n ////////////////////////////////\r\n shaderProgramPlane = shaderProgram(gl, \"shader-vs-phong\", \"shader-fs-phong\");\r\n shaderProgramLight = shaderProgram(gl, \"shader-vs-light\", \"shader-fs-light\");\r\n\r\n /////////////////////////////////\r\n //////// set up textures //////\r\n /////////////////////////////////\r\n var image = document.getElementById('checkerboard');\r\n textureCheckerboard = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, textureCheckerboard);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n\r\n \r\n // TODO 6.3a): Set up the texture containing the checkerboard\r\n // image. Have a look at the functions gl.bindTexture(),\r\n // gl.texImage2D() and gl.texParameteri(). Also do not\r\n // forget to generate the mipmap pyramid using \r\n // gl.generateMipmap(). Note: Both format and internal\r\n // format parameter should be gl.RGBA, the data type\r\n // used should be gl.UNSIGNED_BYTE.\r\n gl.bindTexture(gl.TEXTURE_2D,textureCheckerboard);\r\n gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n var image = document.getElementById('cobblestone');\r\n textureCobblestone = gl.createTexture();\r\n\r\n \r\n // TODO 6.3b): Set up the texture containing the cobblestone\r\n // image, also using gl.bindTexture() and gl.texImage2D().\r\n // We do not need mipmapping here, so do not forget to \r\n // use gl.texParameteri() to set the minification filter \r\n // to gl.LINEAR. Format, internal format and type should\r\n // be the same as for the checkerboard texture.\r\n gl.bindTexture(gl.TEXTURE_2D, textureCobblestone);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n\r\n \r\n\r\n }", "function init() {\n \n // Retrieve the canvas\n const canvas = document.getElementById('webgl-canvas');\n if (!canvas) {\n console.error(`There is no canvas with id ${'webgl-canvas'} on this page.`);\n return null;\n }\n\n\n // Retrieve a WebGL context\n gl = canvas.getContext('webgl2');\n if (!gl) {\n console.error(`There is no WebGL 2.0 context`);\n return null;\n }\n \n // Set the clear color to be black\n gl.clearColor(0, 0, 0, 1);\n \n // some GL initialization\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n \n gl.cullFace(gl.BACK);\n gl.frontFace(gl.CCW);\n gl.clearColor(0.0,0.0,0.0,1.0)\n gl.depthFunc(gl.LEQUAL)\n gl.clearDepth(1.0)\n\n // Read, compile, and link your shaders\n initProgram();\n \n // create and bind your current object\n createShapes();\n \n // set up your camera\n setUpCamera();\n \n // do a draw\n draw();\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 init(gl, wgl) {\n initShaders(gl, wgl); // Setup the shader program and program info\n initModels(gl, wgl); // Build objects to be drawn and their buffers\n initLights(gl, wgl); // Setup lighting\n initGl(gl, wgl); // Setup gl properties\n}", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n loadTexture();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function start() {\n \"use strict\";\n\n // sets up webgl, twgl, and canvas\n let canvas = document.getElementById(\"mycanvas\");\n let gl = canvas.getContext(\"webgl\");\n let m4 = twgl.m4;\n\n // sets up the sliders\n let slider = document.getElementById('slider');\n slider.value = 0;\n let slider1 = document.getElementById('slider1');\n slider1.value = 0;\n let slider2 = document.getElementById('slider2');\n slider2.value = 0;\n\n // reads the vertex shader and fragment shader\n let vertexSource = document.getElementById(\"vs\").text;\n let fragmentSource = document.getElementById(\"fs\").text;\n\n // compiles the vertex shader\n let vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader,vertexSource);\n gl.compileShader(vertexShader);\n // checks if compilation of vertex shader worked\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(vertexShader)); return null; }\n\n // compiles the fragment shader\n let fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader,fragmentSource);\n gl.compileShader(fragmentShader);\n // checks if compilation of fragment shader worked\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(fragmentShader)); return null; }\n\n // attaches both vertex and fragment shader to the shader program\n let shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n // checks to see that the program was linked correctly\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Could not initialize shaders\"); }\n gl.useProgram(shaderProgram);\n\n // sets up the vPosition attribute for the vertex shader\n shaderProgram.PositionAttribute = gl.getAttribLocation(shaderProgram, \"vPosition\");\n gl.enableVertexAttribArray(shaderProgram.PositionAttribute);\n\n //sets up the vColor attribute for the vertex shader\n shaderProgram.ColorAttribute = gl.getAttribLocation(shaderProgram, \"vColor\");\n gl.enableVertexAttribArray(shaderProgram.ColorAttribute);\n\n // access to the matrix uniform\n shaderProgram.MVPmatrix = gl.getUniformLocation(shaderProgram,\"uMVP\");\n\n // array of vertices for the main cube\n let vertexPosCube = new Float32Array(\n [ 1, 1, 1, -1, 1, 1, -1,-1, 1, 1,-1, 1,\n 1, 1, 1, 1,-1, 1, 1,-1,-1, 1, 1,-1,\n 1, 1, 1, 1, 1,-1, -1, 1,-1, -1, 1, 1,\n -1, 1, 1, -1, 1,-1, -1,-1,-1, -1,-1, 1,\n -1,-1,-1, 1,-1,-1, 1,-1, 1, -1,-1, 1,\n 1,-1,-1, -1,-1,-1, -1, 1,-1, 1, 1,-1 ]);\n\n // array of colors for the main cube\n let colorsForCube = new Float32Array(\n [ .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833,\n .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833,\n .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833,\n .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833,\n .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833,\n .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833, .7067,.5833,.1833 ]);\n\n // triangle indices for the main cube\n let triangleIndicesCube = new Uint8Array(\n [ 0, 1, 2, 0, 2, 3,\n 4, 5, 6, 4, 6, 7,\n 8, 9,10, 8,10,11,\n 12,13,14, 12,14,15,\n 16,17,18, 16,18,19,\n 20,21,22, 20,22,23 ]);\n\n // puts vertices into a buffer to allow us to transfer them to the graphics hardware\n let trianglePosBufferCube = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferCube);\n gl.bufferData(gl.ARRAY_BUFFER, vertexPosCube, gl.STATIC_DRAW);\n trianglePosBufferCube.itemSize = 3;\n trianglePosBufferCube.numItems = 24;\n\n // puts colors into a buffer to allow us to transfer them to the graphics hardware\n let colorBufferCube = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferCube);\n gl.bufferData(gl.ARRAY_BUFFER, colorsForCube, gl.STATIC_DRAW);\n colorBufferCube.itemSize = 3;\n colorBufferCube.numItems = 24;\n\n // puts indices into a buffer to allow us to transfer them to the graphics hardware\n let indexBufferCube = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferCube);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, triangleIndicesCube, gl.STATIC_DRAW);\n\n // vertex positions for the silver triangle\n let vertexPosSilverTriangle = new Float32Array (\n [ 0,0,0, .25,1,.25, 0,0,1,\n 0,0,0, 1,0,0, 0,0,1,\n 0,0,0, 1,0,0, .25,1,.25,\n .25,1,.25, 1,0,0, 0,0,1 ]);\n\n // colors for each vertex for the silver triangle\n let vertexColorsSilverTriangle = new Float32Array (\n [ .64,.64,.64, .64,.64,.64, .64,.64,.64,\n .35,.35,.35, .35,.35,.35, .35,.35,.35,\n .75,.75,.75, .75,.75,.75, .75,.75,.75,\n .2,.2,.2, .2,.2,.2, .2,.2,.2, ]);\n\n // triangle indices for the silver triangle\n let triangleIndicesSilverTriangle = new Uint8Array(\n [ 0, 1, 2,\n 3, 4, 5,\n 6, 7, 8,\n 9,10,11 ]);\n\n // puts vertices into a buffer to allow us to transfer them to the graphics hardware\n let trianglePosBufferSilverTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferSilverTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexPosSilverTriangle, gl.STATIC_DRAW);\n trianglePosBufferSilverTriangle.itemSize = 3;\n trianglePosBufferSilverTriangle.numItems = 12;\n\n // puts colors into a buffer to allow us to transfer them to the graphics hardware\n let colorBufferSilverTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferSilverTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexColorsSilverTriangle, gl.STATIC_DRAW);\n colorBufferSilverTriangle.itemSize = 3;\n colorBufferSilverTriangle.numItems = 12;\n\n // puts indices into a buffer to allow us to transfer them to the graphics hardware\n let indexBufferSilverTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferSilverTriangle);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, triangleIndicesSilverTriangle, gl.STATIC_DRAW);\n\n // vertex positions for the silver triangle\n let vertexPosGreenTriangle = new Float32Array (\n [ 0,0,0, .25,1,.25, 0,0,1,\n 0,0,0, 1,0,0, 0,0,1,\n 0,0,0, 1,0,0, .25,1,.25,\n .25,1,.25, 1,0,0, 0,0,1 ]);\n\n // colors for each vertex for the silver triangle\n let vertexColorsGreenTriangle = new Float32Array (\n [ .5,.8,0, .5,.8,0, .5,.8,0,\n 0,1,0, 0,1,0, 0,1,0,\n .2,.6,.1, .2,.6,.1, .2,.6,.1,\n .6,1,.2, .6,1,.2, .6,1,.2, ]);\n\n // triangle indices for the silver triangle\n let triangleIndicesGreenTriangle = new Uint8Array(\n [ 0, 1, 2,\n 3, 4, 5,\n 6, 7, 8,\n 9,10,11 ]);\n\n // puts vertices into a buffer to allow us to transfer them to the graphics hardware\n let trianglePosBufferGreenTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferGreenTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexPosGreenTriangle, gl.STATIC_DRAW);\n trianglePosBufferGreenTriangle.itemSize = 3;\n trianglePosBufferGreenTriangle.numItems = 12;\n\n // puts colors into a buffer to allow us to transfer them to the graphics hardware\n let colorBufferGreenTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferGreenTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexColorsGreenTriangle, gl.STATIC_DRAW);\n colorBufferGreenTriangle.itemSize = 3;\n colorBufferGreenTriangle.numItems = 12;\n\n // puts indices into a buffer to allow us to transfer them to the graphics hardware\n let indexBufferGreenTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferGreenTriangle);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, triangleIndicesGreenTriangle, gl.STATIC_DRAW);\n\n // vertex positions for the silver triangle\n let vertexPosBlueTriangle = new Float32Array (\n [ 0,0,0, .25,1,.25, 0,0,1,\n 0,0,0, 1,0,0, 0,0,1,\n 0,0,0, 1,0,0, .25,1,.25,\n .25,1,.25, 1,0,0, 0,0,1 ]);\n\n // colors for each vertex for the silver triangle\n let vertexColorsBlueTriangle = new Float32Array (\n [ .2,.2,1, .2,.2,1, .2,.2,1,\n 0,0,1, 0,0,1, 0,0,1,\n .2,.6,1, .2,.6,1, .2,.6,1,\n 0,0,.5, 0,0,.5, 0,0,.5, ]);\n\n // triangle indices for the silver triangle\n let triangleIndicesBlueTriangle = new Uint8Array(\n [ 0, 1, 2,\n 3, 4, 5,\n 6, 7, 8,\n 9,10,11 ]);\n\n // puts vertices into a buffer to allow us to transfer them to the graphics hardware\n let trianglePosBufferBlueTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferBlueTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexPosBlueTriangle, gl.STATIC_DRAW);\n trianglePosBufferBlueTriangle.itemSize = 3;\n trianglePosBufferBlueTriangle.numItems = 12;\n\n // puts colors into a buffer to allow us to transfer them to the graphics hardware\n let colorBufferBlueTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferBlueTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexColorsBlueTriangle, gl.STATIC_DRAW);\n colorBufferBlueTriangle.itemSize = 3;\n colorBufferBlueTriangle.numItems = 12;\n\n // puts indices into a buffer to allow us to transfer them to the graphics hardware\n let indexBufferBlueTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferBlueTriangle);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, triangleIndicesBlueTriangle, gl.STATIC_DRAW);\n\n // vertex positions for the silver triangle\n let vertexPosRedTriangle = new Float32Array (\n [ 0,0,0, .25,1,.25, 0,0,1,\n 0,0,0, 1,0,0, 0,0,1,\n 0,0,0, 1,0,0, .25,1,.25,\n .25,1,.25, 1,0,0, 0,0,1 ]);\n\n // colors for each vertex for the silver triangle\n let vertexColorsRedTriangle = new Float32Array (\n [ 1,0,0, 1,0,0, 1,0,0,\n .4,0,0, .4,0,0, .4,0,0,\n .6,0,0, .6,0,0, .6,0,0,\n .8,0,0, .8,0,0, .8,0,0, ]);\n\n // triangle indices for the silver triangle\n let triangleIndicesRedTriangle = new Uint8Array(\n [ 0, 1, 2,\n 3, 4, 5,\n 6, 7, 8,\n 9,10,11 ]);\n\n // puts vertices into a buffer to allow us to transfer them to the graphics hardware\n let trianglePosBufferRedTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferRedTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexPosRedTriangle, gl.STATIC_DRAW);\n trianglePosBufferRedTriangle.itemSize = 3;\n trianglePosBufferRedTriangle.numItems = 12;\n\n // puts colors into a buffer to allow us to transfer them to the graphics hardware\n let colorBufferRedTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferRedTriangle);\n gl.bufferData(gl.ARRAY_BUFFER, vertexColorsRedTriangle, gl.STATIC_DRAW);\n colorBufferRedTriangle.itemSize = 3;\n colorBufferRedTriangle.numItems = 12;\n\n // puts indices into a buffer to allow us to transfer them to the graphics hardware\n let indexBufferRedTriangle = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferRedTriangle);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, triangleIndicesRedTriangle, gl.STATIC_DRAW);\n\n /**\n * This method actually draws the objects to be drawn.\n */\n function draw() {\n // first slider changes camera position around the y-axis\n let angle1 = slider.value * (Math.PI/180);\n // second slider rotates the object\n let angle2 = slider1.value * (Math.PI/180);\n // third slider rotates the triangles\n let angle3 = slider2.value * (Math.PI/180);\n\n // sets up the camera view\n let eye = [400.0*Math.sin(angle1),150.0,400.0*Math.cos(angle1)];\n let target = [0,0,0];\n let up = [0,1,0];\n let tCamera = m4.inverse(m4.lookAt(eye,target,up));\n\n // rotates entire object over x-axis\n let xRotation = m4.axisRotation([1,0,0],angle2);\n\n // model transformation for the cube\n let tModelCube = m4.multiply(m4.scaling([75,75,75]), xRotation);\n\n // rotation for all triangles\n let tRotation = m4.axisRotation([1,1,1], angle3);\n\n // model transformation for the silver triangle\n let tModel_SilverTriangle = m4.multiply(m4.scaling([50,50,50]), m4.translation([75,-75,75]));\n let tModelSilverTriangle = m4.multiply(m4.multiply(tRotation, tModel_SilverTriangle), xRotation);\n\n // model transformation for the green triangle\n let rotation = m4.axisRotation([0,1,0], -Math.PI/2);\n let tModel_GreenTriangle = m4.multiply(m4.scaling([50,50,50]), m4.translation([-75,-75,75]));\n let tModelGreenTriangle1 = m4.multiply(m4.multiply(rotation, tModel_GreenTriangle), xRotation);\n let tModelGreenTriangle = m4.multiply(tRotation, tModelGreenTriangle1);\n\n // model transformation for the green triangle\n let rotation1 = m4.axisRotation([0,1,0],Math.PI);\n let tModel_BlueTriangle = m4.multiply(m4.scaling([50,50,50]), m4.translation([-75,-75,-75]));\n let tModelBlueTriangle1 = m4.multiply(m4.multiply(rotation1, tModel_BlueTriangle), xRotation);\n let tModelBlueTriangle = m4.multiply(tRotation, tModelBlueTriangle1);\n\n // model transformation for the red triangle\n let rotation2 = m4.axisRotation([0,1,0],Math.PI/2);\n let tModel_RedTriangle = m4.multiply(m4.scaling([50,50,50]), m4.translation([75,-75,-75]));\n let tModelRedTriangle1 = m4.multiply(m4.multiply(rotation2, tModel_RedTriangle), xRotation);\n let tModelRedTriangle = m4.multiply(tRotation, tModelRedTriangle1);\n\n // projection transformation\n let tProjection = m4.perspective(Math.PI/3,1,10,1000);\n\n // sets up all transformations together\n let tMVPCube = m4.multiply(m4.multiply(tModelCube,tCamera),tProjection);\n let tMVPSilverTriangle = m4.multiply(m4.multiply(tModelSilverTriangle,tCamera),tProjection);\n let tMVPGreenTriangle = m4.multiply(m4.multiply(tModelGreenTriangle,tCamera),tProjection);\n let tMVPBlueTriangle = m4.multiply(m4.multiply(tModelBlueTriangle,tCamera),tProjection);\n let tMVPRedTriangle = m4.multiply(m4.multiply(tModelRedTriangle,tCamera),tProjection);\n\n // clears the screen and performs z-buffering\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n // sets up the uniform matrix and attributes for Cube\n gl.uniformMatrix4fv(shaderProgram.MVPmatrix,false,tMVPCube);\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferCube);\n gl.vertexAttribPointer(shaderProgram.PositionAttribute, trianglePosBufferCube.itemSize,\n gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferCube);\n gl.vertexAttribPointer(shaderProgram.ColorAttribute, colorBufferCube.itemSize,\n gl.FLOAT,false, 0, 0);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferCube);\n // draws Cube\n gl.drawElements(gl.TRIANGLES, triangleIndicesCube.length, gl.UNSIGNED_BYTE, 0);\n\n // sets up the uniform matrix and attributes for silver triangle\n gl.uniformMatrix4fv(shaderProgram.MVPmatrix,false,tMVPSilverTriangle);\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferSilverTriangle);\n gl.vertexAttribPointer(shaderProgram.PositionAttribute, trianglePosBufferSilverTriangle.itemSize,\n gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferSilverTriangle);\n gl.vertexAttribPointer(shaderProgram.ColorAttribute, colorBufferSilverTriangle.itemSize,\n gl.FLOAT,false, 0, 0);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferSilverTriangle);\n // draws silver triangle\n gl.drawElements(gl.TRIANGLES, triangleIndicesSilverTriangle.length, gl.UNSIGNED_BYTE, 0);\n\n // sets up the uniform matrix and attributes for green triangle\n gl.uniformMatrix4fv(shaderProgram.MVPmatrix,false,tMVPGreenTriangle);\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferGreenTriangle);\n gl.vertexAttribPointer(shaderProgram.PositionAttribute, trianglePosBufferGreenTriangle.itemSize,\n gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferGreenTriangle);\n gl.vertexAttribPointer(shaderProgram.ColorAttribute, colorBufferGreenTriangle.itemSize,\n gl.FLOAT,false, 0, 0);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferGreenTriangle);\n // draws silver triangle\n gl.drawElements(gl.TRIANGLES, triangleIndicesGreenTriangle.length, gl.UNSIGNED_BYTE, 0);\n\n // sets up the uniform matrix and attributes for blue triangle\n gl.uniformMatrix4fv(shaderProgram.MVPmatrix,false,tMVPBlueTriangle);\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferBlueTriangle);\n gl.vertexAttribPointer(shaderProgram.PositionAttribute, trianglePosBufferBlueTriangle.itemSize,\n gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferBlueTriangle);\n gl.vertexAttribPointer(shaderProgram.ColorAttribute, colorBufferBlueTriangle.itemSize,\n gl.FLOAT,false, 0, 0);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferBlueTriangle);\n // draws blue triangle\n gl.drawElements(gl.TRIANGLES, triangleIndicesBlueTriangle.length, gl.UNSIGNED_BYTE, 0);\n\n // sets up the uniform matrix and attributes for red triangle\n gl.uniformMatrix4fv(shaderProgram.MVPmatrix,false,tMVPRedTriangle);\n gl.bindBuffer(gl.ARRAY_BUFFER, trianglePosBufferRedTriangle);\n gl.vertexAttribPointer(shaderProgram.PositionAttribute, trianglePosBufferRedTriangle.itemSize,\n gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBufferRedTriangle);\n gl.vertexAttribPointer(shaderProgram.ColorAttribute, colorBufferRedTriangle.itemSize,\n gl.FLOAT,false, 0, 0);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferRedTriangle);\n // draws red triangle\n gl.drawElements(gl.TRIANGLES, triangleIndicesRedTriangle.length, gl.UNSIGNED_BYTE, 0);\n }\n slider.addEventListener(\"input\",draw);\n slider1.addEventListener(\"input\",draw);\n slider2.addEventListener(\"input\",draw);\n draw();\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n //setupShaders(\"shader-vs\",\"shader-fs\");\n //setPhongShader();\n setGouraudShader();\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "function gl_init(gl, vertexShader, fragmentShader) {\n\n // Create and link the gl program, using the application's vertex and fragment shaders.\n\n var program = gl.createProgram();\n addshader(gl, program, gl.VERTEX_SHADER , vertexShader );\n addshader(gl, program, gl.FRAGMENT_SHADER, fragmentShader);\n gl.linkProgram(program);\n if (! gl.getProgramParameter(program, gl.LINK_STATUS))\n console.log(\"Could not link the shader program!\");\n gl.useProgram(program);\n\n // Create a square as a strip of two triangles.\n\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0 ]), gl.STATIC_DRAW);\n\n // Assign attribute aPosition to each of the square's vertices.\n\n gl.aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.enableVertexAttribArray(gl.aPosition);\n gl.vertexAttribPointer(gl.aPosition, 3, gl.FLOAT, false, 0, 0);\n\n // Remember the address within the fragment shader of each of my uniform variables.\n\n gl.uTime = gl.getUniformLocation(program, \"uTime\" );\n gl.uCursor = gl.getUniformLocation(program, \"uCursor\");\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick();\n}", "function init() {\n const VERTEX_SHADER = `\n attribute vec3 aPosition;\n uniform mat4 uTransformMatrix;\n \n void main() {\n gl_Position = uTransformMatrix * vec4(aPosition, 1.);\n }\n `;\n\n const FRAGMENT_SHADER = `\n precision mediump float;\n uniform vec3 uColor;\n \n void main() {\n gl_FragColor.rgb = uColor;\n gl_FragColor.a = 1.0;\n }\n `;\n\n initShaders(gl, VERTEX_SHADER, FRAGMENT_SHADER);\n const coord = gl.getAttribLocation(gl.program, 'aPosition');\n setupBuffers(coord);\n\n uTransformMatrix = gl.getUniformLocation(gl.program, \"uTransformMatrix\");\n uColor = gl.getUniformLocation(gl.program, \"uColor\");\n\n gl.enable(gl.DEPTH_TEST);\n\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n}", "function init() {\n canvas = document.createElement('canvas');\n gl = canvas.getContext('webgl');\n ratio = window.devicePixelRatio || 1;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\n update();\n createProgram();\n blankTexture = getBlankTexture();\n initQuad();\n\n document.body.appendChild(canvas);\n window.addEventListener('resize', update, false);\n initialized = true;\n }", "function initShaderProgram(gl, vsSource, fsSource) {\n const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n // Create the shader program\n\n const 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\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\talert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n\treturn null;\n }\n\n return shaderProgram;\n}", "function initShaderProgram(gl, vsSource, fsSource) {\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n // Create the shader program\n\n let 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\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n return null;\n }\n\n return shaderProgram;\n}", "function main(){\n var vertices = getVertices();\n var indices = getIndices();\n\n const vertSource = getVertSource();\n const toySource = getToySource();\n const lightSource = getLightSource();\n\n const canvas = document.getElementById('glCanvas');\n const gl = canvas.getContext(\"webgl2\");\n\n if(!gl){\n alert(\"Could not initialize WebGL2!\");\n return;\n }\n\n canvas.onmousedown = handleMouseDown;\n document.onmousemove = handleMouseMove;\n document.onmouseup = handleMouseUp;\n\n\n gl.viewport(0, 0, 885, 885);\n gl.clearColor(0.1, 0.1, 0.1, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n\n view = mat4.lookAt(view,\n cameraPosition, //pos\n cameraTarget, //target\n cameraUp //up\n );\n projection = mat4.perspective(projection,\n Math.PI / 4,\n 895 / 895,\n 1.0,\n 100.0\n );\n\n const spToy = initShaders(gl, vertSource, toySource);\n const spLight = initShaders(gl, vertSource, lightSource);\n var vertBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n\n vao[0] = gl.createVertexArray();\n vao[1] = gl.createVertexArray();\n gl.bindVertexArray(vao[0]);\n var offset = 0;\n var stride = 8 * FLOAT_SIZE; //Number of floats per vertex * sizeof(float)\n //Shader location 0\n gl.enableVertexAttribArray(0);\n gl.vertexAttribPointer(0, 3, gl.FLOAT, false, stride, offset);\n offset = 3 * FLOAT_SIZE;\n //Shader location 1\n gl.enableVertexAttribArray(1);\n gl.vertexAttribPointer(1, 3, gl.FLOAT, false, stride, offset);\n offset = 6 * FLOAT_SIZE;\n //Shader location 2\n gl.enableVertexAttribArray(2);\n gl.vertexAttribPointer(2, 2, gl.FLOAT, false, stride, offset);\n\n gl.bindVertexArray(vao[1]);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertBuffer);\n\n gl.enableVertexAttribArray(0);\n gl.vertexAttribPointer(0, 3, gl.FLOAT, false, stride, 0);\n\n textureSpec = gl.createTexture();\n var imageSpec = document.getElementById(\"spec\");\n gl.bindTexture(gl.TEXTURE_2D, textureSpec);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imageSpec);\n gl.generateMipmap(gl.TEXTURE_2D);\n\n texture = gl.createTexture();\n var image = document.getElementById('texture');\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n gl.generateMipmap(gl.TEXTURE_2D);\n\n renderLoop(gl, spToy, spLight);\n}", "function initShaderProgram(gl, vsSource, fsSource) {\n\tconst vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n\tconst fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n\n\t// Create the shader program\n\tconst shaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\n\t// If creating the shader program failed, alert\n\tif (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\t\talert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n\t\treturn null;\n\t}\n\n\treturn shaderProgram;\n}", "initGL() {\n \"use strict\";\n this.ctx.shaderProgram = loadAndCompileShaders(\n this.gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n this.setUpAttributesAndUniforms();\n this.setUpShapes();\n\n // set the clear color here\n this.gl.clearColor(0.2, 0.2, 0.2, 1); //-> damit wird alles übermalen (erst wenn clear)\n\n // add more necessary commands here\n }", "function initShaderProgram(gl, vsSource, fsSource) {\n\tconst vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n\tconst fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n\tconst 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(`Unable to initialize the shader program: ${gl.getProgramInfoLog(shaderProgram)}`);\n\t\treturn null;\n\t}\n\treturn shaderProgram;\n}", "function setupWebGL(canvasID, vertexShaderID, fragmentShaderID) {\n /* Get the WebGL context */\n gl = twgl.getWebGLContext(document.getElementById(canvasID));\n\n /* Initialize the WebGL environment */\n if (gl) {\n gl.clearColor(0, 0, 0, 1);\n\n gl.enable(gl.DEPTH_TEST);\n gl.depthFunc(gl.LEQUAL);\n \n maximizeCanvas(gl);\n document.body.onresize = () => maximizeCanvas(gl);\n\n Promise.all([\n loadShader(vertexShaderID),\n loadShader(fragmentShaderID)\n ]).then(() => {\n /* Create the programs */\n programInfo = twgl.createProgramInfo(gl, [vertexShaderID, fragmentShaderID]);\n gl.useProgram(programInfo.program);\n\n /* Create the primitive */\n twgl.setDefaults({ attribPrefix: 'a_' });\n var arrays = primitives.createSphereVertices(500, 50, 50);\n createSphereTangents(arrays, 50, 50);\n sphere = twgl.createBufferInfoFromArrays(gl, arrays);\n\n colorMap = twgl.createTexture(gl, { src: './images/colormap.png', flipY: false });\n normalMap = twgl.createTexture(gl, { src: './images/normalmap.png', flipY: false });\n faceMap = twgl.createTexture(gl, { src: './images/me.png' });\n\n /* Initialize the mouse and keys */\n initMouseEvents();\n initKeyEvents();\n\n /* Clear the matrix stack */\n matrixstack.clear();\n\n /* Update the canvas content */\n window.requestAnimationFrame(render);\n });\n }\n}", "function start() {\n let canvas = document.getElementById(\"myCanvas\");\n gl = prepareWebGL(canvas);\n context.shaderProgram = gl.createProgram();\n\n loadShader(gl, context.shaderProgram)\n .finally(() => {\n prepareGlVariables();\n prepareClearColor();\n texture.object = loadTexture(gl, texture.imgSource);\n prepareScene();\n window.requestAnimationFrame(drawAnimated);\n })\n}", "function initializeWebGL() {\n\ttry {\n\t\tgl = canvas.getContext(\"webgl2\");\n\t} catch(e) {\n\t\tconsole.log(e);\n\t}\n\n\tif(gl) {\n\t\tprogram = compileAndLink(program,vs,fs);\n\t\tgl.useProgram(program);\n\n\t\t// Link mesh attributes to shader attributes and enable them\n\t\tprogram = linkMeshAttr(program,false);\n\n\t\t// Init world view and projection matrices\n\t\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\t\tgl.viewport(0.0, 0.0, canvas.clientWidth, canvas.clientHeight);\n\t\taspectRatio = canvas.clientWidth/canvas.clientHeight;\n\n\t\t// Turn on depth testing\n\t\tgl.enable(gl.DEPTH_TEST);\n\t\tgl.enable(gl.CULL_FACE);\n\t} else {\n\t\talert(\"Error: WebGL not supported by your browser!\");\n\t}\n}" ]
[ "0.87163424", "0.8596219", "0.85760325", "0.84909165", "0.83908445", "0.83655006", "0.8319474", "0.8305133", "0.82184213", "0.81231046", "0.8115499", "0.8115499", "0.8053723", "0.8030474", "0.7978208", "0.7969012", "0.7955394", "0.79364115", "0.79215693", "0.79097426", "0.7827785", "0.77949053", "0.77939844", "0.7778759", "0.77688104", "0.775256", "0.77476007", "0.7743121", "0.7740998", "0.770183", "0.7701683", "0.76800245", "0.7649124", "0.7619283", "0.75925463", "0.7588893", "0.75624585", "0.75577635", "0.74867564", "0.74775577", "0.7465765", "0.7465765", "0.7461553", "0.7453152", "0.73741835", "0.73240936", "0.7313608", "0.7290579", "0.72860754", "0.72791165", "0.72487026", "0.72330964", "0.72068995", "0.7202484", "0.7186961", "0.71807796", "0.7167832", "0.71636033", "0.7148542", "0.7145217", "0.71393645", "0.7125033", "0.71212906", "0.7091357", "0.70825875", "0.7064978", "0.705221", "0.7050642", "0.7015539", "0.7005015", "0.69987285", "0.69782233", "0.6966018", "0.696122", "0.69532627", "0.69424504", "0.69118965", "0.69078916", "0.6902695", "0.68999094", "0.68750596", "0.68728375", "0.681179", "0.68068355", "0.6800833", "0.6792791", "0.6784965", "0.67815024", "0.6774745", "0.6767078", "0.6765801", "0.6760816", "0.6757578", "0.6756424", "0.67546505", "0.6754418", "0.6751981", "0.6749061", "0.6743801", "0.6737364" ]
0.83300763
6
getShader Loads a shader program by scouring the current document, looking for a script with the specified ID.
function getShader(gl, id) { var shaderScript = document.getElementById(id);//get the shading script from the HTML file // Didn't find an element with the specified ID; abort. if (!shaderScript) { return null; } // Walk through the source element's children, building the // shader source string. var theSource = ""; var currentChild = shaderScript.firstChild; while(currentChild) { if (currentChild.nodeType == 3) { theSource += currentChild.textContent; } currentChild = currentChild.nextSibling; } // Now find out the type of the shader scripts based on its MIME type. var shader; if (shaderScript.type == "x-shader/x-fragment") { shader = gl.createShader(gl.FRAGMENT_SHADER);//create the fragment shader } else if (shaderScript.type == "x-shader/x-vertex") { shader = gl.createShader(gl.VERTEX_SHADER);//create the vertex shader } else { return null; // Unknown shader type } // Send the source to the shader object gl.shaderSource(shader, theSource); // Compile the shader program gl.compileShader(shader); // See if it compiled successfully if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { alert("An error occurred compiling the shaders: " + gl.getShaderInfoLog(shader)); return null; } return shader;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getShader(id) {\n\tvar shaderScript = document.getElementById(id);\n\tif (!shaderScript) {\n\t\treturn null;\n\t}\n\n\tvar str = \"\";\n\tvar k = shaderScript.firstChild;\n\twhile (k) {\n\t\tif (k.nodeType == 3) {\n\t\t\tstr += k.textContent;\n\t\t}\n\t\tk = k.nextSibling;\n\t}\n\n\tvar shader;\n\tif (shaderScript.type == \"x-shader/x-fragment\") {\n\t\tshader = gl.createShader(gl.FRAGMENT_SHADER);\n\t} else if (shaderScript.type == \"x-shader/x-vertex\") {\n\t\tshader = gl.createShader(gl.VERTEX_SHADER);\n\t} else {\n\t\treturn null;\n\t}\n\n\tgl.shaderSource(shader, str);\n\tgl.compileShader(shader);\n\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\talert(gl.getShaderInfoLog(shader));\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "function getShader( gl, id )\n{\n var shaderScript = document.getElementById( id );\n\n if ( !shaderScript )\n {\n\n console.error( \"No shader scripts present.\" );\n\n return null;\n\n }\n\n var str = \"\";\n\n var k = shaderScript.firstChild;\n\n while ( k )\n {\n\n if ( k.nodeType == 3 )\n {\n\n str += k.textContent;\n\n }\n\n k = k.nextSibling;\n\n }\n\n var shader = null;\n\n if ( shaderScript.type == \"x-shader/x-fragment\" )\n {\n\n shader = gl.createShader( gl.FRAGMENT_SHADER );\n\n }\n else if ( shaderScript.type == \"x-shader/x-vertex\" )\n {\n\n shader = gl.createShader( gl.VERTEX_SHADER );\n\n }\n else\n {\n\n console.error( \"No fragment/vertex shaders found.\" );\n\n return null;\n\n }\n\n gl.shaderSource( shader, str );\n gl.compileShader( shader );\n\n if ( !gl.getShaderParameter( shader, gl.COMPILE_STATUS ) )\n {\n\n console.error( gl.getShaderInfoLog( shader ) );\n\n return null;\n\n }\n\n return shader;\n\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 }", "function getShader(id) { \n\tvar shaderScript = document.getElementById(id); \n\tvar k = shaderScript.firstChild; \n\tvar str=k.textContent;\n\tvar shader; \n\tif (shaderScript.type == \"x-shader/x-fragment\") { \n\t shader = gl.createShader(gl.FRAGMENT_SHADER); \n } else if (shaderScript.type == \"x-shader/x-vertex\") { \n shader = gl.createShader(gl.VERTEX_SHADER);\n } \n gl.shaderSource(shader, str); gl.compileShader(shader); \n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { \n alert(gl.getShaderInfoLog(shader)); \n return null; \n } \n return shader; \n}", "function getShader(gl, id) {\n\tvar shaderScript = document.getElementById(id);\n\tif (!shaderScript) {\n\t\talert(id);\n\t\treturn null;\n\t}\n\n\t// Fill str with the souce of the shader\n\tvar str = \"\";\n\tvar k = shaderScript.firstChild;\n\twhile (k) {\n\t\t// ????\n\t\tif (k.nodeType == 3) {\n\t\t\tstr += k.textContent;\n\t\t}\n\t\tk = k.nextSibling;\n\t}\n\n\tvar shader;\n\n\tif (shaderScript.type == \"x-shader/x-fragment\") {\n\t\tshader = gl.createShader(gl.FRAGMENT_SHADER);\n\t} else if (shaderScript.type == \"x-shader/x-vertex\") {\n\t\tshader = gl.createShader(gl.VERTEX_SHADER);\n\t} else {\n\t\treturn null;\n\t}\n\n\tgl.shaderSource(shader, str);\n\tgl.compileShader(shader);\n\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\talert(gl.getShaderInfoLog(shader));\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "function getShader(gl, id) {\n var shaderScript = document.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 \n return shader;\n }", "function getShader(gl, id) {\r\n var shaderScript = document.getElementById(id);\r\n if (!shaderScript) {\r\n return null;\r\n }\r\n\r\n var str = \"\";\r\n var k = shaderScript.firstChild;\r\n while (k) {\r\n if (k.nodeType == 3) {\r\n str += k.textContent;\r\n }\r\n k = k.nextSibling;\r\n }\r\n\r\n var shader;\r\n if (shaderScript.type == \"--fragment\") {\r\n shader = gl.createShader(gl.FRAGMENT_SHADER);\r\n }\r\n else if (shaderScript.type == \"--vertex\") {\r\n shader = gl.createShader(gl.VERTEX_SHADER);\r\n }\r\n else return null;\r\n\r\n gl.shaderSource(shader, str);\r\n gl.compileShader(shader);\r\n\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n alert(gl.getShaderInfoLog(shader));\r\n return null;\r\n }\r\n\r\n return shader;\r\n }", "function getShader(gl, id) {\n var shaderScript = document.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 \n return shader;\n }", "function getShader(gl, id) {\r\n var shaderScript = document.getElementById(id);\r\n\r\n // Didn't find an element with the specified ID; abort.\r\n if (!shaderScript) {\r\n return null;\r\n }\r\n\r\n // Walk through the source element's children, building the\r\n // shader source string.\r\n var shaderSource = \"\";\r\n var currentChild = shaderScript.firstChild;\r\n while (currentChild) {\r\n if (currentChild.nodeType == 3) {\r\n shaderSource += currentChild.textContent;\r\n }\r\n currentChild = currentChild.nextSibling;\r\n }\r\n\r\n // Now figure out what type of shader script we have,\r\n // based on its MIME type.\r\n var shader;\r\n if (shaderScript.type == \"x-shader/x-fragment\") {\r\n shader = gl.createShader(gl.FRAGMENT_SHADER);\r\n } else if (shaderScript.type == \"x-shader/x-vertex\") {\r\n shader = gl.createShader(gl.VERTEX_SHADER);\r\n } else {\r\n return null; // Unknown shader type\r\n }\r\n\r\n // Send the source to the shader object\r\n gl.shaderSource(shader, shaderSource);\r\n\r\n // Compile the shader program\r\n gl.compileShader(shader);\r\n\r\n // See if it compiled successfully\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n alert(gl.getShaderInfoLog(shader));\r\n return null;\r\n }\r\n\r\n return shader;\r\n}", "function getShader(gl, id) {\n var shaderScript = document.getElementById(id);\n\n // Didn't find an element with the specified ID; abort.\n if (!shaderScript) {\n return null;\n }\n \n // Walk through the source element's children, building the\n // shader source string.\n var shaderSource = \"\";\n var currentChild = shaderScript.firstChild;\n while (currentChild) {\n if (currentChild.nodeType == 3) {\n shaderSource += currentChild.textContent;\n }\n currentChild = currentChild.nextSibling;\n }\n \n // Now figure out what type of shader script we have,\n // based on its MIME type.\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; // Unknown shader type\n }\n\n // Send the source to the shader object\n gl.shaderSource(shader, shaderSource);\n\n // Compile the shader program\n gl.compileShader(shader);\n\n // See if it compiled successfully\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n}", "function getShader(id) {\n const script = document.getElementById(id);\n const shaderString = script.text.trim();\n\n // Assign shader depending on the type of shader\n let shader;\n if (script.type === 'x-shader/x-vertex') {\n shader = gl.createShader(gl.VERTEX_SHADER);\n }\n else if (script.type === 'x-shader/x-fragment') {\n shader = gl.createShader(gl.FRAGMENT_SHADER);\n }\n else {\n return null;\n }\n\n // Compile the shader using the supplied shader code\n gl.shaderSource(shader, shaderString);\n gl.compileShader(shader);\n\n // Ensure the shader is valid\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }", "function getShader(gl, id) {\r\n\tvar shaderScript = document.getElementById(id);\r\n\tif (!shaderScript) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar str = \"\";\r\n\tvar k = shaderScript.firstChild;\r\n\twhile (k) {\r\n\t\tif (k.nodeType == 3)\r\n\t\t\tstr += k.textContent;\r\n\t\tk = k.nextSibling;\r\n\t}\r\n\r\n\tvar shader;\r\n\tif (shaderScript.type == \"x-shader/x-fragment\") {\r\n\t\tshader = gl.createShader(gl.FRAGMENT_SHADER);\r\n\t} else if (shaderScript.type == \"x-shader/x-vertex\") {\r\n\t\tshader = gl.createShader(gl.VERTEX_SHADER);\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tgl.shaderSource(shader, str);\r\n\tgl.compileShader(shader);\r\n\r\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n\t\talert(gl.getShaderInfoLog(shader));\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn shader;\r\n}", "function getShader(gl, id) {\n\tvar shaderScript = document.getElementById(id);\n\n\t// Didn't find an element with the specified ID; abort.\n\tif (!shaderScript) {\n\t\treturn null;\n\t}\n\n\t// Walk through the source element's children, building the\n\t// shader source string.\n\tvar shaderSource = \"\";\n\tvar currentChild = shaderScript.firstChild;\n\twhile (currentChild) {\n\t\tif (currentChild.nodeType == 3) {\n\t\t\tshaderSource += currentChild.textContent;\n\t\t}\n\t\tcurrentChild = currentChild.nextSibling;\n\t}\n\n\t// Now figure out what type of shader script we have,\n\t// based on its MIME type.\n\tvar shader;\n\tif (shaderScript.type == \"x-shader/x-fragment\") {\n\t\tshader = gl.createShader(gl.FRAGMENT_SHADER);\n\t} else if (shaderScript.type == \"x-shader/x-vertex\") {\n\t\tshader = gl.createShader(gl.VERTEX_SHADER);\n\t} else {\n\t\treturn null; // Unknown shader type\n\t}\n\n\t// Send the source to the shader object\n\tgl.shaderSource(shader, shaderSource);\n\n\t// Compile the shader program\n\tgl.compileShader(shader);\n\n\t// See if it compiled successfully\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\talert(gl.getShaderInfoLog(shader));\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "function getShaderFromDocument (gl, id) {\n let shaderScript = document.getElementById(id);\n\n // Didn't find an element with the specified ID; abort.\n\n if (!shaderScript) {\n return null;\n }\n\n // Walk through the source element's children, building the\n // shader source string.\n\n let theSource = \"\";\n let currentChild = shaderScript.firstChild;\n\n while(currentChild) {\n if (currentChild.nodeType === 3) {\n theSource += currentChild.textContent;\n }\n\n currentChild = currentChild.nextSibling;\n }\n\n // Now figure out what type of shader script we have,\n // based on its MIME type.\n\n let shader;\n\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; // Unknown shader type\n }\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, theSource);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n console.error(\"An error occurred compiling the shaders: \" + gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }", "function getShader(gl, id) {\n\n var script = document.getElementById(id);\n if (!script) {\n return null;\n }\n\n var source = script.firstChild.textContent;\n var shader;\n\n switch(script.type) {\n case \"x-shader/x-fragment\":\n shader = gl.createShader(gl.FRAGMENT_SHADER);\n break;\n case \"x-shader/x-vertex\":\n shader = gl.createShader(gl.VERTEX_SHADER);\n break;\n default:\n console.log(\"Invalid shader type: \"+script.type);\n return null;\n }\n\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n console.log(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n\n}", "async function getShader(gl, ID) {\n\tlet shaderScript = document.getElementById(ID);\n\tif (!shaderScript) {\n\t\treturn null;\n\t}\n\n\tlet str = \"\";\n\tlet k = shaderScript.firstChild;\n\twhile (k) {\n\t\tif (k.nodeType == 3) {\n\t\t\tstr += k.textContent;\n\t\t}\n\t\tk = k.nextSibling;\n\t}\n\n\tif (shaderScript.src) {\n\t\tstr = await fetch(shaderScript.src).then(response => response.text());\n\t}\n\n\tlet shader;\n\tif (shaderScript.type == \"text/glsl-fragment\") {\n\t\tshader = gl.createShader(gl.FRAGMENT_SHADER);\n\t} else if (shaderScript.type == \"text/glsl-vertex\") {\n\t\tshader = gl.createShader(gl.VERTEX_SHADER);\n\t} else {\n\t\treturn null;\n\t}\n\t// console.log(str);\n\n\tgl.shaderSource(shader, str);\n\tgl.compileShader(shader);\n\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconsole.log(\"ERROR with script: \", ID);\n\t\tconsole.log(gl.getShaderInfoLog(shader));\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "function getShader(gl, id) {\n \t\n var shaderScript = document.getElementById(id);\n //Pruefe ob ein Element existiert\n if (!shaderScript) {\n return null;\n }\n \n //Pruefe ob alle elemente textelemente sind\n var str = \"\";\n var k = shaderScript.firstChild;\n while (k) {\n if (k.nodeType == 3) {\t\t\t//If the node is a text node, the nodeType property will return 3.\n str += k.textContent;\n }\n k = k.nextSibling;\t\t\t\t//Naechster (sibling = Geschwister)\n }\n\n //Pruefe welche Art von Shader und speichere in variable\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 //Konvertiere den Shader in eine GraKa kompatible Form\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\n return shader;\n }", "function shader(id)\n{\n var shaderScript = document.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 == \"frag\") {\n shader = gl.createShader(gl.FRAGMENT_SHADER);\n } else if (shaderScript.type == \"vert\") {\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) + \" \" + id);\n return null;\n }\n\n return shader;\n}", "function getShaderSrc(id){\r\n\tif(!use2D){\r\n\t\tvar shaderScript = document.getElementById(id);\r\n\t\tif(!shaderScript){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tvar code = \"\";\r\n\t\tvar k = shaderScript.firstChild;\r\n\t\twhile(k){\r\n\t\t\tif(k.nodeType == 3){\r\n\t\t\t\tcode += k.textContent;\r\n\t\t\t}\r\n\t\t\tk = k.nextSibling;\r\n\t\t}\r\n\t\tvar type;\r\n\t\tif(shaderScript.type == \"x-shader/x-fragment\"){\r\n\t\t\ttype = \"frag\";\r\n\t\t}else if(shaderScript.type == \"x-shader/x-vertex\"){\r\n\t\t\ttype = \"vert\";\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\treturn {code: code, type:type};\r\n\t}\r\n\treturn null;\r\n}", "function loadShaderFromDOM(id) {\n var shaderScript = document.getElementById(id);\n // If we don't find an element with the specified id\n // we do an early exit \n\n if (!shaderScript) {\n return null;\n }\n // Loop through the children for the found DOM element and\n // build up the shader source code as a string\n \n var shaderSource = \"\";\n var currentChild = shaderScript.firstChild;\n while (currentChild) {\n if (currentChild.nodeType == 3) { \n shaderSource += currentChild.textContent;\n }\n currentChild = currentChild.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, shaderSource);\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}", "function loadShaderFromDOM(id) {\r\n var shaderScript = document.getElementById(id);\r\n \r\n // If we don't find an element with the specified id\r\n // we do an early exit \r\n if (!shaderScript) {\r\n return null;\r\n }\r\n \r\n // Loop through the children for the found DOM element and\r\n // build up the shader source code as a string\r\n var shaderSource = \"\";\r\n var currentChild = shaderScript.firstChild;\r\n while (currentChild) {\r\n if (currentChild.nodeType == 3) { // 3 corresponds to TEXT_NODE\r\n shaderSource += currentChild.textContent;\r\n }\r\n currentChild = currentChild.nextSibling;\r\n }\r\n \r\n var shader;\r\n if (shaderScript.type == \"x-shader/x-fragment\") {\r\n shader = gl.createShader(gl.FRAGMENT_SHADER);\r\n } else if (shaderScript.type == \"x-shader/x-vertex\") {\r\n shader = gl.createShader(gl.VERTEX_SHADER);\r\n } else {\r\n return null;\r\n }\r\n \r\n gl.shaderSource(shader, shaderSource);\r\n gl.compileShader(shader);\r\n \r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n alert(gl.getShaderInfoLog(shader));\r\n return null;\r\n } \r\n return shader;\r\n}", "function loadShaderFromDOM(id) {\r\n\tvar shaderScript = document.getElementById(id);\r\n\tif (!shaderScript) {\r\n\t\treturn null;\r\n\t}\r\n\tvar shaderSource = \"\";\r\n\tvar currentChild = shaderScript.firstChild;\r\n\twhile (currentChild) {\r\n\t\tif (currentChild.nodeType == 3) {\r\n\t\t\tshaderSource += currentChild.textContent;\r\n\t\t}\r\n\t\tcurrentChild = currentChild.nextSibling;\r\n\t}\r\n\tvar shader;\r\n\tif (shaderScript.type == \"x-shader/x-fragment\") {\r\n\t\tshader = gl.createShader(gl.FRAGMENT_SHADER);\r\n\t} else if (shaderScript.type == \"x-shader/x-vertex\") {\r\n\t\tshader = gl.createShader(gl.VERTEX_SHADER);\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n\tgl.shaderSource(shader, shaderSource);\r\n\tgl.compileShader(shader);\r\n\tif(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n\t\talert(gl.getShaderInfoLog(shader));\r\n\t\treturn null;\r\n\t}\r\n\treturn shader;\r\n}", "function loadShaderFromDOM(id) {\n var shaderScript = document.getElementById(id);\n\n // If we don't find an element with the specified id\n // we do an early exit\n if (!shaderScript) {\n return null;\n }\n\n // Loop through the children for the found DOM element and\n // build up the shader source code as a string\n var shaderSource = \"\";\n var currentChild = shaderScript.firstChild;\n while (currentChild) {\n if (currentChild.nodeType == 3) { // 3 corresponds to TEXT_NODE\n shaderSource += currentChild.textContent;\n }\n currentChild = currentChild.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, shaderSource);\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 }", "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 }", "function compileShader(id) {\n var shaderScript = document.getElementById(id);\n var k = shaderScript.firstChild;\n var str = k.textContent;\n console.log(str);\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 }\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(id + \"\\n\" + gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n}", "function loadShader(ctx, shaderId)\n { \n var shaderScript = document.getElementById(shaderId);\n \n if (!shaderScript) {\n shaderScript = {text : shaderId, type : undefined};\n \n if (shaderId.trim().toLowerCase().startsWith(\"//vertex\")) {\n shaderScript.type = \"x-shader/x-vertex\";\n } else if (shaderId.trim().toLowerCase().startsWith(\"//fragment\")) {\n shaderScript.type = \"x-shader/x-fragment\";\n } else {\n console.trace();\n console.log(\"Invalid shader type\");\n console.log(\"================\");\n console.log(format_lines(shaderScript));\n console.log(\"================\");\n throw new Error(\"Invalid shader type for shader script;\\n script must start with //vertex or //fragment\");\n }\n }\n\n if (shaderScript.type == \"x-shader/x-vertex\")\n var shaderType = ctx.VERTEX_SHADER;\n else if (shaderScript.type == \"x-shader/x-fragment\")\n var shaderType = ctx.FRAGMENT_SHADER;\n else {\n log(\"*** Error: shader script '\"+shaderId+\"' of undefined type '\"+shaderScript.type+\"'\");\n return null;\n }\n\n // Create the shader object\n if (ctx == undefined || ctx == null || ctx.createShader == undefined)\n console.trace();\n \n var shader = ctx.createShader(shaderType);\n\n // Load the shader source\n ctx.shaderSource(shader, shaderScript.text);\n\n // Compile the shader\n ctx.compileShader(shader);\n\n // Check the compile status\n var compiled = ctx.getShaderParameter(shader, ctx.COMPILE_STATUS);\n if (!compiled && !ctx.isContextLost()) {\n // Something went wrong during compilation; get the error\n var error = ctx.getShaderInfoLog(shader);\n \n console.log(format_lines(shaderScript.text));\n console.log(\"\\nError compiling shader: \", error);\n \n ctx.deleteShader(shader);\n return null;\n }\n\n return shader;\n }", "createShaderFromScript(gl, scriptId, shaderType) {\n // look up the script tag by id.\n let shaderScriptElem = document.getElementById(scriptId);\n if (!shaderScriptElem) {\n this._logger.warn(\"Unknown script target element, discarding..\");\n return null;\n }\n\n // extract the contents of the script tag.\n this.createShader(gl, shaderScriptElem.text, shaderType);\n }", "function loadShader(shaderScriptID) {\n \"use strict\";\n return new Promise((resolve, reject) => {\n const script = document.getElementById(shaderScriptID);\n if (!script)\n reject(\"Failed to locate script element with id `\" + shaderScriptID + \"`\");\n const url = script.getAttribute(\"src\");\n\n const xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4) {\n if (this.status == 200) {\n document.getElementById(shaderScriptID).innerHTML =\n this.responseText;\n console.debug(\"`\" + url + \"` loaded to `\" + shaderScriptID + \"`.\");\n resolve(\"`\" + url + \"` loaded to `\" + shaderScriptID + \"`.\")\n } else {\n console.warn(\"Failed to load `\" + url + \"`. Status code: \" + this.status);\n reject(\"`\" + url + \"` loaded to `\" + shaderScriptID + \"`.\");\n }\n }\n }\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n });\n}", "function loadAndCompileShader(id, shaderType){\n var shaderText, shaderSource,compiledShader;\n \n //1.从index.html中获取shader资源\n shaderText = document.getElementById(id);\n shaderSource = shaderText.firstChild.textContent;\n \n //2.根据数据类型(vertex 或者 fragment)创建shader\n compiledShader = gGL.createShader(shaderType);\n \n //3.连接新生成的shader\n gGL.shaderSource(compiledShader,shaderSource);\n gGL.compileShader(compiledShader);\n \n //4.错误检查,并返回结果\n if(!gGL.getShaderParameter(compiledShader,gGL.COMPILE_STATUS)){\n alert(\"A shader compiling error occurred:\"+gGL.getShaderInfoLog(compiledShader));\n }\n return compiledShader;\n}", "getDomShader(elmID){\n\t\tvar elm = document.getElementById(elmID);\n\t\tif(!elm){ console.log(elmID + \" shader not found.\"); return null; }\n\t\t\n\t\t//Determine Shader Type from Element\n\t\tvar type;\n\t\tswitch(elm.type){\n\t\t\tcase \"x-shader/x-vertex\":\ttype = this.gl.VERTEX_SHADER;\tbreak;\n\t\t\tcase \"x-shader/x-fragment\":\ttype = this.gl.FRAGMENT_SHADER;\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.error(\"Unknown shader type in \" + elmID);\n\t\t\t\treturn null; \n\t\t}\n\t\t\n\t\t//Compile Shader\n\t\tvar shader = this.gl.createShader(type);\n\t\tthis.gl.shaderSource(shader,elm.text);\n\t\tthis.gl.compileShader(shader);\n\n\t\t//Get Error data if shader failed compiling\n\t\tif(!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)){\n\t\t\tconsole.error(\"Error compiling shader : \" + elmID,this.gl.getShaderInfoLog(shader));\n\t\t\tthis.gl.deleteShader(shader);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn shader;\n\t}", "function initProgram(id) {\n var programShader = gl.createProgram();\n var vert = compileShader(id + \"-vs\");\n var frag = compileShader(id + \"-fs\");\n gl.attachShader(programShader, vert);\n gl.attachShader(programShader, frag);\n gl.linkProgram(programShader);\n if (!gl.getProgramParameter(programShader, gl.LINK_STATUS)) {\n alert(gl.getProgramInfoLog(programShader));\n return null;\n }\n return programShader;\n}", "function getShader(vshad_str, fshad_str) {\n var vs = shader(vshad_str, 'vert');\n var fs = shader(fshad_str, 'frag');\n\n var Program = gl.createProgram();\n\n gl.attachShader(Program, vs);\n gl.attachShader(Program, fs);\n gl.linkProgram(Program);\n\n if (!gl.getProgramParameter(Program, gl.LINK_STATUS)) {\n alert(\"Could not initialise shaders\");\n return null;\n }\n\n return Program;\n}", "function LoadShader(gl, filename)\n{\n\t// Block loading the shader\n\tvar source = GetDocument(filename, null);\n\tif (!source)\n\t{\n\t\tFatalError(\"Failed to load shader: \" + filename);\n\t\treturn null;\n\t}\n\n\t// Decide the shader type from the filename extension\n\tvar type = gl.FRAGMENT_SHADER;\n\tif (EndsWith(filename.toLowerCase(), \".vsh\"))\n\t\ttype = gl.VERTEX_SHADER;\n\n\t// Create and compile the shader\n\tvar shader = gl.createShader(type);\n\tgl.shaderSource(shader, source);\n\tgl.compileShader(shader);\n\n\t// Report any compilation errors\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n\t{\n\t\tFatalError(filename + \"\\n\" + gl.getShaderInfoLog(shader));\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "function getShaderSource(url) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url, false);\n req.send(null);\n return (req.status == 200) ? req.responseText : null;\n}", "function createProgram(gl, vertexShaderID, fragmentShaderID) {\n function getTextContent( elementID ) {\n // This nested function retrieves the text content of an\n // element on the web page. It is used here to get the shader\n // source code from the script elements that contain it.\n var element = document.getElementById(elementID);\n var node = element.firstChild;\n var str = \"\";\n while (node) {\n if (node.nodeType == 3) // this is a text node\n str += node.textContent;\n node = node.nextSibling;\n }\n return str;\n }\n try {\n var vertexShaderSource = getTextContent( vertexShaderID );\n var fragmentShaderSource = getTextContent( fragmentShaderID );\n }\n catch (e) {\n throw \"Error: Could not get shader source code from script elements.\";\n }\n var vsh = gl.createShader( gl.VERTEX_SHADER );\n gl.shaderSource(vsh,vertexShaderSource);\n gl.compileShader(vsh);\n if ( ! gl.getShaderParameter(vsh, gl.COMPILE_STATUS) ) {\n throw \"Error in vertex shader: \" + gl.getShaderInfoLog(vsh);\n }\n var fsh = gl.createShader( gl.FRAGMENT_SHADER );\n gl.shaderSource(fsh, fragmentShaderSource);\n gl.compileShader(fsh);\n if ( ! gl.getShaderParameter(fsh, gl.COMPILE_STATUS) ) {\n throw \"Error in fragment shader: \" + gl.getShaderInfoLog(fsh);\n }\n var prog = gl.createProgram();\n gl.attachShader(prog,vsh);\n gl.attachShader(prog, fsh);\n gl.linkProgram(prog);\n if ( ! gl.getProgramParameter( prog, gl.LINK_STATUS) ) {\n throw \"Link error in program: \" + gl.getProgramInfoLog(prog);\n }\n return prog;\n}", "function DOMShader(id) {\n let dom = document.querySelector(id);\n return dom.textContent;\n }", "function createProgram(id) { \n programShader=gl.createProgram(); \n var vert=getShader(id+\"-vs\"); \n var frag=getShader(id+\"-fs\"); \n gl.attachShader(programShader,vert); \n gl.attachShader(programShader,frag); \n gl.linkProgram(programShader); \n if (!gl.getProgramParameter(programShader,gl.LINK_STATUS)) { \n alert(gl.getProgramInfoLog(programShader)); \n return null; \n } \n console.log(\"compilation shader ok\"); \n return programShader; \n}", "function loadShader(ctx, shaderType, shaderStr)\r\n{\r\n\r\n // Create the shader object\r\n var shader = ctx.createShader(shaderType);\r\n if (shader == null) {\r\n/*\r\n ctx.console.log(\"*** Error: unable to create shader '\"+shaderType+\"'\"); \r\n*/\r\n return null;\r\n }\r\n\r\n // Load the shader source\r\n ctx.shaderSource(shader, shaderStr);\r\n\r\n // Compile the shader\r\n ctx.compileShader(shader);\r\n\r\n // Check the compile status\r\n var compiled = ctx.getShaderParameter(shader, ctx.COMPILE_STATUS);\r\n if (!compiled) {\r\n // Something went wrong during compilation; get the error\r\n var error = ctx.getShaderInfoLog(shader);\r\n\r\n ctx.console.log(\"*** Error compiling shader '\"+shaderType+\"':\"+error);\r\n\r\n ctx.deleteShader(shader);\r\n return null;\r\n }\r\n\r\n return shader;\r\n}", "function createProgram(gl, vertexShaderID, fragmentShaderID) {\r\n function getTextContent( elementID ) {\r\n // This nested function retrieves the text content of an\r\n // element on the web page. It is used here to get the shader\r\n // source code from the script elements that contain it.\r\n var element = document.getElementById(elementID);\r\n var node = element.firstChild;\r\n var str = \"\";\r\n while (node) {\r\n if (node.nodeType == 3) // this is a text node\r\n str += node.textContent;\r\n node = node.nextSibling;\r\n }\r\n return str;\r\n }\r\n try {\r\n var vertexShaderSource = getTextContent( vertexShaderID );\r\n var fragmentShaderSource = getTextContent( fragmentShaderID );\r\n }\r\n catch (e) {\r\n throw \"Error: Could not get shader source code from script elements.\";\r\n }\r\n var vsh = gl.createShader( gl.VERTEX_SHADER );\r\n gl.shaderSource(vsh,vertexShaderSource);\r\n gl.compileShader(vsh);\r\n if ( ! gl.getShaderParameter(vsh, gl.COMPILE_STATUS) ) {\r\n throw \"Error in vertex shader: \" + gl.getShaderInfoLog(vsh);\r\n }\r\n var fsh = gl.createShader( gl.FRAGMENT_SHADER );\r\n gl.shaderSource(fsh, fragmentShaderSource);\r\n gl.compileShader(fsh);\r\n if ( ! gl.getShaderParameter(fsh, gl.COMPILE_STATUS) ) {\r\n throw \"Error in fragment shader: \" + gl.getShaderInfoLog(fsh);\r\n }\r\n var prog = gl.createProgram();\r\n gl.attachShader(prog,vsh);\r\n gl.attachShader(prog, fsh);\r\n gl.linkProgram(prog);\r\n if ( ! gl.getProgramParameter( prog, gl.LINK_STATUS) ) {\r\n throw \"Link error in program: \" + gl.getProgramInfoLog(prog);\r\n }\r\n return prog;\r\n}", "function loadShader(glCtx, type, source) {\n\t// Create shader object\n\tvar shader = glCtx.createShader(type);\n\tif (shader == null) {\n\t\tconsole.log('unable to create shader');\n\t\treturn null;\n\t}\n \n\t// Set the shader program\n\tglCtx.shaderSource(shader, source);\n\n\t// Compile the shader\n\tglCtx.compileShader(shader);\n\n\t// Check the result of compilation\n\tvar compiled = glCtx.getShaderParameter(shader, glCtx.COMPILE_STATUS);\n\tif (!compiled) {\n\t\tvar error = glCtx.getShaderInfoLog(shader);\n\t\tconsole.log('Failed to compile shader: ' + error);\n\t\tglCtx.deleteShader(shader);\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "static domShaderSrc(elmID) {\n var elm = document.getElementById(elmID);\n if (!elm || elm.text == \"\") {\n console.log(elmID + \" shader not found or no text.\");\n return null;\n }\n\n return elm.text;\n }", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\talert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n\tgl.deleteShader(shader);\n\treturn null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n \n // Send the source to the shader object\n gl.shaderSource(shader, source);\n \n // Compile the shader program\n gl.compileShader(shader);\n \n // See if it compiled successfully\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n \n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, src) {\n const shader = gl.createShader(type);\n \n // Compile shader\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n \n // Check for errors\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n \n return shader;\n}", "function loadShader(gl, type, source) {\r\n const shader = gl.createShader(type);\r\n\r\n // Send the source to the shader object\r\n gl.shaderSource(shader, source);\r\n\r\n // Compile the shader program\r\n gl.compileShader(shader);\r\n\r\n // See if it compiled successfully\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\r\n gl.deleteShader(shader);\r\n return null;\r\n }\r\n\r\n return shader;\r\n}", "function createProgram(gl, vertexShaderID, fragmentShaderID) {\n function getTextContent( elementID ) {\n var element = document.getElementById(elementID);\n var node = element.firstChild;\n var str = \"\";\n while (node) {\n if (node.nodeType == 3) // this is a text node\n str += node.textContent;\n node = node.nextSibling;\n }\n return str;\n }\n try {\n var vertexShaderSource = getTextContent( vertexShaderID );\n var fragmentShaderSource = getTextContent( fragmentShaderID );\n }\n catch (e) {\n throw \"Error: Could not get shader source code from script elements.\";\n }\n var vsh = gl.createShader( gl.VERTEX_SHADER );\n gl.shaderSource(vsh,vertexShaderSource);\n gl.compileShader(vsh);\n if ( ! gl.getShaderParameter(vsh, gl.COMPILE_STATUS) ) {\n throw \"Error in vertex shader: \" + gl.getShaderInfoLog(vsh);\n }\n var fsh = gl.createShader( gl.FRAGMENT_SHADER );\n gl.shaderSource(fsh, fragmentShaderSource);\n gl.compileShader(fsh);\n if ( ! gl.getShaderParameter(fsh, gl.COMPILE_STATUS) ) {\n throw \"Error in fragment shader: \" + gl.getShaderInfoLog(fsh);\n }\n var prog = gl.createProgram();\n gl.attachShader(prog,vsh);\n gl.attachShader(prog, fsh);\n gl.linkProgram(prog);\n if ( ! gl.getProgramParameter( prog, gl.LINK_STATUS) ) {\n throw \"Link error in program: \" + gl.getProgramInfoLog(prog);\n }\n return prog;\n}", "function loadShader(gl, type, source) {\n let shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n\tconst shader = gl.createShader(type);\n\n\t// Send the source to the shader object\n\tgl.shaderSource(shader, source);\n\n\t// Compile the shader program\n\tgl.compileShader(shader);\n\n\t// See if it compiled successfully\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\talert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n\t\tgl.deleteShader(shader);\n\t\treturn null;\n\t}\n\n\treturn shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n \n // Send the source to the shader object\n \n gl.shaderSource(shader, source);\n \n // Compile the shader program\n \n gl.compileShader(shader);\n \n // See if it compiled successfully\n \n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n\n gl.compileShader(shader);\n\n // See if it compiled successfully\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n gl.compileShader(shader);\n\n // See if it compiled successfully\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send the source to the shader object\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n gl.compileShader(shader);\n\n // See if it compiled successfully\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n return shader;\n}", "function loadShader(gl, type, source)\n{\n\tconst shader = gl.createShader(type);\n\t\n\t// send source-code to object\n\tgl.shaderSource(shader,source);\n\n\tgl.compileShader(shader);\n\tif(!gl.getShaderParameter(shader,gl.COMPILE_STATUS))\n\t{\n\t\tconsole.log(\"Failed to compile a shader:\\n\"+\n\t\tgl.getShaderInfoLog(shader));\n\t\tgl.deleteShader(shader);\n\t\treturn null;\n\t}\n\treturn shader;\n}", "function loadShader(gl, type, source) {\n // Create shader object\n var shader = gl.createShader(type);\n\n if (shader == null) {\n throw new Error('unable to create shader');\n } // Set the shader program\n\n\n gl.shaderSource(shader, source); // Compile the shader\n\n gl.compileShader(shader); // Check the result of compilation\n\n var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n\n if (!compiled) {\n var error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type); // no error handling??\n\n // Send the source to the shader object\n gl.shaderSource(shader, source);\n\n // Compile the shader program\n gl.compileShader(shader);\n\n // Now check for errors\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n // this alert business is sloppy...\n alert( 'An error occurred compiling the shaders: \\n' +\n gl.getShaderInfoLog(shader) );\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function LoadShaderFile(fileName, shader) {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function () {\n if (request.readyState == 4 && request.status != 404) {\n OnLoadShader(request.responseText, shader);\n }\n };\n\n request.open('GET', fileName, true);\n request.send();\n}", "function loadShader(type, shaderSrc) {\n var shader = gl.createShader(type);\n \n // Load the shader source\n gl.shaderSource(shader, shaderSrc);\n \n // Compile the shader\n gl.compileShader(shader);\n \n // Check the compile status\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS) &&\n !gl.isContextLost()) {\n var infoLog = gl.getShaderInfoLog(shader);\n window.console.log(\"Error compiling shader:\\n\" + infoLog);\n gl.deleteShader(shader);\n return null;\n }\n return shader;\n}", "function loadShader(gl, type, source) {\n const shader = gl.createShader(type);\n\n // Send source to the shader\n gl.shaderSource(shader, source);\n // Compile shader program\n gl.compileShader(shader);\n\n // Alert if it failed\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS) && !gl.isContextLost()) {\n alert(\"Error occured compiling the \" \n + (type == gl.VERTEX_SHADER ? \"vertex\" : \"fragment\") + \" shader: \" \n + gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\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 }", "async load(id) {\n if (!id || !filter(id) || !fsSync.existsSync(id)) return;\n\n let source;\n try {\n source = fsSync.readFileSync(id, {encoding: 'utf8'});\n } catch (err) {\n this.warn(`Failed to load file '${id}' : ${err.message}`);\n return;\n }\n\n /** @type {GLSLStageName} */\n const stage = stageRegexes.find(([, regex]) => id.match(regex))?.[0];\n if (!stage) {\n this.error({message: `File '${id}' : extension did not match a shader stage.`});\n }\n\n if (pluginOptions.glslify) {\n try {\n source = await glslifyProcessSource(id, source, pluginOptions.glslifyOptions,\n (message) => this.error({message}));\n } catch (err) {\n this.error({message: `Error processing GLSL source with glslify:\\n${err.message}`});\n }\n }\n\n try {\n const result = await glslProcessSource(id, source, stage, pluginOptions);\n result.code = generateCode(result.code);\n return result;\n } catch (err) {\n this.error({message: `Error processing GLSL source:\\n${err.message}`});\n }\n }", "function getShaderName(_ref) {\n var id = _ref.id,\n source = _ref.source,\n type = _ref.type;\n\n var injectShaderName = id && typeof id === 'string' && source.indexOf('SHADER_NAME') === -1;\n return injectShaderName ? '\\n#define SHADER_NAME ' + id + '_' + SHADER_TYPE[type] + '\\n\\n' : '';\n}", "function loadShader(type, gl, source) {\n var glType = type === 'VERTEX' ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER; // Creating the shader\n\n var shader = gl.createShader(glType); // Loading source\n\n gl.shaderSource(shader, source); // Compiling the shader\n\n gl.compileShader(shader); // Retrieving compilation status\n\n var successfullyCompiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); // Throwing if something went awry\n\n if (!successfullyCompiled) {\n var infoLog = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(\"sigma/renderers/weblg/shaders/utils.loadShader: error while compiling the shader:\\n\".concat(infoLog, \"\\n\").concat(source));\n }\n\n return shader;\n}", "function create_shader(gl, type, string) {\r\n\tlet shader = gl.createShader(type)\r\n\tgl.shaderSource(shader, string)\r\n\tgl.compileShader(shader)\r\n\tlet success = gl.getShaderParameter(shader, gl.COMPILE_STATUS)\r\n\t\r\n\tif (success) {\r\n\t\treturn shader\r\n\t}\r\n\r\n\tif (!success) { // log errors\r\n\t\tconsole.log(gl.getShaderInfoLog(shader))\r\n\t\tgl.deleteShader(shader) // clean up\r\n\t}\r\n}", "static domShaderProgram(gl,vectID,fragID,doValidate){\n\t\tvar vShaderTxt\t= ShaderUtil.domShaderSrc(vectID);\t\t\t\t\t\t\t\tif(!vShaderTxt)\treturn null;\n\t\tvar fShaderTxt\t= ShaderUtil.domShaderSrc(fragID);\t\t\t\t\t\t\t\tif(!fShaderTxt)\treturn null;\n\t\tvar vShader\t\t= ShaderUtil.createShader(gl,vShaderTxt,gl.VERTEX_SHADER);\t\tif(!vShader)\treturn null;\n\t\tvar fShader\t\t= ShaderUtil.createShader(gl,fShaderTxt,gl.FRAGMENT_SHADER);\tif(!fShader){\tgl.deleteShader(vShader); return null; }\n\n\t\treturn ShaderUtil.createProgram(gl,vShader,fShader,true);\n\t}", "function createShader(gl, str, type)\n{\n let shader;\n\n // Checking the type of shader\n if (type == \"fragment\") {\n shader = gl.createShader(gl.FRAGMENT_SHADER);\n } else if (type == \"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\n return shader;\n}", "function ky__loadshdr(type,source){\n //create the shader\n var shader=ky__gl.createShader(type);\n //link it with the GLSL code.\n ky__gl.shaderSource(shader,source);\n //get it ready for drawing\n ky__gl.compileShader(shader);\n //ommit it.\n return shader;\n}", "function loadShader( _gl, _shaderSrc, canvas ) {\n\n\tvar vertString = \"\";\n\n\tif(_shaderSrc.vertURL){\n\t\tvertString = fetchHTTP( _shaderSrc.vertURL );\n\t} else {\n vertString =\n\"attribute mediump vec2 a_position;\\n\\\nattribute mediump vec2 a_texcoord;\\n\\\nvarying mediump vec2 CoronaTexCoord;\\n\\\nvoid main() {\\n\\\ngl_Position = vec4(a_position, 0.0, 1.0);\\n\\\nCoronaTexCoord = a_texcoord;\\n\\\n}\\n\\\n\";\n\t}\n\n\tvar fragString = \"\\\n#define P_DEFAULT highp\\n\\\n#define P_RANDOM highp\\n\\\n#define P_POSITION mediump\\n\\\n#define P_NORMAL mediump\\n\\\n#define P_UV mediump\\n\\\n#define P_COLOR lowp\\n\\\n#define FRAGMENT_SHADER_SUPPORTS_HIGHP 1\\n\\\nvarying mediump vec2 CoronaTexCoord; uniform P_RANDOM vec4 v_ColorScale; uniform P_RANDOM vec4 CoronaVertexUserData; uniform highp vec2 u_full_resolution;uniform sampler2D CoronaSampler0;uniform sampler2D CoronaSampler1;uniform highp vec2 u_mouse;uniform highp float CoronaTotalTime; \\\nhighp vec4 CoronaColorScale(highp vec4 c) { return v_ColorScale*c; } P_DEFAULT float CoronaDeltaTime=0.02; uniform P_UV vec4 CoronaTexelSize; P_POSITION vec2 CoronaContentScale = vec2(1.0,1.0); \\n\\\nP_COLOR vec4 FragmentKernel( P_UV vec2 position );\\nvoid main(){gl_FragColor = FragmentKernel(CoronaTexCoord);}\\n\";\n\n\terrorLineOffset = fragString.split(/\\r\\n|\\r|\\n/).length\n\n\n if (_shaderSrc.fragSTR){\n\t\tfragString += _shaderSrc.fragSTR;\n\t} else if(_shaderSrc.fragURL){\n\t\tfragString += fetchHTTP( _shaderSrc.fragURL );\n\t} else {\n\t\tfragString += \"P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord ){P_COLOR vec4 ret = vec4(texCoord.x, texCoord.y, abs(sin(CoronaTotalTime)), 1); return CoronaColorScale(ret);}\";\n\t}\n\n\tvar vertexShader = createShader(_gl, vertString, _gl.VERTEX_SHADER, canvas);\n\tvar fragmentShader = createShader(_gl, fragString , _gl.FRAGMENT_SHADER, canvas);\n\n\tif(!fragmentShader){\n\t\tfragmentShader = createShader(_gl, \"void main(){\\n\\\n\tgl_FragColor = vec4(1.0);\\n\\\n}\" , _gl.FRAGMENT_SHADER, canvas);\n\t}\n\n\t// Create and use program\n\tvar program = createProgram( _gl, [vertexShader, fragmentShader]);\n\t_gl.useProgram(program);\n\n\t// Delete shaders\n\t// _gl.detachShader(program, vertexShader);\n // _gl.detachShader(program, fragmentShader);\n // _gl.deleteShader(vertexShader);\n // _gl.deleteShader(fragmentShader);\n\n\treturn program;\n}", "function loadShader(type, source) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n if (type === gl.VERTEX_SHADER) {\n throw new Error(`(WebGL vertex shader) ${gl.getShaderInfoLog(shader)}`);\n } else if (type === gl.FRAGMENT_SHADER) {\n throw new Error(`(WebGL fragment shader) ${gl.getShaderInfoLog(shader)}`);\n }\n }\n\n return shader;\n }", "function SetShader(shaderId : int){\n\tvar ShaderName : String[] = new String[2];\n\tShaderName[0] = \"Specular\";\n\tShaderName[1] = \"Diffuse\";\n\t\n\tfor(var i = 0; i < meshData.Length; i++){\n\t\tvar skinnedMeshData : SkinnedMeshRenderer = meshData[i].GetComponent(SkinnedMeshRenderer);\n\t\tif(skinnedMeshData){\n\t\t\tskinnedMeshData.material.shader = Shader.Find(ShaderName[shaderId]);\n\t\t}\n\t\telse{\n\t\t\tmeshData[i].GetComponent(MeshRenderer).material.shader = Shader.Find(ShaderName[shaderId]);\n\t\t}\n\t}\n}", "function getShaderName(shader) {\n var SHADER_NAME_REGEXP = /#define[\\s*]SHADER_NAME[\\s*]([A-Za-z0-9_-]+)[\\s*]/;\n var match = shader.match(SHADER_NAME_REGEXP);\n return match ? match[1] : 'unnamed';\n}", "function getShaderModule(moduleOrName) {\n // Check if \"inline\" module\n if (typeof moduleOrName !== 'string') {\n var _shaderModule = moduleOrName;\n __WEBPACK_IMPORTED_MODULE_0_assert___default()(typeof _shaderModule.name === 'string');\n registerShaderModule(_shaderModule, { ignoreMultipleRegistrations: true });\n return _shaderModule;\n }\n\n // Look up module\n var shaderModule = shaderModules[moduleOrName];\n if (!shaderModule) {\n // console.log(`${moduleOrName} not in registered modules:`, shaderModules);\n __WEBPACK_IMPORTED_MODULE_0_assert___default()(false, 'Unknown shader module ' + moduleOrName);\n }\n return shaderModule;\n}", "function initShaderProgram(gl) {\n const vsh = loadShader(gl, gl.VERTEX_SHADER, vsh_src);\n const fsh = loadShader(gl, gl.FRAGMENT_SHADER, fsh_src);\n\n // Create the shader program\n const shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vsh);\n gl.attachShader(shaderProgram, fsh);\n gl.linkProgram(shaderProgram);\n\n // Check for errors in setup\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert('Shader program initialization failed: ' + gl.getProgramInfoLog(shaderProgram));\n return;\n }\n \n return shaderProgram;\n}", "get vertex_shader() {\n let dropdown_val = $(\"#vertex-shader\").find(\":selected\").val();\n let index = parseInt(dropdown_val);\n return this.shader_lib.vertex_shaders[index];\n }", "createProgramFromScriptElements(gl, vertexScriptId, fragmentScriptId) {\n let vshader = this.createShaderFromScript(gl, vertexScriptId, \"vertex\");\n let fshader = this.createShaderFromScript(gl, fragmentScriptId, \"fragment\");\n\n if (isObjectAssigned(vshader) && isObjectAssigned(fshader)) {\n return this.createProgram(gl, vshader, fshader);\n } else {\n this._logger.warn(\"Could not create program because scripts could not be compiled, discarding..\");\n }\n\n // clean up shaders\n gl.deleteShader(vshader);\n gl.deleteShader(fshader);\n\n return null;\n }", "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}", "static createShader(gl,src,type){\n\t\tvar shader = gl.createShader(type);\n\t\tgl.shaderSource(shader,src);\n\t\tgl.compileShader(shader);\n\n\t\t//Get Error data if shader failed compiling\n\t\tif(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)){\n\t\t\tconsole.error(\"Error compiling shader : \" + src, gl.getShaderInfoLog(shader));\n\t\t\tgl.deleteShader(shader);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn shader;\n\t}", "static createShader(gl, src, type) {\n var shader = gl.createShader(type);\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n\n //Get Error data if shader failed compiling\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n console.error(\"Error compiling shader : \" + src, gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n }", "getShader() {\n return this.shaderType;\n }", "create(id, vShader, fShader) {\n let shader = new Shader(vShader, fShader);\n this.shaders.set(id, shader);\n }", "function createShader(main, source, type) {\n var gl = main.gl;\n\n var shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n\n if (!compiled) {\n // Something went wrong during compilation; get the error\n lastError = gl.getShaderInfoLog(shader);\n console.error('*** Error compiling shader ' + shader + ':' + lastError);\n main.trigger('error', { shader: shader, source: source, type: type, error: lastError });\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}", "static compileShader(src,type){\n\t\tvar shader = gl.ctx.createShader(type);\n\t\tgl.ctx.shaderSource(shader,src);\n\t\tgl.ctx.compileShader(shader);\n\n\t\t//Get Error data if shader failed compiling\n\t\tif(!gl.ctx.getShaderParameter(shader, gl.ctx.COMPILE_STATUS)){\n\t\t\tconsole.error(\"Error compiling shader : \" + src, gl.ctx.getShaderInfoLog(shader));\n\t\t\tgl.ctx.deleteShader(shader);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn shader;\n\t}", "function createShader (gl, type, source)\n{\n var shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n \n var success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (success)\n {return shader;}\n\n console.log(shader);\n\n console.log(gl.getShaderInfoLog(shader));\n gl.deleteShader(shader);\n}", "function Shader()\n {\n var program_;\n var uniforms_;\n var attributes_;\n var samplerSlots_;\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 }", "function getScriptObject(id){\r\n return GRP.scripts[id];\r\n /*for (var i = 0, len = GRP.scripts.length; i < len; i++) {\r\n var script = GRP.scripts[i];\r\n if (script.id == id) {\r\n return script;\r\n }\r\n }\r\n return null;*/\r\n}", "function initShaderProgram(gl, vsSource, fsSource) {\n\tconst vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\n\tconst fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\n\n\n\t// Create the shader program\n\tconst shaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\n\t// If creating the shader program failed, alert\n\tif (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\t\talert('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram));\n\t\treturn null;\n\t}\n\n\treturn shaderProgram;\n}", "function initShaderProgram(gl, vsSource, fsSource) {\r\n const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource);\r\n const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource);\r\n\r\n // Create the shader program\r\n\r\n const 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: ' + gl.getProgramInfoLog(shaderProgram));\r\n return null;\r\n }\r\n\r\n return shaderProgram;\r\n}", "createShader(src,type){\n\t\tvar shader = this.ctx.createShader(type);\n\t\tthis.ctx.shaderSource(shader,src);\n\t\tthis.ctx.compileShader(shader);\n\n\t\t//Get Error data if shader failed compiling\n\t\tif(!this.ctx.getShaderParameter(shader, this.ctx.COMPILE_STATUS)){\n\t\t\tconsole.error(\"Error compiling shader : \" + src, this.ctx.getShaderInfoLog(shader));\n\t\t\tthis.ctx.deleteShader(shader);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn shader;\n\t}" ]
[ "0.84481615", "0.8419941", "0.8396628", "0.8378928", "0.8378437", "0.83659244", "0.8363262", "0.83575743", "0.8341929", "0.8324276", "0.83045965", "0.83014584", "0.8236277", "0.8213277", "0.81736225", "0.8150158", "0.8119269", "0.80990374", "0.7999891", "0.7946503", "0.789729", "0.78440356", "0.7842041", "0.7670424", "0.76696426", "0.76393145", "0.75946", "0.7463135", "0.74049735", "0.7080276", "0.698639", "0.68953675", "0.6854277", "0.6748769", "0.6704687", "0.6676891", "0.66742224", "0.667107", "0.6651784", "0.6649647", "0.6620971", "0.6616207", "0.65999746", "0.65966016", "0.65966016", "0.6591612", "0.6591267", "0.6589633", "0.65891606", "0.6576479", "0.65728223", "0.6549206", "0.6549206", "0.6549206", "0.6549206", "0.6549206", "0.6549206", "0.6549206", "0.6549206", "0.6549206", "0.6546342", "0.6545504", "0.65398717", "0.6518924", "0.64746016", "0.6422515", "0.64214396", "0.6418197", "0.6378241", "0.6363825", "0.6334687", "0.6289562", "0.6274739", "0.62586266", "0.6237336", "0.62276024", "0.62182367", "0.61801744", "0.61303836", "0.6130169", "0.5931074", "0.5924667", "0.5891667", "0.5873579", "0.58610713", "0.5837407", "0.5836044", "0.58232546", "0.5817359", "0.5816283", "0.5795247", "0.578644", "0.5783488", "0.57758373", "0.57745045", "0.57614005", "0.5734645", "0.5725931", "0.5705214", "0.56952184" ]
0.84897995
0
setMatrixUniforms specify the matrix values of uniform variables
function setMatrixUniforms() { //send the uniform matrices onto the shader (i.e. pMatrix->shaderProgram.pMatrixUniform etc.) gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix); gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix); var normalMatrix=mat3.create(); mat3.normalFromMat4(normalMatrix,mvMatrix); //calculate a 3x3 normal matrix (transpose inverse) from a 4x4 matrix gl.uniformMatrix3fv(shaderProgram.nMatrixUniform,false,normalMatrix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMatrixUniforms() {\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function setMatrixUniforms() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n}", "function setMatrixUniforms() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n}", "function setMatrixUniforms() {\n\tgl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n\tgl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function setMatrixUniforms() {\r\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\r\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n}", "function setMatrixUniforms() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n }", "function setMatrixUniforms() {\r\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n}", "function setMatrixUniforms() {\n gl.useProgram(shaderProgram)\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix)\n mat3.fromMat4(nMatrix,mvMatrix)\n mat3.transpose(nMatrix,nMatrix)\n mat3.invert(nMatrix,nMatrix)\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix)\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix)\n gl.uniform1f(shaderProgram.ReflectToggle, Toggle)\n gl.uniformMatrix4fv(shaderProgram.normals,false, rot)\n}", "function setMatrixUniforms() {\n\tuploadModelViewMatrixToShader();\n\tuploadNormalMatrixToShader();\n\tuploadProjectionMatrixToShader();\n}", "function setMatrixUniforms() {\n\tuploadModelViewMatrixToShader();\n\tuploadNormalMatrixToShader();\n\tuploadProjectionMatrixToShader();\n}", "function setMatrixUniforms() {\n uploadModelViewMatrixToShader();\n uploadNormalMatrixToShader();\n uploadProjectionMatrixToShader();\n}", "function setMatrixUniforms() {\n uploadModelViewMatrixToShader();\n uploadNormalMatrixToShader();\n uploadProjectionMatrixToShader();\n}", "function setMatrixUniforms() {\n uploadModelViewMatrixToShader();\n uploadNormalMatrixToShader();\n uploadProjectionMatrixToShader();\n}", "function setMatrixUniforms() {\n uploadModelViewMatrixToShader();\n uploadNormalMatrixToShader();\n uploadProjectionMatrixToShader();\n}", "function setMatrixUniforms() {\r\n uploadModelViewMatrixToShader();\r\n uploadNormalMatrixToShader();\r\n uploadProjectionMatrixToShader();\r\n}", "function setMatrixUniforms() {\r\n uploadModelViewMatrixToShader();\r\n uploadNormalMatrixToShader();\r\n uploadProjectionMatrixToShader();\r\n}", "function setMatrixUniforms() {\r\n uploadModelViewMatrixToShader();\r\n uploadNormalMatrixToShader();\r\n uploadProjectionMatrixToShader();\r\n}", "function setMatrixUniforms() {\n uploadModelViewMatrixToShader();\n uploadProjectionMatrixToShader();\n \n}", "function setMatrixUniforms(mvMatrix, pMatrix, normalMatrix)\n{\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n mat3.normalFromMat4(normalMatrix, mvMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, normalMatrix);\n}", "function setMatrixUniforms( )\n{\n\n // Pass the vertex shader the projection matrix and the model-view matrix.\n\n gl.uniformMatrix4fv( shaderProgram.pMatrixUniform, false, pMatrix );\n gl.uniformMatrix4fv( shaderProgram.mvMatrixUniform, false, mvMatrix );\n\n // Pass the vertex normal matrix to the shader so it can compute the lighting calculations.\n\n var normalMatrix = mat3.create( );\n mat3.normalFromMat4( normalMatrix, mvMatrix );\n gl.uniformMatrix3fv( shaderProgram.nMatrixUniform, false, normalMatrix );\n\n}", "function setMatrixUniforms(program){\r\n\tctx.uniformMatrix4fv(program.uPMatrix, false, pMatrix);\r\n\tctx.uniformMatrix4fv(program.uMVMatrix, false, mvMatrix);\r\n}", "function _setMatrixUniforms(pMatrix, mvMatrix) {\r\n\t\t_gl.uniformMatrix4fv(_shaderProgram.pMatrixUniform, false, pMatrix);\r\n\t\t_gl.uniformMatrix4fv(_shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n\r\n\t\t// TODO: Lighting Shader Only\r\n\t\tvar normalMatrix = mat3.create();\r\n\t\tmat4.toInverseMat3(mvMatrix, normalMatrix);\r\n\t\tmat3.transpose(normalMatrix);\r\n\t\t_gl.uniformMatrix3fv(_shaderProgram.nMatrixUniform, false, normalMatrix);\r\n\t}", "function setMatrixUniforms() {\n uploadMVMatrix();\n uploadPMatrix();\n uploadNMatrix();\n}", "setMatrixUniforms() {\n this.calculateNormal();\n this.gl.uniformMatrix4fv(this.program.uModelViewMatrix, false, this.modelViewMatrix);\n this.gl.uniformMatrix4fv(this.program.uProjectionMatrix, false, this.projectionMatrix);\n this.gl.uniformMatrix4fv(this.program.uNormalMatrix, false, this.normalMatrix);\n }", "setMatrixUniforms()\n\t{\n\t\t\tmat4.identity(mvMatrix);\n\t\t\tmat4.translate(mvMatrix, distCENTER);\n\t\t\tmat4.multiply(mvMatrix, rotMatrix);\n\n\t\t\t// mat4.identity(this.rMatrix);\n\t\t\t// mat4.identity(this.tMatrix);\n\t\t\t// mat4.translate(this.tMatrix, [0, 0.5, 0]);\n\t\t\t// mat4.rotate(this.rMatrix, this.rotObjY, [0, 0, 1]);\n\t\t\t// mat4.rotate(this.rMatrix, this.rotObjX, [1, 0, 0]);\n\n\t\t\tgl.uniformMatrix4fv(this.shader.rMatrixUniform, false, rotMatrix);\n\t\t\tgl.uniformMatrix4fv(this.shader.mvMatrixUniform, false, mvMatrix);\n\t\t\tgl.uniformMatrix4fv(this.shader.pMatrixUniform, false, pMatrix);\n\t\t\tgl.uniformMatrix4fv(this.shader.rObjMatrixUniform, false, this.rMatrix);\n\t\t\tgl.uniformMatrix4fv(this.shader.tObjMatrixUniform, false, this.tMatrix);\n\t}", "function left_foot_setMatrixUniforms() {\n //send the uniform matrices onto the shader (i.e. pMatrix->shaderProgram.pMatrixUniform etc.)\n left_foot_gl.uniformMatrix4fv(left_foot_shaderProgram.pMatrixUniform, false, left_foot_pMatrix);\n left_foot_gl.uniformMatrix4fv(left_foot_shaderProgram.mvMatrixUniform, false, left_foot_mvMatrix); \n var normalMatrix=mat3.create();\n mat3.normalFromMat4(normalMatrix,left_foot_mvMatrix); //calculate a 3x3 normal matrix (transpose inverse) from a 4x4 matrix\n left_foot_gl.uniformMatrix3fv(left_foot_shaderProgram.nMatrixUniform,false,normalMatrix); }", "function setCubeMatrixUniforms(){\n gl.useProgram(SkyboxProgram)\n gl.uniformMatrix4fv(SkyboxProgram.cubeProjection, false, cubeP)\n gl.uniformMatrix4fv(SkyboxProgram.ModelVIew, false, Modelviewmatrix)\n gl.uniform1i( SkyboxProgram.skybox, 0)\n}", "function setModelViewMatrix(matrix)\r\n{\r\n gl.uniformMatrix4fv(shaderProgram.uModelViewMatrix, false, matrix);\r\n \r\n var normal_matrix = mat3.create();\r\n mat4.toInverseMat3(matrix, normal_matrix);\r\n mat3.transpose(normal_matrix);\r\n gl.uniformMatrix3fv(shaderProgram.uNormalMatrix, false, normal_matrix);\r\n}", "function loadUniformsMatrices ( uniforms, object ) {\r\n\r\n\t\t_gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object.modelViewMatrix.elements );\r\n\r\n\t\tif ( uniforms.normalMatrix ) {\r\n\r\n\t\t\t_gl.uniformMatrix3fv( uniforms.normalMatrix, false, object.normalMatrix.elements );\r\n\r\n\t\t}\r\n\r\n\t}", "function loadUniformsMatrices ( uniforms, object ) {\r\n\r\n\t\t\t_gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object.modelViewMatrix.elements );\r\n\r\n\t\t\tif ( uniforms.normalMatrix ) {\r\n\r\n\t\t\t\t_gl.uniformMatrix3fv( uniforms.normalMatrix, false, object.normalMatrix.elements );\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function loadUniformsMatrices ( uniforms, object ) {\r\n\r\n\t\t_gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );\r\n\r\n\t\tif ( uniforms.normalMatrix ) {\r\n\r\n\t\t\t_gl.uniformMatrix3fv( uniforms.normalMatrix, false, object._normalMatrix.elements );\r\n\r\n\t\t}\r\n\r\n\t}", "function loadUniformsMatrices ( uniforms, object ) {\n\n\t\t_gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );\n\n\t\tif ( uniforms.normalMatrix ) {\n\n\t\t\t_gl.uniformMatrix3fv( uniforms.normalMatrix, false, object._normalMatrix.elements );\n\n\t\t}\n\n\t}", "function loadUniformsMatrices ( uniforms, object ) {\n\n\t\t_gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );\n\n\t\tif ( uniforms.normalMatrix ) {\n\n\t\t\t_gl.uniformMatrix3fv( uniforms.normalMatrix, false, object._normalMatrix.elements );\n\n\t\t}\n\n\t}", "function loadUniformsMatrices ( uniforms, object ) {\n\n\t\t_gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );\n\n\t\tif ( uniforms.normalMatrix ) {\n\n\t\t\t_gl.uniformMatrix3fv( uniforms.normalMatrix, false, object._normalMatrix.elements );\n\n\t\t}\n\n\t}", "function loadUniformsMatrices ( uniforms, object ) {\n\n _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );\n\n if ( uniforms.normalMatrix ) {\n\n _gl.uniformMatrix3fv( uniforms.normalMatrix, false, object._normalMatrix.elements );\n\n }\n\n }", "function setUniforms(program, uniforms) {\n for(var name in uniforms) {\n var value = uniforms[name];\n var location = gl.getUniformLocation(program, name);\n if(location == null) continue;\n if(value instanceof THREE.Vector2) {\n //console.log(name + \": \" + \"[\" + value.x + \", \" + value.y + \"]\");\n gl.uniform2fv(location, new Float32Array([value.x, value.y]));\n } else if(value instanceof THREE.Vector3) {\n //console.log(name + \": \" + \"[\" + value.x + \", \" + value.y + \", \" + value.z + \"]\");\n gl.uniform3fv(location, new Float32Array([value.x, value.y, value.z]));\n } else if(value instanceof THREE.Color) {\n //console.log(name + \": \" + \"[\" + value.r + \", \" + value.g + \", \" + value.b + \"]\");\n gl.uniform3fv(location, new Float32Array([value.r, value.g, value.b]));\n } else if(value instanceof THREE.Matrix4) {\n //console.log(name + \": \" + value.toArray());\n gl.uniformMatrix4fv(location, false, new Float32Array(value.toArray()));\n } else {\n //console.log(name + \": \" + value);\n gl.uniform1f(location, value);\n }\n }\n}", "setMatrix(m) {\n\tthis.matrix = m;\n }", "function uploadNormalMatrixToShader() {\r\n mat3.fromMat4(nMatrix,mvMatrix);\r\n mat3.transpose(nMatrix,nMatrix);\r\n mat3.invert(nMatrix,nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\r\n}", "function uploadNormalMatrixToShader() {\r\n mat3.fromMat4(nMatrix,mvMatrix);\r\n mat3.transpose(nMatrix,nMatrix);\r\n mat3.invert(nMatrix,nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\r\n}", "function uploadNormalMatrixToShader() {\r\n mat3.fromMat4(nMatrix,mvMatrix);\r\n mat3.transpose(nMatrix,nMatrix);\r\n mat3.invert(nMatrix,nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\r\n}", "function uploadNormalMatrixToShader() {\n\tnMatrix = mvMatrix\n\tmat4.transpose(nMatrix,nMatrix);\n\tmat4.invert(nMatrix,nMatrix);\n\tgl.uniformMatrix4fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix, mvMatrix);\n mat3.transpose(nMatrix, nMatrix);\n mat3.invert(nMatrix, nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function uploadMVMatrix(){\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function uploadNormalMatrixToShader() {\n glMatrix.mat3.fromMat4(nMatrix,mvMatrix);\n glMatrix.mat3.transpose(nMatrix,nMatrix);\n glMatrix.mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function setupVertexShaderMatrix2(){\n var viewMatrixUniform = gl.getUniformLocation(glProgram_helicoptero, \"uVMatrix\");\n var projMatrixUniform = gl.getUniformLocation(glProgram_helicoptero, \"uPMatrix\");\n var normalMatrixUniform = gl.getUniformLocation(glProgram_helicoptero, \"uNMatrix\");\n\n mat3.fromMat4(normalMatrix,matriz_model); // normalMatrix= (inversa(traspuesta(matrizModelado)));\n\n mat3.invert(normalMatrix, normalMatrix);\n mat3.transpose(normalMatrix,normalMatrix);\n\n \n gl.uniformMatrix4fv(viewMatrixUniform, false, viewMatrix);\n gl.uniformMatrix4fv(projMatrixUniform, false, projMatrix);\n //gl.uniformMatrix4fv(normalMatrixUniform, false, normalMatrix);\n gl.uniform3f(glProgram_helicoptero.directionalColorUniform, 1.0, 1.0, 0.8);\n var lightPosition = [0.0,300.0, 10000.0]; \n gl.uniform3fv(glProgram_helicoptero.lightingDirectionUniform, lightPosition); \n}", "_initMatrices() {\n // create our matrices, they will be set after\n const matrix = new Mat4();\n this._matrices = {\n world: {\n // world matrix (global transformation)\n matrix: matrix,\n },\n modelView: {\n // model view matrix (world matrix multiplied by camera view matrix)\n name: \"uMVMatrix\",\n matrix: matrix,\n location: this.gl.getUniformLocation(this._program.program, \"uMVMatrix\"),\n },\n projection: {\n // camera projection matrix\n name: \"uPMatrix\",\n matrix: matrix,\n location: this.gl.getUniformLocation(this._program.program, \"uPMatrix\"),\n },\n modelViewProjection: {\n // model view projection matrix (model view matrix multiplied by projection)\n matrix: matrix,\n }\n };\n }", "function setAllMatrices() {\n gl.uniformMatrix4fv(projectionMatrixLoc, false, flatten(projectionMatrix));\n setMV();\n\n}", "function setAllMatrices() {\n gl.uniformMatrix4fv(projectionMatrixLoc, false, flatten(projectionMatrix));\n setMV();\n\n}", "function setupVertexShaderMatrix(){ \n var viewMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uVMatrix\");\n var projMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uPMatrix\");\n var modMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uMMatrix\");\n\n var normalMatrix2 = mat3.create();\n mat3.fromMat4(normalMatrix2,matriz_model_terreno); // normalMatrix= (inversa(traspuesta(matrizModelado)));\n\n mat3.invert(normalMatrix2, normalMatrix2);\n mat3.transpose(normalMatrix2,normalMatrix2);\n\n //gl.uniformMatrix3fv(glProgram_terreno.nMatrixUniform, false, normalMatrix2);\n \n gl.uniformMatrix4fv(viewMatrixUniform, false, viewMatrix);\n gl.uniformMatrix4fv(projMatrixUniform, false, projMatrix);\n\n gl.uniform1f(glProgram_terreno.frameUniform, time/10.0 );\n gl.uniform3f(glProgram_terreno.ambientColorUniform, 0.0, 0.0, 0.0 );\n gl.uniform3f(glProgram_terreno.directionalColorUniform, 1.0, 1.0, 0.8);\n gl.uniform3f(glProgram_terreno.directionalColorUniform2, 0.2, 0.2, 0.2);\n gl.uniform1i(glProgram_terreno.useLightingUniform,true);\n\n var lightPosition = [0.0,0.0, -1.0]; \n var lightPosition2 = [0.0,300.0, 0.0]; \n gl.uniform3fv(glProgram_terreno.lightingDirectionUniform, lightPosition); \n gl.uniform3fv(glProgram_terreno.lightingDirectionUniform2, lightPosition2);\n \n}", "setUniform(name, value) {\n this.uniforms[name] = value;\n }", "setUniforms(uniformArray){\n let uniformLocationNames = this.vertexShader.getUniformLocationNames().concat(this.fragmentShader.getUniformLocationNames());\n\n let uniforms = [];\n uniforms.push(...uniformArray.getUniversalUniform());\n uniforms.push(...uniformArray.getPerObjectUniform());\n\n for(let name of uniformLocationNames){\n\n if(name.slice(0, name.length - 1) === \"u_sampler\"){\n gl.uniform1i(this.uniformLocations[name + \"Loc\"], name.substr(name.length - 1, 1));\n continue;\n }\n\n let index = this.findIndexUniform(name, uniforms);\n if(index === -1) throw Error(\"Property \" + name + \" not found in uniformArray object\");\n\n if(uniforms[index].getProperty().search(\"1\") != -1){\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], uniforms[index].getValue());\n\n } else if(uniforms[index].getProperty().search(\"2\") != -1) {\n\n let valueArray = uniforms[index].getValue();\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], valueArray[0], valueArray[1]);\n } else if(uniforms[index].getProperty().search(\"3fv\") != -1){\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], false, uniforms[index].getValue());\n\n } else if(uniforms[index].getProperty().search(\"3f\") != -1){\n let valueArray = uniforms[index].getValue();\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], valueArray[0], valueArray[1], valueArray[2]);\n\n } else if(uniforms[index].getProperty().search(\"4fv\") != -1){\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], false, uniforms[index].getValue());\n }\n }\n }", "function uploadModelViewMatrixToShader() {\r\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n}", "function uploadNormalMatrixToShader() {\n\t\n\tmat3.fromMat4(nMatrix,mvMatrix);\n\n\t//the normal matrix is the inverse transpose of the mvMatrix.\n\tmat3.transpose(nMatrix,nMatrix);\n\tmat3.invert(nMatrix,nMatrix);\n\n\t//this line send the nMatrix to the shader\n\tgl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function uploadModelViewMatrixToShader() {\r\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n}", "function uploadModelViewMatrixToShader() {\r\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n}", "function setMV() {\n modelViewMatrix = mult(viewMatrix, modelMatrix);\n gl.uniformMatrix4fv(modelViewMatrixLoc, false, flatten(modelViewMatrix));\n normalMatrix = inverseTranspose(modelViewMatrix);\n gl.uniformMatrix4fv(normalMatrixLoc, false, flatten(normalMatrix));\n}", "function setMV() {\n modelViewMatrix = mult(viewMatrix, modelMatrix);\n gl.uniformMatrix4fv(modelViewMatrixLoc, false, flatten(modelViewMatrix));\n normalMatrix = inverseTranspose(modelViewMatrix);\n gl.uniformMatrix4fv(normalMatrixLoc, false, flatten(normalMatrix));\n}", "function uploadModelViewMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function uploadModelViewMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function addUniforms(color)\n{\n uniforms.push({\n customColor: {type: \"v3\",\n value: color},\n customPointMatrix: {type: \"m4\",\n value: new THREE.Matrix4(1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0)},\n customNormalMatrix: {type: \"m4\",\n value: new THREE.Matrix4(1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0)}\n });\n return uniforms.length - 1;\n}", "function setupUniforms(gl, uniforms, vars) {\n const canvas = document.getElementById(\"canvas\");\n gl.uniform2f(uniforms.resolution, canvas.width, canvas.height);\n gl.uniform1f(uniforms.time, vars.time);\n gl.uniform2f(uniforms.mouse, 0, 0);\n gl.uniform1i(uniforms.tex, 0);\n}", "function uploadModelViewMatrixToShader() {\r\n\tgl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n}", "function uploadModelViewMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function uploadModelViewMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function uploadModelViewMatrixToShader() {\n\tgl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function uploadModelViewMatrixToShader() {\n\tgl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n}", "function setLightPosition( u_position_loc, modelview, lightPosition ) {\n var transformedPosition = new Float32Array(4);\n vec4.transformMat4(transformedPosition, lightPosition, modelview);\n gl.uniform4fv(u_position_loc, transformedPosition);\n}", "_setPerspectiveMatrix() {\n // update our matrix uniform if we actually have updated its values\n if(this.camera._shouldUpdate) {\n this.renderer.useProgram(this._program);\n this.gl.uniformMatrix4fv(this._matrices.projection.location, false, this._matrices.projection.matrix.elements);\n }\n\n // reset camera shouldUpdate flag\n this.camera.cancelUpdate();\n }", "function setValue2fm( gl, v ) {\n\t\n\t\t\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\t\n\t\t}", "function uploadProjectionMatrixToShader() {\r\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, \r\n false, pMatrix);\r\n}", "function uploadProjectionMatrixToShader() {\r\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\r\n}", "function setValue2fm( gl, v ) {\n\n\t \tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n\t }", "function uploadProjectionMatrixToShader() {\r\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform,\r\n false, pMatrix);\r\n gl.uniformMatrix4fv(shaderProgram.inverseViewTransform, false, inverseViewTransform);\r\n}", "updateUniformValues() {\n this.scene.shaders[0].setUniformsValues({ uSampler: 0, uSampler2: 1 });\n this.scene.shaders[0].setUniformsValues({ normScale: this.heightScale });\n }", "function setValueM2a( gl, v ) {\n\n\t \tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n\t }", "function setValueM2a( gl, v ) {\n\t\n\t\t\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\t\n\t\t}", "function uploadProjectionMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, \n false, pMatrix);\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function setValueM2a( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n}", "function uploadProjectionMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform,\n false, pMatrix);\n}", "function uploadProjectionMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, \n false, pMatrix);\n}", "function uploadProjectionMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, \n false, pMatrix);\n}", "function setValue2fm( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n}", "function setValue2fm( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n}", "function setValue2fm( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n}", "function setValue2fm( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n}", "function setValue2fm( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n}", "function setValue2fm( gl, v ) {\n\n\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n}" ]
[ "0.87151825", "0.87052226", "0.87052226", "0.87020713", "0.8659143", "0.863722", "0.8621031", "0.8498454", "0.83971506", "0.83971506", "0.83271617", "0.83271617", "0.83271617", "0.83271617", "0.825695", "0.825695", "0.825695", "0.8234012", "0.82011503", "0.8197572", "0.8182771", "0.81696093", "0.81581277", "0.8056159", "0.7988679", "0.7425044", "0.6816259", "0.672904", "0.66577774", "0.66476935", "0.6623003", "0.66069525", "0.66069525", "0.66069525", "0.6592234", "0.6525284", "0.6408604", "0.63428307", "0.6325788", "0.6325788", "0.63100713", "0.62780195", "0.6277758", "0.6268615", "0.62538064", "0.62327856", "0.619611", "0.6185723", "0.6176715", "0.6176715", "0.6157442", "0.61221254", "0.6121928", "0.6106326", "0.61046517", "0.6075514", "0.6075514", "0.60647297", "0.60647297", "0.6058137", "0.6058137", "0.6053168", "0.605228", "0.605018", "0.6035708", "0.6035708", "0.60001725", "0.60001725", "0.5963191", "0.59105474", "0.5910119", "0.5890333", "0.5884441", "0.58830047", "0.58754677", "0.5856522", "0.5851178", "0.5831421", "0.5827751", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58246654", "0.58211255", "0.5819722", "0.5819722", "0.58156157", "0.58156157", "0.58156157", "0.58156157", "0.58156157", "0.58156157" ]
0.8300245
14
this is used to parse the profile
function url_base64_decode(str) { var output = str.replace('-', '+').replace('_', '/'); switch (output.length % 4) { case 0: break; case 2: output += '=='; break; case 3: output += '='; break; default: throw 'Illegal base64url string!'; } return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getProfile() {\n\t\treturn decode(this.getAccess());\n\t}", "async getInfoProfile() {\n\t\tthis.spinner.info('Get profile info!');\n\t\tthis.spinner.info('here');\n\t\tawait this.page.waitForSelector(element.numberPosts, {timeout: 5000});\n\t\tlet area_count_post = await this.page.$(element.numberPosts)\n\t\tlet numberPosts = await (await area_count_post.getProperty(\"innerText\")).jsonValue();\n\n\t\tthis.page.evaluate(async element => {\n\t\t\treturn {\n\t\t\talias: document.querySelector(element.alias).innerText,\n\t\t\tusername: document.querySelector(element.username).innerText,\n\t\t\tdescriptionProfile: document.querySelector(element.descriptionProfile)\n\t\t\t\t? document.querySelector(element.descriptionProfile).innerText\n\t\t\t\t: '',\n\t\t\turlImgProfile: document\n\t\t\t\t.querySelector(element.urlImgProfile)\n\t\t\t\t.getAttribute('src'),\n\t\t\twebsite: document.querySelector(element.website)\n\t\t\t\t? document.querySelector(element.website).innerText\n\t\t\t\t: null,\n\t\t\tnumberFollowers: document.querySelector(element.numberFollowers)\n\t\t\t\t.innerText,\n\t\t\tnumberFollowing: document.querySelector(element.numberFollowing)\n\t\t\t\t.innerText,\n\t\t\tprivate: !!document.querySelector(element.isPrivate),\n\t\t\tisOfficial: !!document.querySelector(element.isOfficial),\n\t\t\tnumberPosts: numberPosts\n\t\t};\n\t}, element);\n\t}", "function findProfiles() {}", "getProfile() {\n\t\treturn decode(this.getToken());\n\t}", "function parseLinkedinProfile(html, callback) {\n parsed_profile = new Array;\n\n full_name_array = getFullName(html).split(\" \");\n\n // First name\n parsed_profile['first_name'] = full_name_array[0];\n full_name_array.shift();\n\n // Last name\n parsed_profile['last_name'] = full_name_array.join(\" \");\n\n // Position\n parsed_profile['position'] = getPosition(html);\n\n // Company name\n parsed_profile['last_company'] = getLastCompany(html);\n\n // Company path\n parsed_profile['last_company_path'] = getLastCompanyPath(html);\n\n // Main content\n parsed_profile['profile_main_content'] = getMainProfileContent(html);\n\n // LinkedIn URL\n parsed_profile['linkedin_url'] = getLinkedinUrl(html);\n\n // Country code\n parsed_profile['country_code'] = getCountryCode(html);\n\n return callback(parsed_profile);\n}", "function getProfileData() {\n // obtener los datos del usuario al iniciar sesión\n IN.API.Raw(\"people/~:(first-name,last-name,id,num-connections,picture-url,location,positions,summary,public-profile-url)\").result(onSuccess).error(onError); \n }", "whichProfile() {\n\t\tthis.profile = 'particle';\n\t\tthis.readProfileData();\n\t}", "function Profile() {\n\t}", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"positions:(title)\", \"educations\", \"first-name\", \"last-name\", \"industry\", \"picture-url\", \"public-profile-url\", \"email-address\").result(displayProfileData).error(onError);\n }", "loadProfile() {\n\t\tconst url = this.user.url;\n\t\treturn solid.fetch(url)\n\t\t\t.then(res => Promise.all([res.text(), res.headers.get('Content-Type')]))\n\t\t\t.then(([contents, contentType]) => loadProfile({ url, contents, contentType }))\n\t\t\t.then(profile => {\n\t\t\t\tObject.assign(this.user, profile);\n\t\t\t\tif (profile.accountName)\n\t\t\t\t\tthis.id = profile.accountName;\n\t\t\t\treturn profile;\n\t\t\t});\n\t}", "function getProfiles() {\n const sel = 'span[itemtype=\"https://schema.org/Person\"] a';\n return _.map($(sel), function (el) {\n return {\n target: el,\n href: el.href,\n name: el.innerText,\n profile: el.href.match(/\\w+\\-\\d+.*$/)[0] // TODO: this fails on last name with space\n };\n });\n}", "get userProfile() {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n }", "function ProfileData() {\r\n}", "get profile () {\n\t\treturn this._profile;\n\t}", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "get userProfile() {\r\n return this.profileLoader.userProfile;\r\n }", "function extractProfileInfo(body, accessToken) {\r\n return new Promise(function(resolve, reject) {\r\n parseXML(body, function(err, obj) {\r\n if(err) {\r\n return reject(\"parse: \" + err);\r\n } else {\r\n try {\r\n var guid = obj.UserVO.userID[0];\r\n var userName = obj.UserVO.userBaseVO[0].userName[0];\r\n var nameInfo = obj.UserVO.userBaseVO[0].userBaseIndividualVO[0];\r\n var email = \"\";\r\n obj.UserVO.userIdentificationVO.forEach(function(x) {\r\n if(x.loginIDTypeCode[0] === \"003\") {\r\n email = x.loginID[0];\r\n }\r\n });\r\n var lname = (nameInfo ? nameInfo.familyName[0] : \" \");\r\n var fname = (nameInfo ? nameInfo.givenName[0] : \" \");\r\n var profileImg = \"\";\r\n if (obj.UserVO.userBaseVO[0].photographImageFileURLText) {\r\n profileImg = obj.UserVO.userBaseVO[0].photographImageFileURLText[0];\r\n }\r\n \r\n var profileJSON = {\r\n \"guid\": guid,\r\n \"name\": userName,\r\n \"email\": email,\r\n \"token\": accessToken,\r\n \"lastName\": (lname || \" \"),\r\n \"firstName\": (fname || \" \"),\r\n \"profileImg\": profileImg\r\n };\r\n genAccessToken(res, {user: profileJSON.guid, email: profileJSON.email, \r\n firstName: profileJSON.firstName, username: profileJSON.name});\r\n res.redirect(process.env.REDIRECT);\r\n //res.status(301).redirect('http://localhost:3000');\r\n return resolve(profileJSON);\r\n } catch(ex) {\r\n return reject(\"parse: \" + ex);\r\n }\r\n } \r\n });\r\n });\r\n }", "function Profile() {\r\n\tthis.fields = [\r\n\t\t\"LOGIN\", \"EMAIL\", \"NAME\", \"GENDER\", \"BIRTHDAY\", \"CITY\", \r\n \"ICQ\", \"URL\", \"PHOTO\", \"AVATAR\", \"ABOUT\", \"REGISTERED\", \"LAST_VISIT\",\r\n \"TELEGRAM_ID\"\r\n\t];\r\n\tthis.ServicePath = servicesPath + \"profile.service.php\";\r\n\tthis.Template = \"userdata\";\r\n\tthis.ClassName = \"Profile\";\t// Optimize?\r\n}", "function builtInProfiles () {\n new Profile('Kevin', '../img/monk.png', 'martial arts', '1F6212', knownArray, interestArray);\n new Profile('Austin', '../img/fighter.png', 'watching movies', '404040', ['Javascript', 'HTML', 'CSS'], ['Python', 'Ruby']);\n new Profile('Zach', '../img/wizzard.png', 'Anime', '49F3FF', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Ramon', '../img/monk.png', 'Racing motorsports', 'FF0000', ['Javascript', 'HTML', 'CSS'], ['Python']);\n new Profile('Sooz', '../img/rogue.png', 'Knitting', 'FF8C00', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Kris', '../img/rogue.png', 'reading', 'B51A1F', ['Javascript', 'Python'], ['Java']);\n new Profile('Judah', '../img/druid.jpg', 'Cooking', '000000', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Allie', '../img/cleric.png', 'Cooking', '29B0FF', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Carl', '../img/wizzard.png', 'Cooking', '0560dd', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Jose', '../img/rogue.png', 'Youtubing', 'af111c', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Michael', '../img/rogue.png', 'Youtubing', '000000', ['Javascript'], ['Javascript']);\n new Profile('Han', '../img/monk.png', 'Coding', '29B0FF', ['Javascript', 'HTML', 'CSS', 'Python', 'Java'], ['C++']);\n}", "function loadProfileCallback(obj) {\n profile = obj;\n\n // Filter the emails object to find the user's primary account, which might\n // not always be the first in the array. The filter() method supports IE9+.\n email = obj['emails'].filter(function(v) {\n return v.type === 'account'; // Filter out the primary email\n })[0].value; // get the email from the filtered results, should always be defined.\n displayProfile(profile);\n }", "function extract(authData) {\n\n let name = {first: \"\", last: \"\", display: \"\"};\n let profile = {\n // The private bits\n uid: authData.uid,\n provider: authData.providerData[0].providerId,\n newUser: true,\n email: authData.email,\n // Publicly readable info\n expose: {\n name: name,\n bio: \"\",\n image: \"\",\n achievements: []\n }\n };\n\n let provider = authData.providerData[0];\n let fullName = provider.displayName;\n profile.expose.name.first = fullName.split(' ').slice(0, -1).join(' ') || \"\";\n profile.expose.name.last = fullName.split(' ').slice(-1).join(' ') || \"\";\n profile.expose.name.display = provider.displayName || \"\";\n profile.expose.image = provider.photoURL || null;\n\n return profile;\n }", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"id\", \"first_name\", \"last_name\", \"num-connections\", \"email-address\", \"industry\", \"location\", \"picture-url\", \"public-profile-url\").result(onSuccess).error(onError);\n}", "get profile() {\n\t\treturn this.__profile;\n\t}", "get profile() {\n\t\treturn this.__profile;\n\t}", "GetProfile() {\n return this.m_profile;\n }", "getProfile() {\n return this.profile;\n }", "getProfile() {\n return this._profile;\n }", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n}", "function profileInfo(profileObject){\n var name;\n var species;\n var name1st;\n var species1st;\n for(var key in profileObject){\n// if (profileObject.hasOwnProperty(name) && profileObject.hasOwnProperty(species)){\n name = profileObject.name;\n name1st = name.charAt(0).toUpperCase() + name.slice(1);\n species = profileObject.species;\n species1st = species.charAt(0).toUpperCase() + species.slice(1);\n// }\n } \n return name1st + \" is a \" + species1st;\n}", "function getProfile(profileName, callback) {\n profilesFolder(function (err, profilesFolder) {\n if (err) {\n return callback(err)\n }\n\n var fileUri = path.join(profilesFolder, profileName + \".json\")\n fs.readFile(fileUri, function (err, content) {\n if (err) {\n return callback(err)\n }\n\n safeParse(content, callback)\n })\n })\n}", "function getProfile(profileId) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n if (profileId == profiles[i].id) {\r\n regexInput.value = profiles[i].regex;\r\n templateInput.value = profiles[i].template;\r\n globalCheckbox.checked = profiles[i].globalFlag;\r\n caseInsensitiveCheckbox.checked = profiles[i].caseInsensitiveFlag;\r\n multilineCheckbox.checked = profiles[i].multilineFlag;\r\n IgnoreHTMLCheckbox.checked = profiles[i].IgnoreHTML ? true : false;\r\n break;\r\n }\r\n }\r\n }, onError);\r\n}", "getProfile (start, end, width, depth, callback) {\n\t\t\tlet request = new Potree.ProfileRequest(start, end, width, depth, callback);\n\t\t\tthis.profileRequests.push(request);\n\t\t}", "function populateProperties(data) {\r\n properties = {\r\n favourites: findPropertyInResults(PROFILE_FAVOURITES_KEY, data.d.UserProfileProperties.results),\r\n settings: findPropertyInResults(PROFILE_SETTINGS_KEY, data.d.UserProfileProperties.results),\r\n layout: findPropertyInResults(PROFILE_LAYOUT_KEY, data.d.UserProfileProperties.results),\r\n };\r\n\r\n // attempt to decompress the UTF16 encoding on the original string value to get the original value(this will through an error on purpose if the profile property does not exist)\r\n properties.favourites = decompressProfilePropertyValue(properties.favourites);\r\n properties.settings = decompressProfilePropertyValue(properties.settings);\r\n properties.layout = decompressProfilePropertyValue(properties.layout);\r\n\r\n return properties;\r\n}", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"firstName\", \"lastName\", \"id\").result(onSuccess).error(onError);\n}", "static getProfile() {\n // Retrieves the profile data from localStorage\n const profile = localStorage.getItem('profile')\n return profile ? JSON.parse(localStorage.profile) : {}\n }", "function getProfileData() {\n\tIN.API.Raw(\"/people/~:(email-address)\").result(onSuccess).error(onError);\n}", "function loadProfileCallback(obj) {\n profile = obj;\n window.profile = obj;\n // Filter the emails object to find the user's primary account, which might\n // not always be the first in the array. The filter() method supports IE9+.\n email = obj['emails'].filter(function(v) {\n return v.type === 'account'; // Filter out the primary email\n })[0].value; // get the email from the filtered results, should always be defined.\n var displayName = profile['displayName'];\n displayProfile(profile);\n //Create account in ubm db\n createUBMUser(email, displayName, profile);\n}", "get profile() {\n return this._profile;\n }", "function getProfileData(){\n let headers = loadHeaders();\n callAPI(server + \"api/mdm/profiles/search\",headers,\"profilesData\"); //get main profiles list\n\n}", "async _getProfile () {\n try {\n var p = await profile.getProfile();\n this.setState({ profile: p });\n } catch (e) {\n console.error(e, e.stack);\n }\n }", "function buildProfile(samlResponse) {\n debug('buildProfile()');\n\n const samlConfig = app.authConfig;\n const profileConfig = samlConfig.profile;\n\n if (!profileConfig) {\n debug('There is no profile property in the saml configuration.');\n return { message: 'Profile configuration missing' };\n }\n\n const propNames = wickedSaml.getAttributeNames(samlResponse);\n debug('Profile property names:');\n debug(propNames);\n\n const profileModel = {};\n for (let i = 0; i < propNames.length; ++i) {\n const prop = propNames[i];\n profileModel[prop] = wickedSaml.getAttributeValue(samlResponse, prop);\n }\n\n const profile = {};\n for (let propName in profileConfig) {\n const propConfig = profileConfig[propName];\n profile[propName] = mustache.render(propConfig, profileModel);\n }\n debug('Built profile:');\n debug(profile);\n\n return profile;\n }", "function getProfile(person){\n\tprofileString = 'GetProfile=True&ProfileId='; \n\tif(person == 'MyProfile'){\n\t\tprofileString += $('#loggedInUser').text().substr(14,30);\n\t}\n\telse if(person == 'Instructor'){\n\t\tvar i=0;\n\t\tselectedRow.find('td').each(function(){\n\t\t\tif(i==0){\n\t\t\t\tprofileString += $(this).text();\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\t}\n\telse{\n\t\tprofileString += person;\n\t}\n\tprofileString += '&Profiles';\n\tdisplayPageInfo(profileString);\n}", "function SolidProfile (profileUrl, parsedProfile, response) {\n /**\n * Links to profile-related external resources such as the\n * Inbox location, storage locations, type registry indexes etc.\n * @property externalResources\n * @type Object\n */\n this.externalResources = {\n inbox: null,\n storage: [],\n typeIndexes: []\n }\n\n /**\n * Public Type registry index graph\n * @property typeIndexPublic\n * @type rdf.Graph\n */\n this.typeIndexPublic = rdf.graph()\n\n /**\n * Private Type registry index graph\n * @property typeIndexPrivate\n * @type rdf.Graph\n */\n this.typeIndexPrivate = rdf.graph()\n\n /**\n * Parsed graph of the WebID Profile document\n * @property parsedGraph\n * @type rdf.Graph\n */\n this.parsedGraph = rdf.graph()\n\n /**\n * SolidResponse instance from which this profile object was created.\n * Contains the raw profile source, the XHR object, etc.\n * @property response\n * @type SolidResponse\n */\n this.response = response\n\n /**\n * Links to \"see also\" profile documents. Typically loaded immediately\n * after retrieving the initial WebID Profile document.\n * @property relatedProfiles\n * @type Object\n */\n this.relatedProfiles = {\n preferences: [],\n sameAs: [],\n seeAlso: []\n }\n\n /**\n * WebId URL (the `foaf:primaryTopic` of the profile document)\n * @property webId\n * @type String\n */\n this.webId = null\n\n if (!profileUrl) {\n return\n }\n /**\n * Location of the base WebID Profile document (minus the hash fragment).\n * @property baseProfileUrl\n * @type String\n */\n this.baseProfileUrl = (profileUrl.indexOf('#') >= 0)\n ? profileUrl.slice(0, profileUrl.indexOf('#'))\n : profileUrl\n\n if (parsedProfile) {\n this.initWebId(parsedProfile)\n this.appendFromGraph(parsedProfile, this.baseProfileUrl)\n }\n}", "function parseDetails(html) {\r\n var details = new MatchDetails();\r\n var p = new SimpleParser(html);\r\n if (html.indexOf(ACCOUNT_CLOSED) > 0) {\r\n details.noLongerMember = true;\r\n return details;\r\n }\r\n p.seek('<span class=\"user-firstname\" id=\"user-firstname\">');\r\n details.name = p.extract('', '</span>').trim();\r\n details.photoRequestedOn = parsePhotoReqDate(p);\r\n details.photoRequestable = \r\n html.indexOf(\r\n '<a href=\"javascript:photoNudgeUpdate(\\'/singles/servlet/photonudge\\', ')\r\n >= 0;\r\n \r\n // Parse height\r\n p.seek('<td class=\"header\">Height:</td>');\r\n p.seek('<td class=\"info\">');\r\n details.height = p.extract('', '</td>').trim();\r\n \r\n // Photo photo info (if available)\r\n var profilePhotosList = null; // medium size\r\n var iconPhotoList = null; // small\r\n var normalPhotoList = null; // full size\r\n p.cursor = 0;\r\n if (p.seek('var profilePhotoList = ')) { \r\n profilePhotoList = eval(p.extract('','\\n')) // medium size\r\n }\r\n if (p.seek('var iconPhotoList = ')) { \r\n iconPhotoList = eval(p.extract('','\\n')) // small\r\n }\r\n if (p.seek('var normalPhotoList = ')) { \r\n normalPhotoList = eval(p.extract('','\\n')) // full size\r\n }\r\n if (iconPhotoList && iconPhotoList.length > 0 && normalPhotoList\r\n && normalPhotoList.length == iconPhotoList.length) {\r\n details.photos = new Array();\r\n for (var i = 0; i < iconPhotoList.length; i++) {\r\n var photo = new Photo();\r\n photo.url = normalPhotoList[i].url;\r\n photo.width = normalPhotoList[i].width;\r\n photo.height = normalPhotoList[i].height;\r\n photo.caption = Encoder.htmlDecode(normalPhotoList[i].caption);\r\n photo.thumbUrl = iconPhotoList[i].url;\r\n photo.thumbHeight = iconPhotoList[i].height;\r\n photo.thumbWidth = iconPhotoList[i].width;\r\n details.photos.push(photo);\r\n } \r\n } \r\n \r\n return details;\r\n \r\n}", "function getEachProfile(results, callback) {\n Profile.findOne({'_id': results.profileId}, {\n accessToken: 1,\n refreshToken: 1,\n channelId: 1,\n userId: 1,\n email: 1,\n name: 1,\n dataCenter: 1\n }, checkNullObject(callback));\n }", "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n\n if (value) {\n const profile = new UserProfile();\n\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n\n return profile;\n }\n }", "async function getProfile() {\n const headers = {};\n const params = {\n identityNamespace: selectedIdentity.identityCodeSelected,\n mergePolicyId: selectedMergePolicy.mergePolicyIDSelected,\n identityValue: value,\n };\n console.log(params.identityNamespace);\n // set the authorization header and org from the ims props object\n if (props.ims.token && !headers.authorization) {\n headers.authorization = `Bearer ${props.ims.token}`;\n }\n if (props.ims.org && !headers[\"x-gw-ims-org-id\"]) {\n headers[\"x-gw-ims-org-id\"] = props.ims.org;\n }\n try {\n // invoke backend action\n const actionResponse = await actionWebInvoke(\n \"aep-unified-profile\",\n headers,\n params\n );\n\n setProfile(actionResponse);\n\n console.log(`Response from Get Unified Profile`, actionResponse);\n } catch (e) {\n // log and store any error message\n console.error(e);\n setProfile(null);\n setErrorState({\n actionResponse: null,\n actionResponseError: e.message,\n actionInvokeInProgress: false,\n });\n }\n }", "function profileInfo (obj) {\n\n \n return capitalizeWord(obj.name) + ' is a ' + capitalizeWord(obj.species);\n \n}", "function getProfile(profileName) {\n var file = chain(profilesFolder, function (profilesFolder) {\n var fileUri = path.join(profilesFolder, profileName + \".json\")\n return fs.readFile.bind(null, fileUri)\n })\n\n return chain(file, safeParse)\n}", "function getProfileInfo() {\n\treturn TD.cache.twitterUsers.getByScreenName(TD.storage.accountController.getPreferredAccount(\"twitter\").state.username).results[0];\n}", "function _parseMoreUserInfo(username, cb) {\n var rURL = url.resolve(apiURL, username);\n request(rURL, function(err, res, data) {\n if (err || res.statusCode === 404)\n return cb({\n about: 'Username Not Found'\n });\n var $ = cheerio.load(data);\n var isAbout = $('.profile-details')\n .children()\n .first()\n .children()\n .first()\n .text();\n if (isAbout.toLowerCase() !== 'about')\n return cb({\n about: null\n });\n var parsedAboutMe = $('.profile-details')\n .children()\n .first()\n .children()\n .last()\n .text();\n var parsedAvatar = $('.profile-avatar').attr('src');\n var parsedTotalProtips = $('.pro-tip-number span').html();\n\n cb({about: parsedAboutMe.trim(), total_protips: parsedTotalProtips, avatar: parsedAvatar});\n });\n}", "function profileInfo(object) {\n return object.name.charAt(0).toUpperCase() + object.name.slice(1) + ' ' + 'is a' + ' ' + object.species.charAt(0).toUpperCase() + object.species.slice(1);\n}", "function profileInfo(object) {\nvar name = object.name.charAt(0).toUpperCase() + object.name.slice(1); //creates capitalized first letter name\nvar species = object.species.charAt(0).toUpperCase() + object.species.slice(1); //creates capital first letter species\nreturn name + \" is a \" + species; //return name is a species sentence\n}", "function gerProObj()\n{\n\tvar pro=_tg(\"td\",\"type=profile\");\n\t//alert(pro.length);\n\t//bug(\"the total number of the profile container\",pro.length);\n\treturn pro;\n}", "read({ profile }, res) {\n\t\tres.json(profile);\n\t}", "function userProfileObject() {\r\n this.userProfile = _userProfile.People; /* use readJsonFile function in people.js in case of fetching JSON from server */\r\n this.default = {\r\n menuEleID: \"\",\r\n contentEleID : \"\"\r\n }\r\n }", "getProfile() {\n return JSON.parse(localStorage.getItem(PROFILE_KEY));\n }", "function profileInfo(object) {\nreturn capitalizeWord(object.name) + ' is a ' + capitalizeWord(object.species);\n}", "function getName(profile) {\n return profile.name;\n}", "function displayProfiles() {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n addProfileToAList(profiles[i]);\r\n }\r\n });\r\n}", "function get_profile(number) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', '/profiles/profile' + String(number) + '.json', false);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n cur_profile = JSON.parse(xobj.responseText);\n }\n };\n xobj.send(null);\n }", "function profileInfo(object) {\n if (object.name !== undefined && object.species !== undefined)\n {\n return object.name.substring(0,1).toUpperCase() + object.name.substring(1) + \" is a \" + object.species.substring(0,1).toUpperCase() + object.species.substring(1)\n }\n}", "function loadProfile() {\n if(!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\",profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n }", "static getProfile() {\n // console.log(\"getProfile()\");\n return store.get('CURRENT_PROFILE');\n }", "function profileInfo(object) {\n let name = object.name[0].toUpperCase() + object.name.substring(1);\n let species = object.species[0].toUpperCase() + object.species.substring(1);\n return `${name} is a ${species}`;\n}", "function parseProfName(profName) {\n profName = profName.replace(/ [A-Z]$/g, \"\"); // Remove the middle initial if there is one\n let middleAndLastName = profName.substr(0, profName.indexOf(\", \"));\n let firstName = profName.substr(profName.indexOf(\", \") + 2);\n return firstName + \" \" + middleAndLastName;\n}", "grabProfile(userId) {\n try {\n return new Promise((resolve, reject) => {\n node_fetch_1.default(`${this.Gateway}/${userId}`, {\n method: \"GET\",\n headers: this.Headers\n }).then(Data => Data.json()).then(JSON => {\n if (JSON.code) {\n return reject(JSON);\n }\n JSON[\"creation_stamp\"] = this.grabUnix(JSON.id);\n JSON[\"avatar\"] = this.grabAvatar(JSON.id, JSON.avatar);\n JSON[\"badges\"] = this.Flags.deconstructFlags(JSON.public_flags);\n return resolve(JSON);\n });\n });\n }\n catch (Exception) {\n throw Exception.message;\n }\n }", "function profileInfo(object) {\n return object.name.charAt(0).toUpperCase() + object.name.slice(1) + \" is a \" + object.species.charAt(0).toUpperCase() + object.species.slice(1);\n\n}", "function profileInfo(object) {\n var capitalizedName = capitalizeWord(object.name);\n var capitalSpecies = capitalizeWord(object.species);\n return capitalizedName + \" is a \" + capitalSpecies;\n}", "[PROFILE.FETCH_SUCCESS] (state, profile) {\n state.profile = buildProfile(profile)\n }", "async function getProfie() {\n var tagline = await getTagline();\n var country = await getCountry();\n var profile = await getUrl();\n var featured = await getImages();\n res.render('pages/userProfile', {\n username: uname,\n icon: icon,\n tagline: tagline,\n country: country,\n link: profile,\n featured: featured,\n currentUser: currentUser\n });\n }", "static getProfiles() {\r\n let profiles;\r\n if (localStorage.getItem('profiles') === null) {\r\n profiles = [];\r\n } else {\r\n profiles = JSON.parse(localStorage.getItem('profiles'));\r\n }\r\n return profiles;\r\n }", "function LodLiveProfile() {\n\n }", "function retrieveProfileInfo() {\n return JSON.parse(sessionStorage.getItem(\"user\"));\n}", "function _fetchProfile ( di, complete ) {\n // build an Agent Request and IX Token, get RS Tokens, then call People RS to get name and photo\n var agentRequestDetails =\n { 'iss': config.host.setup\n , 'aud': config.host.ix\n , 'request.a2p3.org':\n { 'resources':\n [ config.baseUrl.people + '/scope/namePhoto' ]\n , 'auth':\n { 'passcode': true\n , 'authorization': true\n }\n , 'returnURL': config.baseUrl.setup + '/dashboard/return'\n }\n }\n var agentRequest = request.create( agentRequestDetails, vault.keys[config.host.ix].latest )\n var jws = new jwt.Parse( agentRequest )\n var ixTokenDetails =\n { 'iss': config.host.setup\n , 'aud': config.host.ix\n , 'sub': di\n , 'token.a2p3.org':\n { 'sar': jws.signature\n , 'auth': agentRequestDetails['request.a2p3.org'].auth\n }\n }\n var ixToken = token.create( ixTokenDetails, vault.keys[config.host.ix].latest )\n var details =\n { host: 'ix'\n , api: '/exchange'\n , credentials: vault.keys[config.host.ix].latest\n , payload:\n { iss: config.host.setup\n , aud: config.host.ix\n , 'request.a2p3.org':\n { 'request': agentRequest\n , 'token': ixToken\n }\n }\n }\n api.call( details, function ( e, result ) {\n if (e) return complete( e )\n if (!result) return complete( new Error('UNKNOWN') )\n var peopleHost = Object.keys(result.tokens)[0]\n var peopleToken = result.tokens[peopleHost]\n var peopleDetails =\n { host: config.reverseHost[peopleHost]\n , api: '/namePhoto'\n , credentials: vault.keys[peopleHost].latest\n , payload:\n { iss: config.host.setup\n , aud: peopleHost\n , 'request.a2p3.org': { 'token': peopleToken }\n }\n }\n api.call( peopleDetails, function ( e, result ) {\n if (e) return complete( e , null )\n complete( null, result )\n })\n })\n}", "function readProfileID (){\n \tvar nameEQ = \"profile_id=\";\n \tvar ca = document.cookie.split(';');\n \tfor(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==' ') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n \t}\n \treturn \"Not logged in\";\n\t\t}", "function processCollector() {\r\n\r\n var valiation;\r\n\r\n if (procOperations < 0) {\r\n helperPreMiddlewares.sendRespOfIssue(req, res, 400, 'user profile');\r\n next();\r\n return;\r\n }\r\n\r\n if (procOperations === 0x07) {\r\n valiation = iWAUser.validateObject(uProfile);\r\n\r\n if (valiation !== true) {\r\n // Some attribute value is wrong\r\n helperPreMiddlewares.traceErrors(req,\r\n new iWAErrors.HttpRequest('Controller: user # Pre-middleware: parseProfileData | ' +\r\n 'Some of the sent user\\'s profile field, has a wrong type or value. Validations ' +\r\n 'details: ' + valiation));\r\n helperPreMiddlewares.sendRespOfIssue(req, res, 400, 'user profile');\r\n return;\r\n\r\n } else {\r\n // We don't need update req.processed.userProfile, because we got the reference and we've changed\r\n // the proper object instance\r\n next();\r\n }\r\n }\r\n }", "profile (state) {\n return state.profile\n }", "getUserProfile(success, failure) {\n ApolloService.query({\n query: Queries.GET_USER_PROFILE\n }).then(data => { success(this.handleResponse(data.data.getUserProfile, \"user\")) }).catch(error => failure(error));\n }", "getProfileSuggestions(profile) {\n const profileSuggestions = [];\n if (!profile) {\n return profileSuggestions;\n }\n\n if (profile.username) {\n const usernameSuggestions = getSuggestionsSplitByMultiple(profile.username.toLowerCase(), Constants.AUTOCOMPLETE_SPLIT_CHARACTERS);\n profileSuggestions.push(...usernameSuggestions);\n }\n [profile.first_name, profile.last_name, profile.nickname].forEach((property) => {\n const suggestions = getSuggestionsSplitBy(property.toLowerCase(), ' ');\n profileSuggestions.push(...suggestions);\n });\n profileSuggestions.push(profile.first_name.toLowerCase() + ' ' + profile.last_name.toLowerCase());\n\n return profileSuggestions;\n }", "function getProfileInfo() {\n var GoogleUser = gapi.auth2.getAuthInstance().currentUser.get();\n var profile = GoogleUser.getBasicProfile();\n var id_token = GoogleUser.getAuthResponse().id_token;\n\n var xhr = new XMLHttpRequest();\n var email = profile.getEmail();\n var name = profile.getName();\n xhr.open('POST', '/public/verifyIdToken');\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.onload = function() {\n signInSuccess(name);\n }\n xhr.send('idtoken=' + id_token + '&email=' + email + '&name=' + name);\n}", "async function loadProfile(webId) {\n try {\n var rc = await fetchProfile(webId);\n if (!rc)\n return null;\n\n var uriObj = new URL(webId)\n uriObj.hash = uriObj.search = uriObj.query = '';\n\n var base = uriObj.toString()\n const kb = $rdf.graph()\n\n $rdf.parse(rc.profile, kb, base, rc.content_type);\n\n const LDP = $rdf.Namespace(\"http://www.w3.org/ns/ldp#\");\n const PIM = $rdf.Namespace(\"http://www.w3.org/ns/pim/space#\");\n const SOLID = $rdf.Namespace(\"http://www.w3.org/ns/solid/terms#\");\n\n const s_webId = $rdf.sym(webId)\n\n uriObj.pathname = '/';\n var ret = uriObj.toString();\n\n var store = kb.any(s_webId, PIM('storage'));\n var inbox = kb.any(s_webId, LDP('inbox'));\n\n var s_issuer = kb.any(s_webId, SOLID('oidcIssuer'));\n var s_account = kb.any(s_webId, SOLID('account'));\n var s_pubIndex = kb.any(s_webId, SOLID('publicTypeIndex'));\n\n var is_solid_id = (s_issuer || s_account || s_pubIndex) ? true : false;\n\n if (inbox)\n return { store: inbox.value, is_solid_id };\n else if (store)\n return { store: store.value, is_solid_id };\n\n } catch (e) {\n console.error('Error', e)\n alert('Error ', e)\n return null;\n }\n}", "function getProfile(email) {\n return dataservice.getProfile(email).then(function(data) {\n vm.profileName = data[0].name;\n vm.profileSurname = data[0].last_name;\n vm.profileAddress = data[0].address;\n vm.profilePostal = data[0].cp;\n vm.profileEmail = data[0].email;\n vm.previousAvatar = data[0].avatar;\n vm.profileAvatar = vm.previousAvatar;\n console.log(vm.profileAvatar);\n\n return [vm.profileName, vm.profileSurname, vm.profileAddress,\n vm.profilePostal, vm.profileEmail, vm.profileAvatar];\n });\n }", "getProfile(userToken) {\n this.props.fetchProfileData(userToken.email).then(\n (res) => {\n this.setState({\n profile: res.data.profile,\n experience: res.data.profile.experience,\n linkedin: res.data.profile.linkedin,\n });\n },\n (error) => {\n console.log(error);\n }\n );\n }", "function objProfile() {\n\tvar objTable = '<TABLE BORDER=2 CELLSPACING=0><TR><TD><H1>Object Profile</H1></TD></TR>';\n\tfor (var i = 0; i < arguments.length; i++) { \n\t\tobjTable += '<TR><TD><BR><BR><H2><TT>' + (i + 1) + ') ' + arguments[i] + '</H2></TD></TR>';\n\t\tobjTable += '<TR><TD><TT><TABLE CELLPADDING=5>' + parseObj(eval(arguments[i])) + '</TABLE></TD></TR>';\n\t\t}\n\tobjTable += '</TABLE><BR><BR><BR>';\n\treturn objTable;\n\t}", "function filter(profile) {\n\t return {\n\t user_id: profile.user_id,\n\t picture: profile.picture,\n\t name: profile.name\n\t };\n\t}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "function getProfile(results, callback) {\n async.concatSeries(results.object, getEachProfile, callback)\n }", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function fetchInfo() {\n $scope.showProcessing = true;\n var url = apiPath + \"profile.php\";\n mediasoftHTTP.actionProcess(url, [{\n user_id: $rootScope.selectedID,\n type: 'users',\n\n }])\n .success(loadInfoSuccess)\n .error(loadError);\n }", "createProfile() {}", "function Profile() {\n _classCallCheck(this, Profile);\n\n Profile.initialize(this);\n }", "function TwiceProfiles() {\n let profiles = Profiles();\n profiles.insertBefore(TwicePicture(), profiles.firstChild);\n return profiles;\n}", "async loadProfile() {\n console.log(this.session)\n try {\n this.loadingProfile = true;\n const profile = await this.getProfile();\n console.log(profile)\n if (profile) {\n this.profile = profile;\n saveOldUserData(profile);\n console.log(this.profile)\n }\n\n this.loadingProfile = false;\n //this.setupProfileData();\n } catch (error) {\n console.log(`Error: ${error}`);\n }\n\n }", "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function getUserProfile(user) {\n return {\n coords: [noise(user.longitude), noise(user.latitude)],\n name: user.name,\n location: user.city + ', ' + user.state,\n email: user.email,\n company: user.currentemployer,\n cohort: user.cohort\n };\n}", "function getUser(json) {\n // Set this user in variable\n const thisUser = json[0];\n // Global variable for id\n window.UserID = thisUser.Uid;\n // Variables for users\n let firstname = thisUser.UfirstName;\n let lastname = thisUser.UlastName;\n let email = thisUser.Uemail;\n let desc = thisUser.Udesc;\n let facebook = thisUser.facebook;\n let instagram = thisUser.instagram;\n let linkedin = thisUser.linkedin;\n\n // Profile name\n profileName.innerHTML = `${firstname} <span>${lastname}</span>`;\n // Profile desc\n profileDesc.innerHTML = desc;\n // Profile email\n profileEmail.innerHTML = `<a href=\"mailto:${email}\">${email}</a>`;\n // Profile socials\n // Output socials if the value is not equal to null\n if (facebook != 'null' && facebook != null) profileSocials.innerHTML += `<li id=\"fb\"><a href=\"${facebook}\">${firstname} ${lastname}</a></li>`;\n if (instagram != 'null' && instagram != null) profileSocials.innerHTML += `<li id=\"ig\"><a href=\"instagram.com/${instagram}\">${instagram}</a></li>`;\n if (linkedin != 'null' && linkedin != null) {\n // For linkedin href\n // To lower case\n let linkedToLower = linkedin.toLowerCase();\n // Replace å/ä with a\n let linkedToReplaceOne = linkedToLower.replace(/å|ä/g, 'a');\n // Replace ö with o\n let linkedToReplaceTwo = linkedToReplaceOne.replace(/ö/g, 'o');\n // Replace space with -\n let linkedUrl = linkedToReplaceTwo.replace(/ /g, '-');\n // Output linkedin\n profileSocials.innerHTML += `<li id=\"ldi\"><a href=\"https://sg.linkedin.com/in/${linkedUrl}\">${linkedin}</a></li>`;\n }\n}", "function getUserDetails(accessToken){\n\tconst request = require('request');\t\n\tvar amazonProfileURL = require('./config').amazonProfileURL + accessToken;\n\treturn new Promise((resolve, reject) => {\n\t\trequest(amazonProfileURL, function(error, response, body) {\n\t\t\tif (response.statusCode == 200) {\n\t\t\t\tvar profile = JSON.parse(body);\n\t\t\t\tconsole.log(profile);\n\t\t\t\tresolve(profile);\n\t\t\t} else {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t});\n}", "function $fb48534df1ba1847$var$profile(hljs) {\n return {\n name: \"Python profiler\",\n contains: [\n hljs.C_NUMBER_MODE,\n {\n begin: \"[a-zA-Z_][\\\\da-zA-Z_]+\\\\.[\\\\da-zA-Z_]{1,3}\",\n end: \":\",\n excludeEnd: true\n },\n {\n begin: \"(ncalls|tottime|cumtime)\",\n end: \"$\",\n keywords: \"ncalls tottime|10 cumtime|10 filename\",\n relevance: 10\n },\n {\n begin: \"function calls\",\n end: \"$\",\n contains: [\n hljs.C_NUMBER_MODE\n ],\n relevance: 10\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n {\n className: \"string\",\n begin: \"\\\\(\",\n end: \"\\\\)$\",\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n }\n ]\n };\n}" ]
[ "0.68599415", "0.6752998", "0.67452204", "0.67446274", "0.6519533", "0.647352", "0.64597815", "0.6437472", "0.63876945", "0.63852715", "0.638432", "0.6361713", "0.6300902", "0.62915367", "0.62609226", "0.62609226", "0.6252527", "0.6223336", "0.61956227", "0.6191141", "0.6171942", "0.61646533", "0.6131941", "0.6122776", "0.6122776", "0.60855865", "0.6080881", "0.6066768", "0.604263", "0.6036429", "0.6029136", "0.60284823", "0.60092545", "0.5993953", "0.59918344", "0.5971758", "0.5952556", "0.5924625", "0.59225726", "0.5917523", "0.5856277", "0.58525306", "0.5839963", "0.5837787", "0.5835375", "0.58275354", "0.5817939", "0.5816466", "0.581492", "0.5805775", "0.5801889", "0.58017373", "0.57894105", "0.5749109", "0.5733819", "0.57161003", "0.57126874", "0.5711883", "0.568848", "0.5680935", "0.56694794", "0.5668532", "0.566705", "0.56667143", "0.566267", "0.5661525", "0.5659631", "0.5657832", "0.5656488", "0.5651699", "0.56511134", "0.56450456", "0.5628889", "0.560362", "0.56002814", "0.5595209", "0.5592158", "0.5590898", "0.55895466", "0.5587972", "0.5586172", "0.5570261", "0.55411094", "0.5539268", "0.5531673", "0.55276793", "0.552149", "0.5509029", "0.5478112", "0.5471152", "0.5470694", "0.54680645", "0.5463936", "0.54620206", "0.54516375", "0.54502505", "0.5443147", "0.543542", "0.54142386", "0.54124624", "0.5410018" ]
0.0
-1
Randomly generate a time interval to simulate "typing"
function randomInterval(min,max) { return Math.floor(Math.random()*(max-min+1)+min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function random_interval(text){\r\n\tvar time = Math.floor(Math.random()*5+1)*1000;\r\n\tdocument.getElementById(text).innerHTML = time/1000 + \" seconds\";\r\n\treturn time;\r\n}", "function getRandomTimeout () {\n return self.intervalMs + Math.floor(Math.random() * self.intervalMs / 5)\n }", "function pickTime() {\n var min = 300,\n max = 1000;\n return Math.round(Math.random() * (max - min + 1) + min);\n}", "function generateRandomSwim()\n\t\t{\n\t\t\tlet randomTimerDuration = RandomSwimInterval_Min + Math.floor((1 + RandomSwimInterval_Max - RandomSwimInterval_Min) * Math.random());\n\t\t\tcurrentRandomTimer = window.setTimeout(doRandomSwim, randomTimerDuration);\n\t\t} // end generateRandomSwim()", "function startTime() {\n xCount = setInterval(getRandomQuote, 7500); \n}", "function getRandomizedTime ( delay, randinter, mode ) {\n\ttry {\n\t\trandinter = ( randinter == null || randinter == undefined || randinter === \"\" ) ? 15*60*1000 : Number(randinter); // if randinter not specified, use default 15 min\n\t\tmode = ( mode == null || mode == undefined || mode === \"\" ) ? 0 : Number(mode); // if mode not specified, use default 0\n\n\t\tswitch ( mode ) {\n\t\t\tcase 0:\n\t\t\t\t// curent time (milli) + delay (milli) + random ( randinter ) mins\n\t\t\t return ( new Date().getTime() + delay + Math.ceil ( Math.random() * randinter ) );\n\t\t\tcase 1:\n\t\t\t\t// current time (milli) + delay (milli) +/- random ( randinter/2 ) mins\n\t\t\t\treturn ( new Date().getTime() + delay + Math.ceil ( Math.random() * randinter - randinter/2.0 ) );\n\t\t\tcase 2:\n\t\t\t\t// delay (milli) + random (randinter ) mins\n\t\t\t\treturn ( delay + Math.ceil ( Math.random() * randinter ) );\n\t\t}\n\t\t\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>getRandomizedTime():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tprintErrorMSG(msg);\n\t\tthrow err;\n\t}\n}", "getRandomTime() {\n return Math.floor(Math.random(1000) * 5000) + 1;\n }", "function randomTime(r) {\n\treturn 10*60*60+10*60*60*r;\n}", "function generateTime() {\n return Math.max(0.18, Math.floor(Math.random() * 25) / 100);\n}", "function generateTimings(member, phraseLength) {\n var delays = [];\n var durations = [];\n var index = 0;\n\n //Used to keep track of how much space is remaining in a phrase\n var spaceRemaining = phraseLength;\n //First note always starts on 0\n delays.push(0);\n while(spaceRemaining > 0 ){\n var interval = Math.floor((Math.random() * (phraseLength / 4)));\n //If the generated interval is greater than space left, just use amount\n // of space left\n if(interval > spaceRemaining){\n durations[index] = spaceRemaining;\n break;\n }\n durations.push(interval);\n //Note starts immediately after previous, don't add delay if this is last\n // duration to add\n (interval == spaceRemaining || delays.push(interval));\n index++;\n spaceRemaining -= (interval);// + delays[index-1]);\n }\n return {delays: delays, durations: durations};\n}", "function getRandomTime() {\n let min = 30000;\n let max = 60000;\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n}", "function rngTime(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function randomTime(min,max){\n return Math.round(Math.random() * (max - min) + min);\n}", "function randomTime(min,max){\n return Math.round(Math.random() * (max - min) + min);\n}", "function randomTime(min,max){\n return Math.round(Math.random() * (max-min) + min);\n}", "function randomTime() {\n\t\tvar randomNumber = Math.floor(Math.random() * 3);\n\t\treturn randomNumberInSecs = randomNumber * 100;\n\t}", "function setRandomInterval(){\n var bodyEl = angular.element( document.querySelector( 'body' ) );\n setTimeout(function(){\n bodyEl.addClass('youreDrunk');\n setTimeout(function(){\n bodyEl.removeClass('youreDrunk');\n }, 1500);\n setRandomInterval();\n }, randomIntFromInterval(9000,30000));\n }", "function type(id, text){\r\n $('#'+id).addClass('notblinking');\r\n var rand = 0\r\n for (var i = 0; i < text.length; i++) {\r\n rand += parseInt(randomInterval(40,300));\r\n var typing = setTimeout(function(y){\r\n $('#'+id).append(text.charAt(y));\r\n },rand, i);\r\n };\r\n // SPECIAL CASES\r\n setTimeout(function(){\r\n $('#'+id).removeClass('notblinking');\r\n if(text === \"do u no de wae\") {\r\n $('#grtn').html('<a id=\"grtn\" href=https://www.youtube.com/embed/eix7fLsS058 class=\"special-greeting blinking\">do u no de wae</a>');\r\n } else {\r\n $('#'+id).addClass('blinking');\r\n }\r\n },rand+333);\r\n}", "function randomTime(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "function randomTime(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "function randomTime(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "function randomTime(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "function randomGame() {\n\tlet num;\n\tlet times = 0;\n\tlet timer = setInterval(function() {\n\t\tnum = Math.random();\n\t\tconsole.log(times);\n\t\ttimes++;\n\t\tif (num > 0.75) {\n\t\t\tconsole.log(times);\n\t\t\tconsole.log('done');\n\t\t\tclearInterval(timer);\n\t\t}\n\t}, 1000);\n}", "function makeDynamicTimeDigitMovement3() {\n\n // NOTE: makeDynamicTimeDigitMovement3 just OFFESTS RUNNERS immediately!\n\n // Offset time-digits immediately very rarely !\n var bOffsetImmediately = Math.random() > 0.99;\n\n if (bOffsetImmediately === true) {\n\n var shakeX;\n var shakeY;\n var rndDigitsOffsetX;\n var rndDigitsOffsetY;\n\n for (var i = 0; i < animGS.runners.length; i++) {\n\n shakeX = calcRndGenMinMax(0, animGS.startingTimeTopLeftOffset);\n shakeY = calcRndGenMinMax(0, animGS.startingTimeTopLeftOffset);\n\n rndDigitsOffsetX = shakeX * Math.random() * (Math.random() > Math.random() ? 1 : -1);\n rndDigitsOffsetY = shakeY * Math.random() * (Math.random() > Math.random() ? 1 : -1);\n\n animGS.runners[i].runnerX += rndDigitsOffsetX;\n animGS.runners[i].runnerY += rndDigitsOffsetY;\n }\n }\n\n return;\n }", "function start()\n{\ndocument.getElementById(\"two\").style.marginTop=\"20%\";\n\nvar x = Math.floor((Math.random() * 25) + 1); // to display the fist word and this word will change after every 3 second...\n\ndocument.getElementById(\"two\").innerHTML =obj.spellings[x].word;\n\nsetInterval(function() {game()},4000); // changing word after every 3 se....\n}", "function simulate(){\n var name = names[Math.floor(Math.random()*names.length)];\n var room = rooms[Math.floor(Math.random()*rooms.length)];\n var duration = 1 + 5 * Math.random();\n var vote = Math.floor(Math.random()*2);\n //Timestamps\n var now = new Date();\n var time = now.getHours() + \" hours \" + now.getMinutes() + \" minutes \" + now.getSeconds() + \" seconds\";\n \n console.log(name);\n console.log(room);\n console.log(vote);\n console.log(time);\n \n var person = {\n name: name,\n\troom: room,\n vote: vote,\t\n\ttime: time\n }\n // simulate this person entering\n enter(person);\n \n //Vote a bunch before leaving\n setTimeout(function(){\n updateVote(person)\n }, 1000)\n // simulate this person leaving after 'duration' seconds\n setTimeout(function(){\n leave(person)\n }, 8000)\n}", "_startTimer() {\n let interval = this.config[\"appear\"][\"interval\"]\n let variation = this.config[\"appear\"][\"interval_variation\"]\n let seconds = interval + Math.round(Math.random() * variation)\n\n util.log(\"power-up\", \"next in \" + seconds + \" seconds\")\n this.timer = this.game.time.events.add(Phaser.Timer.SECOND * seconds, this._addPowerup, this);\n }", "function randomTime(min, max) {\n // Return a random number between the 'min' and 'max' values. Round the number.\n return Math.round(Math.random() * (max - min) + min);\n}", "function get_random_time(range,min){\n time = Math.floor(Math.random() * range) + min; // generate number from min to min+range\n console.log(time+\" minutes\")\n return time*60000; // return milliseconds for form submission\n}", "function changeSpeed() {\r\n timerText++;\r\n if (timerText % 5 == 0) {\r\n ellipse1Speed = random(1,10);\r\n ellipse2Speed = random(1, 10);\r\n circle1Speed= random(1,10);\r\n circle2Speed = random(1,10);\r\n circle3Speed = random(1,10);\r\n circle4Speed = random(1,10);\r\n rect1Speed = random(1,10);\r\n rect2Speed = random(1,10);\r\n rect3Speed = random(1,10);\r\n rect4Speed = random(1,10);\r\n\r\n }\r\n }", "function melodyLoop(time) {\n let p = random();\n if (p < 0.9) {\n let pos = 0;\n\n // a random melody in this scale\n // let pos = floor(random(0, factors.length));\n let note1 = fundamental * factors[pos];\n synth1.triggerAttackRelease(note1, \"4n\", time);\n }\n\n}", "function generate() {\n timer = 10;\n timer_el.innerHTML = `<h2>${timer}</h2>`;\n question.innerHTML = `${abc.results[rand].question}`;\n answerArray = [\n abc.results[rand].incorrect_answers[0],\n abc.results[rand].incorrect_answers[1],\n abc.results[rand].incorrect_answers[2],\n abc.results[rand].correct_answer,\n ];\n shuffle(answerArray);\n displayQuestions();\n score_el.innerHTML = `<h4>Score: ${score}</h4>`;\n timer_el.innerHTML = `<h2>10</h2>`;\n }", "function zooSimulator() {\n let animalSpecies = zooAnimals.map(a => a.species)\n console.log(animalSpecies)\n let problemsKey = ['isIll', 'isEscape', 'isHungry', 'archiveProblem']\n function randomInt(min, max) {\n let rand = min + Math.random() * (max + 1 - min);\n console.log(rand)\n return Math.floor(rand);\n }\n setInterval(()=>{\n zooMediator.resolveProblem(problemsKey[randomInt(0, 3)], animalSpecies[randomInt(0,3)])}\n ,5000)\n}", "function makeDynamicTimeDigitMovement10() {\n\n // NOTE: makeDynamicTimeDigitMovement10 just RANDOMIZES table WITH points-per-char !\n\n // Offset time-digits immediately very rarely !\n var bOffsetImmediately = Math.random() > 0.995;\n\n if (bOffsetImmediately === true) {\n for (var i = 0; i < animGS.allAsciiCharsData.length; i++) {\n // Randomize per-char-points\n animGS.allAsciiCharsData[i].allCharDefinitionData.sort(function () { return (0.5 - Math.random()); });\n }\n }\n\n return;\n }", "function makeDynamicTimeDigitMovement1() {\n\n var shakeX = calcRndGenMinMax(0, animGS.timeDigitsDynamicMovementMaxShakeOffset);\n var shakeY = calcRndGenMinMax(0, animGS.timeDigitsDynamicMovementMaxShakeOffset);\n\n var rndDigitsOffsetX = shakeX * Math.random() * (Math.random() > Math.random() ? 1 : -1);\n var rndDigitsOffsetY = shakeY * Math.random() * (Math.random() > Math.random() ? 1 : -1);\n\n // Reset RARE-ly from time to time !\n var bResetToDefaults = Math.random() > 0.99;\n\n for (var i = 0; i < animGS.allAsciiCharsData.length; i++) {\n for (var j = 0; j < animGS.allAsciiCharsData[i].allCharDefinitionData.length; j++) {\n for (var k = 0; k < animGS.allAsciiCharsData[i].allCharDefinitionData[j].length; k++) {\n\n if (bResetToDefaults === true) {\n // Reset\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingXBackup = animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingXBackupFULL;\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingYBackup = animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingYBackupFULL;\n }\n else {\n // Dynamic movement\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingXBackup += rndDigitsOffsetX;\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingYBackup += rndDigitsOffsetY;\n }\n }\n }\n }\n\n return;\n }", "function generateNPC(){\n setInterval(spawnCoin, interval)\n setInterval(spawnMine, interval)\n}", "function getRandomQuote() {\n endTime();//ends timer if user clicks button\n if (count < a.length){\n printQuote(ranNum[count]); \n count++;\n } else {\n count = 0;\n printQuote(ranNum[count]);\n count++;\n }\n startTime();//starts a new timer after other functions complete\n}", "function timeOutWrapper(cb) {\n setTimeout(cb, getRandom());\n}", "function gameStart(time) {\n // trying to add a timeout function to the order of the sounds generated by the loop\n // https://stackoverflow.com/questions/5226285/settimeout-in-for-loop-does-not-print-consecutive-values\n // https://stackoverflow.com/questions/24293376/javascript-for-loop-with-timeout\n for (let i = 1; i <= 1; i++) {\n let random = randomNumberBetween(0, 3);\n setTimeout(() => {\n if (random === 0) {\n wedge('.wedge-choice1', '#30bb0b', '#008000', pickSoundGreen);\n } else if (random === 1) {\n wedge('.wedge-choice2', '#FF0000', '#B22222', pickSoundRed);\n } else if (random === 2) {\n wedge('.wedge-choice3', '#FFFF00', '#ffc303', pickSoundYellow);\n } else if (random === 3) {\n wedge('.wedge-choice4', '#0000FF', '#00008B', pickSoundBlue);\n }\n }, (time * computerSequence.length) * i);\n computerSequence.push(random);\n }\n}", "function randomGame() {\n let count = 0;\n let timeId = setInterval(function() {\n let num = Math.random();\n count++;\n if (num > .75) {\n clearInterval(timeId);\n // has to console.log to show the count.\n // if only return, it'll show nothing.\n return console.log(\"It took \" + count + \"try/tries.\");\n }\n }, 1000);\n}", "function spinCell(cell, array, word, spinLength) {\n //the time delay for the set timeouts\n let delayTime = 50;\n //run a for loop for as many times as the number of spins (spinLength)\n for (let i = 0; i < spinLength; i++) {\n //set the cell's text to a random selection from the corresponding array\n setTimeout(() => {\n cell.text(array[Math.floor(Math.random() * array.length)]);\n }, delayTime, cell, verb)\n //increase the delay\n delayTime += 80;\n }\n //set the cell to the pre determined value\n setTimeout(()=>{\n cell.text(word);\n }, delayTime, word)\n\n}", "function makeDynamicTimeDigitMovement11() {\n\n // NOTE: makeDynamicTimeDigitMovement11 just shifts 2 randomly selected points-per-single-char !\n\n // Offset time-digits immediately very rarely !\n var bOffsetImmediately = Math.random() > 0.99;\n\n if (bOffsetImmediately === true) {\n\n var firstRand;\n var secondRand;\n var tmpPoint;\n\n for (var i = 0; i < animGS.allAsciiCharsData.length; i++) {\n\n firstRand = calcRndGenMinMax(0, animGS.allAsciiCharsData[i].allCharDefinitionData.length - 1);\n secondRand = calcRndGenMinMax(0, animGS.allAsciiCharsData[i].allCharDefinitionData.length - 1);\n\n if (firstRand != secondRand) {\n\n tmpPoint = animGS.allAsciiCharsData[i].allCharDefinitionData[firstRand];\n animGS.allAsciiCharsData[i].allCharDefinitionData[firstRand] = animGS.allAsciiCharsData[i].allCharDefinitionData[secondRand];\n animGS.allAsciiCharsData[i].allCharDefinitionData[secondRand] = tmpPoint;\n }\n }\n }\n\n return;\n }", "function getTheRandomTime()\n{\n\tvar baseTime = 3000;\n\tvar randomVal = Math.floor(Math.random() * (2000 - 1000) + 1000);\n\treturn (baseTime + randomVal);\n}", "function resetPowerUpTimer() {\n this.nextPowerUpTime = randomInteger(\n SNAKE_GAME_CONFIG.powerUpSpawnPeriod[0],\n SNAKE_GAME_CONFIG.powerUpSpawnPeriod[1]\n );\n}", "function changeSpeed() {\n timerText++;\n if (timerText % 5 == 0) {\n dogboneSpeed = random(1,10);\n pawSpeed = random(1,10);\n flowerSpeed = random(1,10);\n \n }\n}", "function limitedRepeat() {\n let intervalId = setInterval(console.log(\"hi for now\"), 100);\n setTimeout(() => clearInterval(intervalId), 500);\n}", "function timeFrame() {\n return Math.round(Math.random() * (MAX - MIN) + MIN)\n }", "selectRand(length = 1) {\n\t}", "function outputA()\n {\n var randomTime = Math.floor(Math.random() * 3000) + 1;\n\n setTimeout(function(){\n console.log(\"A\");\n }, randomTime);\n }", "function outputC()\n {\n var randomTime = Math.floor(Math.random() * 3000) + 1;\n\n setTimeout(function(){\n console.log(\"C\");\n }, randomTime);\n }", "function timer(){\n typingTimer = false;\n}", "function generate_inteval(k) {\n\t\t\tvar maxInterval = (Math.pow(2, k) - 1) * 1000;\n\n\t\t\t// If the generated interval is more than 30 seconds, truncate it down to 30 seconds.\n\t\t\tif (maxInterval > 30*1000) {\n\t\t\t\tmaxInterval = 30*1000;\n\t\t\t}\n\n\t\t\t// generate the interval to a random number between 0 and the maxInterval determined from above\n\t\t\treturn Math.random() * maxInterval;\n\t\t}", "function outputB()\n {\n var randomTime = Math.floor(Math.random() * 3000) + 1;\n\n setTimeout(function(){\n console.log(\"B\");\n }, randomTime);\n }", "function autoType(content) {\n //defines the current character. charAt(), is used to access the character\n //at a given position: https://www.w3schools.com/jsref/jsref_charat.asp\n let currentChar = content.charAt(charPos);\n //if that character is a newline insert a line break and increase charPos count\n if (currentChar === \"\\n\") {\n $('#description').append(\"<br>\");\n charPos++;\n //otherwise, insert the current character, as is. Also inrease count\n } else {\n $('#description').append(currentChar);\n charPos++;\n }\n //when all of the characters have been printed out\n if (charPos >= content.length) {\n //request access to the users microphone, and start listening\n annyang.start();\n //reset charpos (for good measure)\n charPos = 0;\n //add a button to begin the game (and get around the user interaction audio BS**)\n //**it's not really bs it's good it exists\n $(\"#welcome\").append(`<div id=\"welcomeButton\">Click Me To Begin</div>`);\n //add the event listener for the button\n $(\"#welcomeButton\").on(\"click\", function(){\n //when clicked remove the welcome message content\n $(\"#welcome\").remove();\n //and begin the first round\n newRound();\n });\n //break out of the loop\n return;\n }\n //start the whole process again\n setTimeout(autoType, Math.floor(Math.random() * 5), content);\n}", "attackPattern(){\n console.log(\"Starting attack timer!\");\n //five seconds between attacks, use attacks based on level\n this.attackTimer = this.scene.time.addEvent({\n delay: 6000, //5 seconds\n callback: this.pickAttack,\n //args: [],\n callbackScope: this,\n loop: true,\n startAt: 1000\n });\n }", "function randomValues() {\n anime({\n targets: '#dot, #dot2, #dot3, #dot4, #dot5, #dot6, #dot7, #dot8',\n translateX: function() {\n return anime.random(0, 20);\n },\n\n translateY: function() {\n return anime.random(0, 20);\n },\n\n easing: 'easeInOutQuad',\n duration: 2050,\n complete: randomValues\n });\n}", "function randStart() {\n return Math.random() - .5;\n}", "function melodyLoop(time) {\n let p = random();\n if(p < 0.9){\n let pos = floor(random(0, myScale.length));\n let note1 = root + myScale[pos] + octave * 12;\n let note1Object = Tone.Frequency(note1, \"midi\");\n\n let note2 = note1 + semitones;\n let note2Object = Tone.Frequency(note2, \"midi\");\n\n synth.triggerAttackRelease(note1Object, \"4n\", time);\n synth.triggerAttackRelease(note2Object, \"4n\", time);\n }\n}", "function makeDynamicTimeDigitMovement2() {\n\n // NOTE: makeDynamicTimeDigitMovement2 just OFFESTS timing-digits immediately !\n\n // Offset time-digits immediately very rarely !\n var bOffsetImmediately = Math.random() > 0.99;\n\n if (bOffsetImmediately === true) {\n\n var shakeX = calcRndGenMinMax(0, animGS.startingTimeTopLeftOffset);\n var shakeY = calcRndGenMinMax(0, animGS.startingTimeTopLeftOffset);\n\n var rndDigitsOffsetX = shakeX * Math.random() * (Math.random() > Math.random() ? 1 : -1);\n var rndDigitsOffsetY = shakeY * Math.random() * (Math.random() > Math.random() ? 1 : -1);\n\n for (var i = 0; i < animGS.allAsciiCharsData.length; i++) {\n for (var j = 0; j < animGS.allAsciiCharsData[i].allCharDefinitionData.length; j++) {\n for (var k = 0; k < animGS.allAsciiCharsData[i].allCharDefinitionData[j].length; k++) {\n\n // FIRST - Reset\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingXBackup = animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingXBackupFULL;\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingYBackup = animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingYBackupFULL;\n\n // SECOND - Offset immediately \n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingXBackup += rndDigitsOffsetX;\n animGS.allAsciiCharsData[i].allCharDefinitionData[j][k].runnerStartingYBackup += rndDigitsOffsetY;\n\n }\n }\n }\n }\n\n return;\n }", "function startTyping(){\n start++;\n $('.speed').show();\n $('.startt').hide();\n $('.guidelines').hide();\n $('.answer').show();\n $('.accuracy').hide();\n generateRandomParagraph();\n startTime= new Date().getTime();\n words=0;\n document.getElementById('paragraphInput').value= null;\n inputLen=0;\n y= setInterval(timer,600);\n document.querySelector('#paragraphInput').focus();\n console.log(inputUnit.innerText);\n}", "function randStart() {\n return Math.floor(Math.random() * Math.floor(13)) + 1;\n}", "function changeCulprit() {\n let timerId = null; \n timerId = setInterval(holeRandom, 700) \n}", "randomSpeed() {\n this.sp = movementMultip * Math.floor(Math.random() * 10+1);\n }", "function getRandomUntil(mx) {\n return Math.floor(Math.random() * mx);\n }", "function intervalSayHello() {\n console.log(\"hello : every 3second\");\n}", "function randomAge() {\n let num = Math.floor(Math.random() * 120);\n while (num < 20) {\n num = Math.floor(Math.random() * 120);\n } console.log(`Teddy is ${randomAge()} years old!`)\n}", "function randomInterval(min, max) {\n return Math.random() * (max - min) + min;\n}", "function sendAfterTime(name, randomTimeLimit) { \n let time = Math.floor(Math.random() * randomTimeLimit) + 1;\n setTimeout(function () {\n postToGoogle(name, color);\n }, time);\n}", "function funTime() {\n stroke(random(360), 100, 100);\n strokeWeight(1);\n\n line(0, 0, random(width), random(height));\n}", "function setRandom(){\n \n correctAns=Math.floor(1000+Math.random()*9000) +\"\";\n // console.log(\"Generated no is\"+correctAns);\n}", "function typeGen() {\n var rand = Math.random();\n if (rand <= .33) {\n return \"Ancient Dragon\";\n } else if (rand >= .66) {\n return \"Prowler\";\n } else {\n return \"Mighty Grunt\";\n }\n}", "function intervalTrigger() {\n return window.setInterval(function () {\n puType = Math.round(Math.random());\n gravity = 0.2;\n dragonSprite.src = \"pu1.png\";\n\n window.clearInterval(id);\n }, 800);\n }", "function createTimeRequirement(count){\n //As previous, converts 36 hour system to work with 24 hour data\n if (count < 0){\n count += scaledBaseLoad.length;\n }\n if (count >= scaledBaseLoad.length){\n count -= scaledBaseLoad.length;;\n }\n //From the PhD data, roughly 50/50 chance of a car being used within a short (1-3 hours) or long (5-24) time after arriving at home\n if (Math.random() < 0.5){\n return gaussianRandom(2, 6); //Short 1-3hour, arrival time independent\n }\n else{\n var distrib = [16,14,12,12,10,10,10,14,48,46,46,44,40,38,36,34,32,30,28,26,24,22,20,18]; //long time, depends on when arrives. Values are MAXIMUM wait time\n count = Math.floor(count/2); //Converts half hour times to the hour before. 16:30 -> 16:00\n maxTime = distrib[count];\n return gaussianRandom(maxTime-8, maxTime); //Avg spread of 4 hours, or 8 periods\n }\n}", "getRandom (type) {\n return getRandom(type)\n }", "function autoGenerate(){\n setInterval(printQuote, 15000);\n}", "function type()\n{\ndocument.getElementById('screen').innerHTML +=text.charAt(index);\nindex += 1;\nvar t = setTimeout('type()',100);\n// The time taken for each character here is 100ms. You can change it if you want.\n}", "function girb_interval(){\n\t\t//\n\t\tclearInterval(girb_int);\n\t\t//\n\t\tif(Math.random()*100 > 50){\n\t\t\tmove_girb();\n\t\t}else{\n\t\t\treset_interval();\n\t\t\tset_animation(return_randImg(arr_img_idle));\n\t\t}\n\t}", "function makeDynamicTimeDigitMovement7() {\n\n // NOTE: makeDynamicTimeDigitMovement7 just OFFESTS ALL RUNNERS to the WHOLE equally distributed points of the screen !\n\n // Offset time-digits immediately very rarely !\n var bOffsetImmediately = Math.random() > 0.995;\n\n if (bOffsetImmediately === true) {\n\n var howManyEdgesPoints = animGS.runners.length;\n var howManyHorizontalLines = calcRndGenMinMax(3, parseInt(howManyEdgesPoints / 3, 10));\n var oneStepX = animGS.cnvWidth / (howManyEdgesPoints / howManyHorizontalLines);\n var oneStepY = animGS.cnvHeight / (howManyHorizontalLines - 1);\n var startEdgeX = 0;\n var startEdgeY = 0;\n var allEdgesPointsCounter = 0;\n\n var allDigitsDynamicOffsets = new Array(howManyEdgesPoints);\n\n for (var addo = 0; addo < allDigitsDynamicOffsets.length; addo++) {\n allDigitsDynamicOffsets[addo] = new Array(2);\n }\n\n while (allEdgesPointsCounter < howManyEdgesPoints) {\n\n allDigitsDynamicOffsets[allEdgesPointsCounter][0] = startEdgeX + (Math.random() * oneStepX);\n allDigitsDynamicOffsets[allEdgesPointsCounter][1] = startEdgeY;\n\n startEdgeX += oneStepX;\n allEdgesPointsCounter++;\n\n if (startEdgeX >= animGS.cnvWidth) {\n startEdgeX = 0;\n startEdgeY += oneStepY;\n }\n }\n\n // Randomize the order !\n allDigitsDynamicOffsets.sort(function () { return (0.5 - Math.random()); });\n\n for (var i = 0; i < animGS.runners.length; i++) {\n animGS.runners[i].runnerX = allDigitsDynamicOffsets[i][0];\n animGS.runners[i].runnerY = allDigitsDynamicOffsets[i][1];\n }\n }\n\n return;\n }", "function changeDelay(a, b){\r\n\t\tdelay += (a + Math.floor(Math.random() * b || 0));\r\n\t\tif(delay < 0)\r\n\t\t\tdelay = 0;\r\n\t}", "function letstart()\n {\n \n document.getElementById('para').innerHTML=random(4);\n document.getElementById('quest').innerHTML=random_2();\n document.getElementById('sc').innerHTML=\"score\"+\" = \"+count;\n start=3.5;\n \n \n interval=setInterval(timer,1000);\n ID=setTimeout(display,3500);\n \n}", "function rng () {\n return random()\n }", "function random() {\n var randomInt = 0;\n while (randomInt < 1 || randomInt > 60) {\n \trandomInt = Math.floor(Math.random() * 10000) % 60;\n }\n return randomInt;\n}", "function simulateTime (hours=0) {\n let interval = setInterval(() => {\n if (hours > 50) return clearInterval(interval);\n console.log(`${format(getRGBColor(hours))} ${hours} hours after lead`);\n hours += 2; // increment by 2 hours\n }, 1000);\n}", "function generateTarget() {\n return Math.floor(Math.random()*10)\n}", "next_rand() {\n this.jitter_pos *= 10;\n if (this.jitter_pos > 10000000000)\n this.jitter_pos = 10;\n return (this.jitter * this.jitter_pos) % 1;\n }", "function generateTarget() { \n return Math.floor(Math.random() * 9)\n;}", "function randomGame(){\r\n randomCount = 0;\r\n\r\n //set up the call back after 1000ms\r\n setTimeout(pickNumber , 1000);\r\n}", "function generateTarget(){\n return Math.floor(Math.random()*10)\n \n}", "function generateTarget() {\n return Math.floor(Math.random()* 9)\n}", "function newRound() {\n currentClue = random(clues);\n responsiveVoice.speak(currentClue);\n timer = 30 * 60;\n}", "function usePotions(type, time){\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n\n robot.keyTap(\"f3\");\n robot.setKeyboardDelay(900);\n}", "function newWord() {\n $('#word_hint').html(words[Math.floor((Math.random() * words.length))]);\n resetTimer();\n vrtionary.ultimateClear();\n vrtionary.setTeamTime(30);\n}", "function randomTaunt()\r\n{ \r\n\tif( getTP() > 1 ) { \r\n\t\tsay(randomCitation()); \r\n\t} \r\n}", "function randStops() {\n return parseInt(Math.random() * 10) + 2;\n}", "function typing() {\n let options = {\n strings: [\"Hello, Adventurer... ^1000\", \"Shall we begin?\"],\n loop: false,\n smartBackspace: true,\n backSpeed: 50,\n typeSpeed: 100,\n showCursor: false\n }\n let typed = new Typed(\".type-intro\", options);\n \n setTimeout(function(){\n $(\".formy\").fadeIn(8000);\n }, 5000)\n}", "generateSpeed(){\n return Math.floor(Math.random()*(250-225)+225);\n }", "function generateTarget(){\n return Math.floor(Math.random () * 10)\n}", "function setTimer(){ \n timer = setInterval(\"getRandNum();\",50); \n document.getElementById(\"start\").disabled = true;\n document.getElementById(\"end\").disabled = false;\n}", "function tiktok() {\n int = setInterval(run, 1000); // configure interval\n}", "selectRand() {\n\t}", "typeFor(seconds, channel) {\n return __awaiter(this, void 0, void 0, function* () {\n yield channel.stopTyping();\n yield channel.startTyping(1);\n yield Sojiro_1.Sojiro.wait(seconds);\n yield channel.stopTyping();\n });\n }" ]
[ "0.7088958", "0.68200773", "0.67238766", "0.66800547", "0.6551102", "0.6510392", "0.6495139", "0.64236677", "0.6292952", "0.6277739", "0.6253145", "0.6240741", "0.62363106", "0.62363106", "0.6229949", "0.6220399", "0.6177548", "0.61275834", "0.6116657", "0.6116657", "0.61010796", "0.6084259", "0.60000575", "0.5979691", "0.5937018", "0.59125334", "0.58803463", "0.5875778", "0.58011115", "0.57898146", "0.5788026", "0.57728875", "0.57606286", "0.5750749", "0.5748017", "0.5741693", "0.5736927", "0.57332635", "0.572131", "0.5696313", "0.56937504", "0.5682668", "0.5675959", "0.5665038", "0.5641946", "0.56390136", "0.56366783", "0.56343734", "0.56257945", "0.5613847", "0.55876243", "0.558364", "0.5578815", "0.55768096", "0.5575907", "0.557418", "0.5573389", "0.55685174", "0.55667603", "0.55640584", "0.55629283", "0.5544244", "0.5533693", "0.5533683", "0.55275065", "0.5518625", "0.5493614", "0.5492012", "0.54869044", "0.5486847", "0.5481105", "0.5480628", "0.5471895", "0.5471869", "0.546145", "0.5459838", "0.5432338", "0.5428193", "0.5427752", "0.54136723", "0.5404267", "0.53935784", "0.5391093", "0.5389971", "0.53878284", "0.53849673", "0.53754824", "0.53738046", "0.5371458", "0.5369241", "0.5366298", "0.5366205", "0.53657055", "0.53654224", "0.5360978", "0.53589994", "0.5352563", "0.5347122", "0.5345141", "0.5343435", "0.534336" ]
0.0
-1
Types out text typewriterstyle
function type(id, text){ $('#'+id).addClass('notblinking'); var rand = 0 for (var i = 0; i < text.length; i++) { rand += parseInt(randomInterval(40,300)); var typing = setTimeout(function(y){ $('#'+id).append(text.charAt(y)); },rand, i); }; // SPECIAL CASES setTimeout(function(){ $('#'+id).removeClass('notblinking'); if(text === "do u no de wae") { $('#grtn').html('<a id="grtn" href=https://www.youtube.com/embed/eix7fLsS058 class="special-greeting blinking">do u no de wae</a>'); } else { $('#'+id).addClass('blinking'); } },rand+333); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"heading\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"typing\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"typewrited\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i == -1) {\n setTimeout(typeWriter, 2000);\n i = 0;\n } else {\n if (i < txt.length) {\n document.getElementById(\"name\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"cmdline\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"animated-text\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function type() {\n // Type as long as there are characters left in phrase\n if (char_index <= text[text_index].length) {\n if (!typing) set_typing(true);\n set_typed_text(text[text_index].substring(0, char_index++));\n setTimeout(type, type_delay);\n }\n // Call erase when finished\n else {\n set_typing(false);\n setTimeout(erase, new_delay);\n }\n }", "function newTyping() {\n output.html(type.value());\n output.parent('output');\n}", "function typeWriter(text, i, fnCallback) {\n // Chekc if text isn't finished yet\n if (i < (text.length)) {\n // Add next character to h1\n document.getElementById(\"typing\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n\n // Wait for a while and call this function again for next character\n setTimeout(function() {\n typeWriter(text, i + 1, fnCallback)\n }, 50);\n }\n // Text finished, call callback if there is a callback function\n else if (typeof fnCallback == 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 2000);\n }\n }", "function typeWriter(text, i, fnCallback) {\n\t // check if text isn't finished yet\n\t if (i < (text.length)) {\n\t\t// add next character to #top\n\t document.querySelector(\"#cursor\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n \n\t\t// wait for a while and call this function again for next character\n\t\tsetTimeout(function() {\n\t\t typeWriter(text, i + 1, fnCallback)\n\t\t}, 250); //this controls speed of the typing and the delay in between\n\t }\n\t // text finished, call callback if there is a callback function\n\t else if (typeof fnCallback == 'function') {\n\t\t// call callback after timeout\n\t\tsetTimeout(fnCallback, 700);\n\t }\n\t}", "function typeWriter(text, delay, position) {\n if (position < text.length) {\n dialogue = document.getElementById(\"dialogue\");\n d = delay; // delay before next recursive call\n p = position; // current position\n c = text.charAt(p); // current character being processed.\n if (c=='✔') { // use at the end of the sentence. will delay longer (visible pause).\n d*=40;\n p+=1;\n } else if (c=='✨') { // define style for a separate section. \n // syntax: ✨210color:blueSOMETEXT✨ 2 is the length of the next number, 10 is the length of the styling text.\n if (!isStyling) {\n isStyling = true;\n lenNum = parseInt(text.charAt(p+1),10); // get length of the number\n lenTxt = parseInt(text.substr(p+2,lenNum),10); // get length of the styling text\n s = text.substr(p+2+lenNum,lenTxt); // style. syntax: \"attribute:value attribute:value\"\n tag = document.createElement(\"span\");\n\n attrib = document.createAttribute(\"style\");\n attrib.value = s;\n tag.setAttributeNode(attrib); // set style of span tag\n\n dialogue.appendChild(tag);\n\n p+=lenTxt+lenNum+2;\n } else {isStyling = false;p++;}\n } else if (c=='❌') { // clear the dialogue\n dialogue.innerHTML = \"\";\n p++;\n } else if (c=='➡') { // newline\n dialogue.innerHTML += \"<br>\";\n p++;\n }\n if (isStyling) {dialogue = dialogue.getElementsByTagName(\"span\")[dialogue.getElementsByTagName(\"span\").length-1];}\n dialogue.innerHTML += text.charAt(p);\n if (skip) {typeWriter(text, delay, ++p);}\n else {setTimeout(function(){typeWriter(text, delay, ++p)}, d);}\n } else {skip = false;}\n}", "function typeWriter() {\n\n if (i < txt.length) {\n document.getElementById('name').innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter(){\n if (i < txt.length) {\n typeBox.innerHTML += txt.charAt(i);\n console.log(txt.charAt(i));\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"no\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"no\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"name\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "typeAnimation(){\n\t\t//preserve a copy of all the text we're about to display incase we need to save\n\t\tthis.saveCopy();\n\t\t\n\t\tFileManager.writing = false; \n\t\t\n\t\t//figure out how fast we want to type the screen based on how much content needs typing \n\t\tvar letters = 0;\n\t\tfor (i=0; i< this.state.toShowText.length; i++){\t\t\t \n\t\t\tletters += this.state.toShowText[i].text.length;\n\t\t}\n\t\tvar scale = Math.floor(letters/20);\n\t\tif(scale < 1){\n\t\t\tscale = 1;\n\t\t}\n\t\t\n\t\t\n\t\t//do the actual typing\n\t\tthis.typeAnimationActual(scale);\n\t\t\n\t}", "function typeText(text){\n var chars = text.split('');\n chars.forEach(function(char, index){\n $(settings.el).delay(settings.speed).queue(function (next){\n var text = $(this).html() + char;\n $(this).html(text);\n next();\n\n // we are done, remove from queue\n if(index === chars.length - 1){\n settings.queue = settings.queue - 1;\n $(settings.mainel).trigger('typewriteTyped', text);\n }\n });\n }, this);\n }", "function typeIt() {\n clearCanvas();\n disableCanvas();\n $(settings.typed, context).show();\n $(settings.drawIt, context).bind('click.signaturepad', function (e) {\n e.preventDefault();\n drawIt();\n });\n $(settings.typeIt, context).unbind('click.signaturepad');\n $(settings.typeIt, context).bind('click.signaturepad', function (e) {\n e.preventDefault();\n });\n $(settings.output, context).val('');\n $(settings.drawIt, context).removeClass(settings.currentClass);\n $(settings.typeIt, context).addClass(settings.currentClass);\n $(settings.sig, context).removeClass(settings.currentClass);\n $(settings.drawItDesc, context).hide();\n $(settings.clear, context).hide();\n $(settings.typeItDesc, context).show();\n }", "function typeWriter() {\n \tif (i < txt.length) {\n document.getElementById(\"intro\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (u < txt.length) {\n var x = document.getElementById(\"typed\").textContent += txt.charAt(u);\n u++;\n setTimeout(typeWriter, speed);\n console.log(x);\n }\n}", "function typeWriter() {\n var txt = document.getElementById(\"demo1\").textContent;\n var length = txt.length;\n if (i < length) {\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "typewriter() {\n // This is a class that handles the text on the screen\n class TxtType {\n constructor(el, toRotate, period) {\n this.toRotate = toRotate;\n this.el = el;\n this.loopNum = 0;\n this.period = parseInt(period, 10) || 2000;\n this.txt = \"\";\n this.isDeleting = false;\n this.tick();\n }\n }\n\n // Tick function that types (or deletes) a new letter at a random increment\n TxtType.prototype.tick = function () {\n const i = this.loopNum % this.toRotate.length;\n const fullTxt = this.toRotate[i];\n\n // If deleting, remove a letter\n if (this.isDeleting) {\n this.txt = fullTxt.substring(0, this.txt.length - 1);\n // Else, append one\n } else {\n this.txt = fullTxt.substring(0, this.txt.length + 1);\n }\n\n // Re-render the inner text every time\n this.el.innerHTML = \"<span>\" + this.txt + \"</span>\";\n\n // Get reference to our TxtType class\n const that = this;\n\n // Generates random increment to simulate typewriter effect\n let delta = 200 - Math.random() * 100;\n\n // If deleting, we will double the speed\n if (this.isDeleting) {\n delta /= 2;\n }\n\n // If we reach the full text, start deleting\n if (!this.isDeleting && this.txt === fullTxt) {\n delta = this.period;\n this.isDeleting = true;\n // If we reach empty, start next string\n } else if (this.isDeleting && this.txt === \"\") {\n this.isDeleting = false;\n this.loopNum++;\n\n // And take a half second pause\n delta = 500;\n }\n\n // Action timer\n setTimeout(() => {\n that.tick();\n }, delta);\n };\n\n // When window loads (it should since this gets called after the component mounts)\n const startEffect = () => {\n // Get our element that does the effect\n const elements = document.getElementsByClassName(\"typewrite\");\n\n // If we decide to put more in later\n for (let i = 0; i < elements.length; i++) {\n const toRotate = elements[i].getAttribute(\"data-type\");\n const period = elements[i].getAttribute(\"data-period\");\n\n // If we have something in our data-type attribute, we must cycle through it\n if (toRotate) {\n new TxtType(elements[i], JSON.parse(toRotate), period);\n }\n }\n // Create a style element\n let css = document.createElement(\"style\");\n\n // Give it our\n css.innerHTML = \".typewrite > { border-right: 0.08em solid #fff}\";\n // Append the style element to the html doc\n document.body.appendChild(css);\n };\n\n startEffect();\n }", "function typeWriter(text, i, fnCallback) {\r\n // chekc if text isn't finished yet\r\n if (i < (text.length)) {\r\n // add next character to h1\r\n document.querySelector(\"h1\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\r\n \r\n // wait for a while and call this function again for next character\r\n setTimeout(function() {\r\n typeWriter(text, i + 1, fnCallback)\r\n }, 100);\r\n }\r\n // text finished, call callback if there is a callback function\r\n else if (typeof fnCallback == 'function') {\r\n // call callback after timeout\r\n setTimeout(fnCallback, 700);\r\n }\r\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n /*\n else{\n \ti=0;\n \tdocument.getElementById(\"demo\").innerHTML = \"\";\n \tthis.typeWriter();\n }\n */\n}", "function typeWrite (context, canvas, string, x, y, lineHeight, padding) {\n context.font = \"14px Verdana\";\n context.fillStyle = \"#FFF\";\n\n \"use strict\";\n var cursor_x = x || 0;\n var cursor_y = y || 0;\n var lineHeight = lineHeight || 14; \n var padding = padding || 10;\n var i = 0;\n\n $_inter = setInterval(function() {\n var rem = string.substr(i);\n var space = rem.indexOf(' ');\n space = (space === -1) ? string.length:space;\n var wordwidth = context.measureText(rem.substr(0, space)).width;\n var w = context.measureText(string.charAt(i)).width;\n\n if (cursor_x + wordwidth >= canvas.width - padding) {\n cursor_x = x;\n cursor_y += lineHeight;\n }\n\n context.fillText(string.charAt(i), cursor_x, cursor_y);\n\n i++;\n cursor_x += w;\n\n if (i === string.length) {\n clearInterval($_inter);\n }\n }, 80);\n}", "function typeWriter() {\r\n if (i < txt.length) {\r\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\r\n i++;\r\n setTimeout(typeWriter, speed);\r\n }\r\n}", "function typeWriter() {\n var h1 = document.querySelector(\"#typewriter h1\");\n var h2 = document.querySelector(\"#typewriter h2\");\n\n // Setting up the headings with hidden spans that contain the text characters\n fillElementWithText(h1, \"hi, my name is yanik\");\n fillElementWithText(h2, \"I am a software developer specializing in web development\");\n\n // Setting up the cursors for both headings\n var bigCursor = new Image();\n bigCursor.src = \"resources/icons/line.svg\";\n bigCursor.id = \"big_typing_cursor\";\n var smallCursor = bigCursor.cloneNode(true);\n smallCursor.style.height = \"33px\";\n smallCursor.style.top = \"5px\";\n\n // Setting up the initial position of the cursor\n bigCursor.style.left = h1.firstChild.offsetLeft + \"px\";\n h1.appendChild(bigCursor);\n\n // Making the line flash and writing the text\n toggleFlashLine(bigCursor, true);\n setTimeout(function () {\n bigCursor.style.visibility = \"visible\";\n toggleFlashLine(bigCursor, false);\n writeHeading(55, h1, bigCursor, h2, smallCursor );\n }, 250);\n\n cacheImages();\n\n function writeHeading(speed, heading1, line1, heading2, line2) {\n var i = 0;\n var text = heading1.querySelectorAll(\"span\");\n var intervalId = setInterval(writeCharacter, speed);\n\n function writeCharacter () {\n // Moving the line cursor (top space depends on current header)\n line1.style.left = (text[i].offsetWidth + text[i].offsetLeft) + \"px\";\n if (heading1.tagName == \"H1\")\n line1.style.top = (text[i].offsetTop + 10) + \"px\";\n else if (heading1.tagName == \"H2\")\n line1.style.top = (text[i].offsetTop + 5) + \"px\";\n\n // Maxing the character visible\n text[i].style.visibility = \"visible\";\n i++;\n\n // After writing the h1, flashing the line a little and starting to write the h2\n if (i >= text.length && heading1.tagName == \"H1\") {\n clearInterval(intervalId);\n toggleFlashLine(line1, true);\n\n setTimeout(function () {\n toggleFlashLine(line1, false);\n heading1.removeChild(line1);\n\n line2.style.left = heading2.firstChild.offsetLeft + \"px\";\n heading2.appendChild(line2);\n\n writeHeading(30, heading2, line2);\n }, 350);\n\n // After writing the h2, the cursor line will be appended to the last character\n // (to stay in place when window resizes) and will flash continuously\n } else if (i >= text.length && heading1.tagName == \"H2\") {\n clearInterval(intervalId);\n heading1.removeChild(line1);\n line1.style.left = heading1.lastChild.offsetWidth + \"px\";\n line1.style.top = \"5px\";\n heading1.lastChild.appendChild(line1);\n toggleFlashLine(line1, true);\n }\n }\n } // End of writeHeading\n\n function toggleFlashLine(line, toggle) {\n if (toggle === false)\n clearInterval(line.flashInterval);\n else if (toggle === true) {\n var lineStatus = 1;\n line.flashInterval = setInterval(flash, 400);\n\n function flash() {\n if (lineStatus === 1) {\n line.style.visibility = \"hidden\";\n lineStatus = 0;\n } else {\n line.style.visibility = \"visible\";\n lineStatus = 1;\n }\n }\n }\n } // End of toggleFlashLine()\n\n\n function fillElementWithText(element, text) {\n for (var i = 0; i < text.length; i++){\n if (text[i] === \" \")\n var character = document.createTextNode(\" \");\n else\n var character = document.createTextNode(text[i]);\n var tempSpan = document.createElement(\"span\");\n tempSpan.appendChild(character);\n tempSpan.class = \"main-text-char\";\n tempSpan.style.position = \"relative\";\n tempSpan.style.visibility = \"hidden\";\n element.appendChild(tempSpan);\n }\n } // End of fillElementWithText()\n\n} // End of typeWriter()", "function typeWriter() {\n if (i < txt.length) {\n $(\"#myname\").html($(\"#myname\").html() + txt.charAt(i));\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter(text, i, fnCallback) {\n // check if text isn't finished yet\n if (i < text.length) {\n // add next character to h1\n tagLine.show().html(text.substring(0, i + 1));\n \n // wait for a while and call this function again for next character\n setTimeout(function () {\n typeWriter(text, i + 1, fnCallback);\n }, 100);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback === 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 2000);\n }\n }", "function typewriter(txt, id, ind = 0) {\n // console.log(txt, i);\n if (ind < txt.length) {\n document.getElementById(id).innerHTML += txt.charAt(ind);\n ind++;\n setTimeout(typewriter, speed, txt, id, ind);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"question\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter(text, i, fnCallback) {\n // chekc if text isn't finished yet\n if (i < (text.length)) {\n // add next character to h1\n document.getElementById(\"one\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n\n // wait for a while and call this function again for next character\n setTimeout(function() {\n typeWriter(text, i + 1, fnCallback)\n }, 100);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback == 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 700);\n }\n }", "function typeWriter(text, i, fnCallback) {\n // chekc if text isn't finished yet\n if (i < text.length) {\n // add next character to h2\n document.querySelector(\"h2\").innerHTML =\n text.substring(0, i + 1) + '<span aria-hidden=\"true\"></span>';\n\n // wait for a while and call this function again for next character\n setTimeout(function () {\n typeWriter(text, i + 1, fnCallback);\n }, 100);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback == \"function\") {\n // call callback after timeout\n setTimeout(fnCallback, 700);\n }\n }", "function typeWriter(text, i, fnCallback) {\n // chekc if text isn't finished yet\n if (i < text.length) {\n // add next character to h1\n document.querySelector('.text-container').innerHTML =\n text.substring(0, i + 1) + '<span aria-hidden=\"true\"></span>';\n\n // wait for a while and call this function again for next character\n setTimeout(function () {\n typeWriter(text, i + 1, fnCallback);\n }, 50);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback == 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 100);\n }\n }", "function typeWriter(text, i, fnCallback) {\n // chekc if text isn't finished yet\n if (i < (text.length)) {\n // add next character to h3\n document.querySelector(\"h3\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n\n // wait for a while and call this function again for next character\n setTimeout(function() {\n typeWriter(text, i + 1, fnCallback)\n }, 75);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback === 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 700);\n }\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"nomPrenom\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "__typewriter() {\n let arr = this.options.text.split('');\n\n for (let i = 0, len = arr.length; i < len; i++) {\n let char = arr[i];\n let el = this.__createElement();\n \n char = char === ' ' ? el.innerHTML = '&nbsp;' : el.innerText = char;\n \n setTimeout(() => { \n setTimeout(() => {\n el.classList.add('active'); \n }, this.options.delay);\n \n document.querySelector(this.options.selector).insertAdjacentElement('beforeend', el);\n }, i * this.options.interval);\n }\n }", "function typewriter(screen, index, callback, noDeletion) {\n if (index >= screen.text.length) {\n if (callback) callback();\n return;\n }\n\n var charTime, extraTime;\n if (skip) {\n charTime = 0;\n extraTime = 0;\n } else if (screen.text[index].length === 0) {\n extraTime = 0;\n } else {\n charTime = 50;\n extraTime = 500;\n }\n\n // separate by letter\n var text = screen.text[index].split('');\n\n // type each letter one by one\n text.forEach(function (letter, i) {\n setTimeout(function () {\n screen.element.insertAdjacentHTML('BeforeEnd', letter);\n }, charTime * i);\n });\n\n // move on to the next index\n setTimeout(function () {\n if (noDeletion && index < screen.text.length - 1) {\n screen.element.insertAdjacentHTML('BeforeEnd', '<br>');\n } else {\n screen.element.innerHTML = '';\n }\n typewriter(screen, index + 1, callback, noDeletion);\n }, charTime * text.length + extraTime);\n}", "function fixTypewriter( content ){\n\n\tlet typewriter = setupTypewriter( content );\n\ttypewriter.type();\n\n\treturn false\n}", "function begin_typing() {\t\t\t\t\t\t/*FUNCTION CONTROLLING TYPEWRITING EFFECT ---- */\r\n\tif (i < txt[type_flag].length) {\r\n\t\tdocument.getElementById(\"my_info_p\").innerHTML += txt[type_flag].charAt(i);\r\n\t\ti++;\r\n\t\tsetTimeout(begin_typing, speed);\r\n\t}\r\n\tif (i == txt[type_flag].length) {\r\n\t\tdocument.getElementById(\"my_info_p\").innerHTML += '<br>';\r\n\t\ttype_flag++;\r\n\t\ti = 0;\r\n\t\tbegin_typing();\r\n\t}\r\n\r\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"snackbar\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "typeText(int) {\n const index = this.typeInt(int);\n return tileTypes[index].type;\n }", "function typeWriter() {\n var animatedText = document.querySelector('#intro'); // sem pismena se postupne ukladaji\n var welcomeText = 'Welcome to Typing Speed Test'; //text to animate\n if (char < welcomeText.length) { // podminka, aby se napsal pouze welcomeText a nic navic\n animatedText.innerHTML += welcomeText.charAt(char); // ulozi pismeno do animatedText, += aby se pismena pridavali, ne zobrazovali po jednom\n char++; // zvetsim hodnotu poradove cisla pismena\n setTimeout(typeWriter, 100); // aby funkce se opakovala (jinak bude pouze prvni pismeno) + s efektem typewritingu, ne najdenou. \n }\n}", "function changeTyped(text1,text2) {\n\ttyped.destroy();\n\t\ttyped = new Typed(\".typed\", {\n\t\tstrings: [text1, text2],\n\t\ttypeSpeed: 70,\n\t\tloop: true,\n\t\tstartDelay: 1000,\n\t\tshowCursor: false\n\t});\n}", "function typewriter(params1,param2)\n {\n //console.log(\"Js Method Called>>>>>>>\",params1);\n if(params1 == \"Employee\"){\n //console.log(\"Employee\");\n aText = new Array(\"Can I help you explore new opportunities?\");\n //destination = document.getElementById(\"seekertext\");\n iArrLength = aText[0].length; // the length of the text array\n iSpeed = 100; \n iIndex = 0; \n \n iScrollAt = 20; \n header = 1;\n iTextPos = 0; \n sContents = ''; \n iRow;\n } else if(params1 == \"Employer\") {\n //console.log(\"Employer\");\n aText = new Array(\"Can I help you find a New Employee?\");\n //destination = document.getElementById(\"employertext\");\n iArrLength = aText[0].length; // the length of the text array\n iSpeed = 100; \n iIndex = 0; \n \n iScrollAt = 20; \n header = 2;\n iTextPos = 0; \n sContents = ''; \n iRow;\n }\n sContents = ' ';\n iRow = Math.max(0, iIndex-iScrollAt);\n \n //console.log(\"Js Method Called>>>>>>>\",params);\n while ( iRow < iIndex ) {\n sContents += aText[iRow++] + '<br />';\n }\n if(header == 1){\n destination = document.getElementById(\"seekertext\");\n }else{\n destination = document.getElementById(\"employertext\");\n }\n \n destination.innerHTML = sContents + aText[iIndex].substring(0, iTextPos)+\"<i class='hr-line'></i>\";\n if ( iTextPos++ == iArrLength ) {\n iTextPos = 0;\n iIndex++;\n if ( iIndex != aText.length ) {\n iArrLength = aText[iIndex].length;\n setTimeout(\"typewriter()\", 500);\n }\n } else {\n setTimeout(\"typewriter()\", iSpeed);\n }\n //console.log(\"Method Last>>>\",iIndex);\n \n }", "function updateTypeWriter() {\n if (typeWriterIndex >= typeWriterWords.length) {\n typeWriterIndex = 0;\n }\n $('#rotate').html(typeWriterWords[typeWriterIndex]);\n typeWriterIndex++;\n}", "function typeWriter(txt, speed) {\n var text = arguments[0];\n var speed = arguments[1];\n var element = document.getElementById(\"paragraph-title\");\n console.log(speed);\n console.log(text);\n \n if (i < text.length) {\n element.innerHTML += text.charAt(i);\n i++;\n setTimeout(function () {\n typeWriter(text, speed);\n }, speed);\n \n \n }\n \n\n \n \n}", "function typeWriter() {\n if (i < txt.length) { // If var i is less that the length of the text. Ex. Omar=4. if i=0 is less than 4 then do the below\n document.getElementById(\"first\").innerHTML += txt.charAt(i); // Get element with ID first and get the inner HTML and add to it the value of var txt character of i. Example if i=1, then only 'H' will be added to ID first. if i=2 then 'He' will be added and so on. \n i++; // Increase the var i by 1. if i=0 it will become i=1.\n setTimeout(typeWriter, speed); // To apply the speed to the above.\n }else if (ii < txt1.length) { // if the above is not met, then it will start the below. In this case, once the above text is written, afterward the below text will be written.\n document.getElementById(\"second\").innerHTML += txt1.charAt(ii);\n ii++;\n setTimeout(typeWriter, speed1);\n }\n}", "drawType(type, n) {\n write(' ');\n write(color(type, n));\n write('\\n');\n }", "type() {\n const current = this.wordIndex % this.words.length; // current Index of Word\n const fullTxt = this.words[current]; // get full text of current word\n\n // CHECK IF DELETING\n if (this.isDeleting) { \n this.txt = fullTxt.substring(0, this.txt.length - 1); // remove characters\n } else {\n this.txt = fullTxt.substring(0, this.txt.length + 1); // add characters\n }\n\n // INSERT TEXT INTO ELEMENT\n this.txtElement.html(`<span class=\"txt\">${this.txt}</span>`);\n let typeSpeed = \"255\"; // SET Typing Speed\n\n if (this.isDeleting) {\n typeSpeed = typeSpeed / 3; // SET Deleting Speed\n }\n\n // ON WORD COMPLETION\n if (!this.isDeleting && this.txt === fullTxt) {\n typeSpeed = this.wait; // makes pause at end\n this.isDeleting = true; // set delete to true\n } else if (this.isDeleting && this.txt === '') {\n this.isDeleting = false;\n // move to next word...\n this.wordIndex++;\n // Pause before restart typing \n typeSpeed = 500;\n }\n setTimeout(() => this.type(), typeSpeed);\n }", "function kw(type){return{type:type,style:\"keyword\"}}", "function typenize (type)\n {\n let typewords = type.split(' ');\n\n if (typewords.length === 1)\n {\n if (typewords[0] === 'Integer' || typewords[0] === 'Float')\n return 'number';\n\n else if (typewords[0] === 'String')\n return 'string';\n\n else if (typewords[0] === 'Boolean' || typewords[0] === 'True' || typewords[0] === 'False')\n return 'boolean';\n \n else if (typewords[0] === 'InputFile')\n return '{ name: string, data: Buffer }';\n\n else if (typewords[0] === 'CallbackGame')\n return 'any';\n\n else\n return typewords[0];\n }\n\n else if (typewords.length === 3)\n {\n if (typewords[0] === 'Array' && typewords[1] === 'of')\n return 'Array<' + typenize(typewords[2]) + '>';\n\n else if (typewords[1] === 'or')\n return typenize(typewords[0]) + ' | ' + typenize(typewords[2]);\n }\n\n return 'any';\n }", "function typeOut(str, startX, startY, lineHeight, lineWidth, color, callback) {\n var ctx = gameArea.canvas.getContext(\"2d\");\n var canvas = gameArea.canvas;\n\n var cursorX = startX || 0;\n var cursorY = startY || 0;\n var lineHeight = lineHeight || 32;\n var i = 0;\n $_inter = setInterval(function() {\n var rem = str.substr(i);\n var space = rem.indexOf(' ');\n space = (space === -1)?str.length:space;\n var wordwidth = ctx.measureText(rem.substring(0, space)).width;\n var w = ctx.measureText(str.charAt(i)).width;\n if(cursorX + wordwidth >= (window.innerWidth / 2) + (lineWidth / 2)) {\n cursorX = startX;\n cursorY += lineHeight;\n }\n ctx.fillStyle = color;\n ctx.fillText(str.charAt(i), cursorX, cursorY);\n i++;\n cursorX += w;\n if(i === str.length) {\n clearInterval($_inter);\n callback(true);\n }\n }, 20);\n\n}", "function typistUpdateHtml(element, state) {\n var text = state.texts[state.currentTextIndex];\n var typed = text.substring(0, state.currentTypedChars);\n var untyped = text.substring(state.currentTypedChars);\n \n element.innerHTML = typed + \" <span class=\\\"typist-untyped\\\">\" + untyped + \"</span>\";\n}", "function typeCharacter( paramDoc, paramCharCode ) {\t\r\n\t// Local variable to extract information about cursor after operations\r\n\tvar newCursorCoords;\r\n\t// Determine if we typing normally, or overwriting a selected block, and act accordingly\r\n\tif ( paramDoc.isSelection ) {\r\n\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn, String.fromCharCode(paramCharCode) );\r\n\t}\r\n\telse newCursorCoords = paramDoc.insertText( String.fromCharCode(paramCharCode), cursorLine, cursorColumn );\r\n\t\r\n\tcursorColumn = newCursorCoords[1];\r\n}", "function skilltypeWriter() {\n if (ss < skilltxt.length) {\n document.getElementById(\"skillP\").innerHTML += skilltxt.charAt(ss);\n ss++;\n // if (skilltxt.charAt(ss-1)=='.' ){\n // skillP.innerHTML += (`<br>`);\n // }\n setTimeout(skilltypeWriter, skillspeed);\n }\n}", "function typing() {\n let options = {\n strings: [\"Hello, Adventurer... ^1000\", \"Shall we begin?\"],\n loop: false,\n smartBackspace: true,\n backSpeed: 50,\n typeSpeed: 100,\n showCursor: false\n }\n let typed = new Typed(\".type-intro\", options);\n \n setTimeout(function(){\n $(\".formy\").fadeIn(8000);\n }, 5000)\n}", "function begin_typing_2() {\t\t\t\t\t\t/*FUNCTION CONTROLLING TYPEWRITING EFFECT ---- */\r\n\tif (i_2 < txt_2[type_flag_2].length) {\r\n\t\tdocument.getElementById(\"looking_for_info_p\").innerHTML += txt_2[type_flag_2].charAt(i_2);\r\n\t\ti_2++;\r\n\t\tsetTimeout(begin_typing_2, speed_2);\r\n\t}\r\n\tif (i_2 == txt_2[type_flag_2].length) {\r\n\t\tdocument.getElementById(\"looking_for_info_p\").innerHTML += '<br>';\r\n\t\ttype_flag_2++;\r\n\t\ti_2 = 0;\r\n\t\tbegin_typing_2();\r\n\t}\r\n\r\n}", "function autoType(elementClass, typingSpeed){\n var thhis = $(elementClass);\n thhis.css({\n \"position\": \"relative\",\n \"display\": \"inline-block\"\n });\n thhis.prepend('<div class=\"cursor\" style=\"right: initial; left:0;\"></div>');\n thhis = thhis.find(\".text-js\");\n var text = thhis.text().trim().split('');\n var amntOfChars = text.length;\n var newString = \"\";\n thhis.text(\"|\");\n setTimeout(function(){\n thhis.css(\"opacity\",1);\n thhis.prev().removeAttr(\"style\");\n thhis.text(\"\");\n for(var i = 0; i < amntOfChars; i++){\n (function(i,char){\n setTimeout(function() { \n newString += char;\n thhis.text(newString);\n },i*typingSpeed);\n })(i+1,text[i]);\n }\n },1500);\n}", "function typewriter () {\n setTimeout(resetTypewriterOne, 0)\n setTimeout(resetTypewriterTwo, 4000)\n setTimeout(resetTypewriterThree, 9000)\n}", "function typer() {\n if(i < type.length, i <rule.length){\n document.getElementById('type').innerHTML += type.charAt(i);\n document.getElementById('rules').innerHTML += rule.charAt(i)\n \n i++;\n setTimeout(typer, speed);\n }\n}", "function typeWriter1() {\n if (i < txt1.length) {\n document.getElementById(\"writer1\").innerHTML += txt1.charAt(i);\n i++;\n setTimeout(typeWriter1, speed);\n }else{\n setTimeout(function(){\n typeWriter2()\n }, 500)\n }\n}", "function type(element, text) {\n [...text].forEach(x => {\n act(() => {\n userEvent.type(element, x);\n });\n });\n}", "function formatType(type, checker) {\n return !isAssignableToSimpleTypeKind(type, SimpleTypeKind.ANY, checker) ? markdownHighlight(toTypeString(type, checker)) : undefined;\n}", "function typeWriter() {\r\n if (i < h1_n.length) {\r\n document.getElementById(\"h1_name\").innerHTML += h1_n.charAt(i); \r\n i++;\r\n setTimeout(typeWriter, speed);\r\n }\r\n}", "onTextChange()\n {\n let data = this.pad.getContents()\n\n // add type\n data[\"@type\"] = \"mycelium::rich-text\"\n\n this.shroom.setData(this.key, data)\n }", "get type () {\n return TEXT;\n }", "get type () {\n return TEXT;\n }", "function type(speed, i, text) {\n if (stop) return;\n if (i < text.length) {\n document.getElementById(\"story\").innerHTML += text.charAt(i);\n i++;\n setTimeout(type, speed, speed, i, text);\n }\n}", "function formatType(type) {\n if (type == 0) {\n return '次';\n } else if (type == 1) {\n return '月';\n } else if (type == 2) {\n return '年';\n }\n }", "function type()\n{\ndocument.getElementById('screen').innerHTML +=text.charAt(index);\nindex += 1;\nvar t = setTimeout('type()',100);\n// The time taken for each character here is 100ms. You can change it if you want.\n}", "function typeWriter(elemento) {\n\tconst textoArray = elemento.innerHTML.split('');\n\telemento.innerHTML = '';\n\ttextoArray.forEach((letra, i) => {\n\t\tsetTimeout(() => elemento.innerHTML += letra, 100 * i);\n\t});\n\n}", "function typeWriter(response, $responseDisplay, displayResponseEmoji){\n // define the starting point and speed of typeWriter\n let i = 0;\n let speed = 50;\n\n (function addLetter() {\n // if the character length of the response is less that 0,\n if (i < response.length) {\n $responseDisplay.html($responseDisplay.html() + response.charAt(i));\n i++;\n // keep adding letters to the responseDisplay paragraph\n // at the speed of 50\n setTimeout(addLetter, speed);\n }\n\n // once the typewriter effect is completed, add the emoji at the end of the response\n else{\n $responseDisplay.html($responseDisplay.html() + displayResponseEmoji);\n }\n\n })(); // end of addLetter\n} // end of typeWriter", "function type(elem, txt, speed) {\n if (i < txt.length) {\n document.getElementById(elem).innerHTML += txt.charAt(i);\n i++;\n timeouts.push(setTimeout(function(){type(elem, txt, speed)}, speed));\n }\n}", "function doneTyping () {\n //do something\n }", "function erase() {\n // Erase as long as there are characters left in typed_text\n if (char_index > 0) {\n if (!typing) set_typing(true);\n set_typed_text(text[text_index].substring(0, --char_index));\n setTimeout(erase, erase_delay);\n }\n // Go to next word and call type when finished\n else {\n set_typing(false);\n text_index++;\n if (text_index >= text.length) text_index = 0;\n setTimeout(type, type_delay + 1000);\n }\n }", "function typeString($target, index, cursorPosition, callback) {\n // Get text\n var text = settings.text[index];\n // Get placeholder, type next character\n var placeholder = $target.attr('placeholder');\n $target.attr('placeholder', placeholder + text[cursorPosition]);\n // Type next character\n if (cursorPosition < text.length - 1) {\n setTimeout(function () {\n typeString($target, index, cursorPosition + 1, callback);\n }, settings.delay);\n return true;\n }\n // Callback if animation is finished\n callback();\n }", "function getType() {\r\n var type = document.getElementById('dress-code').value;\r\n document.getElementById('type').innerHTML = type.replace(/(.{36})/g, \"$1<br>\");//breaks line after 36 characters//\r\n}", "function kw(type) {return {type: type, style: \"keyword\"};}", "function typeText(id, text) {\n if (i < text.length) {\n document.getElementById(id).innerHTML += text.charAt(i);\n i++;\n setTimeout(typeText.bind(null, id, text), speed);\n }\n}", "function write(type, ele) {\n document.write(type);\n document.write(\": \");\n document.write(ele);\n document.write(\" \");\n}", "function typewriter(string)\n{\n\tthis.string = string;\n\tthis.story = this.string.split(\"\");\n\tthis.length = this.story.length;\n\tthis.index = 0;\n\tthis.best_index = 0;\n\tthis.guess_count = 0;\n\tthis.incomplete = true;\n\n// Returns a random index of the story\n\tthis.randomIndex = function ()\n\t{\n\t\treturn Math.floor(Math.random() * this.length)\n\t};\n\n// Called when a match is found\n// advances index\n\tthis.matched = function()\n\t{\n\t\t// check to see if final letter matched.\n\t\tif (this.index == this.length-1)\n\t\t{\n\t\t\tthis.incomplete = false;\n\t\t};\n\n\t\t// increase index\n\t\tthis.index++;\n\t};\n\n// Called on a mismatch\n// Sets best match\n// resets index\n\tthis.mismatched = function()\n\t{\n\t\tthis.index = 0;\n\t};\n\n// This function guesses a letter. If it matches the index is incremented for\n// the next letter. If it doesn't match, the index is reset and the best\n// index increased if needed.\n\n\tthis.guess = function()\n\t{\n\t\t// Pick a random letter from story\n\t\tthis.letter = this.story[this.randomIndex()];\n\t\t// increment guess\n\t\tthis.guess_count++;\n\n\t\t// If letter matches current index call matched()\n\t\t// else call mismatched()\n\t\tif (this.letter == this.story[this.index])\n\t\t{\n\t\t\tthis.matched();\n\t\t} else {\n\t\t\tthis.mismatched();\n\t\t};\n\n\t\t// check to see if new best index reached,\n\t\t// print latest streak and guesses taken\n\t\tif (this.index > this.best_index)\n\t\t{\n\t\t\tconsole.log(this.story[this.best_index] + \" \" + this.guess_count + \" guesses.\");\n\t\t\tthis.best_index = this.index;\n\n\t\t};\n\t};\n}", "async function getTypeText(type) { // eslint-disable-line no-unused-vars\n\tif (type === 'proposta') {\n\t\treturn 'minha proposta';\n\t} if (type === 'histórico') {\n\t\treturn 'meu histórico';\n\t}\n\treturn 'meu posicionamento';\n}", "function typeout (message, position) {\n let messagetext = message\n let i = 0\n let result = messagetext[i]\n let typing = setInterval(function () {\n if (i === messagetext.length - 1) {\n clearInterval(typing)\n return\n }\n i++\n result += messagetext[i]\n position.html(result)\n },\n 30)\n}", "function init() {\r\n const txtElement = document.querySelector('.txt-type');\r\n const words = JSON.parse(txtElement.getAttribute('data-words'));\r\n const wait = txtElement.getAttribute('data-wait');\r\n new TypeWriter(txtElement, words, wait);\r\n}", "function type(style) {\n return {\n style: style,\n match: function match(token) {\n return token.kind === 'Name';\n },\n update: function update(state, token) {\n state.prevState.type = token.value;\n }\n };\n}", "function TextEditor() {}", "function typeEffect(element, speed) {\n var text = $(element).text();\n $(element).html('');\n \n var i = 0;\n var timer = setInterval(function() {\n if (i < text.length) {\n $(element).append(text.charAt(i));\n i++;\n } else {\n clearInterval(timer);\n }\n }, speed);\n}", "function superTypeWriter(textArray, element) {\n textArray.forEach(function (item, j) {\n var time = j * 3000;\n setTimeout(function () {\n i = 0;\n typeWriter(item, element)\n }, time)\n })\n}", "function copy_text(txt){\n var pasteBoard = [NSPasteboard generalPasteboard]\n [pasteBoard declareTypes:[NSArray arrayWithObject:NSPasteboardTypeString] owner:nil]\n [pasteBoard setString:txt forType:NSPasteboardTypeString]\n}", "function italics(){\n bread.style.color = 'cornflowerblue';\n bread.style.fontStyle = 'italic';\n}", "function editType() {\n let currentType = document.getElementById(\"typeEdit\").value\n if (currentType === \"classic\") {\n setType(\"classic\"); \n setTypeText(\"Classical Music\");\n }\n\n else if (currentType === \"popular\") {\n setType(\"popular\"); \n setTypeText(\"Popular Music\")\n }\n\n else if (currentType === \"jazzy/pop\") {\n setType(\"jazzy/pop\"); \n setTypeText(\"Jazzy-Pop music\");\n }\n\n else if (currentType === \"surprise\") {\n setType(\"suprise\"); \n setTypeText(\"A surprise\");\n }\n}", "function StartTextAnimation(i) {\n\t if (typeof dataText[i] == 'undefined'){\n\t\t setTimeout(function() {\n\t\t\tStartTextAnimation(0);\n\t\t }, 1000); //delay for re-typing\n\t }\n\t // check if dataText[i] exists\n\t if (i < dataText[i].length) {\n\t\t// text exists! start typewriter animation\n\t typeWriter(dataText[i], 0, function(){\n\t\t // after callback (and whole text has been animated), start next text\n\t\t StartTextAnimation(i + 1);\n\t });\n\t }\n\t}", "function doneTyping () {\n //do something\n}", "function drawTyped(text, cursorChar) {\n let visibleText = text;\n let ellipsis = false;\n const maxWidth = 176 - 40;\n while (g.setFont(\"12x20\")\n .stringWidth(visibleText) > maxWidth) {\n ellipsis = true;\n visibleText = visibleText.slice(1);\n }\n if (ellipsis) {\n visibleText = \"...\" + visibleText;\n }\n g.setColor(g.theme.bg2)\n .fillRect(5, 5, 171, 30);\n g.setColor(g.theme.fg2)\n .setFont(\"12x20\")\n .drawString(visibleText + cursorChar, 15, 10, false);\n }", "function type_writer_effect_name(text, n) {\n\tif (n < (text.length)) {\n\t\t$('#name_area').html(text.substring(0, n+1));\n\t\tn++;\n\t\tsetTimeout(function() {type_writer_effect_name(text, n)}, 50);\n\t}\n}", "type(text = '', config = {}) {\n\n\t\t// Contextualizing the config object\n\t\tconst conf = this.contextConfig(config);\n\n\t\t// Caching the typing state\n\t\tthis.cache = {\n\t\t\t...conf,\n\t\t\ttext,\n\t\t};\n\n\t\treturn new Promise(resolve => {\n\n\t\t\t// Attaching the type resolve function\n\t\t\tthis.typeResolve = resolve;\n\n\t\t\t// Recursive typing\n\t\t\tconst recType = (text, tick, init = false) => {\n\n\t\t\t\t// Checking if the text is finished\n\t\t\t\tif (text.length > 0) {\n\t\t\t\t\tthis.typeTimer = setTimeout(() => {\n\n\t\t\t\t\t\t// Stopping typing\n\t\t\t\t\t\tif (init && this.typing) {\n\t\t\t\t\t\t\tthis.stopType();\n\n\t\t\t\t\t\t\t// Updating the index\n\t\t\t\t\t\t\tconf.cursor.index = this.config.cursor.index;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Stopping deleting\n\t\t\t\t\t\tif (this.deleting) {\n\t\t\t\t\t\t\tthis.stopDelete();\n\n\t\t\t\t\t\t\t// Updating the index\n\t\t\t\t\t\t\tconf.cursor.index = this.config.cursor.index;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Updating the typing state\n\t\t\t\t\t\tthis.typing = true;\n\n\t\t\t\t\t\t// Typing a character\n\t\t\t\t\t\tthis.config.text = this.config.text.slice(0, conf.cursor.index) + text[0] + this.config.text.slice(conf.cursor.index);\n\t\t\t\t\t\tthis.config.cursor.index = ++conf.cursor.index;\n\t\t\t\t\t\tthis.render(conf);\n\n\t\t\t\t\t\t// Playing typing sound\n\t\t\t\t\t\tthis.playSound(conf);\n\n\t\t\t\t\t\t// Caching the typing state\n\t\t\t\t\t\tthis.cache = {\n\t\t\t\t\t\t\t...conf,\n\t\t\t\t\t\t\ttick,\n\t\t\t\t\t\t\ttext: text.slice(1),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// Invoking the recursion\n\t\t\t\t\t\trecType(text.slice(1), conf.tick || this.config.tick);\n\t\t\t\t\t}, tick);\n\t\t\t\t} else {\n\n\t\t\t\t\t// Stopping typing\n\t\t\t\t\tthis.stopType();\n\n\t\t\t\t\t// Resolving the typing\n\t\t\t\t\tresolve(this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Starting the recursion\n\t\t\trecType(text, conf.delay || 0, true);\n\t\t});\n\t}", "function CameraCommand_Action_ProcessMode_TypeText(elapsed)\n{\n\t//basic not done yet?\n\tif (!this.Mode_TypeText_Basic)\n\t{\n\t\t//Process Basic\n\t\tthis.Mode_TypeText_Basic = this.ProcessMode_Basic(elapsed);\n\t}\n\t//animation not yet done?\n\telse if (!this.Mode_TypeText_Animation)\n\t{\n\t\t//add an animation command\n\t\tthis.Camera.Commands.push(new CameraCommand_Animation(this.Camera, __CAMERA_UI_TYPE_KEYDOWN));\n\t\t//done with this\n\t\tthis.Mode_TypeText_Animation = true;\n\t}\n\t//focus not set\n\telse if (!this.Mode_TypeText_Focused)\n\t{\n\t\t//screenshot mode?\n\t\tif (__SCREENSHOTS_ON)\n\t\t{\n\t\t\t//fake focus\n\t\t\tthis.Object.HTML.STATES_FOCUSED = true;\n\t\t\t//not ignoring events?\n\t\t\tif (!this.Object.HTML.IGNORE_EVENTS)\n\t\t\t{\n\t\t\t\t//trigger state update\n\t\t\t\tBasic_UpdateState(this.Object.HTML, this.Object);\n\t\t\t}\n\t\t\t//has focused?\n\t\t\tif (this.Object.HTML.State_OnFocus)\n\t\t\t{\n\t\t\t\t//trigger it\n\t\t\t\tthis.Object.HTML.State_OnFocus(this.Object);\n\t\t\t}\n\t\t\t//now set the value directly\n\t\t\tthis.Target.value = Get_String(this.Data[0], \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//set it\n\t\t\tthis.Target.focus();\n\t\t}\n\t\t//reset elapsed time as we are about to start typing\n\t\tthis.ElapsedTime = 0;\n\t\t//done with this\n\t\tthis.Mode_TypeText_Focused = true;\n\t}\n\t//text not readied?\n\telse if (!this.Mode_TypeText_TextProcessed)\n\t{\n\t\t//increase elapsed time\n\t\tthis.ElapsedTime += elapsed;\n\t\t//calculate how many keys to type\n\t\tvar cKeysToType = Math.floor(this.Speed * this.ElapsedTime);\n\t\t//calculate remaining time\n\t\tthis.ElapsedTime = this.ElapsedTime - (cKeysToType / this.Speed);\n\n\t\t//while we have keys to type\n\t\twhile (cKeysToType > 0)\n\t\t{\n\t\t\t//one less key to type\n\t\t\tcKeysToType--;\n\t\t\tvar typeDate = /date/i.test(this.Target.getAttribute(\"type\"));\n\t\t\tif (typeDate)\n\t\t\t\tthis.Target.value = this.Data[0];\n\t\t\t//get current value\n\t\t\tvar strCurrent = this.Target.value.replace(/\\r\\n/g, \"\\n\").replace(/\\n/g, \"\\r\\n\");\n\t\t\t//get target value\n\t\t\tvar strTarget = Get_String(this.Data[0], \"\");\n\n\t\t\t//are they the same?\n\t\t\tif (strCurrent == strTarget)\n\t\t\t{\n\t\t\t\t//done with this\n\t\t\t\tthis.Mode_TypeText_TextProcessed = true;\n\t\t\t\t//all done\n\t\t\t\tcKeysToType = 0;\n\t\t\t\t//check the class\n\t\t\t\tswitch (this.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\t\t\t//Not in QA? or in Edge (Edge seems to refuse to fire the OnChange during QA)\n\t\t\t\t\t\tif (typeDate || __BROWSER_EDGE || !(__QA_ON && __QA.UseQACamera()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//trigger edit on change\n\t\t\t\t\t\t\tEdit_ValueChanged(null, this.Target);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\t\t\t\t//fake an Enter action\n\t\t\t\t\t\tComboBox_OnKeyUp({ srcElement: this.Target, target: this.Target, keyCode: 0x0d }, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//target is greater than current and target starts with current\n\t\t\t\tif (strTarget.length > strCurrent.length && strTarget.StartsWith(strCurrent))\n\t\t\t\t{\n\t\t\t\t\t//loop through characters to add (some are ignored by html after we set them)\n\t\t\t\t\tfor (var charToAdd = strTarget.charAt(strCurrent.length), bLoop = true; bLoop; charToAdd = strTarget.charAt(strCurrent.length))\n\t\t\t\t\t{\n\t\t\t\t\t\t//in QA Mode?\n\t\t\t\t\t\tif (__QA_ON && __QA.UseQACamera())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//check this char\n\t\t\t\t\t\t\tswitch (charToAdd)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase '\\r':\n\t\t\t\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\t\t\t\t//ask the qa to type enter\n\t\t\t\t\t\t\t\t\t__QA.TypeReturn();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t//ask the qa to type a char\n\t\t\t\t\t\t\t\t\t__QA.TypeChar(charToAdd);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//end loop\n\t\t\t\t\t\t\tcKeysToType = 0;\n\t\t\t\t\t\t\t//we done\n\t\t\t\t\t\t\tbLoop = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//add the char\n\t\t\t\t\t\t\tstrCurrent += charToAdd;\n\t\t\t\t\t\t\t//check this char\n\t\t\t\t\t\t\tswitch (charToAdd)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase '\\r':\n\t\t\t\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\t\t\t\t//these are removed when added to the html so keep on adding more chars\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase '.':\n\t\t\t\t\t\t\t\t\t//this one can cause problems if the edit is of type number as \"x.\" is not a valid number\n\t\t\t\t\t\t\t\t\tbLoop = /number/i.test(this.Target.type); //only break if its not a number type\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t//we done\n\t\t\t\t\t\t\t\t\tbLoop = false;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//in QA Mode?\n\t\t\t\t\tif (__QA_ON && __QA.UseQACamera())\n\t\t\t\t\t{\n\t\t\t\t\t\t//this a space filled object?\n\t\t\t\t\t\tif (Get_String(this.Object.Properties[__NEMESIS_PROPERTY_SPACEFILLED], null) !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//get the char we are removing\n\t\t\t\t\t\t\tvar removing = strCurrent.charAt(strCurrent.length - 1);\n\t\t\t\t\t\t\t//get the filling char\n\t\t\t\t\t\t\tvar fillingChar = Get_String(this.Object.Properties[__NEMESIS_PROPERTY_FILLINGCHAR], null);\n\t\t\t\t\t\t\t//this the removing char?\n\t\t\t\t\t\t\tif (removing === \" \" || removing === fillingChar)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//ok then enter a loop\n\t\t\t\t\t\t\t\twhile (removing === \" \" || removing === fillingChar)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//remove last character from the current string\n\t\t\t\t\t\t\t\t\tstrCurrent = strCurrent.substring(0, strCurrent.length - 1);\n\t\t\t\t\t\t\t\t\t//get the char we are removing\n\t\t\t\t\t\t\t\t\tremoving = strCurrent.charAt(strCurrent.length - 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//now force it\n\t\t\t\t\t\t\t\tthis.Target.value = strCurrent;\n\t\t\t\t\t\t\t\t//end exit completely (we dont want to get hit by the edge force onchange)\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//ask the qa to delete a char\n\t\t\t\t\t\t__QA.TypeDelete();\n\t\t\t\t\t\t//end loop\n\t\t\t\t\t\tcKeysToType = 0;\n\t\t\t\t\t}\n\t\t\t\t\t//are we removing a end of line?\n\t\t\t\t\telse if (/\\n$|\\r\\n$/i.test(strCurrent))\n\t\t\t\t\t{\n\t\t\t\t\t\t//remove it\n\t\t\t\t\t\tstrCurrent = strCurrent.replace(/\\n$|\\r\\n$/i, \"\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the char we are removing\n\t\t\t\t\t\tvar removing = strCurrent.charAt(strCurrent.length - 1);\n\t\t\t\t\t\t//is it a space? or the filling char?\n\t\t\t\t\t\tif (removing == \" \" || removing == Get_String(this.Object.Properties[__NEMESIS_PROPERTY_FILLINGCHAR], null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we dont count this one\n\t\t\t\t\t\t\tcKeysToType++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//remove last character from the current string\n\t\t\t\t\t\tstrCurrent = strCurrent.substring(0, strCurrent.length - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//not qa? or in Edge (Edge seems to refuse to fire the OnChange during QA)\n\t\t\t\tif (!(__QA_ON && __QA.UseQACamera()) || __BROWSER_EDGE)\n\t\t\t\t{\n\t\t\t\t\t//update value\n\t\t\t\t\tthis.Target.value = strCurrent;\n\t\t\t\t\t//check the class\n\t\t\t\t\tswitch (this.Class)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\t\t\t\t//trigger edit on change\n\t\t\t\t\t\t\tEdit_ValueChanged(null, this.Target);\n\t\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\t//finished!\n\telse\n\t{\n\t\t//finished!\n\t\tthis.State = __CAMERA_CMD_STATE_FINISHED;\n\t}\n}" ]
[ "0.72368354", "0.7207265", "0.7054152", "0.6945238", "0.68852663", "0.6869939", "0.6855101", "0.68446064", "0.68422323", "0.6808665", "0.67775327", "0.6752686", "0.67464894", "0.6743793", "0.6743793", "0.67348385", "0.67348385", "0.6732244", "0.6716871", "0.6642572", "0.6636813", "0.6633185", "0.65988874", "0.65818805", "0.6570062", "0.6561205", "0.65609616", "0.65226376", "0.6503397", "0.65019387", "0.6487279", "0.6484788", "0.64690787", "0.64432997", "0.6438719", "0.643646", "0.64053327", "0.63540554", "0.63477683", "0.62936276", "0.6287649", "0.62803024", "0.61786747", "0.6174159", "0.6173631", "0.6156367", "0.609315", "0.6079341", "0.60661316", "0.60593724", "0.6031734", "0.60106736", "0.5952611", "0.5950718", "0.5879548", "0.58599347", "0.58596504", "0.58396554", "0.5831029", "0.5830447", "0.5773079", "0.575209", "0.5734301", "0.5730111", "0.5709483", "0.57015765", "0.56901556", "0.5681339", "0.5662781", "0.5656044", "0.5656044", "0.5645878", "0.5623628", "0.55930156", "0.5587598", "0.55809426", "0.5559508", "0.55527246", "0.5522354", "0.55084276", "0.5499171", "0.54957765", "0.5493785", "0.5459834", "0.54431415", "0.54323184", "0.54217196", "0.54100084", "0.53913194", "0.5388353", "0.53883195", "0.5382322", "0.5382135", "0.5379033", "0.5369926", "0.5365348", "0.53623295", "0.5359517", "0.53454185", "0.5333312", "0.53304356" ]
0.0
-1
given a string, say A: if its valid B: if there's more in the radix valid not valid more 'more' 'more' no more object false
function radixHas (input) { if (input[0] === '"') { if (input.length > 1 && input[input.length - 1] === '"' && input[input.length - 2] !== '\\') { return { value: input .substr(1, input.length - 2) .replace(/\\"/g, '"'), valid: true, type: 'STRING', stop: true, length: input.length }; } return 'more'; } if (input[0] === '/' && input[1] === '/') { if (input[input.length - 1] === '\n' || input[input.length - 1] === '\0') { return { value: '', type: 'COMMENT', valid: true, stop: true, length: input.length } } return 'more'; } if (input.match(numberRegex)) return { valid: true, type: 'NUMBER', value: Number.parseFloat(input), length: input.length }; var focus = tokenRadix; for (var i = 0; i < input.length; i++) { if (focus[input[i]] !== undefined) { focus = focus[input[i]]; } else { if (input.match(identifierRegex)) return { valid: true, type: 'IDENTIFIER', value: input, length: input.length } return false; } } return focus.valid ? { type: focus.type, valid: true, value: input, length: input.length } : 'more'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function similar_to(num, str) {\n var one_digit = false;\n var digits = num.toString().split('');\n var chars = str.replace(/\\s+/g, '').split('');\n if (chars.length < digits.length) return false;\n for (var i = 0; i < digits.length; i++) {\n var c = chars[i];\n if (c==digits[i]) {\n one_digit = true;\n continue;\n }\n switch (digits[i]) {\n case '0':\n if (c!='o' && c!='O' && c!='6' && c!= '8') return false;\n break;\n case '1':\n if (c!='i' && c!='I' && c!='[' && c!= ']' && c!= '|' && c!='l' && c!=\"'\") return false;\n break;\n case '2':\n if (c!='z' && c!='Z') return false;\n break;\n case '5':\n if (c!='S') return false;\n break;\n case '7':\n if (c!='?') return false;\n break;\n case '8':\n if (c!='3') return false;\n case '9':\n if (c!='g') return false;\n break;\n default:\n return false;\n break;\n }\n }\n return num >= 10 || one_digit;\n}", "function ABCheck(str) {\n\n // First, we declare two regex expressions to match if a and b ever occur three characters apart.\n // Note that . is a \"wildcard\" metacharacterin regex that matches almost any character.\n var testOne = /a...b/;\n var testTwo = /b...a/;\n\n // Next, we use the test method in conjunction with the regex expressions to see if our string contains any matching characters\n var aThenB = testOne.test(str);\n var bThenA = testTwo.test(str);\n\n // Finally, we return our answer\n return aThenB || bThenA;\n}", "function ab_Check(str)\n {\n return (/a...b/).test(str) || (/b...a/).test(str);\n }", "function ABCheck(str) {\n for (let i = 0; i < str.length; i++) {\n if ((str[i] === \"a\" && str[i + 4] === \"b\") || (str[i] === \"b\" && str[i + 4] === \"a\")) {\n return true;\n }\n }\n return false;\n}", "function isConsBits(/*String:digit string string for checking*/ digit){\n for(var i=1; i<digit.length-1; i++ ){\n var formerBit = parseInt(digit[i-1],10);\n var currentBit = parseInt(digit[i],10);\n var latterBit = parseInt(digit[i+1],10);\n if(formerBit+1==currentBit && currentBit+1 == latterBit) {\n return true;\n }\n }\n return false;\n\n}", "function ABCheck(str) {\n var i = str.indexOf('a');\n while (i != -1 && i + 4 < str.length) {\n if (str.charAt(i + 4) == 'b')\n return true;\n i = str.indexOf('a', i + 1);\n }\n return false;\n}", "function tryParse(s, radix, initial) {\n if (s != null && /\\S/.test(s)) {\n if (radix === 10) {\n const v = +s;\n if (!Number.isNaN(v)) {\n return [true, v];\n }\n }\n }\n return [false, initial != null ? initial : 0];\n }", "function ABCheck(str) { \n var components = str.toLowerCase().split('');\n for (i = 0; i < components.length; i++) {\n if ((components[i] === 'a') && ((components[i - 4] === 'b') || (components[i + 4] === 'b'))) {\n return true;\n } else if ((components[i] === 'b') && ((components[i - 4] === 'a') || (components[i + 4] === 'a'))) {\n return true;\n } \n }\n return false;\n}", "function check_aba(s) {\r\n\r\n var i, n, t;\r\n\r\n // First, remove any non-numeric characters.\r\n\r\n t = \"\";\r\n for (i = 0; i < s.length; i++) {\r\n c = parseInt(s.charAt(i), 10);\r\n if (c >= 0 && c <= 9)\r\n t = t + c;\r\n }\r\n\r\n // Check the length, it should be nine digits.\r\n\r\n if (t.length != 9)\r\n return false;\r\n\r\n // Now run through each digit and calculate the total.\r\n\r\n n = 0;\r\n for (i = 0; i < t.length; i += 3) {\r\n n += parseInt(t.charAt(i), 10) * 3\r\n + parseInt(t.charAt(i + 1), 10) * 7\r\n + parseInt(t.charAt(i + 2), 10);\r\n }\r\n\r\n // If the resulting sum is an even multiple of ten (but not zero),\r\n // the aba routing number is good.\r\n\r\n if (n != 0 && n % 10 == 0)\r\n return true;\r\n else\r\n return false;\r\n }", "function validAnagram (str1, str2) {\n let obj = {};\n if (str1.length !== str2.length) return false;\n for (let char of str1) {\n obj[char] = obj[char] ? obj[char] + 1 : 1;\n }\n for (let char of str2) {\n if (!obj[char]) {\n return false;\n } else {\n obj[char]--;\n }\n }\n return true;\n}", "function checkAB(str) {\n\tvar response = false;\n\tvar arrStr = str.split('');\n\tvar jarak_ab = 0;\n\tvar jarak_ba = 0;\n\n\touterloop: for (var i = 0; i < arrStr.length; i++) {\n\t\tif (arrStr[i] === 'a') {\n\t\t\tfor (var j = 0; j < arrStr.length; j++) {\n\t\t\t\tif (arrStr[j] === 'b') {\n\t\t\t\t\tjarak_ab = Math.abs(j - i);\n\n\t\t\t\t\tif (jarak_ab === 4) {\n\t\t\t\t\t\tresponse = true;\n\t\t\t\t\t\tbreak outerloop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (arrStr[i] === 'b') {\n\t\t\tfor (var j = 0; j < arrStr.length; j++) {\n\t\t\t\tif (arrStr[j] === 'a') {\n\t\t\t\t\tjarak_ba = Math.abs(j - i);\n\n\t\t\t\t\tif (jarak_ba === 4) {\n\t\t\t\t\t\tresponse = true;\n\t\t\t\t\t\tbreak outerloop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn response;\n}", "function checkAB1(str) {\r\n\r\n for (let i = 0; i < str.length; i++) {\r\n if (str[i] === 'a' && str[i + 4] === 'b') {\r\n return true\r\n } else if (str[i] === 'b' && str[i + 4] === 'a') {\r\n return true\r\n }\r\n }\r\n return false\r\n}", "function ABCheck(str) {\n var arr = str.split(\"\");\n\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] === \"a\") {\n for(var j = 0 ; j < arr.length; j++) {\n if(arr[j] === \"b\" && Math.abs(j - i) === 4) {\n return \"true\";\n }\n }\n\n }\n }\n\n return false;\n}", "function checknum(obj){\n\t\tvar maxnum,maxnext,maxnnex,wrongnum=0;\n\t\tfor(var i=0;i<obj.length;i++){\n\t\t\tmaxnum=obj.substring(i,i+1);\n\t\t\tmaxnext=obj.substring(i+1,i+2);\n\t\t\tmaxnnex=obj.substring(i+2,i+3);\n\t\t\tif(maxnum==maxnext){\n\t\t\t\tif(maxnum==maxnnex){\n\t\t\t\t\twrongnum++;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tif(wrongnum>=1){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function isDigitStr(str2) {\n return typeof str2 === \"string\" && str2.charCodeAt(0) >= 48 && str2.charCodeAt(0) <= 57;\n }", "function isDigitStr(str2) {\n return typeof str2 === \"string\" && str2.charCodeAt(0) >= 48 && str2.charCodeAt(0) <= 57;\n }", "function ABCheck(str) {\n\n for (var i = 0; i < str.length; i++) {\n if (str[i] === 'a' && str[i + 4] === 'b') {\n return true;\n }\n\n }\n return false;\n}", "function isDigitOrBar( str ) {\n\tfor(var i=0; i < str.length; i++) {\n\t\tvar ch= str.charAt(i);\n\t\tif((ch < \"0\" || ch > \"9\") && ch!=\"-\") {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function alphanum(a, b) {\n function chunkify(t) {\n var tz = [];\n var y = -1;\n var n = 0;\n\n for (var i = 0; i <= t.length; i++) {\n var _char = t.charAt(i);\n\n var charCode = _char.charCodeAt(0);\n\n var m = charCode === 46 || charCode >= 48 && charCode <= 57;\n\n if (m !== n) {\n tz[++y] = '';\n n = m;\n }\n\n tz[y] += _char;\n }\n\n return tz;\n }\n\n function stringfy(v) {\n if (typeof v === 'number') {\n v = \"\".concat(v);\n }\n\n if (!v) {\n v = '';\n }\n\n return v;\n }\n\n var aa = chunkify(stringfy(a));\n var bb = chunkify(stringfy(b));\n\n for (var x = 0; aa[x] && bb[x]; x++) {\n if (aa[x] !== bb[x]) {\n var c = Number(aa[x]);\n var d = Number(bb[x]);\n\n if (c === aa[x] && d === bb[x]) {\n return c - d;\n }\n\n return aa[x] > bb[x] ? 1 : -1;\n }\n }\n\n return aa.length - bb.length;\n}", "function isCharClass(a, b, step, isNum, isDescending) {\n if (isDescending) {\n return false;\n }\n if (isNum) {\n return a <= 9 && b <= 9;\n }\n if (a < b) {\n return step === 1;\n }\n return false;\n}", "function isStringA_le_B (a, b) {\n let la = a.length;\n let lb = b.length;\n return(((la < lb) || ((la == lb) && (a <= b))));\n}", "function isCharClass(a, b, step, isNum, isDescending) {\n if (isDescending) { return false; }\n if (isNum) { return a <= 9 && b <= 9; }\n if (a < b) { return step === 1; }\n return false;\n}", "function isCharClass(a, b, step, isNum, isDescending) {\n if (isDescending) { return false; }\n if (isNum) { return a <= 9 && b <= 9; }\n if (a < b) { return step === 1; }\n return false;\n}", "function stringChecker(a,b, myFunc){\n // we initialize our results\n let results;\n // if the length of b !== the length of a\n if (String(b).length !== String(a).length){\n // we know the answer is false\n return false;\n } else{\n // we convert our strings/integers to arrays.\n // stringConverter- returns 2 arrays within an array.\n results = stringConverter(a,b);\n // we then compare the frequency of our two arrays\n return myFunc(results[0],results[1]);\n };\n \n}", "function checkAB (num) {\n num = num.split('')\n\n // console.log(num)\n for (let counter = 0; counter < num.length; counter++) {\n if (num[counter] === 'a' && (num[counter - 4] === 'b' || num[counter + 4] === 'b')) {\n return true\n }\n }\n return false\n}", "function compareNumStr(a, b) {\n if (a.length > b.length) {\n return 1\n } else if (a.length < b.length) {\n return -1\n }\n if (a > b) {\n return 1\n } else if (a < b) {\n return -1\n }\n return 0\n}", "function caml_string_lessthan(s1, s2) {\n (s1.t & 6) && caml_convert_string_to_bytes(s1);\n (s2.t & 6) && caml_convert_string_to_bytes(s2);\n return (s1.c < s2.c)?1:0;\n}", "function validAnagram(str1, str2) {\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n if (str1 === str2) {\n return true;\n }\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n let anagram1 = {};\n\n for (let char of str1) {\n anagram1[char] = ++anagram1[char] || 1;\n }\n\n console.log('obj: ', anagram1);\n\n for (let char of str2) {\n if (!anagram1[char]) {\n return false;\n } else {\n anagram1[char] -= 1;\n }\n }\n return true;\n}", "function isAValidMessage(message){\n // your code\n const str = message.split(/[0-9]/g).filter((elm) => elm !== '');\n const num = message.split(/[a-zA-Z]/g).filter((elm) => elm !== '');\n let result;\n\n if (message === \"\") {\n return true;\n }\n \n if (/\\s/.test(message)) {\n return false;\n }\n \n if (/[a-zA-Z]/.test(message[0])) {\n return false;\n }\n \n const mathMin = Math.min(num.length, num.length);\n for (let i = 0; i < mathMin; i += 1) {\n if (\n // str[i].length == 'undefined' || \n str[i].length !== +num[i]\n || num.length !== str.length\n ) {\n // console.log('str[i]=> ', str[i]);\n // console.log('str[i].length=> ', str[i].length);\n // console.log('str[i].length=> +num[i] ', str[i].length, +num[i]);\n // console.log('num=> ', num);\n // console.log('+num[i]=> ', +num[i]);\n // console.log('num.length=> ', num.length);\n // console.log('str.length=> ', str.length);\n result = false;\n return result;\n } else {\n // console.log('str[i]=> ', str[i]);\n // console.log('str[i].length=> ', str[i].length);\n // console.log('str[i].length=> +num[i] ', str[i].length, +num[i]);\n // console.log('num=> ', num);\n // console.log('+num[i]=> ', +num[i]);\n // console.log('num.length=> ', num.length);\n // console.log('str.length=> ', str.length);\n result = true;\n }\n }\n // console.log(message)\n // console.log('result=> ', result)\n return result;\n}", "function isBeautifulString(inp) {\n let alph = \"abcdefghijklmnopqrstuvwxyz\";\n //arrange letters of input string ascending so\n //we can test whether the given letter's quantity is\n //<= that of the previous letter in the alphabet.\n let arr = inp.split(\"\").sort().join(\"\");\n //Next three lines check if input string contains consecutive\n //letters and returns false if not the case. This was added due to 'zaa'\n //fail.\n let uniq = [...new Set(arr)].join(\"\");\n let consecutiveCheck = alph.match(uniq);\n if (consecutiveCheck === null) return false;\n //Breaks sorted string into groups of the same character\n let byLet = arr.match(/([a-z])\\1*/g);\n //Gives an array of the quantities of each character in string\n let quans = byLet.map((i) => i.length);\n //Checks that the quantity of a given letter is less than or equal to\n //the preceeding letter\n let pass = quans.slice(1).map((v, i) => v <= quans[i]);\n //Checks that that's always the case\n let bigPass = pass.every((i) => i === true);\n console.log(arr);\n console.log(\"uniq\", uniq);\n console.log(\"consecutiveCheck\", consecutiveCheck);\n console.log(byLet);\n console.log(quans);\n console.log(quans.slice(1));\n console.log(pass);\n console.log(bigPass);\n console.log(\"test\", alph.split(\"\").includes(\"a\"));\n //Both cases have to be true, as 'bbc' and 'yyz' failed\n //(because there are more b's than a's given that a is not present etc.);\n return bigPass && byLet[0][0] === \"a\";\n}", "function ABCheck(str) {\n var rightCheck = /a...b/; // Declare regex to match characters \"a\" and \"b\" that occur 3 letters apart.\n var leftCheck = /b...a/; // The use of \".\" matches (nearly) any character.\n return rightCheck.test(str) || leftCheck.test(str); // Return true (due to .test method being applied) if either of the two conditions are satisified (if there is a match in our input string). If not, return false.\n}", "function isNumberOrAlphabet(str) {\nfor(var i=0;i<str.length;i++) {\nvar c=str.charCodeAt(i);\nif(c<0x0030 || (c>0x0039 && c<0x0041) || (c>0x005A && c<0x0061) || c>0x007A) return false;\n}\nreturn true;\n}", "function check(str){\n if ( /a...b/.test(str) || /b...a/.test(str) ) return true;\n return false;\n}", "function isBalanced2(s) {\n let aux = -1;\n \n while (s.length != 0) {\n aux = s.length;\n s = s.replace(\"()\",\"\");\n s = s.replace(\"[]\",\"\");\n s = s.replace(\"{}\",\"\");\n \n if (aux == s.length) return \"NO\";\n }\n\n return \"YES\";\n\n}", "function checkPerms(s1, s2) { //case-sensitive; assume whitespace is significant; only ASCII inputs\n\tvar l1 = s1.length;\n\tvar l2 = s2.length;\n\tif (l1 !== l2) return false;\n\n\tvar chars = {};\n\tfor (var i = 0, l = l1; i < l; i++) {\n\t\tif (chars[s1[i]]) chars[s1[i]] += 1;\n\t\telse chars[s1[i]] = 1;\n\t}\n\tfor (var i = 0, l = l2; i < l; i++) {\n\t\tif (chars[s2[i]]) chars[s2[i]] -= 1;\n\t\telse return false;\n\n\t\tif (chars[s2[i]] < 0) return false;\n\t}\n\treturn true;\n}", "function isBalanced(str) {\n // Good luck!\n return false;\n}", "function checkIsOver(str, num) {\n return str.length > num;\n //this is going to be analyzed as true or false\n}", "_isNegative(value, radix) {\n const that = this,\n valueLength = value.length,\n firstCharacter = value.charAt(0).toLowerCase();\n\n if (radix === 2) {\n return valueLength === that._wordLengthNumber && firstCharacter === '1';\n }\n else if (radix === 8) {\n switch (that._wordLengthNumber) {\n case 8:\n return valueLength === 3 && (firstCharacter === '2' || firstCharacter === '3');\n case 16:\n return valueLength === 5 && firstCharacter === '1';\n case 32:\n return valueLength === 11 && (firstCharacter === '2' || firstCharacter === '3');\n case 64:\n return valueLength === 22 && firstCharacter === '1';\n }\n }\n else {\n return valueLength === that._wordLengthNumber / 4 && ['8', '9', 'a', 'b', 'c', 'd', 'e', 'f'].indexOf(firstCharacter) !== -1;\n }\n }", "function validateISBN(isbn) {\n\tif(isbn.match(/[^0-9xX\\.\\-\\s]/)) {\n\t\treturn false;\n\t}\n\n\tisbn = isbn.replace(/[^0-9xX]/g,'');\n\n\tif(isbn.length != 10 && isbn.length != 13) {\n\t\treturn false;\n\t}\n\n\t\tcheckDigit = 0;\n\tif(isbn.length == 10) {\n\t\tcheckDigit = 11 - ( (\n\t\t\t\t\t\t\t\t 10 * isbn.charAt(0) +\n\t\t\t\t\t\t\t\t 9 * isbn.charAt(1) +\n\t\t\t\t\t\t\t\t 8 * isbn.charAt(2) +\n\t\t\t\t\t\t\t\t 7 * isbn.charAt(3) +\n\t\t\t\t\t\t\t\t 6 * isbn.charAt(4) +\n\t\t\t\t\t\t\t\t 5 * isbn.charAt(5) +\n\t\t\t\t\t\t\t\t 4 * isbn.charAt(6) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(7) +\n\t\t\t\t\t\t\t\t 2 * isbn.charAt(8)\n\t\t\t\t\t\t\t\t) % 11);\n\n\t\tif(checkDigit == 10) {\n\t\t\treturn (isbn.charAt(9) == 'x' || isbn.charAt(9) == 'X') ? true : false;\n\t\t} else {\n\t\t\treturn (isbn.charAt(9) == checkDigit ? true : false);\n\t\t}\n\t} else {\n\t\tcheckDigit = 10 - ((\n\t\t\t\t\t\t\t\t 1 * isbn.charAt(0) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(1) +\n\t\t\t\t\t\t\t\t 1 * isbn.charAt(2) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(3) +\n\t\t\t\t\t\t\t\t 1 * isbn.charAt(4) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(5) +\n\t\t\t\t\t\t\t\t 1 * isbn.charAt(6) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(7) +\n\t\t\t\t\t\t\t\t 1 * isbn.charAt(8) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(9) +\n\t\t\t\t\t\t\t\t 1 * isbn.charAt(10) +\n\t\t\t\t\t\t\t\t 3 * isbn.charAt(11)\n\t\t\t\t\t\t\t\t) % 10);\n\n\t\tif(checkDigit == 10) {\n\t\t\treturn (isbn.charAt(12) == 0 ? true : false) ;\n\t\t} else {\n\t\t\treturn (isbn.charAt(12) == checkDigit ? true : false);\n\t\t}\n\t}\n}", "function canConstruct(ransomNote, magazine) {\n let ransomChars = {};\n let magazineChars = {};\n\n for(let i = 0; i < ransomNote.length; i++) {\n let ransomChar = ransomNote[i];\n if (ransomChars[ransomChar]) {\n ransomChars[ransomChar] += 1;\n } else {\n ransomChars[ransomChar] = 1;\n }\n }\n\n for(let j = 0; j < magazine.length; j++) {\n let magChar = magazine[j];\n if (magazineChars[magChar]) {\n magazineChars[magChar] += 1;\n } else {\n magazineChars[magChar] = 1;\n }\n }\n\n for(let key of Object.keys(ransomChars)) {\n if (!magazineChars[key] || ransomChars[key] > magazineChars[key]) {\n return false;\n }\n }\n\n return true;\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let char = str1[i];\n lookup[char] ? (lookup[char] += 1) : (lookup[char] = 1);\n }\n\n for (let i = 0; i < str1.length; i++) {\n let char = str2[i];\n if (!lookup[char]) {\n return false;\n } else {\n lookup[char] -= 1;\n }\n }\n\n return true;\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n // check if str1 has the same length as str2 & same characters\n if(str1.length !== str2.length){\n return false\n }\n // create an object call lookup\n let lookup = {}\n// construct the object first\n for (let i = 0; i < str1.length; i++){\n letter = str1[i]\n //if letter exits, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n for (let i = 0; i < str2.length; i++){\n let letter = second[i];\n // can't find letter of letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n return true;\n }\n}", "function isBeautifulString(inputString) {\n inputString = inputString.split('');\n var letterObject = {\n 'a': 0,\n 'b': 0,\n 'c': 0,\n 'd': 0,\n 'e': 0,\n 'f': 0,\n 'g': 0,\n 'h': 0,\n 'i': 0,\n 'j': 0,\n 'k': 0,\n 'l': 0,\n 'm': 0,\n 'n': 0,\n 'o': 0,\n 'p': 0,\n 'q': 0,\n 'r': 0,\n 's': 0,\n 't': 0,\n 'u': 0,\n 'v': 0,\n 'w': 0,\n 'x': 0,\n 'y': 0,\n 'z': 0\n };\n var max = Infinity;\n var isGood = true;\n for(var i = 0; i < inputString.length; i++){\n letterObject[inputString[i]]++;\n }\n Object.keys(letterObject)\n .sort()\n .forEach(function(v, i){\n if(letterObject[v] <= max){\n max = letterObject[v];\n }else{\n isGood = false;\n }\n });\n return isGood;\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n if (str1.length !== str2.length ) {\n return false\n }\n\n let strObj = {};\n\n for (let val in str1 ) {\n // for strings you need to do strObj[str1[val]]\n // if key exists add to it if not create it\n strObj[str1[val]] = (strObj[str1[val]] || 0) + 1;\n }\n\n for (let val in str2) {\n strObj[str2[val]] = (strObj[str2[val]] || 0) + 1;\n }\n\n // now loop over the to see if the values are even\n for (let key in strObj) {\n if (strObj[key] % 2 !== 0) {\n return false\n }\n }\n\n return true\n\n}", "function validAnagram(str1, str2) {\n\tif (str1.length !== str2.length) return false;\n\n\t// Does the strings have the same chars and its counts\n\t// { a: 2, b: 1, r: 3, o: 5}\n\tlet freq1 = {};\n\tlet freq2 = {};\n\n\t// Iterate trough the strings and add the chars to the freq counters\n\tfor (let i of str1) {\n\t\tfreq1[i] = freq1[i] ? freq1[i] + 1 : 1;\n\t}\n\tfor (let i of str2) {\n\t\tfreq2[i] = freq2[i] ? freq2[i] + 1 : 1;\n\t}\n\tconsole.log(freq1, freq2);\n\t// Compare the strings and return bool\n\tfor (let i in freq1) {\n\t\tif (!(i in freq2)) {\n\t\t\treturn false;\n\t\t}\n\t\t// if the value of the key is diffrent\n\t\tif (freq1[i] !== freq2[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "alphanumCase (a, b) {\n function chunkify(t) {\n var tz = new Array();\n var x = 0, y = -1, n = 0, i, j;\n while (i = (j = t.charAt(x++)).charCodeAt(0)) {\n var m = (i == 46 || (i >=48 && i <= 57));\n if (m !== n) {\n tz[++y] = '';\n n = m;\n }\n tz[y] += j;\n }\n return tz;\n }\n\n var aa = chunkify(a.toLowerCase());\n var bb = chunkify(b.toLowerCase()); \n for (let x = 0; aa[x] && bb[x]; x++) {\n if (aa[x] !== bb[x]) {\n var c = Number(aa[x]), d = Number(bb[x]);\n if (c == aa[x] && d == bb[x]) {\n return c - d;\n } else return (aa[x] > bb[x]) ? 1 : -1;\n }\n }\n return aa.length - bb.length;\n }", "function ExOh(str) { \n var numx= str.match(/x/gi);\n var numy=str.match(/o/gi);\n if (numx!==null && numy!==null) return numx.length == numy.length;\n else return false; \n}", "function validAnagram(str1, str2) {\n if(str1.length !== str2.length) {\n return false;\n }\n \n let lookup = {};\n \n for(i = 0; i < str1.length; i++){\n let letter = str1[i]\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n \n for(let j = 0; j < str2.length; j++) {\n let letter = str2[j]\n if(!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1\n }\n }\n return true;;\n}", "function isEqualNumXandO(string) {\n let xx = string.toLowerCase();\n if ((xx.split(\"o\").length - 1) === (xx.split(\"x\").length - 1)) {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "function isStringNumOrg(str,intmax,dotmax,neg)\n{\n\tvar result = true;\n \tif(str == null || str.trim() == \"\") return false;\n\t\n\tstr = str.trim();\n\t\n\tvar dotnum = 0;\n\tvar numlen = str.length;\n\tvar dotlen = 0;\n\tfor(var i=0; i<str.length; i++)\n {\n var strSub = str.substring(i,i+1); \n if( !(strSub<=\"9\"&&strSub>=\"0\") )\n {\n \tif(strSub==\".\")\n \t{\n \t\tdotnum = dotnum + 1;\n \t\tnumlen = numlen -1;\n \t\tdotlen = str.length - i -1;\n \t\tif(dotnum > 1)\n \t\t{\n\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n \t\tcontinue;\n \t}\n \tif(neg)\n \t{\n \t\tif(!(strSub==\"-\" && i==0))\n\t\t\t\t{\n\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tnumlen = numlen -1;\n \t}\n \telse\n \t{\n\t\t\t\tresult = false;\n\t\t\t\tbreak;\n\t\t\t}\n }\n }\n numlen = numlen - dotlen;\n if(result)\n {\n\t if(dotmax > 0)\n\t {\t \t\n\t \tif(result && (intmax > 0) && (intmax < numlen )) \n\t \t\tresult = false;\n\t \tif(result && (dotmax < dotlen )) \n\t \t\tresult = false;\n\t }\n\t else\n\t {\n\t \tif(result && (dotlen > 0)) \n\t \t\tresult = false;\n\t \tif(result && (intmax > 0) && (intmax < numlen )) \n\t \t\tresult = false;\n\t }\n\t}\n return result ;\t\n}", "function validAnaram2(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n //Initalize object\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n //if letter exists, incremnt, otherwise set to 1\n lookup[letter] ? (lookup[letter] += 1) : (lookup[letter] = 1);\n }\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n //Cant find letter or letter is zero then its not an anagram\n //Because zero is falsey\n if (!lookup[letter]) {\n return false;\n } else {\n //If letter exists, subtract one, one is truthy\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function isAlsoPermutation(strA, strB) {\n if (strA.length !== strB.length) {\n return false;\n }\n\n var charCount = {};\n\n for (var i = 0; i < strA.length; i++) {\n if (charCount[strA[i]] === undefined) {\n charCount[strA[i]] = 1;\n } else {\n charCount[strA[i]]++;\n }\n }\n\n for (var j = 0; j < strB.length; j++) {\n if (charCount[strB[j]] === undefined) {\n return false;\n }\n\n charCount[strB[j]]--;\n\n if (charCount[strB[j]] < 0) {\n return false;\n }\n }\n return true;\n}", "function isValidIBAN($v)\n {\n $v = $v.replace(/^(.{4})(.*)$/,\"$2$1\"); //Move the first 4 chars from left to the right\n //Convert A-Z to 10-25\n $v = $v.replace(\n /[A-Z]/g,\n function ($e) {\n return $e.charCodeAt(0) - 'A'.charCodeAt(0) + 10;\n }\n );\n var $sum = 0;\n var $ei = 1; //First exponent\n for (var $i = $v.length - 1; $i >= 0; $i--) {\n $sum += $ei * parseInt($v.charAt($i),10); //multiply the digit by it's exponent\n $ei = ($ei * 10) % 97; //compute next base 10 exponent in modulus 97\n }\n return $sum % 97 == 1;\n }", "function isValid(s) {\n let buffer = {};\n\n for (let char of s) {\n if (!buffer[char]) {\n buffer[char] = 1\n } else {\n buffer[char]++;\n }\n }\n\n let freq;\n let except;\n let keys = Object.keys(buffer);\n\n if (buffer[keys[0]] == buffer[keys[1]]) {\n freq = buffer[keys[0]];\n except = buffer[keys[2]];\n } else if (buffer[keys[0]] == buffer[keys[2]]) {\n freq = buffer[keys[0]];\n except = buffer[keys[1]];\n } else if (buffer[keys[1]] == buffer[keys[2]]) {\n freq = buffer[keys[1]];\n except = buffer[keys[0]];\n } else {\n return 'NO'\n }\n\n if (Math.abs(freq - except) > 1) {\n return 'NO'\n }\n\n let flag = false;\n\n for (let idx in buffer) {\n if (buffer[idx] != freq) {\n if (flag) {\n return 'NO'\n } else {\n flag = true;\n }\n }\n }\n return 'YES';\n}", "function isValid(str) {\n var mp = new Map([\n [\n '{', 1\n ], [\n '}', -1\n ], [\n '[', 2\n ], [\n ']', -2\n ], [\n '(', 3\n ], [\n ')', -3\n ]\n ])\n var arr = str.split('');\n var result = [];\n arr.forEach(item => {\n //括号相等\n if( mp.get( ...result.slice(-1) ) + mp.get(item) === 0){\n result.pop()\n } else {\n result.push(item)\n }\n })\n return result.length === 0;\n}", "function checkAB(str) {\n var tampungA = []\n var tampungB = []\n\n for (var i = 0; i < str.length; i++){\n if (str[i] === 'a'){\n tampungA.push(i)\n }\n else if (str[i] === 'b'){\n tampungB.push(i)\n }\n }\n var jarak = []\n for (var j = 0; j < tampungA.length; j++){\n var flag = false\n for (var k = 0; k < tampungB.length; k++){\n var jarak2 = Math.abs(tampungA[j] - tampungB[k])\n jarak.push(jarak2)\n }\n }\n\n \n if(tampungB.length < 1 || tampungA.length < 1) {\n return false\n}\n\n for (var a = 0; a < jarak.length; a++){\n if (jarak[a] === 4){\n return true\n } \n}\n\nreturn false\n\n}", "function validCreditNum(str) {\n var checkDigit = parseInt(str.charAt(str.length-1));\n var totalNumbers=0;\n var reverseArr = str.slice(0,-1).split(\"\").reverse();\n\n for(var i=0; i<reverseArr.length; i++) {\n if (i % 2 === 0)\n reverseArr[i] *= 2;\n if (reverseArr[i] > 9)\n reverseArr[i] -= 9;\n totalNumbers += parseInt(reverseArr[i]);\n }\n return ((totalNumbers + checkDigit) % 10 === 0);\n }", "static fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity')\n return Long.ZERO;\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n (radix = unsigned), (unsigned = false);\n }\n else {\n unsigned = !!unsigned;\n }\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n let p;\n if ((p = str.indexOf('-')) > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return Long.fromString(str.substring(1), unsigned, radix).neg();\n }\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n const radixToPower = Long.fromNumber(Math.pow(radix, 8));\n let result = Long.ZERO;\n for (let i = 0; i < str.length; i += 8) {\n const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n const power = Long.fromNumber(Math.pow(radix, size));\n result = result.mul(power).add(Long.fromNumber(value));\n }\n else {\n result = result.mul(radixToPower);\n result = result.add(Long.fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n }", "function jsoo_z_of_js_string_base(base, s) {\n if (base == 0) { // https://github.com/ocaml/Zarith/blob/b8dbaf48a7927061df699ad7ce642bb4f1fe5308/caml_z.c#L598\n base = 10;\n var p = 0;\n var sign = 1;\n if(s[p] == '-') { sign = -1; p++ }\n else if (s[p] == '+') { p++ }\n if (s[p] == '0') {\n p ++;\n if (s.length == p) {\n return 0;\n } else {\n var bc = s[p];\n if (bc == 'o' || bc == 'O') {\n base = 8;\n } else if (bc == 'x' || bc == 'X') {\n base = 16;\n } else if (bc == 'b' || bc == 'B') {\n base = 2;\n }\n if(base != 10) {\n s = s.substring(p+1);\n if(sign == -1) s = \"-\" + s;\n }\n }\n }\n }\n //remove leading '+'\n if (s[0] == '+') s = s.substring(1);\n //remove leading '0's\n s = s.replace(/^0+/, '');\n //normalize \"empty\" numbers\n if(s == '-' || s == '') s = '0';\n\n function digit(code){\n if(code >= 48 && code <= 57) return code - 48;\n if(code >= 97 && code <= 102) return code - 97 + 10;\n if(code >= 65 && code <= 70) return code - 65 + 10;\n }\n var i = 0;\n if(s[i] == '-') i++;\n for( ; i < s.length ; i++){\n var c = digit(s.charCodeAt(i));\n if(c == undefined || c >= base)\n caml_invalid_argument(\"Z.of_substring_base: invalid digit\");\n }\n return ml_z_normalize(bigInt(s, base));\n \n}", "function anagrams(stringA, stringB) {\n let charMap = {};\n let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');\n let specialChars = [0,0];\n for ( let i = 0; i < stringA.length; i++ ) {\n let currentChar = stringA[i].toLowerCase();\n if ( alphabet.indexOf(currentChar) !== -1 ) {\n if ( !charMap[currentChar] ) charMap[currentChar] = 0;\n charMap[currentChar] ++;\n }\n else {\n specialChars[0]++;\n }\n }\n \n for ( let i = 0; i < stringB.length; i++ ) {\n let currentChar = stringB[i].toLowerCase();\n if ( alphabet.indexOf(currentChar) === -1 ) specialChars[1]++;\n else {\n if ( !charMap[currentChar] ) {\n console.log(currentChar);\n return false;\n }\n charMap[currentChar]--;\n if ( charMap[currentChar] === 0 ) delete charMap[currentChar];\n }\n }\n if ( Object.keys(charMap).length > 0 ) return false;\n //console.log(st)\n return (stringA.length - specialChars[0]) === (stringB.length - specialChars[1])\n }", "function JL_bccomp( a, b){\n\tif (a.length > b.length){ return 1; }\t\n\tif (a.length < b.length){ return -1; }\n\tvar i= 0; while ( a.charAt(i)==b.charAt(i) && ++i<a.length){ }\n\tif ( i==a.length){ return 0; }\n\tif ( parseInt( a.charAt(i)) > parseInt( b.charAt(i))){ return 1; }\t\n\treturn -1;\t\t\n}", "function validAnagram(str1, str2) {\n // add whatever parameters you deem necessary - good luck!\n // Run checks if string is empty or strings are not same length\n if (str1 === \"\" && str2 === \"\") {\n return true;\n }\n if (str1.length !== str2.length) {\n return false;\n }\n //Initalize objects for counters\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n //Create Objects through iteration\n for (let val of str1) {\n freqCounter1[val] = (freqCounter1[val] || 0) + 1;\n }\n for (let val of str2) {\n freqCounter2[val] = (freqCounter2[val] || 0) + 1;\n }\n\n //Iterate through one ob\n for (let key in freqCounter1) {\n if (!(key in freqCounter2)) {\n return false;\n }\n if (freqCounter2[key] !== freqCounter1[key]) {\n return false;\n }\n }\n return true;\n}", "function telephoneCheck(str) {\r\n if (!parseInt(str[0],10)){\r\n if (str[0] !== '('){\r\n return false;\r\n }\r\n }\r\n var n= /\\d/g;\r\n var p= /\\d|\\(|\\)/g;\r\n var base = str.match(n).join('');\r\n var par = str.match(p).join('');\r\n var p1 = -1;\r\n var p2 = -1;\r\n console.log(base);\r\n if (base.length === 10){\r\n console.log(\"added 1 to beginning\");\r\n base = \"1\"+base;\r\n par = \"1\"+par;\r\n }\r\n else if(base.length === 11){\r\n if (base[0] !== \"1\"){\r\n console.log(\"invalid country code\");\r\n return false;\r\n }\r\n }\r\n else{\r\n console.log(\"invalid number of digits\");\r\n return false;\r\n }\r\n p1 = par.indexOf('(');\r\n p2 = par.lastIndexOf(')');\r\n if (p1 >= 0 || p2 >= 0){\r\n console.log(\"contains parenthases\");\r\n console.log(par);\r\n if (p1 >= 0 && p2 >= 0){\r\n if(p1 !== 1){\r\n return false;\r\n }\r\n else{\r\n if (p2 !== 5){\r\n return false;\r\n }\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function validAnagram(str1, str2){\n // check length is the same, if so FALSE\n if (str1.length !== str2.length) return false;\n let obj1 = {}\n let obj2 = {}\n // make object 1 for str1: 1 for loop\n for (let char of str1) {\n obj1[char] = (obj1[char] || 0) + 1;\n }\n // make object 2 for str1: 1 for loop\n for (let char of str2) {\n obj2[char] = (obj2[char] || 0) + 1;\n }\n // compare objects!: 1 for loop \n for (let key in obj1) {\n // make sure each key for obj1 is in obj2\n if (!(key in obj2)) return false;\n // make sure each key value for obj1 is the same for obj2 \n if (obj1[key] !== obj2[key]) return false;\n }\n return true}", "function checkibancore(iban) {\n\tvar standard = -1;\n\tillegal = /\\W|_/; // contains chars other than (a-zA-Z0-9)\n\tif(illegal.test(iban)) { // yes, alert and exit\n\t\tillegal = /((\\W|_)+)/g;\n\t\tvar ichars;\n\t\tvar aliban = \"\";\n\t\tvar lindex = -1;\n\t\twhile (ichars = illegal.exec(iban)) {\n\t\t\taliban += iban.substring(lindex+1,ichars.index)+\"<strong>\"+ichars[1]+\"</strong>\";\n\t\t\tlindex = ichars.index;\n\t\t}\n\t\taliban += iban.substr(lindex+1);\n\t\taliban = aliban.replace(/\\|/g, \"%7C\");\n\t\talert(aliban+\"\\n\\n\"+altxt[0]);\n\t\treturn \"0\"; }\n\telse { // no, continue\n\t\tillegal = /^\\D\\D\\d\\d.+/; // first chars are letter letter digit digit\n\t\tif(illegal.test(iban) == false) { // no, alert and exit\n\t\t\talert(\"|\"+iban.substr(0,4)+\"|\"+iban.substr(5)+\"\\n\\n\"+altxt[1]);\n\t\t\treturn \"0\"; }\n\t\telse { // yes, continue\n\t\t\tillegal = /^\\D\\D00.+|^\\D\\D01.+|^\\D\\D99.+/; // check digit are 00 or 01 or 99\n\t\t\tif(illegal.test(iban)) { // yes, alert and exit\n\t\t\t\talert(iban.substr(0,2)+\"|\"+iban.substr(2,2)+\"|\"+iban.substr(5)+\"\\n\\n\"+altxt[2]);\n\t\t\t\treturn \"0\"; }\n\t\t\telse { // no, continue\n\t\t\t\tlofi = ilbc.slice(0,ctcnt).in_array(iban.substr(0,2).toUpperCase()); // test if country respected\n\t\t\t\tif (is_ident(false,lofi)) { ctck=-1; lofi=6; } // country not respected\n\t\t\t\telse { ctck=lofi; lofi=ilbc[lofi+ctcnt*1]; } // country respected\n\t\t\t\tif (lofi == 6) { // not respected, alert\n\t\t\t\t\talert(altxt[3]+iban.substr(0,2).toUpperCase()+altxt[4]);\n\t\t\t\t\tlofi = iban.length; } // but continue\n\t\t\t\tif ((iban.length-lofi) != 0) { // fits length to country\n\t\t\t\t\talert(altxt[5]+ctynm[ctck]+altxt[6]+ilbc[ctck+ctcnt*1]+altxt[7]); // no, alert and exit\n\t\t\t\t\treturn \"0\"; } // yes, continue\n\t\t\t\tif (ctck >= 0) { illegal = buildtest(\"B04\" +ilbc[ctck+ctcnt*2],standard); } // fetch sub structure of respected country\n\t\t\t\telse { illegal = /.+/; } // or take care of not respected country\n\t\t\t\tif (illegal.test(iban) == false) { // fits sub structure to country\n\t\t\t\t\talert(getstructurealert(ilbc[ctck+ctcnt*2],iban)+\"\\n\\n\"+altxt[1]); // no, alert and exit\n\t\t\t\t\treturn \"0\"; }\n\t\t\t\telse { // yes, continue\n\t\t\t\t\treturn iban.ISO13616Prepare().ISO7064Mod97_10(); }}}}} // calculate and return the remainer", "function shouldExpand(a, b, num, isNum, padding, opts) {\n if (isNum && (a > 9 || b > 9)) { return false; }\n return !padding && num === 1 && a < b;\n}", "function shouldExpand(a, b, num, isNum, padding, opts) {\n if (isNum && (a > 9 || b > 9)) { return false; }\n return !padding && num === 1 && a < b;\n}", "function validAnagram(first, second){\n\tif(first.length !== second.length){\n\t\treturn false;\n\t}\n\t\n\tconst lookup = {}; //obj as freq.counter\n\n\t//Break down the first string.\n\tfor(let i=0; i < first.length ; i++){\n\t\tlet letter = first[i];\n\t\t//if letter exists, increment, otherwise set to 1\n\t\tlookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n\t}\n\n\t//Break down the second string\n\t//then check to first string.\n\tfor(let i=0; i < second.length; i++){\n\t\tlet letter = second[i];\n\t\t//can't find letter or letter is zero then not anagram.\n\t\tif(!lookup[letter]){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tlookup[letter] -= 1;\n\t\t}\t\n\t}\n\treturn true;\n}", "anagram(string1, string2) {\n try {\n var format = /[a-zA-Z0-9]/;\n var result = false;\n /*\n *checks if strings are within the given format\n */\n if (format.test(string1) && format.test(string2)) {\n /*\n *checks if both strings are of equal length\n */\n if (string1.length == string2.length) {\n /*\n *splits the given strings and sorts them\n */\n var sort1 = string1.toString().split(\"\").sort().join(\"\");\n var sort2 = string2.toString().split(\"\").sort().join(\"\");\n result = sort1 == sort2;\n }\n else {\n console.log(\"Strings length must be of equal length\");\n }\n\n /*\n *checks if one string is an anagram of another\n */\n if (result == true) {\n // console.log(string1 + \" \" + string2);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n console.log(\"Enter only string\");\n\n }\n }\n catch (error) {\n console.log(error.message);\n }\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) return false\n\n let check = {}\n\n for (let i = 0; i < str1.length; i++) {\n const letter = str1[i]\n check[letter] ? (check[letter] += 1) : (check[letter] = 1)\n }\n\n for (let i = 0; i < str2.length; i++) {\n const letter = str2[i]\n if (!check[letter]) {\n return false\n } else {\n check[letter] -= 1\n }\n }\n\n return true\n}", "function shouldExpand(a, b, num, isNum, padding, opts) {\n if (isNum && (a > 9 || b > 9)) {\n return false;\n }\n return !padding && num === 1 && a < b;\n}", "function isValid(str) {\r\n const arr = str.split(' ');\r\n const ops = arr.reduce((acc, cur) => {\r\n if (operators.includes(cur)) {return acc + 1} else {return acc}\r\n }, 0)\r\n const nums = arr.reduce((acc, cur) => {\r\n if (Number(cur) == cur) {return acc + 1} else {return acc}\r\n }, 0)\r\n if (nums === ops + 1) {return true} else {return false}\r\n}", "function __isIDCard($str) {\r\n /*\r\n * 15位数字\r\n * 18位数字\r\n * 17数字+x/X\r\n */\r\n var reg = /^([0-9]{15}|[0-9]{18}|[0-9]{17}X|[0-9]{17}x)$/;\r\n return reg.test($str);\r\n}", "function checkAnagram(a = '', b = '') {\n var array = {};\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n let res = a.charCodeAt(i) - 97;\n console.log('res', res);\n array[res] = (array[res] || 0) + 1;\n }\n console.log('array', array);\n\n for (let j = 0; j < b.length; j++) {\n let res = b.charCodeAt(j) - 97;\n if (!array[res]) {\n return false;\n }\n array[res]--;\n }\n return true;\n}", "function ExOh(str) { \n\n \n var x = str.match(/[x]+/gi);\n var o = str.match(/[o]+/gi);\n \n if (o === null || x === null)\n {\n return false\n }\n else{\n x = x.join('').split('').length;\n o = o.join('').split('').length;\n \n if (x == o)\n return true\n else\n return false;\n \n }\n \n}", "function checkAB(str) {\n // you can only write your code here!\n var flag = false, i = 0\n while (!flag && i < str.length) {\n \n if (str[i]==='a'||str[i]==='b') {\n var j = i+1 , counter = 0\n while(!flag && j < str.length) {\n if(((str[i]==='a'&&str[j]==='b')||(str[i]==='b'&&str[j]==='a'))&&counter===3) {\n flag =true\n } else {\n counter++\n j++\n }\n }\n }\n i++ \n }\n return flag\n}", "function isBeautifulString(inputString) {\n const map = {};\n\n for (let i = 0; i < inputString.length; i++) {\n let currentCharacter = inputString[i];\n if (map[currentCharacter] === undefined) {\n map[currentCharacter] = 1;\n } else {\n map[currentCharacter] += 1\n }\n }\n\n for (const key in map) {\n if (key === 'a') continue;\n const prevChar = String.fromCharCode(key.charCodeAt(0) - 1);\n if (map[key] <= map[prevChar]) continue;\n else return false;\n }\n\n return true;\n}", "function anagrams(stringA, stringB) {\n function cleanString(s) {\n return s\n .trim()\n .toLowerCase()\n .replace(/[^a-z]/g, \"\");\n }\n\n let cleanedA = cleanString(stringA).split(\"\"),\n cleanedB = cleanString(stringB).split(\"\");\n\n let dict = {};\n for (const char of cleanedA) {\n dict[char] = dict[char] + 1 || 1;\n }\n\n for (const char of cleanedB) {\n if (dict[char] && dict[char] > 0) dict[char] -= 1;\n else return false;\n }\n\n for (const char of Object.keys(dict)) {\n if (dict[char] !== 0) return false;\n }\n\n return true;\n}", "function constructNote(str1, str2) {\n if (str2.length < str1.length) return false;\n function freqCounter(str) {\n let obj = {};\n for (let letter of str) {\n obj[letter] = obj[letter] + 1 || 1;\n }\n return obj;\n }\n let str1Obj = freqCounter(str1);\n let str2Obj = freqCounter(str2);\n for (let key in str1Obj) {\n // if less letters in string 2 than string 1 return false\n if (!str2Obj[key] || str2Obj[key] < str1Obj[key]) {\n return false;\n }\n }\n return true;\n}", "function lengthValidate(num){\n return num.toString().length === 11\n}", "function luhnvalidate(cstring) {\n \"use strict\";\n cstring += \"\"; // type cast as string\n var len = cstring.length;\n // Note difference between substring and substr\n // Also note that luhncalculate returns a Number or undefined\n return luhncalculate(cstring.substring(0, len - 1)) === +cstring.substr(-1, 1);\n}", "function checkPermutations(a,b) {\n // strings must be the same length\n if (a.length !== b.length) return false\n \n let chars = new Map()\n // count characters in string a\n for (var i = 0; i < a.length; i++) {\n let char = a.charAt(i)\n if (chars.get(char)) {\n chars.set(char, chars.get(char) + 1)\n } else {\n chars.set(char, 1)\n }\n }\n // remove characters present in string b\n for (i = 0; i < b.length; i++) {\n let char = b.charAt(i)\n chars.set(char, chars.get(char) - 1)\n }\n // all character counts should be 0 if strings are permutations\n // console.log(\"chars\", chars)\n for (let char in chars) {\n if (chars.get(char) !== 0) return false\n }\n return true\n}", "function allNumbers(str, len){\r\n\tif (str.length == len) {\r\n\t\tvar m=str.match( \"^([0-9]+)$\" );\r\n\t\treturn m!=null;\r\n\t} else return false;\r\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let letter = str1[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n\n for (let i = 0; i < str2.length; i++) {\n let letter = str2[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n //we subtract one to make sure both str have same frequency of letter\n lookup[letter] -= 1;\n }\n }\n\n return true;\n}", "function validate(isbnStr) {\n if (typeof isbnStr !== \"string\") {\n throw new TypeError(\"argument must be a string\");\n }\n\n const normalized = normalize(isbnStr);\n\n switch (normalized.length) {\n case 10:\n return validateNormalizedISBN10(normalized);\n case 13:\n return validateNormalizedISBN13(normalized);\n default:\n return false;\n }\n}", "function validate(n) {\n n = n.toString().split('').map(Number).reverse();\n return n.reduce(function (sum, digit, index) {\n if (index & 1) digit <<= 1;\n if (digit > 9) digit -= 9;\n return sum + digit;\n }, 0) % 10 == 0;\n}", "function caml_string_lessequal(s1, s2) {\n (s1.t & 6) && caml_convert_string_to_bytes(s1);\n (s2.t & 6) && caml_convert_string_to_bytes(s2);\n return (s1.c <= s2.c)?1:0;\n}", "function validAnagram(str1, str2) {\n //if both strings are empty return true\n if(str1.length === 0 && str2.length === 0) return true;\n //create two empty objects\n let obj1 = {};\n let obj2 = {};\n //loop through each of the strings and put them in the objects\n for(let char of str1) {\n if(obj1[char] > 0) {\n obj1[char]++\n } else {\n obj1[char] = 1;\n }\n }\n for(let char of str2) {\n if(obj2[char] > 0) {\n obj2[char]++\n } else {\n obj2[char] = 1;\n }\n }\n //check if each key in strings match to each other \n for(let key in obj1) {\n if(!key in obj2) return false;\n //chack if the frequencies match\n if(obj1[key] !== obj2[key]) return false;\n }\n return true;\n}", "function isValid(s) {\n // use object to count characters\n const count = {};\n for (let i = 0; i < s.length; i++) {\n let char = s[i];\n count[char] = count[char] || 0;\n count[char]++;\n }\n // check if the count of all characters are the same\n let nums = Object.values(count); // returns array of all values\n let freq = Math.min(...nums);\n let extra = 0;\n for (let key in count) {\n // if yes, return YES\n // if not, check if there are other counts that differ\n if (count[key] > freq) {\n extra += count[key] - freq;\n }\n }\n // check if the count varies only by 1\n // if yes, return YES\n // if no, return NO\n if (freq === 1 && extra === Object.keys(count).length - 1) {\n return 'YES';\n } else if (extra > 1) {\n return 'NO';\n }\n return 'YES';\n}", "function toArab(string) {\n let total =0;\n let letra = \"\";\n let num = 0;\n let numSiguiente = 0;\n let arabe = 0;\n \n function letraToNumero(letra){\n switch(letra){\n case 'I': return 1;\n case 'V': return 5;\n case 'X': return 10;\n case 'L': return 50;\n case 'C': return 100;\n case 'D': return 500;\n case 'M': return 1000;\n default: return -1;\n }\n }\n \n checkRomano = validador(string);\n if(checkRomano === -1){\n console.log(\"Introduce un numero Romano valido.\")\n return -1;\n }else{\n for (i=0; i<string.length; i++){\n num = letraToNumero(string[i]);\n numSiguiente= letraToNumero(string[i+1]);\n if(num < numSiguiente){\n total = total - num;\n }else{\n total = total + num;\n }\n }\n return total;\n }\n }", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isBalanced(string, leftChar = '(', rightChar = ')') {\n let count = 0;\n\n for (let idx = 0; idx < string.length; idx += 1) {\n let char = string[idx];\n if (char === leftChar) {\n count += 1;\n } else if (char === rightChar) {\n count -= 1;\n }\n\n if (count < 0) {\n break;\n }\n }\n\n return count === 0;\n}", "function is_a(str) { return str.indexOf(c) !== -1; }", "function naturalCompare(aStr, bStr) {\n var aIdx = 0;\n var bIdx = 0;\n\n while (aIdx < aStr.length && bIdx < bStr.length) {\n var aChar = aStr.charCodeAt(aIdx);\n var bChar = bStr.charCodeAt(bIdx);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n var aNum = 0;\n\n do {\n ++aIdx;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIdx);\n } while (isDigit(aChar) && aNum > 0);\n\n var bNum = 0;\n\n do {\n ++bIdx;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIdx);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIdx;\n ++bIdx;\n }\n }\n\n return aStr.length - bStr.length;\n}", "function naturalCompare(aStr, bStr) {\n var aIdx = 0;\n var bIdx = 0;\n\n while (aIdx < aStr.length && bIdx < bStr.length) {\n var aChar = aStr.charCodeAt(aIdx);\n var bChar = bStr.charCodeAt(bIdx);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n var aNum = 0;\n\n do {\n ++aIdx;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIdx);\n } while (isDigit(aChar) && aNum > 0);\n\n var bNum = 0;\n\n do {\n ++bIdx;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIdx);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIdx;\n ++bIdx;\n }\n }\n\n return aStr.length - bStr.length;\n}", "check(campo) {\n //Condicional para saber si existe y que sea != a vacio\n if (campo && campo !== '') {\n if (campo !== 'isbn') {\n return () => {\n return true\n }\n } else {\n return () => {\n let isbn = this.isbn,\n partesIsbn = isbn.split('-'),\n nPartes = partesIsbn.length\n if (nPartes !== 5) {\n return false\n } else {\n let valido = true\n for (let i = 0; i < nPartes; i++) {\n let estaParte = partesIsbn[i]\n if (!/^([0-9])*$/.test(estaParte)) {\n valido = false\n break\n }\n }\n return valido\n }\n }\n }\n } else {\n return () => {\n return false\n }\n }\n }", "function alphabetSubsequence(s) {\n for(let i = 1; i < s.length; i++) {\n if(s[i].charCodeAt() <= s[i-1].charCodeAt()) {\n return false;\n }\n }\n return true;\n}", "function checkPermutationsHash2(str1, str2) {\n if (typeof str1 !== \"string\" || typeof str2 !== \"string\") {\n throw new Error(\"Please pass two strings\");\n }\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n var str1Characters = {};\n for (var i = 0; i < str1.length; i++) {\n str1Characters[str1[i]] = str1Characters[str1[i]] || 0;\n str1Characters[str1[i]]++;\n }\n\n for (var i = 0; i < str2.length; i++) {\n var character = str2[i];\n if (!(character in str1Characters) || str1Characters[character] === 0) {\n return false;\n } else {\n str1Characters[character]--;\n }\n }\n\n return true;\n}" ]
[ "0.5971141", "0.59197456", "0.591616", "0.5898972", "0.5896091", "0.5873027", "0.585961", "0.584643", "0.58365446", "0.582743", "0.5815965", "0.5808959", "0.5787837", "0.57631177", "0.5763006", "0.5763006", "0.57606417", "0.57462835", "0.57239616", "0.5709279", "0.56955177", "0.5694686", "0.5694686", "0.5689383", "0.56796193", "0.5673067", "0.56633943", "0.5656902", "0.5652244", "0.56454355", "0.5629102", "0.5620638", "0.5617884", "0.5606977", "0.55935115", "0.5586497", "0.5580189", "0.55702364", "0.55587023", "0.5557294", "0.55398136", "0.5536602", "0.5536426", "0.5530365", "0.5525985", "0.5514624", "0.55125767", "0.5491792", "0.54820013", "0.54781604", "0.5477673", "0.5473379", "0.5471791", "0.54436904", "0.542882", "0.54240334", "0.54186374", "0.5405961", "0.54030055", "0.53993016", "0.5393381", "0.53922975", "0.5386054", "0.5385142", "0.53818595", "0.5380698", "0.5380698", "0.5370189", "0.5369189", "0.5366329", "0.53654504", "0.5361762", "0.53579456", "0.5342778", "0.5313563", "0.5306903", "0.53040344", "0.530177", "0.5298727", "0.52835804", "0.52782947", "0.5271302", "0.5267056", "0.5265237", "0.526375", "0.5255825", "0.5254898", "0.52456284", "0.5238391", "0.5235832", "0.52335775", "0.52335775", "0.52335775", "0.523093", "0.52230424", "0.5211122", "0.5211122", "0.52093726", "0.5207023", "0.5205154" ]
0.650782
0
resolves . and .. elements in a path array with directory names there must be no slashes, empty elements, or device names (c:\) in the array (so also no leading and trailing slashes it does not distinguish relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length; i >= 0; i--) { var last = parts[i]; if (last == '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolvePathDots(input) {\r\n\t\tvar output = [];\r\n\t\tinput.replace(/^(\\.\\.?(\\/|$))+/, '')\r\n\t\t .replace(/\\/(\\.(\\/|$))+/g, '/')\r\n\t\t .replace(/\\/\\.\\.$/, '/../')\r\n\t\t .replace(/\\/?[^\\/]*/g, function (part) { part === '/..' ? output.pop() : output.push(part); });\r\n\t\treturn output.join('').replace(/^\\//, input.charAt(0) === '/' ? '/' : '');\r\n\t}", "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "function normalizeArray(parts,allowAboveRoot){ // if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version", "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// path.resolve([from ...], to)", "function resolvePath(...paths) {\n return [].concat(...paths)\n .filter(v => typeof v === 'string' || isArray(v))\n .join('.').split('.')\n .filter(v => !!v);\n}", "function rationalizePaths(array){\n for(var i = 0, len = array.length; i < len; i++){\n //I know, this is very unneeded, but I like having it because of it's over bearing round-a-bout-ness\n array[i] = require.resolve(array[i]).split('\\\\').filter(function(o,i,a){ return (a.length-1) !== i; }).join('\\\\');\n }\n\n return array;\n}", "function _resolvePointer(...paths) {\n return paths\n // reduce to /-separated string, ignoring anything before the last-\n // specified absolute path (e.g. [\"/a\", \"/b\", \"./c\"] becomes \"/b/./c\")\n .reduce((joined, next) => {\n // next child is absolute; discard previous\n if (next.startsWith(\"/\")) {\n return next;\n }\n\n return `${joined}/${next}`;\n }, \"\")\n\n // now, remove .. and .\n .split(\"/\").reduce((resolved, next) => {\n switch (next) {\n case \"..\":\n return resolved.slice(0, -1);\n case \".\":\n return resolved;\n default:\n return resolved.concat(next);\n }\n }, []).join(\"/\");\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // path.resolve([from ...], to)", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n } // Split a filename into [root, dir, basename, ext], unix version", "function $UUq2$var$normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // path.resolve([from ...], to)", "function normalize(path) {\n const input = path.split('/');\n const output = [];\n for (let i = 0; i < input.length; ++i) {\n const directory = input[i];\n if (i === 0 || (directory.length && directory !== '.')) {\n if (directory === '..') {\n output.pop();\n } else {\n output.push(directory);\n }\n }\n }\n return output.join('/');\n }", "function parseCd (path, cd) {\n\n cdA = cd.split(\"/\");\n\n console.log(cdA);\n\n for (x in cdA) {\n\n console.log(cdA[x]+'\\n');\n\n if (cdA[x] == '..') {\n\n return;\n\n // saw = 0;\n\n // while (saw == 0){\n\n // if (path[-1] == '/') saw = 1;\n\n // path = path.slice(0, -1);\n\n // }\n\n }\n\n\n\n else path += (cdA[x] + '/');\n\n }\n\n\n\n return path;\n\n}", "function normalizePath(path) {\n var directories = [], parts = path.split(\"/\"), prev;\n\n for (var i = 0, l = parts.length - 1; i <= l; i++) {\n var directory = parts[i];\n\n // if it's blank, but it's not the first thing, and not the last thing, skip it.\n if (directory === \"\" && i !== 0 && i !== l) continue;\n\n // if it's a dot, and there was some previous dir already, then skip it.\n if (directory === \".\" && prev !== undefined) continue;\n\n // if it starts with \"\", and is a . or .., then skip it.\n if (directories.length === 1 && directories[0] === \"\" &&\n (directory === \".\" || directory === \"..\")) continue;\n\n if (directory === \"..\" && directories.length && prev !== \"..\" &&\n prev !== \".\" && prev !== undefined && (prev !== \"\")) {\n directories.pop();\n prev = directories.slice(-1)[0]\n } else {\n if (prev === \".\") directories.pop();\n directories.push(directory);\n prev = directory;\n }\n }\n return directories.join(\"/\");\n}", "function $FHml$var$normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // posix version", "function pathResolve(path1, path2) {\n path1 = path1.split('/');\n path1.pop();\n var pathArr = path1.concat(path2.split('/'));\n var up = 0;\n for (var i = pathArr.length - 1; i >= 0; i--) {\n var last = pathArr[i];\n if (last === '.') {\n pathArr.splice(i, 1)\n } else if (last === '..') {\n pathArr.splice(i, 1);\n up++\n } else if (up) {\n pathArr.splice(i, 1);\n up--\n }\n }\n return pathArr.join('/')\n }", "function resolve() {\n var root = '';\n var elements = [];\n var leaf = '';\n var path;\n for (var i = 0; i < arguments.length; i++) {\n path = String(arguments[i]);\n if (path.trim() == '') {\n continue;\n }\n var parts = path.split(SEPARATOR_RE);\n if (isAbsolute(path)) {\n // path is absolute, throw away everyting we have so far\n root = parts.shift() + SEPARATOR;\n elements = [];\n }\n leaf = parts.pop();\n if (leaf == '.' || leaf == '..') {\n parts.push(leaf);\n leaf = '';\n }\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j];\n if (part == '..') {\n if (elements.length > 0 && elements.peek() != '..') {\n elements.pop();\n } else if (!root) {\n elements.push(part);\n }\n } else if (part != '' && part != '.') {\n elements.push(part);\n }\n }\n }\n path = elements.join(SEPARATOR);\n if (path.length > 0) {\n leaf = SEPARATOR + leaf;\n }\n return root + path + leaf;\n}", "function normalizePaths(path) {\n // @ts-ignore (not sure why this happens)\n return path.map(segment => typeof segment === 'string' ? segment.split('.') : segment);\n} // Supports passing either an id or a value (document/reference/object)", "function xnormalize(fpath) {\n if (!fpath) return \"\";\n var parts = fpath.split(/[\\\\\\/]/g);\n var roots = [];\n parts.forEach( function(part) {\n if (!part || part===\".\") {\n /* nothing */\n }\n else if (part===\"..\") {\n if (roots.length > 0 && roots[roots.length-1] !== \".parent\") {\n roots.pop();\n }\n else {\n roots.push(\".parent\");\n }\n }\n else {\n roots.push(part);\n }\n });\n return roots.join(\"/\");\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === \".\") {\n parts.splice(i, 1);\n } else if (last === \"..\") {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift(\"..\");\n }\n }\n\n return parts;\n }", "function toFilePath(pathArray){\n\tif (typeof(pathArray) === 'string') return pathArray;\n\tvar expanded = '';\n\tfor(var i=0; i < pathArray.length; i++){\n\t\texpanded = OS.Path.join(pathArray, dirName[i]);\n\t}\n\treturn expanded;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i]\n if (last === '.') {\n parts.splice(i, 1)\n } else if (last === '..') {\n parts.splice(i, 1)\n up++\n } else if (up) {\n parts.splice(i, 1)\n up--\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..')\n }\n }\n\n return parts\n}", "function normalizeArray(parts, allowAboveRoot) {\r\n // if the path tries to go above the root, `up` ends up > 0\r\n var up = 0;\r\n for (var i = parts.length - 1; i >= 0; i--) {\r\n var last = parts[i];\r\n if (last === '.') {\r\n parts.splice(i, 1);\r\n } else if (last === '..') {\r\n parts.splice(i, 1);\r\n up++;\r\n } else if (up) {\r\n parts.splice(i, 1);\r\n up--;\r\n }\r\n }\r\n // if the path is allowed to go above the root, restore leading ..s\r\n if (allowAboveRoot) {\r\n for (; up--; up) {\r\n parts.unshift('..');\r\n }\r\n }\r\n return parts;\r\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n }\n else if (last === '..') {\n parts.splice(i, 1);\n up++;\n }\n else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\r\n // if the path tries to go above the root, `up` ends up > 0\r\n var up = 0;\r\n for (var i = parts.length - 1; i >= 0; i--) {\r\n var last = parts[i];\r\n if (last === '.') {\r\n parts.splice(i, 1);\r\n } else if (last === '..') {\r\n parts.splice(i, 1);\r\n up++;\r\n } else if (up) {\r\n parts.splice(i, 1);\r\n up--;\r\n }\r\n }\r\n\r\n // if the path is allowed to go above the root, restore leading ..s\r\n if (allowAboveRoot) {\r\n for (; up--; up) {\r\n parts.unshift('..');\r\n }\r\n }\r\n\r\n return parts;\r\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n }", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}" ]
[ "0.72002256", "0.7079204", "0.7060445", "0.7000722", "0.69598734", "0.68429655", "0.6764273", "0.6622679", "0.65752923", "0.6572563", "0.65173155", "0.64808446", "0.6434036", "0.64339215", "0.6359622", "0.63100463", "0.6276153", "0.6274993", "0.6246552", "0.62407887", "0.62228715", "0.6203528", "0.61785644", "0.6174491", "0.61744606", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226", "0.6174226" ]
0.61782634
46
A bounding rectangle x,y the minimum coordinate contained in the rectangle sx,sy the size of the rectangle along the x,y axis
function Rect(x,y,sx,sy,centered){ this.sx = sx; // width of the rectangle on the x axis this.sy = sy; // width of the rectangle on the y axis this.hx = sx/2; // half of the rectangle width on the x axis this.hy = sy/2; // half of the rectangle width on the y axis this.x = x; // minimum x coordinate contained in the rectangle this.y = y; // minimum y coordinate contained in the rectangle this.cx = x + this.hx; // x coordinate of the rectangle center this.cy = y + this.hy; // y coordinate of the rectangle center this.mx = this.x + sx; // maximum x coordinate contained in the rectangle this.my = this.y + sy; // maximum x coordinate contained in the rectangle if(centered){ this.x -= this.hx; this.cx -= this.hx; this.mx -= this.hx; this.y -= this.hy; this.cy -= this.hy; this.my -= this.hy; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BoundingBoxRect() { }", "bbox() {\n var maxX = -Infinity;\n var maxY = -Infinity;\n var minX = Infinity;\n var minY = Infinity;\n this.forEach(function (el) {\n maxX = Math.max(el[0], maxX);\n maxY = Math.max(el[1], maxY);\n minX = Math.min(el[0], minX);\n minY = Math.min(el[1], minY);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }", "constrain(x, y, scale) {\n scale || (scale = this.state.scale);\n\n if (this.state.size.width * scale > this.props.width) {\n minX = (this.state.size.width * scale - this.props.width) * -1;\n maxX = 0;\n } else {\n minX = 0;\n maxX = this.props.width - this.state.size.width * scale;\n }\n\n if (this.state.size.height * scale > this.props.height) {\n minY = (this.state.size.height * scale - this.props.height) * -1;\n maxY = 0;\n } else {\n minY = 0;\n maxY = this.props.height - this.state.size.height * scale;\n }\n\n x = Math.max(x, minX);\n x = Math.min(x, maxX);\n\n y = Math.max(y, minY);\n y = Math.min(y, maxY);\n\n return {\n x: x,\n y: y\n };\n }", "setSizeBounds() {\n const cosAngle = Math.cos(this.angle * Math.PI / 180);\n const sinAngle = Math.sin(this.angle * Math.PI / 180);\n this.sizeBounds.alongX = this.size.D1*cosAngle;\n this.sizeBounds.alongY = this.size.D1*sinAngle + this.size.D2;\n }", "function getMinBox() {\n //get coordinates \n var coorX = coords.map(function(p) {\n return p.x\n });\n var coorY = coords.map(function(p) {\n return p.y\n });\n\n //find top left and bottom right corners \n var min_coords = {\n x: Math.min.apply(null, coorX),\n y: Math.min.apply(null, coorY)\n }\n var max_coords = {\n x: Math.max.apply(null, coorX),\n y: Math.max.apply(null, coorY)\n }\n\n //return as strucut \n return {\n min: min_coords,\n max: max_coords\n }\n}", "function getMinBox() {\n //get coordinates \n var coorX = coords.map(function(p) {\n return p.x\n });\n var coorY = coords.map(function(p) {\n return p.y\n });\n\n //find top left and bottom right corners \n var min_coords = {\n x: Math.min.apply(null, coorX),\n y: Math.min.apply(null, coorY)\n }\n var max_coords = {\n x: Math.max.apply(null, coorX),\n y: Math.max.apply(null, coorY)\n }\n\n //return as strucut \n return {\n min: min_coords,\n max: max_coords\n }\n}", "function getRectangle(x, y, width, height) {\n return {\n minX: x,\n maxX: x + width,\n minY: y,\n maxY: y + height\n };\n }", "function BoundingBox(x, y, width, height) { \n this.width = width;\n this.height = height;\n\n this.left = x;\n this.top = y;\n this.right = this.left + width;\n this.bottom = this.top + height;\n}", "function smallRect (xVal, yVal, red, green, blue) {\n\tfill(red, green, blue);\n\trect(xVal, yVal, 60, 150);\n}", "function constrainPoint(point,rect){return{left:Math.min(Math.max(point.left,rect.left),rect.right),top:Math.min(Math.max(point.top,rect.top),rect.bottom)};}", "function calculateBoundingBox() {\n return {\n top: -((strokeWidth + 1) / 2) + sourceRectYEntry,\n left: -(targetRect.left - (sourceRect.left + sourceRect.width)),\n width:\n (strokeWidth + 1) / 2 +\n (targetRect.left + targetRect.width / 2) -\n (sourceRect.left + sourceRect.width),\n height: (strokeWidth + 1) / 2 + Math.abs(sourceRectYEntry),\n };\n }", "function boundingBox() {\n for (let node of nodes) {\n // If the positions exceed the box, set them to the boundary position.\n var yearX = xSmallScale.bandwidth() * ((node.year - minYear) / 4 + 0.6) // xSmallScale.bandwidth() * ((node.year - minYear) / 4 + 0.1)\n node.x = Math.max(Math.min(node.x, yearX + xSmallScale.bandwidth() / 2.5 - medalRadius), yearX - xSmallScale.bandwidth() / 2.5 + medalRadius);\n node.y = Math.max(Math.min(innerHeight - medalRadius, node.y), 0 + medalRadius);\n }\n }", "function BoundingBox(topX, topY, totalWidth, totalHeight) {\n this.x = topX;\n this.y = topY;\n this.width = totalWidth;\n this.height = totalHeight;\n}", "function getCoordinate(event) {\n let ne = rectangle.getBounds().getNorthEast();\n let sw = rectangle.getBounds().getSouthWest();\n\n rightUpLat = ne.lat();\n rightUpLng = ne.lng();\n leftDownLat = sw.lat();\n leftDownLng = sw.lng();\n\n let rectangleLength = rightUpLng - leftDownLng;\n let rectangleWidth = rightUpLat - leftDownLat;\n let check = false;\n\n if (rectangleWidth > maxWidth) {\n\n let newBounds = {\n north: rightUpLat,\n south: rightUpLat - maxWidth + 0.02,\n east: rightUpLng,\n west: leftDownLng\n };\n\n rectangle.setBounds(newBounds);\n check = true;\n }\n\n if (rectangleLength > maxLength) {\n\n let newBounds = {\n north: rightUpLat,\n south: leftDownLat,\n east: rightUpLng,\n west: rightUpLng - maxLength + 0.02\n };\n\n rectangle.setBounds(newBounds);\n check = true;\n }\n\n\n if (check) {\n alert('Превышен максимальный размер области');\n }\n}", "_estimateBoundingBox()\n\t{\n\t\tconst size = this._getDisplaySize();\n\t\tif (typeof size !== \"undefined\")\n\t\t{\n\t\t\tthis._boundingBox = new PIXI.Rectangle(\n\t\t\t\tthis._pos[0] - size[0] / 2,\n\t\t\t\tthis._pos[1] - size[1] / 2,\n\t\t\t\tsize[0],\n\t\t\t\tsize[1],\n\t\t\t);\n\t\t}\n\n\t\t// TODO take the orientation into account\n\t}", "static WorldPointToSizedRect() {}", "function boundingBox(x,y,xextent,yextent)\n{\n \n this.x1=x;\n this.y1=y;\n this.x2=x+xextent;\n this.y2=y+yextent;\n this.toString=function(){ return 'boundingBox(('+this.x1+','+this.y1+'),('+this.x2+','+this.y2+'))'; }\n}", "function R(){var e=s.getBoundingClientRect(),n=\"offset\"+[\"Width\",\"Height\"][t.ort];return 0===t.ort?e.width||s[n]:e.height||s[n]}", "rectifyBBox (bbox) {\n // horizontal top\n if (bbox[0].y != bbox[1].y) {\n let ymin = Math.min(bbox[0].y, bbox[1].y)\n bbox[0].y = ymin\n bbox[1].y = ymin\n }\n\n // horizontal bottom\n if (bbox[3].y != bbox[2].y) {\n let ymax = Math.max(bbox[3].y, bbox[2].y)\n bbox[3].y = ymax\n bbox[2].y = ymax\n }\n\n // vertical right\n if (bbox[1].x != bbox[2].x) {\n let xmax = Math.max(bbox[1].x, bbox[2].x)\n bbox[1].x = xmax\n bbox[2].x = xmax\n }\n\n // vertical left\n if (bbox[0].x != bbox[3].x) {\n let xmin = Math.min(bbox[0].x, bbox[3].x)\n bbox[0].x = xmin\n bbox[3].x = xmin\n }\n\n return bbox\n }", "get bounds () {\n const xMin = Math.min.apply(null, this.pointArr.map(pt => pt.x))\n const yMin = Math.min.apply(null, this.pointArr.map(pt => pt.y))\n const xMax = Math.max.apply(null, this.pointArr.map(pt => pt.x))\n const yMax = Math.max.apply(null, this.pointArr.map(pt => pt.y))\n\n return {\n x: xMin,\n y: yMin,\n width: xMax - xMin,\n height: yMax - yMax\n }\n }", "function S(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "function getBox(o) {\n return {\n xMin: o.position.x,\n xMax: o.position.x + o.width,\n yMin: o.position.y,\n yMax: o.position.y + o.height\n };\n }", "function getMinMaxRect(points) {\n\t// Find the min-max quadrilateral\n\tvar corners = getMinMaxCorners(points);\n\n\t// Get the coordinates of a rectangle that lies inside the quadrilateral\n\tvar xmin, xmax, ymin, ymax;\n\txmin = corners.ul.x;\n\tymin = corners.ul.y;\n\n\txmax = corners.ur.x;\n\tif (ymin < corners.ur.y) ymin = corners.ur.y;\n\n\tif (xmax > corners.lr.x) xmax = corners.lr.x;\n\tymax = corners.lr.y;\n\n\tif (xmin < corners.ll.x) xmin = corners.ll.x;\n\tif (ymax > corners.ll.y) ymax = corners.ll.y;\n\n\treturn {\n\t\tx: xmin, \n\t\ty: ymin,\n\t\twidth: xmax - xmin,\n\t\theight: ymax - ymin\n\t};\n}", "_estimateBoundingBox()\n\t{\n\t\t// take the alignment into account:\n\t\tthis._boundingBox = new PIXI.Rectangle(\n\t\t\tthis._pos[0] - this._size[0] / 2.0,\n\t\t\tthis._pos[1] - this._size[1] / 2.0,\n\t\t\tthis._size[0],\n\t\t\tthis._size[1],\n\t\t);\n\t}", "function j(){var e=s.getBoundingClientRect(),r=\"offset\"+[\"Width\",\"Height\"][t.ort]\nreturn 0===t.ort?e.width||s[r]:e.height||s[r]}", "function hb_rect(self,value) {\n switch (value) {\n case 0: return self.pos[0] - self.width/2;\n case 1: return self.pos[1] - self.height;\n case 2: return self.pos[0] + self.width/2;\n case 3: return self.pos[1];\n }\n }", "getBounds(){\n let rect = new Rectangle()\n\t\trect.setRect(this.x, this.y, this.size, this.size)\n\t\treturn rect\n }", "getBounds(){\n let rect = new Rectangle()\n\t\trect.setRect(this.x, this.y, this.size, this.size)\n\t\treturn rect\n }", "function getBox(o) {\n return {\n xMin: o.position.x,\n xMax: o.position.x + o.width,\n yMin: o.position.y,\n yMax: o.position.y + o.height\n };\n }", "calculateBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n if (this.graphicsData.length) {\n var shape = null;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineStyle ? data.lineStyle.width : 0;\n shape = data.shape;\n if (type === ShapeSettings_1.ShapeSettings.SHAPES.RECT || type === ShapeSettings_1.ShapeSettings.SHAPES.RREC) {\n x = shape.x - (lineWidth / 2);\n y = shape.y - (lineWidth / 2);\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + (lineWidth / 2);\n h = shape.radius + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + (lineWidth / 2);\n h = shape.height + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt((dx * dx) + (dy * dy));\n if (w < 1e-9) {\n continue;\n }\n rw = ((h / w * dy) + dx) / 2;\n rh = ((h / w * dx) + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var padding = this.boundsPadding;\n this._bounds.minX = minX - padding;\n this._bounds.maxX = maxX + padding;\n this._bounds.minY = minY - padding;\n this._bounds.maxY = maxY + padding;\n }", "function getBoundingBoxEstimate( x, y, iWidth, iFontSpec) {\n var fontSize = iFontSpec['font-size'] || kDefaultFontSize,\n factors = getFontScaleFactors( iFontSpec);\n return { top: y - Math.round( (1.0 + factors.ascent) * fontSize),\n bottom: y + Math.round( factors.descent * fontSize),\n left: x - Math.round( factors.left * fontSize) - 1,\n right: x + iWidth + Math.round( factors.right * fontSize) + 2 };\n }", "async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;\n const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;\n return { x, y, width, height };\n }", "async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;\n const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;\n return { x, y, width, height };\n }", "async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;\n const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;\n return { x, y, width, height };\n }", "function X(){var t=c.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||c[e]:t.height||c[e]}", "bbox() {\n let width = this.box.attr(\"width\");\n let height = this.box.attr(\"height\");\n let x = this.box.attr(\"x\");\n let y = this.box.attr(\"y\");\n let cy = y + height / 2;\n let cx = x + width / 2;\n\n return {\n width: width,\n height: height,\n x: x,\n y: y,\n cx: cx,\n cy: cy\n };\n }", "function visibleRect(_posX, _posY, _width, _height, _size) {\n if(bounded) {\n var upperLeft = toWorld(0, 0);\n var lowerRight = toWorld(screenSizeX, screenSizeY);\n \n var xMin = upperLeft.x - _posX;\n var yMin = upperLeft.y - _posY;\n var xMax = lowerRight.x - _posX;\n var yMax = lowerRight.y - _posY;\n \n xMin = xMin < 0 ? 0 : xMin;\n yMin = yMin < 0 ? 0 : yMin;\n xMax = xMax < 0 ? 0 : xMax;\n yMax = yMax < 0 ? 0 : yMax;\n \n xMin = xMin > _width ? _width : xMin;\n yMin = yMin > _height ? _height : yMin;\n xMax = xMax > _width ? _width : xMax;\n yMax = yMax > _height ? _height : yMax;\n\n xMin /= _size;\n yMin /= _size;\n xMax /= _size;\n yMax /= _size;\n \n xMin = (0.5 + xMin) | 0;\n yMin = (0.5 + yMin) | 0;\n xMax = (0.5 + xMax) | 0;\n yMax = (0.5 + yMax) | 0;\n\n return {xMin: xMin, xMax: xMax, yMin: yMin, yMax: yMax};\n }\n return null;\n }", "function getMinMax() {\n var minPt = pts[0];\n var maxPt = pts[0];\n for (var i=1; i<pts.length; i++) {\n minPt = minPt.$min( pts[i] );\n }\n for (i=1; i<pts.length; i++) {\n maxPt = maxPt.$max( pts[i] );\n }\n nextRect.set( minPt).to( maxPt );\n}", "function adjustByMinSize(viewport,rects,minSize) {\n var smallerCount = 0, // no. of rect which is less then the minSize\n min; // The min rectangle\n \n if (minSize === undefined)\n minSize = {width : 0 , height : 0};\n \n for (var i = 0 ; i < rects.length ;i++) {\n if (rects[i].width < minSize.width ||\n rects[i].height < minSize.height) {\n smallerCount++;\n min = rects[i];\n }\n }\n \n if (smallerCount == 1) { \n\n // Ignore 0 or 2.\n // If the count is 2, it has no way to adjust.\n var dw = minSize.width - min.width,\n dh = minSize.height - min.height;\n if (dw < 0)\n dw = 0;\n if (dh < 0)\n dh = 0;\n \n for (var i = 0 ; i < rects.length ;i++) {\n if (rects[i].width < minSize.width ||\n rects[i].height < minSize.height) {\n \n rects[i].width += dw;\n rects[i].height += dh;\n \n if (i === 1) { // It is on the right / bottom\n rects[i].left -= dw;\n rects[i].top -= dh;\n }\n \n } else {\n rects[i].width -= dw;\n rects[i].height -= dh; \n \n if (i === 1) { // It is on the right / bottom\n rects[i].left += dw;\n rects[i].top += dh;\n }\n }\n }\n }\n\n }", "function coordinateToRectangle(x, y){\n\n // The space a single rectangle and border occupies\n const unitWidth = rectangleWidth + gridThickness;\n const unitHeight = rectangleHeight + gridThickness;\n\n // We need to take into account the extra border at the top/left sides\n // of the canvas, before performing the calculation\n const extraBorder = gridThickness / 2;\n\n // The grid counts rectangles starting at the bottom, but coordinates start\n // at the top, so the row needs to be inverted (0 -> max, max -> 0, etc.)\n const maxRow = numRectanglesHigh - 1;\n\n let column = Math.ceil(x / unitWidth - extraBorder);\n let row = maxRow - Math.ceil(y / unitHeight - extraBorder);\n\n column = clampValueBetween(column, 0, numRectanglesWide - 1);\n row = clampValueBetween(row, 0, numRectanglesHigh - 1);\n\n return {\n x: column,\n y: row\n };\n }", "getBounds() {\n return new Rectangle(new Point(this.x, this.y), new Vector(0, 0));\n }", "boundingBox(shape) {\n let r = {x0 : 10, x1 : -10, y0 : 10, y1 : -10};\n\n shape.foreach( function(x, y) {\n if ((x <= r.x0)) r.x0 = x;\n if ((x >= r.x1)) r.x1 = x;\n if ((y <= r.y0)) r.y0 = y;\n if ((y >= r.y1)) r.y1 = y;\n });\n\n return r;\n }", "function getRectCenter(rect){return{left:(rect.left+rect.right)/2,top:(rect.top+rect.bottom)/2};}", "function setBoundingBox() {\r\n that.x1P = board.widthP - 1;\r\n that.y1P = board.heightP - 1;\r\n that.x2P = that.y2P = 0;\r\n for (var i in that.pieces) {\r\n piece = that.pieces[i];\r\n that.x1P = Math.min(that.x1P, piece.xP);\r\n that.x2P = Math.max(that.x2P, piece.xP + piece.widthP - 1);\r\n that.y1P = Math.min(that.y1P, piece.yP);\r\n that.y2P = Math.max(that.y2P, piece.yP + piece.heightP - 1);\r\n }\r\n that.xP = that.x1P;\r\n that.yP = that.y1P;\r\n that.widthP = that.x2P - that.x1P + 1;\r\n that.heightP = that.y2P - that.y1P + 1;\r\n }", "function calculateBBox (paper) {\n var grid = paper.draggable.current();\n \n return {\n x: grid[1].attr(\"cx\"),\n y: grid[1].attr(\"cy\"),\n width: grid[3].attr(\"cx\") - grid[2].attr(\"cx\"),\n height: grid[2].attr(\"cy\") - grid[1].attr(\"cy\")\n }\n }", "setBounds() {\n let x = this.position.getX();\n let y = this.position.getY();\n let s = Game.Settings().UnitSize;\n let hs = s / 2;\n\n //generate Individual Bounds\n this.bounds = new Bounds(x - hs, y - hs, x + hs, y + hs);\n }", "getBoundingBox(minPoint, maxPoint) {\n if (minPoint.x > this.x)\n minPoint.x = this.x;\n if (maxPoint.x < this.x)\n maxPoint.x = this.x;\n if (minPoint.y > this.y)\n minPoint.y = this.y;\n if (maxPoint.y < this.y)\n maxPoint.y = this.y;\n if (minPoint.z > this.z)\n minPoint.z = this.z;\n if (maxPoint.z < this.z)\n maxPoint.z = this.z;\n }", "_calculateBounds() {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n }", "createTheoriticalBoundingBox(x, y) {\n var temp = new BoundingBox(x, y, this.width, this.height)\n temp.entity = this.entity;\n return temp;\n }", "static fromBoundingRect(rect) {\n let b = new Bound(new Pt_1.Pt(rect.left || 0, rect.top || 0), new Pt_1.Pt(rect.right || 0, rect.bottom || 0));\n if (rect.width && rect.height)\n b.size = new Pt_1.Pt(rect.width, rect.height);\n return b;\n }", "function BoundingBox(x, y, width, height) {\n this.x = x - CAMERA.x;\n this.y = y - CAMERA.y;\n this.width = width;\n this.height = height;\n\n this.left = x;\n this.top = y;\n this.right = this.left + width;\n this.bottom = this.top + height;\n}", "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n }", "boundingRect(width, height) {\n if (arguments.length === 0) {\n return [this.opts.boundingWidth, this.opts.boundingHeight];\n }\n\n if (arguments.length >= 1 && isDefined(width)) {\n const minWidth = this.option('margin.left') + this.option('margin.right');\n if (width < minWidth) { width = minWidth; }\n this.opts.boundingWidth = width;\n }\n\n if (arguments.length === 2 && isDefined(height)) {\n const minHeight = this.option('margin.top') + this.option('margin.bottom');\n if (height < minHeight) { height = minHeight; }\n this.opts.boundingHeight = height;\n }\n\n this._boundsUpdate();\n this.update();\n\n return this;\n }", "bbox() {\n let maxX = -Infinity\n let maxY = -Infinity\n let minX = Infinity\n let minY = Infinity\n this.forEach(function (el) {\n maxX = Math.max(el[0], maxX)\n maxY = Math.max(el[1], maxY)\n minX = Math.min(el[0], minX)\n minY = Math.min(el[1], minY)\n })\n return new Box(minX, minY, maxX - minX, maxY - minY)\n }", "function calcDimensions(x, y) {\n if (x > xMax) {\n xMax = x;\n }\n if (x < xMin) {\n xMin = x;\n }\n if (y > yMax) {\n yMax = y;\n }\n if (y < yMin) {\n yMin = y;\n }\n }", "static unionRect(b1, b2) {\n\t\tvar x = Math.min(b1.x, b2.x);\n\t\tvar y = Math.min(b1.y, b2.y);\n\t\tvar width = Math.max(b1.x + b1.width, b2.x + b2.width) - x;\n\t\tvar height = Math.max(b1.y + b1.height, b2.y + b2.height) - y;\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t};\n\t}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n }", "function getRectCenteredCoordFromSize(size)\n{\n\tlet xCoord = (g_canvasWidth / 2) - (size.x / 2);\n\tlet yCoord = (g_canvasHeight / 2) - (size.y / 2);\n\treturn { x: xCoord, y: yCoord };\n}", "function boundArea(x, y, w, h){\n\tthis.x = x;\n\tthis.y = y;\n\tthis.w = w;\n\tthis.h = h;\n}", "rect(x, y, w, h) {\n CanvasManager.rect(findNodeHandle(this), x, y, w, h)\n }", "_calculateBounds() {\n this.finishPoly();\n var lb = this.geometry.bounds;\n this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n }", "function Bounds()\n{\n /**\n * @member {number}\n * @default 0\n */\n this.minX = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.minY = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxX = -Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxY = -Infinity;\n\n this.rect = null;\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "getWorldBounds() {\n const left = this.screenToWorldCoordinates(Vector.Zero).x;\n const top = this.screenToWorldCoordinates(Vector.Zero).y;\n const right = left + this.drawWidth;\n const bottom = top + this.drawHeight;\n return new BoundingBox(left, top, right, bottom);\n }", "getBoundingBox() {\n return new BoundingBox(this.x, this.y, this.width, this.height)\n }", "get localBounds() {\n return {\n x: this.x, //I changed this, it was \"x: 0,\"\n y: this.y, //I changed this, it was \"y: 0,\"\n width: this.width,\n height: this.height\n } \n }", "function showRect(svg, { x, y, width, height }) {\n const view = getViewBox(svg);\n const { width: width_, height: height_ } = calculateNewWidthAndHeight({\n width,\n height,\n });\n setViewBox(svg, {\n x: x + width / 2 - width_ / 2,\n y: y + height / 2 - height_ / 2,\n width: width_,\n height: height_,\n });\n function calculateNewWidthAndHeight({ width, height }) {\n const margin = 1.3;\n const minimum = 500;\n if (width < minimum && height < minimum) {\n if (width > height) {\n width = minimum;\n } else {\n height = minimum;\n }\n }\n return {\n width:\n width > height\n ? width * margin\n : (view.width * height * margin) / view.height,\n height:\n height >= width\n ? height * margin\n : (view.height * width * margin) / view.width,\n };\n }\n }", "_calculateBounds()\n {\n const trim = this._texture.trim;\n const orig = this._texture.orig;\n\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height))\n {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else\n {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n }", "get boundingBox() {\n }", "function minSize (x) {\r\n var pref = size(x);\r\n if ( pref === null ) {return null;}\r\n return filter(x) ? filter(x).call(this, { \r\n edge : edge(x),\r\n result : { width : pref.minWidth, height : pref.minHeight },\r\n size : { width : width, height : height }\r\n }) : maxSize(x);\r\n }", "function put_rect(rect, max_width){\r\n line.push(rect);\r\n\r\n var parent = undefined;\r\n\r\n for (var i = 0; i < line.length; i++){\r\n if ((line[i].space_left >= rect.height) && (line[i].x + line[i].width + rect.width + applyPacking.PADDING - max_width) <= applyPacking.FLOAT_EPSILON){\r\n parent = line[i];\r\n break;\r\n }\r\n }\r\n\r\n if (parent !== undefined){\r\n rect.x = parent.x + parent.width + applyPacking.PADDING;\r\n rect.y = parent.bottom;\r\n rect.space_left = rect.height;\r\n rect.bottom = rect.y;\r\n parent.space_left -= rect.height + applyPacking.PADDING;\r\n parent.bottom += rect.height + applyPacking.PADDING;\r\n } else {\r\n rect.y = global_bottom;\r\n global_bottom += rect.height + applyPacking.PADDING;\r\n rect.x = init_x;\r\n rect.bottom = rect.y;\r\n rect.space_left = rect.height;\r\n }\r\n\r\n if (rect.y + rect.height - real_height > -applyPacking.FLOAT_EPSILON) real_height = rect.y + rect.height - init_y;\r\n if (rect.x + rect.width - real_width > -applyPacking.FLOAT_EPSILON) real_width = rect.x + rect.width - init_x;\r\n }", "get rect() {\n return {\n x: this.x - this.width / 2,\n y: this.y - this.height / 2,\n width: this.width,\n height: this.height,\n };\n }", "createBoundingShape(minPos, maxPos) {\n if (!minPos || !maxPos) {\n return;\n }\n\n this._modelBounds = aabb.fromPoints(aabb.create(), minPos, maxPos);\n this._worldBounds = aabb.clone(this._modelBounds);\n }", "function _inBox(p, s, x) {\n var minX = p[0];\n var minY = p[1];\n\n var maxX = p[0] + s[0];\n var maxY = p[1] + s[1];\n\n return (\n minX <= x[0] && x[0] <= maxX &&\n minY <= x[1] && x[1] <= maxY\n );\n}", "function rect(x, y, w, h) {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n }", "getBoundingBox()\r\n\t{\r\n\t\tif ( this.vpos.length == 0 ) return null;\r\n\t\tvar min = [...this.vpos[0]];\r\n\t\tvar max = [...this.vpos[0]];\r\n\t\tfor ( var i=1; i<this.vpos.length; ++i ) \r\n\t\t{\r\n\t\t\tfor ( var j=0; j<3; ++j ) \r\n\t\t\t{\r\n\t\t\t\tif ( min[j] > this.vpos[i][j] ) min[j] = this.vpos[i][j];\r\n\t\t\t\tif ( max[j] < this.vpos[i][j] ) max[j] = this.vpos[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { min: min, max: max };\r\n\t}", "_calculateBounds() {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height)) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n }", "function getRectInBounds(dim, minWidth=10, minHeight=10) {\n\tvar startX = randInt(0, dim[0]);\n\tvar startY = randInt(0, dim[1]);\n\tvar width = randInt(0, dim[0]-startX);\n\tvar height = randInt(0, dim[1] - startY);\n\tif (width < minWidth) { width = minWidth; }\n\tif (height < minHeight) { height = minHeight; }\n\tif (startX+width > dim[0] || startY+height > dim[1]) {\n\t\treturn getRectInBounds(dim, minWidth, minHeight);\n\t}\n\treturn {x: startX, y: startY, w: width, h: height};\n}", "function v(){var t=W.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||W[e]:t.height||W[e]}", "function getBoundariesFor(obj) {\r\n\t\treturn {\r\n\t\t\ttop: obj.center.y - (obj.size.height / 2.5),\r\n\t\t\tbottom: obj.center.y + (obj.size.height / 2.5),\r\n\t\t\tleft: obj.center.x - (obj.size.width / 2.5),\r\n\t\t\tright: obj.center.x + (obj.size.width / 2.5)\r\n\t\t};\r\n\t}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function boundingBoxBits(coordinate, size) {\r\n var latDeltaDegrees = size / METERS_PER_DEGREE_LATITUDE;\r\n var latitudeNorth = Math.min(90, coordinate.latitude + latDeltaDegrees);\r\n var latitudeSouth = Math.max(-90, coordinate.latitude - latDeltaDegrees);\r\n var bitsLat = Math.floor(latitudeBitsForResolution(size)) * 2;\r\n var bitsLongNorth = Math.floor(longitudeBitsForResolution(size, latitudeNorth)) * 2 - 1;\r\n var bitsLongSouth = Math.floor(longitudeBitsForResolution(size, latitudeSouth)) * 2 - 1;\r\n return Math.min(bitsLat, bitsLongNorth, bitsLongSouth, MAXIMUM_BITS_PRECISION);\r\n}", "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "bounds() {\n const _bounds = new HRect(this.rect);\n _bounds.offsetTo(0, 0);\n return _bounds;\n }", "withinBounds(size) {\n return (\n this.x >= 0 &&\n this.y >= 0 &&\n this.x < size &&\n this.y < size\n )\n }", "function constrainPoint(point, rect) {\n\t\treturn {\n\t\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t\t};\n\t}", "_calculateBounds() {\n // FILL IN//\n }", "function BoundingBox() {\r\n\t this.x1 = Number.NaN;\r\n\t this.y1 = Number.NaN;\r\n\t this.x2 = Number.NaN;\r\n\t this.y2 = Number.NaN;\r\n\t}" ]
[ "0.7078578", "0.684791", "0.6818044", "0.66710156", "0.6666757", "0.6666757", "0.64929557", "0.6467882", "0.6403344", "0.63710004", "0.6345185", "0.63323104", "0.6330131", "0.6313377", "0.63131547", "0.629353", "0.6277352", "0.62769806", "0.6258857", "0.6240201", "0.62348264", "0.61676127", "0.6159976", "0.61586857", "0.61584073", "0.6157416", "0.6115405", "0.6115405", "0.6109424", "0.6097618", "0.6079296", "0.6075252", "0.6075252", "0.6075252", "0.60716295", "0.6054173", "0.60522246", "0.6051517", "0.6042044", "0.60299", "0.6029567", "0.59989464", "0.59796333", "0.5967818", "0.5967345", "0.59598106", "0.5953406", "0.5950897", "0.5942216", "0.5939207", "0.5938903", "0.59354126", "0.5934765", "0.59136385", "0.58994794", "0.5892733", "0.588916", "0.58851516", "0.5884375", "0.587769", "0.5848735", "0.5843592", "0.58376443", "0.58376443", "0.58376443", "0.58376443", "0.58376443", "0.58331174", "0.58317876", "0.5827137", "0.5820326", "0.5819569", "0.58181053", "0.5816123", "0.5801419", "0.579732", "0.5796094", "0.5794357", "0.578828", "0.578627", "0.57845473", "0.5784016", "0.57812375", "0.578013", "0.57786226", "0.57786226", "0.57786226", "0.57786226", "0.57786226", "0.57786226", "0.57786226", "0.57786226", "0.5775533", "0.57632047", "0.57632047", "0.57570547", "0.57515013", "0.5750601", "0.5742171", "0.5740839" ]
0.70760936
1
intersect line a,b with line c,d, returns null if no intersection
function lineIntersect(a,b,c,d){ // http://paulbourke.net/geometry/lineline2d/ var f = ((d.y - c.y)*(b.x - a.x) - (d.x - c.x)*(b.y - a.y)); if(f == 0){ return null; } f = 1 / f; var fab = ((d.x - c.x)*(a.y - c.y) - (d.y - c.y)*(a.x - c.x)) * f ; if(fab < 0 || fab > 1){ return null; } var fcd = ((b.x - a.x)*(a.y - c.y) - (b.y - a.y)*(a.x - c.x)) * f ; if(fcd < 0 || fcd > 1){ return null; } return new V2(a.x + fab * (b.x-a.x), a.y + fab * (b.y - a.y) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineintersect(s1, e1, s2, e2) { \n // Solve the equation \n // [(e1-s1) -(e2-s2)]*[a1 a2]^T = s2-s1\n // for [a1 a2]. Both a1 and a2 should be in the range [0,1] for segments to\n // intersect. The matrix on the lhs will be singular if the lines are\n // collinear.\n const a = e1[0] - s1[0], c = e1[1] - s1[1]\n const b = -(e2[0] - s2[0]), d = -(e2[1] - s2[1])\n const e = s2[0] - s1[0], f = s2[1] - s1[1]\n const det = a*d - b*c\n if (det == 0) return null\n const a1 = ( d*e - b*f)/det\n const a2 = (-c*e + a*f)/det\n if (a1 < 0 || a1 > 1 || a2 < 0 || a2 > 1) return null\n return [s1[0]+a1*a, s1[1]+a1*c]\n}", "function lineIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n\t var a = x2 - x1,\n\t b = x3 - x1,\n\t c = x4 - x3,\n\t d = y2 - y1,\n\t e = y3 - y1,\n\t f = y4 - y3,\n\t det = a * f - c * d;\n\t // parallel lines? intersection is undefined\n\t // ignore the case where they are colinear\n\t if(det === 0) return null;\n\t var t = (b * f - c * e) / det,\n\t u = (b * d - a * e) / det;\n\t // segments do not intersect?\n\t if(u < 0 || u > 1 || t < 0 || t > 1) return null;\n\t\n\t return {x: x1 + a * t, y: y1 + d * t};\n\t}", "function lineIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n\t var a = x2 - x1,\n\t b = x3 - x1,\n\t c = x4 - x3,\n\t d = y2 - y1,\n\t e = y3 - y1,\n\t f = y4 - y3,\n\t det = a * f - c * d;\n\t // parallel lines? intersection is undefined\n\t // ignore the case where they are colinear\n\t if(det === 0) return null;\n\t var t = (b * f - c * e) / det,\n\t u = (b * d - a * e) / det;\n\t // segments do not intersect?\n\t if(u < 0 || u > 1 || t < 0 || t > 1) return null;\n\t\n\t return {x: x1 + a * t, y: y1 + d * t};\n\t}", "function intersection(line_start, line_end, side_start, side_end) {\n\n var line = line_end.clone().subtract(line_start);\n var side = side_end.clone().subtract(side_start);\n var lineCrossSidePerp = line.x * side.y - line.y * side.x;\n\n // if line Cross side === 0, it means the lines are parallel so have infinite intersection points\n if (lineCrossSidePerp === 0) {\n return null;\n }\n\n var diff = side_start.clone().subtract(line_start);\n var t = (diff.x * side.y - diff.y * side.x) / lineCrossSidePerp;\n if (t < 0 || t >= 1) {\n return null;\n }\n\n var u = (diff.x * line.y - diff.y * line.x) / lineCrossSidePerp;\n if (u < 0 || u >= 1) {\n return null;\n }\n\n var intersection = line_start.clone().add(line.clone().multiply(Victor(t, t)));\n return intersection;\n}", "function getLineIntersection(a1, a2, b1, b2) {\n var dax = a1[0] - a2[0],\n dbx = b1[0] - b2[0],\n day = a1[1] - a2[1],\n dby = b1[1] - b2[1];\n\n var det = dax * dby - day * dbx;\n if (det == 0) // TODO: Add epsilon\n return null; // parallel\n\n var a = a1[0] * a2[1] - a1[1] * a2[0];\n var b = b1[0] * b2[1] - b1[1] * b2[0];\n\n return [\n (a * dbx - dax * b) / det,\n (a * dby - day * b) / det\n ];\n }", "getIntersection(other) {\n // Get equations describing lines (ax + bx = c),\n // then solve for a point - if no solution, no intersection.\n this.getLineParameters()\n other.getLineParameters()\n const denom = this.b * other.a - other.b * this.a\n // If denominator is zero, no solution, so no intersection (ie lines are parallel)\n // You can see that the slopes are the same because if a/b == a'/b' then denom=0\n if (denom === 0)\n return null\n // Lines intersect, but need to check if intersecting point is actually within \n // both line segments bounding boxes.\n const x = (this.b * other.c - other.b * this.c) / denom\n const y = (this.c * other.a - other.c * this.a) / denom\n // console.log(x, this.x1, this.x2)\n if (!this.pointInBounds(x, y)) return null\n if (!other.pointInBounds(x, y)) return null\n // Must be on both line segments so return intersection\n const intersectPoint = new Point2D(x, y)\n return intersectPoint\n }", "function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return false\n }\n \n denominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1))\n \n // Lines are parallel\n if (denominator === 0) {\n return false\n }\n \n var ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator\n var ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator\n \n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return false\n }\n \n // Return a object with the x and y coordinates of the intersection\n var x = x1 + ua * (x2 - x1)\n var y = y1 + ua * (y2 - y1)\n \n return {x: x, y: y}\n }", "intersect(line) {\n const sub = this.a - line.a;\n if (sub === 0) return null;\n \n const x = (line.b - this.b) / sub;\n const y = this.getYAt(x);\n return createVector(x, y);\n }", "function _lineIntersect(A,B,E,F,infinite){\n\t\tvar a1, a2, b1, b2, c1, c2, x, y;\n\t\t\n\t\ta1= B.y-A.y;\n\t\tb1= A.x-B.x;\n\t\tc1= B.x*A.y - A.x*B.y;\n\t\ta2= F.y-E.y;\n\t\tb2= E.x-F.x;\n\t\tc2= F.x*E.y - E.x*F.y;\n\t\t\n\t\tvar denom=a1*b2 - a2*b1;\n\t\t\n\t\tx = (b1*c2 - b2*c1)/denom,\n\t\ty = (a2*c1 - a1*c2)/denom\n\t\t\n\t\tif(!isFinite(x) || !isFinite(y)){\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// lines are colinear\n\t\t/*var crossABE = (E.y - A.y) * (B.x - A.x) - (E.x - A.x) * (B.y - A.y);\n\t\tvar crossABF = (F.y - A.y) * (B.x - A.x) - (F.x - A.x) * (B.y - A.y);\n\t\tif(_almostEqual(crossABE,0) && _almostEqual(crossABF,0)){\n\t\t\treturn null;\n\t\t}*/\n\t\t\n\t\tif(!infinite){\n\t\t\t// coincident points do not count as intersecting\n\t\t\tif (Math.abs(A.x-B.x) > TOL && (( A.x < B.x ) ? x < A.x || x > B.x : x > A.x || x < B.x )) return null;\n\t\t\tif (Math.abs(A.y-B.y) > TOL && (( A.y < B.y ) ? y < A.y || y > B.y : y > A.y || y < B.y )) return null;\n\n\t\t\tif (Math.abs(E.x-F.x) > TOL && (( E.x < F.x ) ? x < E.x || x > F.x : x > E.x || x < F.x )) return null;\n\t\t\tif (Math.abs(E.y-F.y) > TOL && (( E.y < F.y ) ? y < E.y || y > F.y : y > E.y || y < F.y )) return null;\n\t\t}\n\t\t\n\t\treturn {x: x, y: y};\n\t}", "function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n\t var mx = a2x - a1x;\n\t var my = a2y - a1y;\n\t var nx = b2x - b1x;\n\t var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n\t // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\t\n\t var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\t\n\t if (nearZero(nmCrossProduct)) {\n\t return false;\n\t } // `vec_m` and `vec_n` are intersect iff\n\t // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n\t // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n\t // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\t\n\t\n\t var b1a1x = a1x - b1x;\n\t var b1a1y = a1y - b1y;\n\t var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\t\n\t if (q < 0 || q > 1) {\n\t return false;\n\t }\n\t\n\t var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\t\n\t if (p < 0 || p > 1) {\n\t return false;\n\t }\n\t\n\t return true;\n\t }", "function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\n if (nearZero(nmCrossProduct)) {\n return false;\n } // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\n\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\n if (q < 0 || q > 1) {\n return false;\n }\n\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\n if (p < 0 || p > 1) {\n return false;\n }\n\n return true;\n}", "function lineIntersection(a, b) {\n\t function subtractPoints(point1, point2) {\n\t return [point1[0] - point2[0], point1[1] - point2[1]];\n\t }\n\t function crossProduct(point1, point2) {\n\t return point1[0] * point2[1] - point1[1] * point2[0];\n\t }\n\n\t var p = [a[0][0], a[0][1]],\n\t p2 = [a[1][0], a[1][1]],\n\t q = [b[0][0], b[0][1]],\n\t q2 = [b[1][0], b[1][1]],\n\t r = subtractPoints(p2, p),\n\t s = subtractPoints(q2, q),\n\t uNumerator = crossProduct(subtractPoints(q, p), r),\n\t denominator = crossProduct(r, s);\n\n\t if (uNumerator && denominator) {\n\t var u = uNumerator / denominator,\n\t t = crossProduct(subtractPoints(q, p), s) / denominator;\n\n\t if ((t >= 0) && (t <= 1) && (u >= 0) && (u <= 1)) {\n\t return interp(p, p2, t);\n\t }\n\t }\n\n\t return null;\n\t}", "function getIntersection(x1, y1, x2, y2, x3, y3, x4, y4){\n var denom = ((x2 - x1)*(y4 - y3)-(y2 - y1)*(x4 - x3));\n var r;\n var s;\n var x;\n var y;\n var b = false;\n\n //If lines not collinear or parallel\n if(denom != 0){\n //Intersection in ray \"local\" coordinates\n r = (((y1 - y3) * (x4 - x3)) - (x1 - x3) * (y4 - y3)) / denom;\n\n //Intersection in segment \"local\" coordinates\n s = (((y1 - y3) * (x2 - x1)) - (x1 - x3) * (y2 - y1)) / denom;\n\n //The algorithm gives the intersection of two infinite lines, determine if it lies on the side that the ray is defined on\n if (r >= 0)\n {\n //If point along the line segment\n if (s >= 0 && s <= 1)\n {\n b = true;\n //Get point coordinates (offset by r local units from start of ray)\n x = x1 + r * (x2 - x1);\n y = y1 + r * (y2 - y1);\n }\n }\n }\n var p = [b,x,y];\n return p;\n}", "intersection(start, end, sideStart, sideEnd) {\n let line = end.clone().subtract(start)\n let side = sideEnd.clone().subtract(sideStart)\n let lineCrossSidePerp = line.x * side.y - line.y * side.x\n\n // if line Cross side === 0, it means the lines are parallel so have infinite intersection points\n if (lineCrossSidePerp === 0) {\n return null\n }\n\n const diff = sideStart.clone().subtract(start)\n let t = (diff.x * side.y - diff.y * side.x) / lineCrossSidePerp\n if (t < 0 || t >= 1) {\n return null\n }\n\n const u = (diff.x * line.y - diff.y * line.x) / lineCrossSidePerp\n if (u < 0 || u >= 1) {\n return null\n }\n\n return start.clone().add(line.clone().multiply(new Victor(t, t)))\n }", "function line_intersect(v1, v2, p1, p2) {\n\n\t// Ax + By = C\n\tvar Va = v2.y - v1.y,\n\t\tVb = v1.x - v2.x,\n\t\tVc = Va * v1.x + Vb * v1.y,\n\n\t\tPa = p2.y - p1.y,\n\t\tPb = p1.x - p2.x,\n\t\tPc = Pa * p1.x + Pb * p1.y,\n\n\t\tdet = (Va * Pb - Pa * Vb);\n\n\t// parallel lines\n\tif (det == 0) {\n\t\treturn null;\n\t}\n\n\tvar x = (Pb * Vc - Vb * Pc) / det,\n\t\ty = (Va * Pc - Pa * Vc) / det,\n\t\tvdistsq = ((v2.x - v1.x)*(v2.x - v1.x) + (v2.y - v1.y)*(v2.y - v1.y) ),\n\t\tvdotprod = (x - v1.x) * (v2.x - v1.x) + (y - v1.y) * (v2.y - v1.y),\n\t\tpdistsq = ((p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y) ),\n\t\tpdotprod = (x - p1.x) * (p2.x - p1.x) + (y - p1.y) * (p2.y - p1.y);\n\n\t// intersection point is out of bounds\n\tif (vdotprod < 0 || vdotprod > vdistsq || pdotprod < 0 || pdotprod > pdistsq) {\n\t\treturn null;\n\t}\n\n\tvar circle = new Path.Circle(new Point(x, y), 10);\n\tcircle.fillColor = 'green';\n\n\treturn [x, y];\n}", "intersect_line_line(p1, p2, p3, p4){\n\t\tlet denom = ((p4.y - p3.y)*(p2.x - p1.x) - (p4.x - p3.x)*(p2.y - p1.y));\n\t\tif (denom === 0) return false // lines are parallel\n\t\tlet ua = ((p4.x - p3.x)*(p1.y - p3.y) - (p4.y - p3.y)*(p1.x - p3.x)) / denom;\n\t\tlet ub = ((p2.x - p1.x)*(p1.y - p3.y) - (p2.y - p1.y)*(p1.x - p3.x)) / denom;\n\n\t\tif (ua < 0 || ua > 1 || ub < 0 || ub > 1) return false;\n\t\treturn new Point(p1.x + ua * (p2.x - p1.x), p1.y + ua * (p2.y - p1.y));\n\t}", "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n if (nearZero(delta)) { // parallel\n return false;\n }\n var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n if (namenda < 0 || namenda > 1) {\n return false;\n }\n var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n if (miu < 0 || miu > 1) {\n return false;\n }\n return true;\n }", "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n if (nearZero(delta)) { // parallel\n return false;\n }\n var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n if (namenda < 0 || namenda > 1) {\n return false;\n }\n var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n if (miu < 0 || miu > 1) {\n return false;\n }\n return true;\n }", "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n\t if (nearZero(delta)) {\n\t // parallel\n\t return false;\n\t }\n\t var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n\t if (namenda < 0 || namenda > 1) {\n\t return false;\n\t }\n\t var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n\t if (miu < 0 || miu > 1) {\n\t return false;\n\t }\n\t return true;\n\t}", "function LineIntersect2(a0, a1, b0, b1, intersectionPoint) {\n if (a0 == b0 || a0 == b1 || a1 == b0 || a1 == b1)\n return false;\n var x1 = a0.x;\n var y1 = a0.y;\n var x2 = a1.x;\n var y2 = a1.y;\n var x3 = b0.x;\n var y3 = b0.y;\n var x4 = b1.x;\n var y4 = b1.y;\n //AABB early exit\n if (Math.max(x1, x2) < Math.min(x3, x4) || Math.max(x3, x4) < Math.min(x1, x2))\n return false;\n if (Math.max(y1, y2) < Math.min(y3, y4) || Math.max(y3, y4) < Math.min(y1, y2))\n return false;\n var ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3));\n var ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3));\n var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n if (Math.abs(denom) < 10e-7) {\n //Lines are too close to parallel to call\n return false;\n }\n ua /= denom;\n ub /= denom;\n if ((0 < ua) && (ua < 1) && (0 < ub) && (ub < 1)) {\n intersectionPoint.x = (x1 + ua * (x2 - x1));\n intersectionPoint.y = (y1 + ua * (y2 - y1));\n return true;\n }\n return false;\n }", "function linesIntersect(x1, y1, x2, y2, x3, y3, x4, y4){\n\t\t // Return false if either of the lines have zero length\n\t\t if (x1 == x2 && y1 == y2 ||\n\t\t\t\tx3 == x4 && y3 == y4){\n\t\t\t return false;\n\t\t }\n\t\t // Fastest method, based on Franklin Antonio's \"Faster Line Segment Intersection\" topic \"in Graphics Gems III\" book (http://www.graphicsgems.org/)\n\t\t var ax = x2-x1;\n\t\t var ay = y2-y1;\n\t\t var bx = x3-x4;\n\t\t var by = y3-y4;\n\t\t var cx = x1-x3;\n\t\t var cy = y1-y3;\n\n\t\t var alphaNumerator = by*cx - bx*cy;\n\t\t var commonDenominator = ay*bx - ax*by;\n\t\t if (commonDenominator > 0){\n\t\t\t if (alphaNumerator < 0 || alphaNumerator > commonDenominator){\n\t\t\t\treturn false;\n\t\t\t }\n\t\t } else if (commonDenominator < 0){\n\t\t\t if (alphaNumerator > 0 || alphaNumerator < commonDenominator){\n\t\t\t\treturn false;\n\t\t\t }\n\t\t }\n\t\t betaNumerator = ax*cy - ay*cx;\n\t\t if (commonDenominator > 0){\n\t\t\t if (betaNumerator < 0 || betaNumerator > commonDenominator){\n\t\t\t\treturn false;\n\t\t\t }\n\t\t }else if (commonDenominator < 0){\n\t\t\t if (betaNumerator > 0 || betaNumerator < commonDenominator){\n\t\t\t\treturn false;\n\t\t\t }\n\t\t }\n\t\t if (commonDenominator == 0){\n\t\t\t // This code wasn't in Franklin Antonio's method. It was added by Keith Woodward.\n\t\t\t // The lines are parallel.\n\t\t\t // Check if they're collinear.\n\t\t\t var y3LessY1 = y3-y1;\n\t\t\t var collinearityTestForP3 = x1*(y2-y3) + x2*(y3LessY1) + x3*(y1-y2); // see http://mathworld.wolfram.com/Collinear.html\n\t\t\t // If p3 is collinear with p1 and p2 then p4 will also be collinear, since p1-p2 is parallel with p3-p4\n\t\t\t if (collinearityTestForP3 == 0){\n\t\t\t\t// The lines are collinear. Now check if they overlap.\n\t\t\t\tif (x1 >= x3 && x1 <= x4 || x1 <= x3 && x1 >= x4 ||\n\t\t\t\t\t x2 >= x3 && x2 <= x4 || x2 <= x3 && x2 >= x4 ||\n\t\t\t\t\t x3 >= x1 && x3 <= x2 || x3 <= x1 && x3 >= x2){\n\t\t\t\t if (y1 >= y3 && y1 <= y4 || y1 <= y3 && y1 >= y4 ||\n\t\t\t\t\t\t y2 >= y3 && y2 <= y4 || y2 <= y3 && y2 >= y4 ||\n\t\t\t\t\t\t y3 >= y1 && y3 <= y2 || y3 <= y1 && y3 >= y2){\n\t\t\t\t\t return true;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "function getLineIntersectionPoint(a, b, c, d) {\r\n const cX = c[0];\r\n const aX = a[0];\r\n const cdDeltaX = d[0] - cX;\r\n const abDeltaX = b[0] - aX;\r\n const cY = c[1];\r\n const aY = a[1];\r\n const cdDeltaY = d[1] - cY;\r\n const abDeltaY = b[1] - aY;\r\n // Division by zero if the lines are parallel.\r\n const ua = (abDeltaX * (cY - aY) - abDeltaY * (cX - aX)) / (abDeltaY * cdDeltaX - abDeltaX * cdDeltaY);\r\n return [cX + ua * cdDeltaX, cY + ua * cdDeltaY];\r\n}", "doLinesIntersect (a, b) {\n for (let i = 1; i < a.length; i++) {\n for (let j = 1; j < b.length; j++) {\n if (b[j]) {\n if (this.doLineSegmentsIntersect(\n a[i - 1].x, a[i - 1].y, a[i].x, a[i].y,\n b[j - 1].x, b[j - 1].y, b[j].x, b[j].y\n )) return true\n }\n }\n }\n }", "function intersectLineLine(x1, y1, x2, y2, x3, y3, x4, y4) {\n \"use strict\";\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, num;\n var x, y;\n x = 0;\n y = 0;\n\n var result = null;\n\n a1 = y2 - y1;\n\n b1 = x1 - x2;\n c1 = (x2 * y1) - (x1 * y2);\n\n r3 = ((a1 * x3) + (b1 * y3) + c1);\n r4 = ((a1 * x4) + (b1 * y4) + c1);\n\n if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {\n return result;\n }\n\n a2 = y4 - y3;\n b2 = x3 - x4;\n c2 = (x4 * y3) - (x3 * y4);\n\n r1 = (a2 * x1) + (b2 * y1) + c2;\n r2 = (a2 * x2) + (b2 * y2) + c2;\n\n if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {\n return result;\n }\n\n denom = (a1 * b2) - (a2 * b1);\n\n if (denom === 0) {\n return result;\n }\n\n num = (b1 * c2) - (b2 * c1);\n x = (num) / denom;\n\n num = (a2 * c1) - (a1 * c2);\n y = (num) / denom;\n\n result = createVector(x, y);\n\n return result;\n}", "function getIntersections(a, b, c) {\n\t// Calculate the euclidean distance between a & b\n\teDistAtoB = Math.sqrt( Math.pow(b[0]-a[0], 2) + Math.pow(b[1]-a[1], 2) );\n\n\t// compute the direction vector d from a to b\n\td = [ (b[0]-a[0])/eDistAtoB, (b[1]-a[1])/eDistAtoB ];\n\n\t// Now the line equation is x = dx*t + ax, y = dy*t + ay with 0 <= t <= 1.\n\n\t// compute the value t of the closest point to the circle center (cx, cy)\n\tt = (d[0] * (c[0]-a[0])) + (d[1] * (c[1]-a[1]));\n\n\t// compute the coordinates of the point e on line and closest to c\n var e = {coords:[], onLine:false};\n\te.coords[0] = (t * d[0]) + a[0];\n\te.coords[1] = (t * d[1]) + a[1];\n\n\t// Calculate the euclidean distance between c & e\n\teDistCtoE = Math.sqrt( Math.pow(e.coords[0]-c[0], 2) + Math.pow(e.coords[1]-c[1], 2) );\n\n\t// test if the line intersects the circle\n\tif( eDistCtoE < c[2] ) {\n\t\t// compute distance from t to circle intersection point\n\t dt = Math.sqrt( Math.pow(c[2], 2) - Math.pow(eDistCtoE, 2));\n\n\t // compute first intersection point\n\t var f = {coords:[], onLine:false};\n\t f.coords[0] = ((t-dt) * d[0]) + a[0];\n\t f.coords[1] = ((t-dt) * d[1]) + a[1];\n\t // check if f lies on the line\n\t f.onLine = is_on(a,b,f.coords);\n\n\t // compute second intersection point\n\t var g = {coords:[], onLine:false};\n\t g.coords[0] = ((t+dt) * d[0]) + a[0];\n\t g.coords[1] = ((t+dt) * d[1]) + a[1];\n\t // check if g lies on the line\n\t g.onLine = is_on(a,b,g.coords);\n\n\t\treturn {points: {intersection1:f, intersection2:g}, pointOnLine: e};\n\n\t} else if (parseInt(eDistCtoE) === parseInt(c[2])) {\n\t\t// console.log(\"Only one intersection\");\n\t\treturn {points: false, pointOnLine: e};\n\t} else {\n\t\t// console.log(\"No intersection\");\n\t\treturn {points: false, pointOnLine: e};\n\t}\n}", "function intersection(line1, line2, point) {\n this.line1 = line1;\n this.line2 = line2;\n this.point = point;\n this.segments = [];\n }", "function LineIntersect(p1, p2, q1, q2) {\n var i = { x: 0, y: 0 };\n var a1 = p2.y - p1.y;\n var b1 = p1.x - p2.x;\n var c1 = a1 * p1.x + b1 * p1.y;\n var a2 = q2.y - q1.y;\n var b2 = q1.x - q2.x;\n var c2 = a2 * q1.x + b2 * q1.y;\n var det = a1 * b2 - a2 * b1;\n if (!FloatEquals(det, 0)) {\n // lines are not parallel\n i.x = (b2 * c1 - b1 * c2) / det;\n i.y = (a1 * c2 - a2 * c1) / det;\n }\n return i;\n }", "function lineLineIntersection(l1, l2) {\n let [[p1x, p1y], [p2x, p2y]] = l1;\n let [[p3x, p3y], [p4x, p4y]] = l2;\n let v1x = p2x - p1x;\n let v1y = p2y - p1y;\n let v2x = p4x - p3x;\n let v2y = p4y - p3y;\n let cross = v2x * v1y - v2y * v1x;\n if (cross === 0) {\n // parallel\n return undefined;\n }\n let b = ((p3y - p1y) * v1x - (p3x - p1x) * v1y) / cross;\n return [p3x + b * v2x, p3y + b * v2y];\n}", "function checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n var denominator, a, b, numerator1, numerator2, result = {\n x: null,\n y: null,\n };\n denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n // console.log('Denominator: ' + denominator);\n if (denominator < 0.0000001 && denominator > -0.0000001) {\n // console.log( 'no intersection ');\n return result;\n }\n // console.log( 'intersection' );\n a = line1StartY - line2StartY;\n b = line1StartX - line2StartX;\n numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n a = numerator1 / denominator;\n b = numerator2 / denominator;\n\n // if we cast these lines infinitely in both directions, they intersect here:\n result.x = line1StartX + (a * (line1EndX - line1StartX));\n result.y = line1StartY + (a * (line1EndY - line1StartY));\n/*\n // it is worth noting that this should be the same as:\n x = line2StartX + (b * (line2EndX - line2StartX));\n y = line2StartX + (b * (line2EndY - line2StartY));\n */\n\n return result;\n}", "function Line(point1, point2) {\n\tthis._point1 = point1;\n\tthis._point2 = point2;\n\t\n\t/***************************************************************************\n\t* equals\n\t*\n\t* Description:\n\t*\tTests if two lines are the same\n\t*\n\t* Args:\n\t*\tl - a Line object\n\t*\n\t* Returns:\n\t*\tA boolean, returns true if the two lines are the same\n\t***************************************************************************/\n\tthis.equals = function(l) {\n\t\tvar end1 = this.getEndPoints(-1000, 1000, -1000, 1000);\n\t\tvar end2 = l.getEndPoints(-1000, 1000, -1000, 1000);\n\t\treturn (end1[0].equals(end2[0]) && end1[1].equals(end2[1]));\n\t}\n\n\t/***************************************************************************\n\t* getIntersection\n\t*\n\t* Description:\n\t*\tFinds the point of intersection between this line and another\n\t*\n\t* Args:\n\t*\tline - a Line object\n\t*\n\t* Returns:\n\t*\ta Point object - the intersection of the two lines if it exists\n\t*\tNull otherwise\n\t***************************************************************************/\n\tthis.getIntersection = function(line) {\n\t\t// Extract the coordinates from the points of the lines\n\t\tvar x1 = this._point1.x;\n\t\tvar y1 = this._point1.y;\n\t\tvar x2 = this._point2.x;\n\t\tvar y2 = this._point2.y;\n\t\tvar x3 = line._point1.x;\n\t\tvar y3 = line._point1.y;\n\t\tvar x4 = line._point2.x;\n\t\tvar y4 = line._point2.y;\n\n\t\t// Calculate the denominator to each coordinate of the intersection point\n\t\tvar denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\t\t// If it is zero, the lines are either parallel or coincident, so just return null\n\t\tif (denominator == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Calculate the coordinates of the intersection point\n\t\tvar det12 = x1 * y2 - y1 * x2;\n\t\tvar det34 = x3 * y4 - y3 * x4;\n\t\tvar x = (det12 * (x3 - x4) - det34 * (x1 - x2)) / denominator;\n\t\tvar y = (det12 * (y3 - y4) - det34 * (y1 - y2)) / denominator;\n\n\t\treturn new Point(x, y);\n\t}\n\n\t/***************************************************************************\n\t* segmentLength\n\t*\n\t* Description:\n\t*\tComputes the length of the line segment between the two points\n\t*\n\t* Args:\n\t*\tNone\n\t*\n\t* Returns:\n\t*\tA number - the length\n\t***************************************************************************/\n\tthis.segmentLength = function() {\n\t\treturn window.GeomUtil.distance(this._point1, this._point2);\n\t}\n\n\t/***************************************************************************\n\t* unitVector\n\t*\n\t* Description:\n\t*\tComputes the unit vector in the direction of this line\n\t*\n\t* Args:\n\t*\tNone\n\t*\n\t* Returns:\n\t*\ta Vector object\n\t***************************************************************************/\n\tthis.unitVector = function() {\n\t\tvar len = this.segmentLength();\n\t\treturn new Vector((this._point2.x - this._point1.x)/len, (this._point2.y - this._point1.y)/len);\n\t}\n\n\t/***************************************************************************\n\t* normalVector\n\t*\n\t* Description:\n\t*\tComputes the normal vector (of unit length) in the counter-clockwise \n\t*\tdirection\n\t*\n\t* Args:\n\t*\tNone\n\t*\n\t* Returns:\n\t*\ta Vector object\n\t***************************************************************************/\n\tthis.normalVector = function() {\n\t\tvar len = this.segmentLength();\n\t\treturn new Vector((this._point1.y - this._point2.y)/len, (this._point2.x - this._point1.x)/len);\n\t}\n\n\t/***************************************************************************\n\t* getEndPoints\n\t*\n\t* Description:\n\t*\tCalculates the endpoints of this line given boundaries. This maintains the \n\t*\torder of the points\n\t*\n\t* Args:\n\t*\tminx - the minimum x value allowed for the end points\n\t*\tmaxx - the maximum x value allowed for the end points\n\t*\tminy - the minimum y value allowed for the end points\n\t*\tmaxy - the maximum y value allowed for the end points\n\t*\n\t* Returns:\n\t*\tan array of two Point objects\n\t***************************************************************************/\n\tthis.getEndPoints = function(minx, maxx, miny, maxy) {\n\t\tvar points = [];\n\n\t\t// Vertical line\n\t\tif (this._point1.x == this._point2.x) {\n\t\t\tpoints.push(new Point(this._point1.x, miny));\n\t\t\tpoints.push(new Point(this._point2.x, maxy));\n\t\t} \n\t\t// Horizontal line\n\t\telse if (this._point1.y == this._point2.y) {\n\t\t\tpoints.push(new Point(minx, this._point1.y));\n\t\t\tpoints.push(new Point(maxx, this._point2.y));\n\t\t} \n\t\t// All other cases\n\t\telse {\n\t\t\tvar slope = (this._point2.y - this._point1.y) / (this._point2.x - this._point1.x);\n\t\t\tvar yintercept = this._point1.y - slope * this._point1.x;\n\t\t\tvar intercept1 = slope * minx + yintercept;\n\t\t\tvar intercept2 = (maxy - yintercept) / slope;\n\t\t\tvar intercept3 = slope * maxx + yintercept;\n\t\t\tvar intercept4 = (miny - yintercept) / slope;\n\t\t\tvar coordinates = [];\n\t\t\tif ((intercept1 >= miny) && (intercept1 <= maxy)) {\n\t\t\t\tcoordinates.push(minx);\n\t\t\t\tcoordinates.push(intercept1);\n\t\t\t}\n\t\t\tif ((intercept2 >= minx) && (intercept2 <= maxx)) {\n\t\t\t\tcoordinates.push(intercept2);\n\t\t\t\tcoordinates.push(maxy);\n\t\t\t}\n\t\t\tif ((intercept3 >= miny) && (intercept3 <= maxy)) {\n\t\t\t\tcoordinates.push(maxx);\n\t\t\t\tcoordinates.push(intercept3);\n\t\t\t}\n\t\t\tif ((intercept4 >= minx) && (intercept4 <= maxx)) {\n\t\t\t\tcoordinates.push(intercept4);\n\t\t\t\tcoordinates.push(miny);\n\t\t\t}\n\n\t\t\t// Add the end points to the list in the correct order\n\t\t\tvar p1 = new Point(coordinates[0], coordinates[1]);\n\t\t\tvar p2 = new Point(coordinates[2], coordinates[3]);\n\t\t\tvar fullline = new Line(p1, p2);\n\t\t\t// If they are in the correct order\n\t\t\tif (this.unitVector().equals(fullline.unitVector())) {\n\t\t\t\tpoints.push(p1);\n\t\t\t\tpoints.push(p2);\n\t\t\t}\n\t\t\t// Otherwise they are in the wrong order\n\t\t\telse {\n\t\t\t\tpoints.push(p2);\n\t\t\t\tpoints.push(p1);\n\t\t\t}\n\t\t}\n\n\t\treturn points;\n\t}\n\n\t/***************************************************************************\n\t* flip\n\t*\n\t* Description:\n\t*\tComputes a new line which is this line rotated 180 degrees\n\t*\n\t* Args:\n\t*\tNone\n\t*\n\t* Returns:\n\t*\ta Line object\n\t***************************************************************************/\n\tthis.flip = function() {\n\t\treturn new Line(this._point2, this._point1);\n\t}\n}", "function intersect(x1,y1,x2,y2,x3,y3,x4,y4){\r\n s1x = x2 - x1;\r\n s1y = y2 - y1;\r\n\r\n s2x = x4 - x3;\r\n s2y = y4 - y3;\r\n\r\n s1 = ((-s1y * (x1 - x3)) + (s1x * (y1 - y3))) / ((-s2x * s1y) + (s1x * s2y))\r\n s2 = (( s2x * (y1 - y3)) - (s2y * (x1 - x3))) / ((-s2x * s1y) + (s1x * s2y))\r\n\r\n if ((s1 >= 0)*(s1 <= 1)*(s2 >= 0)*(s2 <= 1))\r\n {\r\n return [(x1 + (s2*s1x)),(y1 + (s2*s1y))];\r\n }\r\n else \r\n {\r\n return null;;\r\n }\r\n}", "intersection ( line ) {\n if ( line.a.x > this.x && line.b.x > this.x ) return null; // Right\n if ( line.a.x < this.x && line.b.x < this.x ) return null; // Left\n\n const cy = line.fy(this.x);\n if ( cy < this.a ) return null; // Below\n if ( cy > this.b ) return null; // Above\n return new Point(this.x, cy);\n }", "doLineSegmentsIntersect (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy) {\n const Sx = Bx - Ax\n const Sy = By - Ay\n const Tx = Dx - Cx\n const Ty = Dy - Cy\n const u = (-Sy * (Ax - Cx) + Sx * (Ay - Cy)) / (-Tx * Sy + Sx * Ty)\n const v = (Tx * (Ay - Cy) - Ty * (Ax - Cx)) / (-Tx * Sy + Sx * Ty)\n return u >= 0 && u <= 1 && v >= 0 && v <= 1\n }", "function intersectLine(p1,p2,q1,q2){\n// Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n// p7 and p473.\nvar a1,a2,b1,b2,c1,c2;var r1,r2,r3,r4;var denom,offset,num;var x,y;\n// Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n// b1 y + c1 = 0.\na1=p2.y-p1.y;b1=p1.x-p2.x;c1=p2.x*p1.y-p1.x*p2.y;\n// Compute r3 and r4.\nr3=a1*q1.x+b1*q1.y+c1;r4=a1*q2.x+b1*q2.y+c1;\n// Check signs of r3 and r4. If both point 3 and point 4 lie on\n// same side of line 1, the line segments do not intersect.\nif(r3!==0&&r4!==0&&sameSign(r3,r4)){return}\n// Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\na2=q2.y-q1.y;b2=q1.x-q2.x;c2=q2.x*q1.y-q1.x*q2.y;\n// Compute r1 and r2\nr1=a2*p1.x+b2*p1.y+c2;r2=a2*p2.x+b2*p2.y+c2;\n// Check signs of r1 and r2. If both point 1 and point 2 lie\n// on same side of second line segment, the line segments do\n// not intersect.\nif(r1!==0&&r2!==0&&sameSign(r1,r2)){return}\n// Line segments intersect: compute intersection point.\ndenom=a1*b2-a2*b1;if(denom===0){return}offset=Math.abs(denom/2);\n// The denom/2 is to get rounding instead of truncating. It\n// is added or subtracted to the numerator, depending upon the\n// sign of the numerator.\nnum=b1*c2-b2*c1;x=num<0?(num-offset)/denom:(num+offset)/denom;num=a2*c1-a1*c2;y=num<0?(num-offset)/denom:(num+offset)/denom;return{x:x,y:y}}", "function getLineLineIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {\n\t\t var det1And2 = getLineLineIntersection_det(x1, y1, x2, y2);\n\t\t var det3And4 = getLineLineIntersection_det(x3, y3, x4, y4);\n\t\t var x1LessX2 = x1 - x2;\n\t\t var y1LessY2 = y1 - y2;\n\t\t var x3LessX4 = x3 - x4;\n\t\t var y3LessY4 = y3 - y4;\n\t\t var det1Less2And3Less4 = getLineLineIntersection_det(x1LessX2, y1LessY2, x3LessX4, y3LessY4);\n\t\t if (det1Less2And3Less4 == 0){\n\t\t\t // the denominator is zero so the lines are parallel and there's either no solution (or multiple solutions if the lines overlap) so return null.\n\t\t\t return false;\n\t\t }\n\t\t var x = (getLineLineIntersection_det(det1And2, x1LessX2,\n\t\t\t\tdet3And4, x3LessX4) /\n\t\t\t\tdet1Less2And3Less4);\n\t\t var y = (getLineLineIntersection_det(det1And2, y1LessY2,\n\t\t\t\tdet3And4, y3LessY4) /\n\t\t\t\tdet1Less2And3Less4);\n\t\t return Array(x, y);\n\t }", "function intersectsLine(a,b,c,d,p,q,r,s) {\n var det, gamma, lambda;\n det = (c - a) * (s - q) - (r - p) * (d - b);\n if (det === 0) {\n return false;\n } else {\n lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det;\n gamma = ((b - d) * (r - a) + (c - a) * (s - b)) / det;\n\n if((0 < lambda && lambda < 1) && (0 < gamma && gamma < 1)) {\n \n // let dir = new THREE.Vector2(c-a, d-b);\n // // dir.normalize();\n\n // let px = a + lambda * dir.x; \n // let py = b + gamma * dir.y;\n \n let dir1 = new THREE.Vector2(c-a, d-b);\n // dir1.normalize();\n let dir2 = new THREE.Vector2(r-p, s-q);\n // dir2.normalize();\n\n let px = (a + lambda * dir1.x); // + (p + gamma * dir2.x); \n let py = (b + lambda * dir1.y); // + (q + gamma * dir2.y); \n \n\n\n return { px: px, py: py };\n }\n\n return false;\n }\n}", "intersect(line) {\n if (!(line instanceof Line)) return null;\n return createVector(this.x, line.getYAt(this.x));\n }", "function getIntersectionOfTwoLinesThatIntersect(line1Start, line1End, line2Start, line2End) {\n // use helper variables to make it more readable\n var a1 = line1Start.x\n var a2 = line1Start.y\n var b1 = line1End.x\n var b2 = line1End.y\n var c1 = line2Start.x\n var c2 = line2Start.y\n var d1 = line2End.x\n var d2 = line2End.y\n var q = ((c2-a2)*(b1-a1)-(c1-a1)*(b2-a2)) / ((d1-c1)*(b2-a2)-(d2-c2)*(b1-a1))\n var intersection = new Point(\n line2Start.x + q * (line2End.x - line2Start.x),\n line2Start.y + q * (line2End.y - line2Start.y),\n ) \n return intersection\n}", "function line_line_intersection_vecs(p,q,r,s) {\n\tvar r_cross_s = vec2_crossprod( r, s ); //it's a scalar, representing z.\n\tif(r_cross_s === 0)\n\t{\n\t\tconsole.log(\"parallel?\",r,s)\n\t\treturn 0;\n\t}\n\t\n\tvar r_over_r_cross_s = r.clone();\n\tvar s_over_r_cross_s = s.clone();\n\t\n\tvar p_to_q = q.clone();\n\tp_to_q.sub(p);\n\t\n\tvar u = vec2_crossprod(p_to_q,r_over_r_cross_s);\n\tvar t = vec2_crossprod(p_to_q,s_over_r_cross_s);\n\t\n\tu /= r_cross_s;\n\tt /= r_cross_s;\n\t\n//\tif( 0 <= u && u <= 1 \n//\t && 0 <= t && t <= 1 ){\n//\t\t//answer is inside both line segments\n//\t}\n\n\tvar answer = p.clone();\n\tanswer.addScaledVector(r, t);\n\treturn answer;\n}", "function findIntersection(d) {\n var a1 = d[0].vector.x;\n var a2 = d[1].vector.x;\n var b1 = d[0].vector.y;\n var b2 = d[1].vector.y;\n var c1 = innerProduct(d[0].base, d[0].vector);\n var c2 = innerProduct(d[1].base, d[1].vector);\n var invDet = 1 / (a1 * b2 - b1 * a2);\n if (isZero(invDet)) {\n // no solution: parallel lines\n return null;\n }\n var x = invDet * (b2 * c1 - b1 * c2);\n var y = invDet * (-a2 * c1 + a1 * c2);\n return {x: x, y: y};\n }", "function intersection( line1_point1, line1_point2, line2_point1, line2_point2, _ipoint ) {\n var\n x = Point2f(line2_point1).subtract(line1_point1),\n direct1 = Point2f(line1_point2).subtract(line1_point1),\n direct2 = Point2f(line2_point2).subtract(line2_point1),\n\n cross = direct1.x*direct2.y - direct1.y*direct2.x;\n if( Math.abs(cross) < /*EPS*/1e-8 )\n return false;\n\n var\n t1 = (x.x * direct2.y - x.y * direct2.x)/cross;\n Point2f(line1_point1).add(direct1.hadamard(t1)).set(_ipoint);\n\n return true;\n }", "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2 , r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = (p2.x * p1.y) - (p1.x * p2.y);\n\n // Compute r3 and r4.\n r3 = ((a1 * q1.x) + (b1 * q1.y) + c1);\n r4 = ((a1 * q2.x) + (b1 * q2.y) + c1);\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = (q2.x * q1.y) - (q1.x * q2.y);\n\n // Compute r1 and r2\n r1 = (a2 * p1.x) + (b2 * p1.yy) + c2;\n r2 = (a2 * p2.x) + (b2 * p2.y) + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = (a1 * b2) - (a2 * b1);\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = (b1 * c2) - (b2 * c1);\n x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n num = (a2 * c1) - (a1 * c2);\n y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n return { x: x, y: y };\n}", "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2 , r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = (p2.x * p1.y) - (p1.x * p2.y);\n\n // Compute r3 and r4.\n r3 = ((a1 * q1.x) + (b1 * q1.y) + c1);\n r4 = ((a1 * q2.x) + (b1 * q2.y) + c1);\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = (q2.x * q1.y) - (q1.x * q2.y);\n\n // Compute r1 and r2\n r1 = (a2 * p1.x) + (b2 * p1.y) + c2;\n r2 = (a2 * p2.x) + (b2 * p2.y) + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = (a1 * b2) - (a2 * b1);\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = (b1 * c2) - (b2 * c1);\n x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n num = (a2 * c1) - (a1 * c2);\n y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);\n\n return { x: x, y: y };\n}", "function checkLineIntersection(line1, line2) {\n var line1point1 = line1.p1;\n var line1point2 = line1.p2;\n var line2point1 = line2.p1;\n var line2point2 = line2.p2;\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n var denominator, a, b, numerator1, numerator2, result = {\n x: null,\n y: null,\n onLine1: false,\n onLine2: false\n };\n denominator = ((line2point2.y - line2point1.y) * (line1point2.x - line1point1.x)) - ((line2point2.x - line2point1.x) * (line1point2.y - line1point1.y));\n if (denominator == 0) {\n return result;\n }\n a = line1point1.y - line2point1.y;\n b = line1point1.x - line2point1.x;\n numerator1 = ((line2point2.x - line2point1.x) * a) - ((line2point2.y - line2point1.y) * b);\n numerator2 = ((line1point2.x - line1point1.x) * a) - ((line1point2.y - line1point1.y) * b);\n a = numerator1 / denominator;\n b = numerator2 / denominator;\n\n // if we cast these lines infinitely in both directions, they intersect here:\n result.x = line1point1.x + (a * (line1point2.x - line1point1.x));\n result.y = line1point1.y + (a * (line1point2.y - line1point1.y));\n/*\n // it is worth noting that this should be the same as:\n x = line2point1.x + (b * (line2point2.x - line2point1.x));\n y = line2point1.x + (b * (line2point2.y - line2point1.y));\n*/\n // if line1 is a segment and line2 is infinite, they intersect if:\n if (a > 0 && a < 1) {\n result.onLine1 = true;\n }\n // if line2 is a segment and line1 is infinite, they intersect if:\n if (b > 0 && b < 1) {\n result.onLine2 = true;\n }\n // if line1 and line2 are segments, they intersect if both of the above are true\n return result;\n}", "function getLineSegmentsIntersection(out, p0, p1, p2, p3) {\n\n var s1_x, s1_y, s2_x, s2_y;\n s1_x = p1[0] - p0[0];\n s1_y = p1[1] - p0[1];\n s2_x = p3[0] - p2[0];\n s2_y = p3[1] - p2[1];\n\n var s, t;\n s = (-s1_y * (p0[0] - p2[0]) + s1_x * (p0[1] - p2[1])) / (-s2_x * s1_y + s1_x * s2_y);\n t = (s2_x * (p0[1] - p2[1]) - s2_y * (p0[0] - p2[0])) / (-s2_x * s1_y + s1_x * s2_y);\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n // Collision detected\n var intX = p0[0] + t * s1_x;\n var intY = p0[1] + t * s1_y;\n out[0] = intX;\n out[1] = intY;\n return t;\n }\n return -1; // No collision\n }", "function intersect(start0, end0, start1, end1) {\n if (equalArrays(start0,start1) || equalArrays(start0,end1) || equalArrays(end0,start1) || equalArrays(end1,start1)) return null;\n var x0 = start0[0],\n y0 = start0[1],\n x1 = end0[0],\n y1 = end0[1],\n x2 = start1[0],\n y2 = start1[1],\n x3 = end1[0],\n y3 = end1[1];\n var denom = (x0 - x1) * (y2 - y3) - (y0 - y1) * (x2 - x3);\n if (denom == 0) return null;\n var x4 = ((x0 * y1 - y0 * x1) * (x2 - x3) - (x0 - x1) * (x2 * y3 - y2 * x3)) / denom;\n var y4 = ((x0 * y1 - y0 * x1) * (y2 - y3) - (y0 - y1) * (x2 * y3 - y2 * x3)) / denom;\n return [x4, y4];\n}", "function getLineSegmentsIntersection (out, p0, p1, p2, p3) {\n\n var s1_x, s1_y, s2_x, s2_y;\n s1_x = p1[0] - p0[0];\n s1_y = p1[1] - p0[1];\n s2_x = p3[0] - p2[0];\n s2_y = p3[1] - p2[1];\n\n var s, t;\n s = (-s1_y * (p0[0] - p2[0]) + s1_x * (p0[1] - p2[1])) / (-s2_x * s1_y + s1_x * s2_y);\n t = ( s2_x * (p0[1] - p2[1]) - s2_y * (p0[0] - p2[0])) / (-s2_x * s1_y + s1_x * s2_y);\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) { // Collision detected\n var intX = p0[0] + (t * s1_x);\n var intY = p0[1] + (t * s1_y);\n out[0] = intX;\n out[1] = intY;\n return t;\n }\n return -1; // No collision\n}", "function xIntersect(line1,line2){\n if(line1.b === null){\n return line1.anX;\n }\n else if(line2.b === null){\n return line2.anX;\n }else{\n return ((line2.b - line1.b) / (line1.m - line2.m));\n }\n }", "function checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n var denominator, a, b, numerator1, numerator2, result = {\n x: null,\n y: null,\n onLine1: false,\n onLine2: false\n };\n denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n if (denominator == 0) {\n return result;\n }\n a = line1StartY - line2StartY;\n b = line1StartX - line2StartX;\n numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n a = numerator1 / denominator;\n b = numerator2 / denominator;\n\n // if we cast these lines infinitely in both directions, they intersect here:\n result.x = line1StartX + (a * (line1EndX - line1StartX));\n result.y = line1StartY + (a * (line1EndY - line1StartY));\n/*\n // it is worth noting that this should be the same as:\n x = line2StartX + (b * (line2EndX - line2StartX));\n y = line2StartX + (b * (line2EndY - line2StartY));\n */\n // if line1 is a segment and line2 is infinite, they intersect if:\n if (a > 0 && a < 1) {\n result.onLine1 = true;\n }\n // if line2 is a segment and line1 is infinite, they intersect if:\n if (b > 0 && b < 1) {\n result.onLine2 = true;\n }\n // if line1 and line2 are segments, they intersect if both of the above are true\n return result;\n}", "function segmentsIntersect(e1, e2, precisionDistance)\n{\n var denom = e2.dy * e1.dx - e2.dx * e1.dy;\n var numera = e2.dx * (e1.v1.y - e2.v1.y) - e2.dy * (e1.v1.x - e2.v1.x);\n var numerb = e1.dx * (e1.v1.y - e2.v1.y) - e1.dy * (e1.v1.x - e2.v1.x);\n\n /* Are the lines coincident? */\n if (ABS(numera) < EPS && ABS(numerb) < EPS && ABS(denom) < EPS) {\n return null;\n }\n\n /* Are the lines parallel */\n if (ABS(denom) < EPS) {\n /* check for overlap */\n return parallelLinesOverlap(e1, e2, precisionDistance);\n }\n\n /* Is the intersection along the segments */\n var mua = numera / denom;\n var da = mua * e1.length;\n if (da < -precisionDistance || da > e1.length + precisionDistance) {\n return null;\n }\n\n var mub = numerb / denom;\n var db = mub * e2.length;\n if (db < -precisionDistance || db > e2.length + precisionDistance) {\n return null;\n }\n\n var x = e1.v1.x + mua * e1.dx;\n var y = e1.v1.y + mua * e1.dy;\n\n return {\n status: ONE_INTERSECTION,\n e1: [x, y],\n e2: [x, y] };\n\n}", "function lineSegmentsIntersect (x1, y1, x2, y2, x3, y3, x4, y4) {\n var x=((x1*y2-y1*x2)*(x3-x4)-(x1-x2)*(x3*y4-y3*x4))/((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));\n var y=((x1*y2-y1*x2)*(y3-y4)-(y1-y2)*(x3*y4-y3*x4))/((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));\n if (isNaN(x)||isNaN(y)) {\n return false;\n } else {\n if (x1>=x2) {\n if (!(x2<=x&&x<=x1)) {return false;}\n } else {\n if (!(x1<=x&&x<=x2)) {return false;}\n }\n if (y1>=y2) {\n if (!(y2<=y&&y<=y1)) {return false;}\n } else {\n if (!(y1<=y&&y<=y2)) {return false;}\n }\n if (x3>=x4) {\n if (!(x4<=x&&x<=x3)) {return false;}\n } else {\n if (!(x3<=x&&x<=x4)) {return false;}\n }\n if (y3>=y4) {\n if (!(y4<=y&&y<=y3)) {return false;}\n } else {\n if (!(y3<=y&&y<=y4)) {return false;}\n }\n }\n return true;\n}", "function findIntersectionPoint(line1, line2) { //http://stackoverflow.com/a/565282/6283767\n\tconst p = line1[0];\n\tconst q = line2[0];\n\tconst r = line1[1].subtract(line1[0]);\n\tconst s = line2[1].subtract(line2[0]);\n\tconst t = q.subtract(p).crossProduct(s) / (r.crossProduct(s));\n\tconst u = q.subtract(p).crossProduct(r) / (r.crossProduct(s));\n\tif (line1[0] === line2[0] || line1[1] === line2[0] || line1[0] === line2[1] || line1[1] === line2[1]) { //They're touching each other on the edge\n\t\treturn new Point(0, 0);\n\t} else if (r.crossProduct(s) === 0 && (q.subtract(p).crossProduct(r) === 0)) { //Collinear\n\t\treturn new Point(0, 0);\n\t} else if (r.crossProduct(s) === 0 && (q.subtract(p).crossProduct(r) !== 0)) { //Parallel lines\n\t\treturn new Point(0, 0);\n\t} else if (r.crossProduct(s) !== 0 && ((0 <= t && t <= 1) && (0 <= u && u <= 1))) {\n\t\tconst newP = p.add(r.scale(t));\n\t\treturn newP;\n\t} else {\n\t\treturn new Point(0, 0);\n\t}\n}", "static SegmentIntersectsSegment( a1, a2, b1, b2)\n\t{\n\t var b = a2.getVecSub(a1);\n\t var d = b2.getVecSub(b1);\n\t var bDotDPerp = b.x * d.y - b.y * d.x;\n\t\n\t // if b dot d == 0, it means the lines are parallel so have infinite intersection points\n\t if (bDotDPerp == 0)\n\t return null;\n\t\n\t var c = b1.getVecSub(a1);\n\t var t = (c.x * d.y - c.y * d.x) / bDotDPerp;\n\t if (t < 0 || t > 1)\n\t return null;\n\t\n\t var u = (c.x * b.y - c.y * b.x) / bDotDPerp;\n\t if (u < 0 || u > 1)\n\t return null;\n\t\n\t return a1.getVecAdd( b.getScalarMult(t) ) ;\n\t}", "function intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y; // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y; // Compute r3 and r4.\n\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1; // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return;\n } // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n\n\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y; // Compute r1 and r2\n\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2; // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return;\n } // Line segments intersect: compute intersection point.\n\n\n denom = a1 * b2 - a2 * b1;\n\n if (denom === 0) {\n return;\n }\n\n offset = Math.abs(denom / 2); // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n return {\n x: x,\n y: y\n };\n}", "function getIntersections(path, line) {\n let s = Snap('svg'),\n ins = Snap.path.intersection(path, line)\n return ins.length > 0 ? ins[0] : null\n}", "function getLineIntersection(firstPoints, secondPoints) {\n\t var x1 = firstPoints[0][0],\n\t y1 = firstPoints[0][1],\n\t x2 = firstPoints[1][0],\n\t y2 = firstPoints[1][1],\n\t x3 = secondPoints[0][0],\n\t y3 = secondPoints[0][1],\n\t x4 = secondPoints[1][0],\n\t y4 = secondPoints[1][1];\n\n\t var determinant = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n\t if (Math.abs(determinant) < 1e-9) {\n\t return \"Lines are parallel\";\n\t } else {\n\t var x = ((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / determinant;\n\t var y = ((x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)) / determinant;\n\t return \"Intersection: (\" + x.toFixed(3) + \", \" + y.toFixed(3) + \")\";\n\t }\n\t}", "function intersectLineSegLineSeg3D(p1, p2, p3, p4) {\r\n if (p1.length !== 3 || p2.length !== 3 || p3.length !== 3 || p4.length !== 3) {\r\n throw new Error('All input points need to be 3D');\r\n }\r\n let pt1 = common_1.arr(p1);\r\n let pt2 = common_1.arr(p2);\r\n let pt3 = common_1.arr(p3);\r\n let pt4 = common_1.arr(p4);\r\n let p13 = common_1.sub(pt1, pt3);\r\n let p43 = common_1.sub(pt4, pt3);\r\n if (common_1.iszero(p43.getN(0)) && common_1.iszero(p43.getN(1)) && common_1.iszero(p43.getN(2))) {\r\n return null;\r\n }\r\n let p21 = common_1.sub(pt2, pt1);\r\n if (common_1.iszero(p21.getN(0)) && common_1.iszero(p21.getN(1)) && common_1.iszero(p21.getN(2))) {\r\n return null;\r\n }\r\n let d1343 = common_1.dot(p13, p43);\r\n let d4321 = common_1.dot(p43, p21);\r\n let d1321 = common_1.dot(p13, p21);\r\n let d4343 = common_1.dot(p43, p43);\r\n let d2121 = common_1.dot(p21, p21);\r\n let denom = d2121 * d4343 - d4321 * d4321;\r\n if (common_1.iszero(denom)) {\r\n return null;\r\n }\r\n let numer = d1343 * d4321 - d1321 * d4343;\r\n let mua = numer / denom;\r\n let mub = (d1343 + d4321 * mua) / d4343;\r\n let pa = common_1.add(pt1, common_1.mul(mua, p21));\r\n let pb = common_1.add(pt3, common_1.mul(mub, p43));\r\n // Line segment pa to pb represents shortest line segment between a and b\r\n // If it's of length zero, then ua, ub represent point of intersection\r\n // between the two lines\r\n if (common_1.iszero(common_1.length(common_1.sub(pb, pa)))) {\r\n return [mua, mub];\r\n }\r\n return null;\r\n}", "function intersectBezier3Line(ax1, ay1, ax2, ay2, ax3, ay3, ax4, ay4, bx1, by1, bx2, by2) {\n var c3, c2, c1, c0;\n var cl, n;\n var isV = bx1 === bx2;\n var isH = by1 === by2;\n var result = [];\n var minbx = Math.min(bx1, bx2);\n var minby = Math.min(by1, by2);\n var maxbx = Math.max(bx1, bx2);\n var maxby = Math.max(by1, by2);\n\n var dot = function dot(a, b) {\n return a.x * b.x + a.y * b.y;\n };\n\n var lerp = function lerp(a, b, t) {\n return {\n x: a.x - (a.x - b.x) * t,\n y: a.y - (a.y - b.y) * t,\n t: t\n };\n };\n\n c3 = {\n x: -ax1 + 3 * ax2 - 3 * ax3 + ax4,\n y: -ay1 + 3 * ay2 - 3 * ay3 + ay4\n };\n c2 = {\n x: 3 * ax1 - 6 * ax2 + 3 * ax3,\n y: 3 * ay1 - 6 * ay2 + 3 * ay3\n };\n c1 = {\n x: -3 * ax1 + 3 * ax2,\n y: -3 * ay1 + 3 * ay2\n };\n c0 = {\n x: ax1,\n y: ay1\n };\n n = {\n x: by1 - by2,\n y: bx2 - bx1\n };\n cl = bx1 * by2 - bx2 * by1;\n var coefs = [cl + dot(n, c0), dot(n, c1), dot(n, c2), dot(n, c3)];\n var roots = getRoots(coefs);\n\n for (var i = 0; i < roots.length; i++) {\n var t = roots[i];\n\n if (0 <= t && t <= 1) {\n var p5 = lerp({\n x: ax1,\n y: ay1\n }, {\n x: ax2,\n y: ay2\n }, t);\n var p6 = lerp({\n x: ax2,\n y: ay2\n }, {\n x: ax3,\n y: ay3\n }, t);\n var p7 = lerp({\n x: ax3,\n y: ay3\n }, {\n x: ax4,\n y: ay4\n }, t);\n var p8 = lerp(p5, p6, t);\n var p9 = lerp(p6, p7, t);\n var p10 = lerp(p8, p9, t);\n\n if (bx1 === bx2) {\n if (minby <= p10.y && p10.y <= maxby) {\n result.push(p10);\n }\n } else if (by1 === by2) {\n if (minbx <= p10.x && p10.x <= maxbx) {\n result.push(p10);\n }\n } else if (p10.x >= minbx && p10.y >= minby && p10.x <= maxbx && p10.y <= maxby) {\n result.push(p10);\n }\n }\n }\n\n if (isH || isV) {\n result.forEach(function (item) {\n if (isV) {\n if (item.x < minbx) {\n item.x = minbx;\n } else if (item.x > maxbx) {\n item.x = maxbx;\n }\n } else {\n if (item.y < minby) {\n item.y = minby;\n } else if (item.y > maxby) {\n item.y = maxby;\n }\n }\n });\n }\n\n return result;\n}", "static detectCollision(a, b) {\n // start with body a and body b\n for (let i=0; i<a.lines.length; i++) {\n for (let j=0; j<b.lines.length; j++) {\n let res = Line.intersect(a.lines[i],b.lines[j])\n if (res.c == true) {\n // draw lines that are intersecting\n // ctx.beginPath();\n // ctx.lineWidth = 5;\n // ctx.moveTo(a.lines[i].p1.x,a.lines[i].p1.y);\n // ctx.lineTo(a.lines[i].p2.x,a.lines[i].p2.y);\n // ctx.stroke();\n // ctx.beginPath();\n // ctx.moveTo(b.lines[j].p1.x,b.lines[j].p1.y);\n // ctx.lineTo(b.lines[j].p2.x,b.lines[j].p2.y);\n // ctx.stroke();\n // ctx.lineWidth = 1;\n return {c:true, x:res.x, y:res.y}\n }\n }\n }\n return {c:false, x:undefined, y:undefined}\n }", "function edgesIntersection(edgeA, edgeB)\n{\n var den = (edgeB.vertex2.y - edgeB.vertex1.y) * (edgeA.vertex2.x - edgeA.vertex1.x) - (edgeB.vertex2.x - edgeB.vertex1.x) * (edgeA.vertex2.y - edgeA.vertex1.y);\n if (den == 0)\n return null; // lines are parallel or conincident\n\n var ua = ((edgeB.vertex2.x - edgeB.vertex1.x) * (edgeA.vertex1.y - edgeB.vertex1.y) - (edgeB.vertex2.y - edgeB.vertex1.y) * (edgeA.vertex1.x - edgeB.vertex1.x)) / den;\n var ub = ((edgeA.vertex2.x - edgeA.vertex1.x) * (edgeA.vertex1.y - edgeB.vertex1.y) - (edgeA.vertex2.y - edgeA.vertex1.y) * (edgeA.vertex1.x - edgeB.vertex1.x)) / den;\n\n if (ua < 0 || ub < 0 || ua > 1 || ub > 1)\n return null;\n\n return {x: edgeA.vertex1.x + ua * (edgeA.vertex2.x - edgeA.vertex1.x), y: edgeA.vertex1.y + ua * (edgeA.vertex2.y - edgeA.vertex1.y)};\n}", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function intersect(a, b) {\n if (cartesianEqual(a.from, b.from) || cartesianEqual(a.from, b.to))\n return a.from;\n if (cartesianEqual(a.to, b.from) || cartesianEqual(a.to, b.to))\n return a.to;\n\n var lc = (a.l + b.l < pi) ? cos(a.l + b.l) - epsilon : -1;\n if (cartesianDot(a.from, b.from) < lc\n || cartesianDot(a.from, b.to) < lc\n || cartesianDot(a.to, b.from) < lc\n || cartesianDot(a.to, b.to) < lc)\n return;\n\n var axb = cartesianCross(a.normal, b.normal);\n cartesianNormalizeInPlace(axb);\n\n var a0 = cartesianDot(axb, a.fromNormal),\n a1 = cartesianDot(axb, a.toNormal),\n b0 = cartesianDot(axb, b.fromNormal),\n b1 = cartesianDot(axb, b.toNormal);\n\n // check if the candidate lies on both segments\n // or is almost equal to one of the four points\n if (\n (a0 > 0 && a1 < 0 && b0 > 0 && b1 < 0) ||\n (a0 >= 0 &&\n a1 <= 0 &&\n b0 >= 0 &&\n b1 <= 0 &&\n (cartesianEqual(axb, a.from) ||\n cartesianEqual(axb, a.to) ||\n cartesianEqual(axb, b.from) ||\n cartesianEqual(axb, b.to)))\n )\n return axb;\n\n // same test for the antipode\n axb[0] = -axb[0];\n axb[1] = -axb[1];\n axb[2] = -axb[2];\n a0 = -a0;\n a1 = -a1;\n b0 = -b0;\n b1 = -b1;\n\n if (\n (a0 > 0 && a1 < 0 && b0 > 0 && b1 < 0) ||\n (a0 >= 0 &&\n a1 <= 0 &&\n b0 >= 0 &&\n b1 <= 0 &&\n (cartesianEqual(axb, a.from) ||\n cartesianEqual(axb, a.to) ||\n cartesianEqual(axb, b.from) ||\n cartesianEqual(axb, b.to)))\n )\n return axb;\n}", "function intersecting(index1, index2, GPSdata){ //index1, index2, GPSdata\n\tvar p1 = GPSdata[index1]; //[x,y]\n\tvar p2 = GPSdata[index1 + 1];\n\tvar p3 = GPSdata[index2];\n\tvar p4 = GPSdata[index2 + 1];\n\t\n\treturn lineIntersect( p1[0], p1[1], p2[0], p2[1], p3[0], p3[1], p4[0], p4[1] );\n}", "function intersect$1(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n }", "function cubicSegmentIntersections(px1, py1, px2, py2, px3, py3, px4, py4, x1, y1, x2, y2) {\n var intersections = [];\n // Find line equation coefficients.\n var A = y1 - y2;\n var B = x2 - x1;\n var C = x1 * (y2 - y1) - y1 * (x2 - x1);\n // Find cubic Bezier curve equation coefficients from control points.\n var bx = bezierCoefficients(px1, px2, px3, px4);\n var by = bezierCoefficients(py1, py2, py3, py4);\n var a = A * bx[0] + B * by[0]; // t^3\n var b = A * bx[1] + B * by[1]; // t^2\n var c = A * bx[2] + B * by[2]; // t\n var d = A * bx[3] + B * by[3] + C; // 1\n var roots = polyRoots_1.cubicRoots(a, b, c, d);\n // Verify that the roots are within bounds of the linear segment.\n for (var i = 0; i < roots.length; i++) {\n var t = roots[i];\n var tt = t * t;\n var ttt = t * tt;\n // Find the cartesian plane coordinates for the parametric root `t`.\n var x = bx[0] * ttt + bx[1] * tt + bx[2] * t + bx[3];\n var y = by[0] * ttt + by[1] * tt + by[2] * t + by[3];\n // The parametric cubic roots we found are intersection points\n // with an infinite line, and so the x/y coordinates above are as well.\n // Make sure the x/y is also within the bounds of the given segment.\n var s = void 0;\n if (x1 !== x2) {\n s = (x - x1) / (x2 - x1);\n }\n else { // the line is vertical\n s = (y - y1) / (y2 - y1);\n }\n if (s >= 0 && s <= 1) {\n intersections.push({ x: x, y: y });\n }\n }\n return intersections;\n}", "function getRayLineIntersectionData(a, b, c, d) {\n let rayScalar = ((b.x - c.x) * (b.y - a.y) - (b.y - c.y) * (b.x - a.x)) / ((d.x - c.x) * (b.y - a.y) - (d.y - c.y) * (b.x - a.x));\n let lineScalar = ((c.x - a.x) * (d.y - c.y) - (c.y - a.y) * (d.x - c.x)) / ((b.x - a.x) * (d.y - c.y) - (b.y - a.y) * (d.x - c.x));\n return {\n intersectionPoint: new Vector(c.x + rayScalar * (d.x - c.x), c.y + rayScalar * (d.y - c.y)),\n \tisIntersecting: rayScalar > 0 && lineScalar >= 0 && lineScalar <= 1\n\t};\n}", "function lineIntersectsLine(lineA, lineB) {\n var a = lineA[0][0],\n b = lineA[0][1],\n c = lineA[1][0],\n d = lineA[1][1],\n p = lineB[0][0],\n q = lineB[0][1],\n r = lineB[1][0],\n s = lineB[1][1],\n det, gamma, lambda;\n\n det = (c - a) * (s - q) - (r - p) * (d - b);\n if (det === 0) {\n return false;\n } else {\n lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det;\n gamma = ((b - d) * (r - a) + (c - a) * (s - b)) / det;\n return (0 < lambda && lambda < 1) && (0 < gamma && gamma < 1);\n }\n }", "function segmentIntersection(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n var d = (ax2 - ax1) * (by2 - by1) - (ay2 - ay1) * (bx2 - bx1);\n if (d === 0) { // The lines are parallel.\n return null;\n }\n var ua = ((bx2 - bx1) * (ay1 - by1) - (ax1 - bx1) * (by2 - by1)) / d;\n var ub = ((ax2 - ax1) * (ay1 - by1) - (ay2 - ay1) * (ax1 - bx1)) / d;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return {\n x: ax1 + ua * (ax2 - ax1),\n y: ay1 + ua * (ay2 - ay1)\n };\n }\n return null; // The intersection point is outside either or both segments.\n}", "function intersect (a, b, c, d) {\n const o1 = a;\n const o2 = c;\n const d1 = sub(b, a);\n const d2 = sub(d, c);\n const d1t = perpendicular(d1);\n const d2t = perpendicular(d2);\n\n const s = dot(sub(o2, o1), d2t) / dot(d1, d2t);\n const t = dot(sub(o1, o2), d1t) / dot(d2, d1t);\n\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n return [o1[0] + s * d1[0], o1[1] + s * d1[1]];\n }\n}", "function intersect (a, b, c, d) {\n const o1 = a;\n const o2 = c;\n const d1 = sub(b, a);\n const d2 = sub(d, c);\n const d1t = perpendicular(d1);\n const d2t = perpendicular(d2);\n\n const s = dot(sub(o2, o1), d2t) / dot(d1, d2t);\n const t = dot(sub(o1, o2), d1t) / dot(d2, d1t);\n\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n return [o1[0] + s * d1[0], o1[1] + s * d1[1]];\n }\n}", "function intersect(a, b, two) {\n\t var pa = cartesian(a),\n\t pb = cartesian(b);\n\n\t // We have two planes, n1.p = d1 and n2.p = d2.\n\t // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n\t var n1 = [1, 0, 0],\n\t // normal\n\t n2 = cartesianCross(pa, pb),\n\t n2n2 = cartesianDot(n2, n2),\n\t n1n2 = n2[0],\n\t // cartesianDot(n1, n2),\n\t determinant = n2n2 - n1n2 * n1n2;\n\n\t // Two polar points.\n\t if (!determinant) return !two && a;\n\n\t var c1 = cr * n2n2 / determinant,\n\t c2 = -cr * n1n2 / determinant,\n\t n1xn2 = cartesianCross(n1, n2),\n\t A = cartesianScale(n1, c1),\n\t B = cartesianScale(n2, c2);\n\t cartesianAddInPlace(A, B);\n\n\t // Solve |p(t)|^2 = 1.\n\t var u = n1xn2,\n\t w = cartesianDot(A, u),\n\t uu = cartesianDot(u, u),\n\t t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n\t if (t2 < 0) return;\n\n\t var t = sqrt(t2),\n\t q = cartesianScale(u, (-w - t) / uu);\n\t cartesianAddInPlace(q, A);\n\t q = spherical(q);\n\n\t if (!two) return q;\n\n\t // Two intersection points.\n\t var lambda0 = a[0],\n\t lambda1 = b[0],\n\t phi0 = a[1],\n\t phi1 = b[1],\n\t z;\n\n\t if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n\t var delta = lambda1 - lambda0,\n\t polar = abs(delta - pi) < epsilon,\n\t meridian = polar || delta < epsilon;\n\n\t if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n\t // Check that the first point is between a and b.\n\t if (meridian ? polar ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1) : phi0 <= q[1] && q[1] <= phi1 : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n\t var q1 = cartesianScale(u, (-w + t) / uu);\n\t cartesianAddInPlace(q1, A);\n\t return [q, spherical(q1)];\n\t }\n\t }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math_js__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math_js__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian_js__[\"g\" /* spherical */])(q1)];\n }\n }", "function lines_intersect_2d(p1, p2, p3, p4) {\n\t// first, sanity check that we aren't looking at actual connected points\n\tif (p1 == p3 || p1 == p4 || p2 == p3 || p2 == p4) {\n\t\treturn false;\n\t}\n\tvar x=((p1.x*p2.y-p1.y*p2.x)*(p3.x-p4.x)-(p1.x-p2.x)*(p3.x*p4.y-p3.y*p4.x))/((p1.x-p2.x)*(p3.y-p4.y)-(p1.y-p2.y)*(p3.x-p4.x));\n\tvar y=((p1.x*p2.y-p1.y*p2.x)*(p3.y-p4.y)-(p1.y-p2.y)*(p3.x*p4.y-p3.y*p4.x))/((p1.x-p2.x)*(p3.y-p4.y)-(p1.y-p2.y)*(p3.x-p4.x));\n\tif (isNaN(x)||isNaN(y)) {\n\t\treturn false;\n\t} else {\n\t\tif (p1.x>=p2.x) {\n\t\t\tif (!(p2.x<=x&&x<=p1.x)) {return false;}\n\t\t} else {\n\t\t\tif (!(p1.x<=x&&x<=p2.x)) {return false;}\n\t\t}\n\t\tif (p1.y>=p2.y) {\n\t\t\tif (!(p2.y<=y&&y<=p1.y)) {return false;}\n\t\t} else {\n\t\t\tif (!(p1.y<=y&&y<=p2.y)) {return false;}\n\t\t}\n\t\tif (p3.x>=p4.x) {\n\t\t\tif (!(p4.x<=x&&x<=p3.x)) {return false;}\n\t\t} else {\n\t\t\tif (!(p3.x<=x&&x<=p4.x)) {return false;}\n\t\t}\n\t\tif (p3.y>=p4.y) {\n\t\t\tif (!(p4.y<=y&&y<=p3.y)) {return false;}\n\t\t} else {\n\t\t\tif (!(p3.y<=y&&y<=p4.y)) {return false;}\n\t\t}\n\t}\n\treturn [x, y];\n}", "function intersection(a, b){\n return(\n // replace this line with your code\n );\n}", "function intersect(a, b, two) {\n var pa = d3f_geo_cartesian(a),\n pb = d3f_geo_cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = d3f_geo_cartesianCross(pa, pb),\n n2n2 = d3f_geo_cartesianDot(n2, n2),\n n1n2 = n2[0], // d3f_geo_cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = d3f_geo_cartesianCross(n1, n2),\n A = d3f_geo_cartesianScale(n1, c1),\n B = d3f_geo_cartesianScale(n2, c2);\n d3f_geo_cartesianAdd(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = d3f_geo_cartesianDot(A, u),\n uu = d3f_geo_cartesianDot(u, u),\n t2 = w * w - uu * (d3f_geo_cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Math.sqrt(t2),\n q = d3f_geo_cartesianScale(u, (-w - t) / uu);\n d3f_geo_cartesianAdd(q, A);\n q = d3f_geo_spherical(q);\n if (!two) return q;\n\n // Two intersection points.\n var λ0 = a[0],\n λ1 = b[0],\n φ0 = a[1],\n φ1 = b[1],\n z;\n if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;\n var δλ = λ1 - λ0,\n polar = abs(δλ - π) < ε,\n meridian = polar || δλ < ε;\n\n if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1)\n : φ0 <= q[1] && q[1] <= φ1\n : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {\n var q1 = d3f_geo_cartesianScale(u, (-w + t) / uu);\n d3f_geo_cartesianAdd(q1, A);\n return [q, d3f_geo_spherical(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesian)(a),\n pb = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesian)(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianCross)(pa, pb),\n n2n2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianCross)(n1, n2),\n A = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(n1, c1),\n B = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(n2, c2);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(A, u),\n uu = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(u, u),\n t2 = w * w - uu * ((0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.sqrt)(t2),\n q = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(u, (-w - t) / uu);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(q, A);\n q = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.spherical)(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.abs)(delta - _math_js__WEBPACK_IMPORTED_MODULE_0__.pi) < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon,\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < ((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.abs)(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_0__.pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(u, (-w + t) / uu);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(q1, A);\n return [q, (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.spherical)(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesian)(a),\n pb = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesian)(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianCross)(pa, pb),\n n2n2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianCross)(n1, n2),\n A = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(n1, c1),\n B = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(n2, c2);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(A, u),\n uu = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(u, u),\n t2 = w * w - uu * ((0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.sqrt)(t2),\n q = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(u, (-w - t) / uu);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(q, A);\n q = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.spherical)(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.abs)(delta - _math_js__WEBPACK_IMPORTED_MODULE_0__.pi) < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon,\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < ((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.abs)(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_0__.pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(u, (-w + t) / uu);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(q1, A);\n return [q, (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.spherical)(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesian)(a),\n pb = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesian)(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianCross)(pa, pb),\n n2n2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianCross)(n1, n2),\n A = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(n1, c1),\n B = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(n2, c2);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(A, u),\n uu = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(u, u),\n t2 = w * w - uu * ((0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianDot)(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.sqrt)(t2),\n q = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(u, (-w - t) / uu);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(q, A);\n q = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.spherical)(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.abs)(delta - _math_js__WEBPACK_IMPORTED_MODULE_0__.pi) < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon,\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < ((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.abs)(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_0__.pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianScale)(u, (-w + t) / uu);\n (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.cartesianAddInPlace)(q1, A);\n return [q, (0,_cartesian_js__WEBPACK_IMPORTED_MODULE_3__.spherical)(q1)];\n }\n }", "function intersectLineCircle( x1, y1, x2, y2, cx, cy, r) {\n \"use strict\";\n var sqR = r*r;\n //Check if segment extremes are inside the circle\n var oneInside = (cx-x1)*(cx-x1)+(cy-y1)*(cy-y1) < sqR;\n var twoInside = (cx-x2)*(cx-x2)+(cy-y2)*(cy-y2) < sqR;\n\n //If segment is inside the circle there is no intersection\n if (oneInside && twoInside) return null;\n\n //Get a normalized vector (sx, sy) in the direction of the segment and its magnitude (sLength)\n var dx = x2-x1;\n var dy = y2-y1; \n var sLength = Math.sqrt(dx*dx + dy*dy);\n var sx = dx/sLength;\n var sy = dy/sLength;\n\n //Calculate the length of the projected line (pLength) connecting the origin\n // of the segment (x1, y1) to the center of the circle (cx, cy) using dot product\n var pLength = (cx-x1)*sx + (cy-y1)*sy;\n\n //Check if closest point in the segment is one of the segment extremes and if there is intersection in that case\n if ((pLength < 0 && !oneInside) || (pLength > sLength && !twoInside)) return null;\n\n //Else, closest point is between both extremes\n //If distance from this point to center is bigger than radius there is no intersection\n var x = x1 + sx * pLength;\n var y = y1 + sy * pLength;\n var d = sqR - ((x-cx)*(x-cx) + (y-cy)*(y-cy));\n if (d < 0) return null;\n\n //Calculate distance from this point to intersection points (applying Pythagoras theorem)\n d = Math.sqrt(d);\n //Calculate intersection points\n var result = [];\n if (oneInside) {\n result.push(createVector(x+sx*d, y+sy*d));\n return result;\n }\n\n if (twoInside) {\n result.push(createVector(x-sx*d, y-sy*d));\n return result;\n }\n\n result.push(createVector(x+sx*d, y+sy*d));\n result.push(createVector(x-sx*d, y-sy*d));\n\n return result;\n\n}", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0],\n // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0],\n // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian ? polar ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1) : phi0 <= q[1] && q[1] <= phi1 : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0],\n // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0],\n // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian ? polar ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1) : phi0 <= q[1] && q[1] <= phi1 : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function d3_geom_polygonIntersect(c, d, a, b) {\n var x1 = c[0], x2 = d[0], x3 = a[0], x4 = b[0],\n y1 = c[1], y2 = d[1], y3 = a[1], y4 = b[1],\n x13 = x1 - x3,\n x21 = x2 - x1,\n x43 = x4 - x3,\n y13 = y1 - y3,\n y21 = y2 - y1,\n y43 = y4 - y3,\n ua = (x43 * y13 - y43 * x13) / (y43 * x21 - x43 * y21);\n return [x1 + ua * x21, y1 + ua * y21];\n}", "function d3_geom_polygonIntersect(c, d, a, b) {\n var x1 = c[0], x2 = d[0], x3 = a[0], x4 = b[0],\n y1 = c[1], y2 = d[1], y3 = a[1], y4 = b[1],\n x13 = x1 - x3,\n x21 = x2 - x1,\n x43 = x4 - x3,\n y13 = y1 - y3,\n y21 = y2 - y1,\n y43 = y4 - y3,\n ua = (x43 * y13 - y43 * x13) / (y43 * x21 - x43 * y21);\n return [x1 + ua * x21, y1 + ua * y21];\n}", "function intersect(a, b, two) {\n var pa = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(a),\n pb = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(pa, pb),\n n2n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(n1, n2),\n A = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n1, c1),\n B = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n2, c2);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, u),\n uu = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(u, u),\n t2 = w * w - uu * (Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(t2),\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w - t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q, A);\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"],\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w + t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q1, A);\n return [q, Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(a),\n pb = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(pa, pb),\n n2n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(n1, n2),\n A = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n1, c1),\n B = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n2, c2);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, u),\n uu = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(u, u),\n t2 = w * w - uu * (Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(t2),\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w - t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q, A);\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"],\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w + t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q1, A);\n return [q, Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(a),\n pb = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(pa, pb),\n n2n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(n1, n2),\n A = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n1, c1),\n B = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n2, c2);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, u),\n uu = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(u, u),\n t2 = w * w - uu * (Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(t2),\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w - t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q, A);\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"],\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w + t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q1, A);\n return [q, Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(a),\n pb = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(pa, pb),\n n2n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(n1, n2),\n A = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n1, c1),\n B = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n2, c2);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, u),\n uu = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(u, u),\n t2 = w * w - uu * (Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(t2),\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w - t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q, A);\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"],\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w + t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q1, A);\n return [q, Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(a),\n pb = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesian\"])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(pa, pb),\n n2n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianCross\"])(n1, n2),\n A = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n1, c1),\n B = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(n2, c2);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, u),\n uu = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(u, u),\n t2 = w * w - uu * (Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianDot\"])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(t2),\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w - t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q, A);\n q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"],\n meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"abs\"])(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianScale\"])(u, (-w + t) / uu);\n Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"cartesianAddInPlace\"])(q1, A);\n return [q, Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__[\"spherical\"])(q1)];\n }\n }", "function findIntersect(r1x1, r1y1, r1x2, r1y2, r2x1, r2y1, r2x2, r2y2) {\r\n\r\n if (r2x1 == r2x2) {\r\n return findIntersectY(r1x1, r1y1, r1x2, r1y2, r2x1);\r\n }\r\n if (r2y1 == r2y2) {\r\n return findIntersectX(r1x1, r1y1, r1x2, r1y2, r2y1);\r\n }\r\n\r\n // m = (y1 - y2) / (x1 - x2) // <-- how to find the slope\r\n // y = mx + b // the 'classic' linear equation\r\n // b = y - mx // how to find b (the y-intersect)\r\n // x = (y - b)/m // how to find x\r\n var r1m = (r1y1 - r1y2) / (r1x1 - r1x2);\r\n var r1b = r1y1 - (r1m * r1x1);\r\n var r2m = (r2y1 - r2y2) / (r2x1 - r2x2);\r\n var r2b = r2y1 - (r2m * r2x1);\r\n\r\n var x = (r2b - r1b) / (r1m - r2m);\r\n var y = r1m * x + r1b;\r\n\r\n return {x: x, y: y};\r\n }", "function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n\t for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n\t var p = points[i];\n\t\n\t if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n\t return true;\n\t }\n\t\n\t p2 = p;\n\t }\n\t }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }", "function intersect(a, b, two) {\n var pa = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(a),\n pb = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"a\" /* cartesian */])(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(pa, pb),\n n2n2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"c\" /* cartesianCross */])(n1, n2),\n A = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n1, c1),\n B = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(n2, c2);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, u),\n uu = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(u, u),\n t2 = w * w - uu * (Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"d\" /* cartesianDot */])(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"u\" /* sqrt */])(t2),\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w - t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q, A);\n q = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(delta - __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */],\n meridian = polar || delta < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"a\" /* abs */])(q[0] - lambda0) < __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */] ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"f\" /* cartesianScale */])(u, (-w + t) / uu);\n Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"b\" /* cartesianAddInPlace */])(q1, A);\n return [q, Object(__WEBPACK_IMPORTED_MODULE_0__cartesian__[\"g\" /* spherical */])(q1)];\n }\n }" ]
[ "0.8023182", "0.8009668", "0.8009668", "0.78674155", "0.7796506", "0.76996833", "0.76971805", "0.768333", "0.76445526", "0.7621484", "0.7585495", "0.7568172", "0.7559469", "0.7548191", "0.7546497", "0.7528471", "0.75217235", "0.75217235", "0.7500918", "0.74072814", "0.73961467", "0.7395124", "0.7388609", "0.7344847", "0.732432", "0.728394", "0.7264484", "0.7249317", "0.724364", "0.721861", "0.7215906", "0.72063357", "0.7201428", "0.7189697", "0.71829563", "0.71799797", "0.7178013", "0.7144798", "0.7135722", "0.71173275", "0.7101368", "0.70938593", "0.7092892", "0.7067141", "0.7061551", "0.70505416", "0.7048245", "0.7037891", "0.70248014", "0.70222783", "0.7012222", "0.7010824", "0.7007443", "0.69934523", "0.6943947", "0.693581", "0.69089025", "0.6901914", "0.6867149", "0.68219286", "0.67933095", "0.67933095", "0.6786204", "0.6779051", "0.6752341", "0.6749829", "0.6744276", "0.6692985", "0.6692009", "0.6687598", "0.6687598", "0.6679878", "0.6665052", "0.6642033", "0.6629296", "0.66219985", "0.6619939", "0.6619939", "0.6619939", "0.6607782", "0.66056067", "0.66056067", "0.66040534", "0.66040534", "0.6595848", "0.6595848", "0.6595848", "0.6595848", "0.6595848", "0.6592541", "0.6585756", "0.65771717", "0.65771717", "0.65771717", "0.65771717", "0.65771717", "0.65771717", "0.65771717", "0.65771717", "0.65771717" ]
0.86406803
0
The dummy class constructor
function Class() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "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 }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "function Constructor() {}", "function Constructor() {}", "function 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() {}", "constructor() {}", "constructor() {}", "constructor() {}", "function _ctor() {\n\t}", "function Ctor() {\n\t// Empty...\n}", "function Ctor() {}", "function Ctor() {\r\n }", "function _construct()\n\t\t{;\n\t\t}", "function HelperConstructor() {}", "consructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function tempCtor() {}", "function construct() { }", "function temporaryConstructor() {}", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor(){\r\n }", "function SimpleClass() {\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor(){\r\n\t}", "constructor() {\r\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor(data) { }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }" ]
[ "0.83117235", "0.8150335", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.81216276", "0.81216276", "0.81216276", "0.80153376", "0.80066764", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7804496", "0.7792796", "0.77391064", "0.75758344", "0.7529224", "0.7496081", "0.74399453", "0.7405994", "0.74001706", "0.74001706", "0.74001706", "0.74001706", "0.74001706", "0.74001706", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.7300504", "0.72488594", "0.7130759", "0.7126093", "0.7071154", "0.70354575", "0.70098794", "0.69566053", "0.6950232", "0.69419897", "0.69419897", "0.69357425", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384" ]
0.0
-1
don't leave dangling pipes when there are errors.
function onerror(er) { cleanup(); if (this.listeners('error').length === 0) { throw er; // Unhandled stream error in pipe. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function brokenPipe() {\n throw Error('artoo.asyncStore: broken pipe.');\n }", "function onerror(error) {\n cleanup();\n if (!hasListeners(this, 'error'))\n throw error; // Unhandled stream error in pipe.\n }", "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"error\",onerror);if(EElistenerCount(dest,\"error\")===0)dest.emit(\"error\",er)}", "function onerror(er) {\n\t cleanup();\n\t if (this.listeners('error').length === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n cleanup();\n if (!this.hasListeners('error')) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (!this.hasListeners('error')) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0) dest.emit('error', er);\n }", "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function maybePipeManually() {\n var chunk\n while ((chunk = writer.read())) {\n if (!conn.write(chunk)) {\n break\n }\n }\n }", "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }" ]
[ "0.69866925", "0.6516497", "0.6399389", "0.6383316", "0.63701004", "0.63701004", "0.63701004", "0.63701004", "0.63701004", "0.6333437", "0.6292604", "0.6285128", "0.6285128", "0.6274714", "0.6233449", "0.62333864", "0.6221305", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.62146306", "0.6212333", "0.6212333", "0.6212333", "0.6212333", "0.6202309", "0.6202309", "0.6202309", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6196249", "0.6047003", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955", "0.60188955" ]
0.61765504
83
remove all the event listeners that were added.
function cleanup() { source.removeListener('data', ondata); dest.removeListener('drain', ondrain); source.removeListener('end', onend); source.removeListener('close', onclose); source.removeListener('error', onerror); dest.removeListener('error', onerror); source.removeListener('end', cleanup); source.removeListener('close', cleanup); dest.removeListener('end', cleanup); dest.removeListener('close', cleanup); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "_clearListeners() {\n for (let listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }", "_clearListeners() {\n for (const listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }", "function clearEvents() {\n\t\t\tvar ident;\n\t\t\tfor (ident in listenersByEventId) {\n\t\t\t\tr.removeListener(ident);\n\t\t\t}\n\t\t}", "removeAllEventListeners() {\n this.eventListeners.forEach(({ target, type, boundListener }) => {\n this.log(`Removing \"${type}\" eventlistener`, target);\n target.removeEventListener(type, boundListener);\n });\n this.eventListeners.length = 0;\n }", "removeAllEventListeners() {\n this.eventListeners.forEach(({target, type, boundListener}) => {\n this.log(`Removing \"${type}\" eventlistener`, target);\n target.removeEventListener(type, boundListener);\n });\n this.eventListeners.length = 0;\n }", "removeAllListeners() {\n\t\tfor (let i = 0; i < this.eventHandles_.length; i++) {\n\t\t\tthis.eventHandles_[i].removeListener();\n\t\t}\n\n\t\tthis.eventHandles_ = [];\n\t}", "removeAllListeners() {\n const me = this,\n listeners = me.eventListeners || (me.eventListeners = {});\n\n for (let event in listeners) {\n listeners[event].forEach((cfg) => me.removeListener(event, cfg));\n }\n }", "removeAllListeners() {\n this.listeners = {};\n }", "removeAllListeners() {\n this._onOpen.removeAllListeners();\n this._onMessage.removeAllListeners();\n this._onUnpackedMessage.removeAllListeners();\n this._onResponse.removeAllListeners();\n this._onSend.removeAllListeners();\n this._onClose.removeAllListeners();\n this._onError.removeAllListeners();\n }", "removeAll() {\n this.listeners.forEach(listener => listener.destroy());\n this.listeners = [];\n }", "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "removeAllListeners() {\n const listeners = this.eventListeners;\n let i, thisObj;\n\n for (const event in listeners) {\n const bucket = listeners[event]; // We iterate backwards since we call removeListener which will splice out of\n // this array as we go...\n\n for (i = bucket.length; i-- > 0;)\n /* empty */\n {\n const cfg = bucket[i];\n this.removeListener(event, cfg);\n thisObj = cfg.thisObj;\n\n if (thisObj && thisObj.untrackDetachers) {\n thisObj.untrackDetachers(this);\n }\n }\n }\n }", "removeEventListeners() {\n\t\twindow.removeEventListener('resize', this.bindResize);\n\t\tthis.domElement.removeEventListener('click', this.bindClick);\n\t\tTweenMax.ticker.removeEventListener('tick', this.bindRender);\n\t\tEmitter.off('LOADING_COMPLETE', this.bindEnter);\n\t\twindow.removeEventListener('mousemove', this.boundMouseMove);\n\t}", "removeListeners() {\n var descriptor = this.getDescriptor();\n if (descriptor) {\n descriptor.unlisten(DescriptorEventType.ACTIVATED, this.onActivated, false, this);\n descriptor.unlisten(DescriptorEventType.DEACTIVATED, this.onDeactivated, false, this);\n descriptor.unlisten(DescriptorEventType.DEACTIVATED, this.onActivationError, false, this);\n }\n }", "function removeListeners() {\n\t\t$(document).off(EVENT_NAME_KEYPRESS);\n\t\t$(document).off(EVENT_NAME_KEYUP);\n\t}", "_removeListeners() {\n document.removeEventListener('click', this._handleWindowClick);\n window.removeEventListener('resize', this._handleResize);\n this.el.removeEventListener('keydown', this._handleKeyDown);\n document.removeEventListener('blur', this._handleBlur, true);\n document.removeEventListener('focus', this._handleFocus, true);\n document.removeEventListener('spark.visible-children', this._handleVisibleChildren, true);\n }", "removeAllEventListeners () {\n this.eventListeners = [];\n }", "removeAllListeners() {\n this.click = [];\n this.drag = [];\n this.dragStart = [];\n this.dragEnd = [];\n }", "cleanUpEvents() {\n for (let idx in this.eventsToClean) {\n this.eventsToClean[idx].removeCleanupListeners();\n }\n }", "detachListeners () {\n if (this.listenersAttached) {\n window.removeEventListener('resize', this.handleWindowResize)\n window.removeEventListener('mouseup', this.handleMouseUp)\n window.removeEventListener('touchend', this.handleTouchEnd)\n window.removeEventListener('touchcancel', this.handleTouchEnd)\n window.removeEventListener('pointerdown', this.handlePointerEvent)\n window.removeEventListener('pointermove', this.handlePointerEvent)\n window.removeEventListener('pointerup', this.handlePointerEvent)\n window.removeEventListener('pointercancel', this.handlePointerEvent)\n this.listenersAttached = false\n }\n }", "_removeListeners() {\n try {\n WINDOW$1.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n WINDOW$1.removeEventListener('blur', this._handleWindowBlur);\n WINDOW$1.removeEventListener('focus', this._handleWindowFocus);\n\n restoreRecordDroppedEvent();\n\n if (this._performanceObserver) {\n this._performanceObserver.disconnect();\n this._performanceObserver = null;\n }\n } catch (err) {\n this._handleException(err);\n }\n }", "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n\n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n\n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "function removeListeners() {\n debug(\"removeListeners\");\n cards().forEach(function(card) {\n card.removeEventListener('click', cardMagic)\n })\n }", "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) {\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\n\t\t\tsetTouchInProgress(false);\n\t\t}", "function clearListeners(event) {\n if(event) {\n delete listeners[event];\n } else {\n listeners = {};\n }\n }", "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "function removeAddedEvents() {\n // remove added native events\n nativeEvents.forEach(function (_ref) {\n var key = _ref.key,\n listener = _ref.listener;\n element.removeEventListener(key, listener);\n });\n nativeEvents = [];\n }", "removeAll()\n {\n this.listeners.length = 0;\n this.errorListeners.length = 0;\n this.validateListeners.length = 0;\n this.createListeners.length = 0;\n this.submitListeners.length = 0;\n }", "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n \n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if(LEAVE_EV) { \n $element.unbind(LEAVE_EV, touchLeave);\n }\n \n setTouchInProgress(false);\n }", "undelegateEvents() {\n this.delegatedEventListeners.forEach(({ type, listener }) => {\n this.el.removeEventListener(type, listener);\n });\n\n this.delegatedEventListeners = [];\n }", "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName)\n } else {\n super.removeAllListeners()\n }\n // re-add internal events\n this._setupInternalEvents()\n // trigger stop check just in case\n this._onRemoveListener()\n }", "function _clearListeners(arr) {\n if (arr == null || arr._parent == null) {\n return;\n }\n\n for (const key in arr._handlers) {\n arr._parent.removeListener(key, arr._handlers[key]);\n }\n}", "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "removeListeners()\n {\n this.cancel.removeEventListener('click', this.destroy);\n }", "removeListeners() {\n const client = MatrixClientPeg.get();\n if (client === null) return;\n\n client.removeListener('sync', this.onSync);\n client.removeListener('Room.timeline', this.onRoomTimeline);\n client.removeListener('Event.decrypted', this.onEventDecrypted);\n client.removeListener('Room.timelineReset', this.onTimelineReset);\n client.removeListener('Room.redaction', this.onRedaction);\n }", "function detachEvents() {\n if (browser.addEventListener) {\n // remove current event listeners\n element.removeEventListener('touchstart', events, browser.passiveEvents ? { passive: true } : false);\n element.removeEventListener('mousedown', events, false);\n element.removeEventListener('webkitTransitionEnd', events, false);\n element.removeEventListener('msTransitionEnd', events, false);\n element.removeEventListener('oTransitionEnd', events, false);\n element.removeEventListener('otransitionend', events, false);\n element.removeEventListener('transitionend', events, false);\n root.removeEventListener('resize', events, false);\n } else {\n root.onresize = null;\n }\n }", "destroy() {\n let i;\n for (let type in this._listeners) {\n let arr = this._listeners[type];\n for (i = 0; i < arr.length; i += 1) {\n arr[i] = null;\n }\n }\n }", "unbindEvents() {\n this.toggleListeners.forEach(toggleListener => toggleListener.destroy());\n this.openListeners.forEach(openListener => openListener.destroy());\n this.closeListeners.forEach(closeListener => closeListener.destroy());\n this.radioOpenListeners.forEach(radioOpenListener => radioOpenListener.destroy());\n this.radioCloseListeners.forEach(radioCloseListener => radioCloseListener.destroy());\n this.inputOpenListeners.forEach(inputOpenListener => inputOpenListener.destroy());\n }", "removeEventListeners() {\n this.leafletMap.removeEventListener('click', (event) => {\n this.clickLeafletMap(event);\n })\n this.leafletMap.removeEventListener('mousemove', (event) => {\n this.onMouseMove(event);\n });\n this.leafletMap.removeEventListener('keydown', (event) => {\n this.onKeyPress(event.originalEvent);\n });\n this.leafletMap.removeEventListener('mouseover', (event) => {\n this.onMouseOverLeaflet(event)\n });\n this.leafletMap.removeEventListener('mouseout', (event) => {\n this.onMouseOutLeaflet(event)\n });\n }", "function clearRemainingListeners() {\n observerTestState.toBeEnabled.forEach(function(feature) {\n chrome.accessibilityFeatures[feature.name].onChange.removeListener(\n feature.listener);\n feature.listener = null;\n });\n observerTestState.toBeDisabled.forEach(function(feature) {\n chrome.accessibilityFeatures[feature.name].onChange.removeListener(\n feature.listener);\n feature.listener = null;\n });\n }", "removeEventListeners() {\r\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\r\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\r\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\r\n \r\n if (this.gyroscope) {\r\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\r\n }\r\n \r\n if (this.glare || this.fullPageListening) {\r\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\r\n }\r\n }", "function removeButtonListeners() {\n if (buttons.fw) {\n buttons.fw.removeEventListener('click', handleForwardButtonClick);\n }\n if (buttons.bk) {\n buttons.bk.removeEventListener('click', handleBackwardButtonClick);\n }\n }", "__removeBroadcastEventListeners() {\n let bindEvents = this._bindBroadcastEvents;\n /* istanbul ignore next */\n if (!bindEvents) {\n return;\n }\n\n bindEvents.forEach(item => eventCenter.off(item[0], item[1]));\n this._bindBroadcastEvents = [];\n }", "_removeEventListeners() {\n this.el.removeEventListener('click', this._onClickBound);\n this.el.removeEventListener('keydown', this._onKeydownBound);\n }", "function removeListeners() {\n $(\"#controls\").off(\"click\");\n $(\"#sequence\").off(\"click\");\n}", "detachHandlers() {\n this.templateNext.removeEventListener('click', this.handleNext);\n this.templatePrev.removeEventListener('click', this.handlePrev);\n window.removeEventListener('keydown', this.handleKeyDown);\n window.removeEventListener('resize', this.handleResize)\n }", "function removeEventListeners() {\n\n eventsAreBound = false;\n\n document.removeEventListener('keydown', onDocumentKeyDown, false);\n window.removeEventListener('hashchange', onWindowHashChange, false);\n window.removeEventListener('resize', onWindowResize, false);\n\n dom.wrapper.removeEventListener('touchstart', onTouchStart, false);\n dom.wrapper.removeEventListener('touchmove', onTouchMove, false);\n dom.wrapper.removeEventListener('touchend', onTouchEnd, false);\n\n if (window.navigator.msPointerEnabled) {\n dom.wrapper.removeEventListener('MSPointerDown', onPointerDown, false);\n dom.wrapper.removeEventListener('MSPointerMove', onPointerMove, false);\n dom.wrapper.removeEventListener('MSPointerUp', onPointerUp, false);\n }\n\n if (config.progress && dom.progress) {\n dom.progress.removeEventListener('click', onProgressClicked, false);\n }\n\n if (config.controls && dom.controls) {\n ['touchstart', 'click'].forEach(function (eventName) {\n dom.controlsLeft.forEach(function (el) {\n el.removeEventListener(eventName, onNavigateLeftClicked, false);\n });\n dom.controlsRight.forEach(function (el) {\n el.removeEventListener(eventName, onNavigateRightClicked, false);\n });\n dom.controlsUp.forEach(function (el) {\n el.removeEventListener(eventName, onNavigateUpClicked, false);\n });\n dom.controlsDown.forEach(function (el) {\n el.removeEventListener(eventName, onNavigateDownClicked, false);\n });\n dom.controlsPrev.forEach(function (el) {\n el.removeEventListener(eventName, onNavigatePrevClicked, false);\n });\n dom.controlsNext.forEach(function (el) {\n el.removeEventListener(eventName, onNavigateNextClicked, false);\n });\n });\n }\n\n }", "destroy () {\n this.eventListeners = null;\n }", "_removeEventListeners() {\n window.removeEventListener('deviceorientation', this._onOrientationFound);\n\n this._map\n .off('locationfound', this._onLocationFound, this)\n .off('locationerror', this._onLocationError, this)\n .off('dragstart', this._onDragStart, this)\n .off('moveend', this._onMoveEnd, this);\n }", "function removeListeners() {\r\n modal.yes.removeEventListener(\"click\", backToMenu);\r\n modal.no.removeEventListener(\"click\", backToGame);\r\n }", "function removeRedandYellowListeners(){\n\t\tfor (var i = $boxes.length -1; i>=0;i--){\n\t\t\tvar $box = $($boxes[i]);\n\t\t\t$box.off('click', addRedorYellow);\n\t\t}\n\t}", "_removeEventListeners() {\n\n this.el.removeEventListener('click', this._onClickBound);\n window.removeEventListener('scroll', this._onScrollBound);\n window.removeEventListener('orientationchange', this._onScrollBound);\n document.removeEventListener('spark.visible-children', this._onVisibleBound, true);\n\n if (canObserve)\n this._removeMutationObserver();\n else\n window.removeEventListener('resize', this._onResizeBound);\n }", "removeEventListeners() {\n // Empty in base class.\n }", "removeDragListeners() {}", "removeDragListeners() {}", "destroy() {\n if (Object.values(this.events).length) {\n for (let event in this.events) {\n window.removeEventListener(event.name, event.fn);\n }\n }\n }", "detachAllEvents() {\n this.handledEvents.forEach((value, key) => {\n this.offEvent(key, value.target, value.options);\n });\n }", "unsubscribeEventListeners () {\n // Remove Aurelia event listeners\n this.subscriptions.forEach((subscription) => {\n subscription.dispose();\n });\n this.subscriptions = undefined;\n\n // Remove basic JS event listeners.\n if (this.canvas) {\n this.canvas.removeEventListener(\n 'contextmenu', this.canvasContextMenuHandler\n );\n this.canvas.removeEventListener('mousedown', this.canvasMouseDownHandler);\n this.canvas.removeEventListener('mouseleave', this.canvasMouseUpHandler);\n this.canvas.removeEventListener('mousemove', this.canvasMouseMoveHandler);\n this.canvas.removeEventListener('mouseup', this.canvasMouseUpHandler);\n this.canvas.removeEventListener('mousewheel', this.canvasMouseWheelHandler);\n }\n }", "_cleanToRemovedListeners() {\n const toRemovedListeners = this._toRemovedListeners;\n\n for (let i = 0; i < toRemovedListeners.length; ++i) {\n const selListener = toRemovedListeners[i];\n\n const listeners = this._listenersMap[selListener._getListenerID()];\n\n if (!listeners) {\n continue;\n }\n\n const fixedPriorityListeners = listeners.getFixedPriorityListeners();\n const sceneGraphPriorityListeners = listeners.getSceneGraphPriorityListeners();\n\n if (sceneGraphPriorityListeners) {\n const idx = sceneGraphPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n sceneGraphPriorityListeners.splice(idx, 1);\n }\n }\n\n if (fixedPriorityListeners) {\n const idx = fixedPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n fixedPriorityListeners.splice(idx, 1);\n }\n }\n }\n\n toRemovedListeners.length = 0;\n }", "clearListeners(clearPersistent) {\n if (this._listeners) {\n this._listeners.forEach(e => {\n if (clearPersistent || !e.persistent) {\n GOOGLE_MAP_API.event.removeListener(e.listener);\n e.listener = null;\n }\n });\n this._listeners = this._listeners.filter(e => {\n return e.listener != null;\n });\n }\n }", "removeAllEvents() {\n this.destroy();\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 }", "function removeListeners() {\n window.removeEventListener('message', _onParentMessage);\n}", "function _removeEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.removeEventListener(i, this.eventForwarder);\n\t }\n\t }", "function dettachEvents() {\n // Remove custom events from the window\n window.removeEventListener(\"touch\", handleInteruption, false);\n window.removeEventListener(\"mousewheel\", handleInteruption, false);\n window.removeEventListener(\"mousedown\", handleInteruption, false);\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 }", "removeEventListeners(){\n\t\tif(!this.document) {\n\t\t\treturn;\n\t\t}\n\t\tDOM_EVENTS.forEach(function(eventName){\n\t\t\tthis.document.removeEventListener(eventName, this._triggerEvent, { passive: true });\n\t\t}, this);\n\t\tthis._triggerEvent = undefined;\n\t}", "destroy() {\n this.listeners = null;\n }", "cleanEchoListeners() {\n this.echoListeners.forEach(element => {\n window.Echo.private(\n element.channel\n ).stopListening(element.event);\n });\n }", "function unRegisterEventHandlers() {\n\tlet event_keys = Object.keys(registered_event_handlers);\n\tevent_keys.forEach(function(key) {\n\t\tlet event_obj = registered_event_handlers[key];\n\t\tif (typeof event_obj.id !== \"undefined\") {\n\t\t\t$(event_obj.dom_node).off(event_obj.event,\"#\"+event_obj.id);\n\t\t} else if (typeof event_obj.class !== \"undefined\") {\n\t\t\t$(event_obj.dom_node).off(event_obj.event,\".\"+event_obj.class);\n\t\t} else {\n\t\t\t$(event_obj.dom_node).off(event_obj.event);\n\t\t}\n\t});\n\tregistered_event_handlers = [];\n}", "removeFinWindowEventListeners() {\n finsembleWindow.removeEventListener(\"maximized\", this.onWindowMaximized);\n finsembleWindow.removeEventListener(\"restored\", this.onWindowRestored);\n finsembleWindow.removeEventListener(\"blurred\", this.onWindowBlurred);\n finsembleWindow.removeEventListener(\"focused\", this.onWindowFocused);\n finsembleWindow.removeEventListener(\"close-requested\", this.close);\n finsembleWindow.removeEventListener(\"minimized\", this.onWindowMinimized);\n }", "__detatchListeners() {\n if (qx.bom.History.SUPPORTS_HASH_CHANGE_EVENT) {\n qx.bom.Event.removeNativeListener(\n window,\n \"hashchange\",\n this.__checkOnHashChange\n );\n } else {\n qx.event.Idle.getInstance().removeListener(\n \"interval\",\n this.__onHashChange,\n this\n );\n }\n }", "function _removeEventListeners(target) {\n for (var i in this._eventOutput.listeners) {\n target.removeEventListener(i, this.eventForwarder);\n }\n }", "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "function removePlayFunctions() {\n play.removeEventListener(\"click\", scrollDown);\n play.removeEventListener(\"click\", generatedGridRows);\n play.removeEventListener(\"click\", randomise);\n play.removeEventListener(\"click\", newGame);\n play.removeEventListener(\"click\", squareSize);\n play.removeEventListener(\"click\", checkerboard);\n play.removeEventListener(\"click\", addFlags);\n play.removeEventListener(\"click\", assignRelativePosition);\n play.removeEventListener(\"click\", assignHTML);\n play.removeEventListener(\"click\", bombIcon);\n play.removeEventListener(\"click\", flags);\n}", "function removeListeners() {\n for (var i = 0; i < cards.length; i++) {\n card = cards[i];\n card.removeEventListener(\"click\", revealCard);\n card.removeEventListener(\"click\", cardOpen);\n card.removeEventListener(\"click\", winner);\n card.classList.add(\"open\", \"disabled\", \"match\");\n }\n}", "function cleanupEvents() {\n if (eventRegistry) {\n for (var i = 0; i < eventRegistry.length; i++) {\n var evt = eventRegistry[i];\n removeEvent(evt.element, evt.type, evt.handler, evt.useCapture);\n }\n // unlink circular refrences so they can be GC'd\n eventRegistry = null;\n removeEvent(window, \"unload\", cleanupEvents, false);\n }\n}", "removeEvents() {\n }", "_cleanToRemovedListeners() {\n const toRemovedListeners = this._toRemovedListeners;\n\n for (let i = 0; i < toRemovedListeners.length; ++i) {\n const selListener = toRemovedListeners[i];\n\n const listeners = this._listenersMap[selListener._getListenerID()];\n\n if (!listeners) {\n continue;\n }\n\n const fixedPriorityListeners = listeners.getFixedPriorityListeners();\n const sceneGraphPriorityListeners = listeners.getSceneGraphPriorityListeners();\n\n if (sceneGraphPriorityListeners) {\n const idx = sceneGraphPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n sceneGraphPriorityListeners.splice(idx, 1);\n }\n }\n\n if (fixedPriorityListeners) {\n const idx = fixedPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n fixedPriorityListeners.splice(idx, 1);\n }\n }\n }\n\n toRemovedListeners.length = 0;\n }", "function clearEvents() {\n $._clearEvents();\n}", "unWireEvent() {\n this.viewerContainer.removeEventListener('scroll', this.scrollHandler);\n this.viewerContainer.removeEventListener('mousedown', this.onMouseDownInternal);\n this.viewerContainer.removeEventListener('mousemove', this.onMouseMoveInternal);\n if (!Browser.isDevice) {\n this.editableDiv.removeEventListener('keypress', this.onKeyPressInternal);\n if (Browser.info.name === 'chrome') {\n this.editableDiv.removeEventListener('textInput', this.onTextInput);\n }\n }\n else {\n this.editableDiv.removeEventListener('input', this.onTextInputInternal);\n }\n this.editableDiv.removeEventListener('paste', this.onPaste);\n this.viewerContainer.removeEventListener('contextmenu', this.onContextMenu);\n this.editableDiv.removeEventListener('blur', this.onFocusOut);\n this.editableDiv.removeEventListener('keydown', this.onKeyDownInternal);\n this.editableDiv.removeEventListener('compositionstart', this.compositionStart);\n this.editableDiv.removeEventListener('compositionupdate', this.compositionUpdated);\n this.editableDiv.removeEventListener('compositionend', this.compositionEnd);\n this.viewerContainer.removeEventListener('mouseup', this.onMouseUpInternal);\n if (!isNullOrUndefined(this.iframe)) {\n this.iframe.removeEventListener('load', this.onIframeLoad);\n }\n this.viewerContainer.removeEventListener('dblclick', this.onDoubleTap);\n window.removeEventListener('resize', this.onWindowResize);\n window.removeEventListener('keyup', this.onKeyUpInternal);\n window.removeEventListener('mouseup', this.onImageResizer);\n window.removeEventListener('touchend', this.onImageResizer);\n }", "detachListeners() {\n this.#outInterface.off('line', this.lineListener);\n this.#errInterface.off('line', this.errorListener);\n this.#child.off('exit', this.exitListener);\n this.#child.removeAllListeners('close');\n }", "function removeListeners() {\r\n gameOverModal.btn.removeEventListener(\"click\", backToMenu);\r\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "reset() {\n const {\n listeners\n } = this;\n const len = listeners.length;\n\n if (len > 0) {\n for (let i = 0; i < len; i += 1) {\n const set = listeners[i];\n const pos = ArrayIndexOf.call(listeners[i], this);\n ArraySplice.call(set, pos, 1);\n }\n\n listeners.length = 0;\n }\n }", "clearListeners(clearPersistent) {\n if (google) {\n if (this._listeners) {\n this._listeners.forEach((e) => {\n if (clearPersistent || !e.persistent) {\n google.maps.event.removeListener(e.listener);\n e.listener = null;\n }\n });\n this._listeners = this._listeners.filter((e) => {\n return e.listener != null;\n });\n }\n }\n }", "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "function _removeEventListeners(target) {\n for (var i in this.eventHandler.listeners) {\n target.removeEventListener(i, this.eventForwarder);\n }\n }", "reset() {\n const {\n listeners\n } = this;\n const len = listeners.length;\n\n if (len > 0) {\n for (let i = 0; i < len; i += 1) {\n const set = listeners[i];\n const pos = ArrayIndexOf$1.call(listeners[i], this);\n ArraySplice$1.call(set, pos, 1);\n }\n\n listeners.length = 0;\n }\n }", "destroy() {\n\t\tfor(const [event, listener] of this.listeners) this.client.removeListener(event, listener);\n\t\tthis.listeners.clear();\n\t}", "destroy() {\n this.removeDomListeners()\n // 238-4\n this.unsubscribers.forEach(unsub => unsub())\n }", "destroy() {\n this.removeDOMListeners();\n this.unsubscribers.forEach((unsub) => unsub());\n }", "unlisten() {\n [\"change\"].forEach(name => {\n this.el_.removeEventListener(name, this.handler_, false)\n })\n\n /* Final reset */\n this.reset()\n }" ]
[ "0.8521039", "0.8521039", "0.8521039", "0.8423259", "0.8304111", "0.8296624", "0.8282094", "0.8274838", "0.82720345", "0.8261525", "0.81342524", "0.8060971", "0.8031993", "0.7983937", "0.7970812", "0.7962308", "0.7867754", "0.78554255", "0.7834158", "0.77878404", "0.77458024", "0.77127075", "0.76607066", "0.765541", "0.7617221", "0.7613077", "0.76037747", "0.7597112", "0.75908387", "0.7576728", "0.7576728", "0.7564958", "0.75427777", "0.7532681", "0.7532363", "0.7519867", "0.75016695", "0.7500645", "0.74816656", "0.74798834", "0.7459843", "0.7455189", "0.7415441", "0.73867166", "0.7375581", "0.73475134", "0.73333454", "0.73327196", "0.7296553", "0.72810817", "0.7273378", "0.7258178", "0.7256101", "0.724964", "0.72429645", "0.72342956", "0.7226727", "0.72203916", "0.72167826", "0.72167826", "0.721651", "0.72135526", "0.71928513", "0.7171641", "0.7163562", "0.7158529", "0.7157283", "0.71553653", "0.7137832", "0.71377355", "0.7131727", "0.71247625", "0.711803", "0.7117867", "0.71073794", "0.7094401", "0.70929146", "0.7081614", "0.7073633", "0.7066863", "0.706411", "0.7063485", "0.70622534", "0.70618063", "0.7050111", "0.70472974", "0.70451516", "0.703912", "0.7025666", "0.7025666", "0.7022917", "0.7018219", "0.70165515", "0.70165515", "0.70165515", "0.7014341", "0.7003827", "0.6988489", "0.697822", "0.69753283", "0.6973915" ]
0.0
-1
CSS TRANSITION SUPPORT (Shoutout: ============================================================
function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionEnd otransitionend', 'transition' : 'transitionend' } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return { end: transEndEventNames[name] } } } return false // explicit for ie8 ( ._.) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "turnOn() {\n this.wrapper.style[Modernizr.prefixed('transition')] = Modernizr.prefixed('transform') + ' .25s';\n return this;\n }", "function reverseTranslate(newFrom){return $animateCss(target,{to:newFrom||from,addClass:options.transitionOutClass,removeClass:options.transitionInClass}).start();}", "function applyCSS(element, properties, duration, easing, isTransition){\n\t\tvar code = (isTransition === 0)?getCSS(properties, duration, easing):getTransition(properties, duration, easing, isTransition);\n\t\tif(styleTag === null || styleTag === undefined){\n\t\t\tstyleTag = document.createElement('style');\n\t\t\tstyleTag.type = 'text/css';\t\n\t\t\tdocument.getElementsByTagName('head')[0].appendChild(styleTag);\n\t\t}\n\t\tstyleTag.innerHTML = code;\n\t\tvar el = (typeof element === 'string') ? document.querySelectorAll(element)[0]:element\n\t\tvar cn = (properties.name || 'myTween');\n\t\tif(el.className.indexOf(cn) === -1){\n\t\t\tel.className += ' ' + cn;\n\t\t}\n\t\treturn code;\n\t}", "function applyTransition(element, properties, duration, easing){\n\t\treturn applyCSS(element, properties, duration, easing, 1);\n\t}", "function flipBack(el) {\n el.children[1].style.webkitTransform = \"perspective(600px) rotateY(0deg)\";\n el.children[0].style.webkitTransform = \"perspective(600px) rotateY(180deg)\";\n el.children[1].style.transition = \"all .5s linear 0s\";\n el.children[0].style.transition = \"all .5s linear 0s\";\n el.children[1].style.transform = \"perspective(600px) rotateY(0deg)\";\n el.children[0].style.transform = \"perspective(600px) rotateY(180deg)\";\n el.children[1].style.webkitTransition = \"all .5s linear 0s\";\n el.children[0].style.webkitTransition = \"all .5s linear 0s\";\n\n}", "function transition() {\n\t// checking R\n\tif (currentColor[0] > targetColor[0]) {\n\t\tcurrentColor[0] -= increment[0];\n\t\tif (currentColor[0] <= targetColor[0]) {\n\t\t\tincrement[0] = 0;\n\t\t}\n\t} else {\n\t\tcurrentColor[0] += increment[0];\n\t\tif (currentColor[0] >= targetColor[0]) {\n\t\t\tincrement[0] = 0;\n\t\t}\n\t}\n\t\n\t// checking G\n\tif (currentColor[1] > targetColor[1]) {\n\t\tcurrentColor[1] -= increment[1];\n\t\tif (currentColor[1] <= targetColor[1]) {\n\t\t\tincrement[1] = 0;\n\t\t}\n\t} else {\n\t\tcurrentColor[1] += increment[1];\n\t\tif (currentColor[1] >= targetColor[1]) {\n\t\t\tincrement[1] = 0;\n\t\t}\n\t}\n\t\n\t// checking B\n\tif (currentColor[2] > targetColor[2]) {\n\t\tcurrentColor[2] -= increment[2];\n\t\tif (currentColor[2] <= targetColor[2]) {\n\t\t\tincrement[2] = 0;\n\t\t}\n\t} else {\n\t\tcurrentColor[2] += increment[2];\n\t\tif (currentColor[2] >= targetColor[2]) {\n\t\t\tincrement[2] = 0;\n\t\t}\n\t}\n\t\n\t// applying the new modified color\n\ttransElement.style.backgroundColor = rgb2hex(currentColor);\n\t\n\t// transition ended. start a new one\n\tif (increment[0] == 0 && increment[1] == 0 && increment[2] == 0) {\n\t\tstartTransition();\n\t}\n}", "function transglow(element, value1, value2){\r\n element.css('-webkit-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('-moz-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('-ms-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('-o-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n }", "function recalcTransforms() {\n var fiftyPercent = Math.round(window.innerWidth / 2) + 'px';\n pointingRight = 'translateZ(-'+fiftyPercent+') rotateY(+90deg) translateZ(+'+fiftyPercent+')';\n pointingLeft = 'translateZ(-'+fiftyPercent+') rotateY(-90deg) translateZ(+'+fiftyPercent+')';\n pointingFront = 'translateZ(-'+fiftyPercent+') rotateY(0deg) translateZ(+'+fiftyPercent+')';\n}", "_applyTransform() {\n this.wrapper.style.transform = [\n 'translateX(-50%)',\n `translateX(${this._translate})`,\n ].join(' ');\n }", "function transform( el, value ) {\n\tvar style = el.style;\n\n\tstyle.transform = value;\n\tstyle.webkitTransform = value;\n\tstyle.oTransform = value;\n\tstyle.msTransform = value;\n}", "cssToMatrix(elementId) {\n const element = document.getElementById(elementId),\n style = window.getComputedStyle(element)\n\n return style.getPropertyValue(\"-webkit-transform\") ||\n style.getPropertyValue(\"-moz-transform\") ||\n style.getPropertyValue(\"-ms-transform\") ||\n style.getPropertyValue(\"-o-transform\") ||\n style.getPropertyValue(\"transform\");\n\n\t }", "cssToMatrix(elementId) {\n const element = document.getElementById(elementId),\n style = window.getComputedStyle(element)\n\n return style.getPropertyValue(\"-webkit-transform\") ||\n style.getPropertyValue(\"-moz-transform\") ||\n style.getPropertyValue(\"-ms-transform\") ||\n style.getPropertyValue(\"-o-transform\") ||\n style.getPropertyValue(\"transform\");\n\n\t }", "function transition() {\n // checking R\n if (currentColor[0] > targetColor[0]) {\n currentColor[0] -= increment[0];\n if (currentColor[0] <= targetColor[0]) {\n increment[0] = 0;\n }\n } else {\n currentColor[0] += increment[0];\n if (currentColor[0] >= targetColor[0]) {\n increment[0] = 0;\n }\n }\n \n // checking G\n if (currentColor[1] > targetColor[1]) {\n currentColor[1] -= increment[1];\n if (currentColor[1] <= targetColor[1]) {\n increment[1] = 0;\n }\n } else {\n currentColor[1] += increment[1];\n if (currentColor[1] >= targetColor[1]) {\n increment[1] = 0;\n }\n }\n \n // checking B\n if (currentColor[2] > targetColor[2]) {\n currentColor[2] -= increment[2];\n if (currentColor[2] <= targetColor[2]) {\n increment[2] = 0;\n }\n } else {\n currentColor[2] += increment[2];\n if (currentColor[2] >= targetColor[2]) {\n increment[2] = 0;\n }\n }\n \n // applying the new modified color\n transElement.style.backgroundColor = rgb2hex(currentColor);\n \n // transition ended. start a new one\n if (increment[0] == 0 && increment[1] == 0 && increment[2] == 0) {\n startTransition();\n }\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function lower() {\n d.getElementById('slide').style.webkitTransition = \"all 0.6s ease\";\n d.getElementById('slide').style.MozTransition = \"all 0.6s ease\";\n d.getElementById('slide').style.top = '-10px';\n}", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "addTransitionTimeToCSS(){\n\t\tdocument.getElementById(this._elementID).style.transition = 'filter '+this._transitionTime+'s';\n\t}", "function transElem(element, transform) {\n element.css('-webkit-transform', transform);\n element.css('-moz-transform', transform);\n element.css('-o-transform', transform);\n element.css('transform', transform);\n element.css('-ms-transform', transform);\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass,\n duration: options.duration\n }).start();\n\n }", "function transitionEnd(){var el=document.createElement('bootstrap');var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]};}}return false;// explicit for ie8 ( ._.)\n}// http://blog.alexmaccaw.com/css-transitions", "function transitionEnd(){var el=document.createElement('bootstrap');var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]};}}return false;// explicit for ie8 ( ._.)\n}// http://blog.alexmaccaw.com/css-transitions", "function transitionSupport() {\n\t// env.window is not defined yet when this is called\n\tvar b = win.document.body || win.document.documentElement,\n\t\ts = b.style,\n\t\tp = 'transition',\n\t\tv = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'];\n\t\n\tif (typeof s[p] == 'string') { return true; }\n\t\n\tp = p.charAt(0).toUpperCase() + p.substr(1);\n\tfor (var i=0; i<v.length; i++) {\n\t\tif (typeof s[v[i] + p] == 'string') { return true; }\n\t}\n\treturn false;\n}", "function transform(el, value) {\n el.style['transform'] = value;\n el.style['webkitTransform'] = value;\n}", "function transformContainer(element, translate3d, animated) {\n element.toggleClass('pp-easing', animated);\n\n element.css(getTransforms(translate3d));\n }", "function transformElement( element, transform ) {\n\n element.style.WebkitTransform = transform;\n element.style.MozTransform = transform;\n element.style.msTransform = transform;\n element.style.OTransform = transform;\n element.style.transform = transform;\n\n}", "function ws_book(i,g,a){var d=jQuery;var e=d(\"ul\",a);var c=i.duration;var b={backgroundColor:\"#000\",position:\"absolute\",left:0,top:0,\"float\":\"left\",width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};var f;this.go=function(p,n){if(h.cssTransitions()&&h.cssTransforms3d()&&!document.all){if(f){return n}var s=g.get(p),k=g.get(n);var l=((n==0&&p!=n+1)||(p==n-1))?{p:true,cont1back:s.src,cont2back:k.src,item1back:k.src,item2back:s.src,item1deg:\"0.1deg\",item2deg:\"-90deg\",item1dodeg:\"90deg\",item2dodeg:\"0deg\",trans1:\"ease-in \",trans2:\"ease-out \"}:{p:false,cont1back:k.src,cont2back:s.src,item1back:s.src,item2back:k.src,item1deg:\"90deg\",item2deg:\"-0.1deg\",item1dodeg:\"0deg\",item2dodeg:\"-90deg\",trans1:\"ease-out \",trans2:\"ease-in \"};var t=d(\"<div>\").css(b).css({background:\"url(\"+l.cont1back+\")\",backgroundSize:\"auto 100%\",width:\"50%\"}).appendTo(a.parent());var q=d(\"<div>\").css(b).css({left:\"50%\",background:\"url(\"+l.cont2back+\") right\",backgroundSize:\"auto 100%\",width:\"50%\"}).appendTo(a.parent());var o=d(\"<div>\").css(b).css({background:\"url(\"+l.item1back+\")\",backgroundSize:\"auto 100%\",marginRight:\"-100%\",transform:\"rotateY(\"+l.item1deg+\")\",transition:l.trans1+c/2000+\"s\",\"transform-origin\":\"right\",\"z-index\":8}).appendTo(t);var m=d(\"<div>\").css(b).css({background:\"url(\"+l.item2back+\") right\",backgroundSize:\"auto 100%\",marginRight:\"-100%\",transform:\"rotateY(\"+l.item2deg+\")\",transition:l.trans2+c/2000+\"s\",\"transform-origin\":\"left\"}).appendTo(q);var r=d(\"<div>\").css(b).css({opacity:0.2,zIndex:2}).appendTo((l.p?t:q)).css(\"opacity\",1).clone().appendTo((l.p?m:o)).css(\"opacity\",0.2).clone().appendTo((l.p?q:t)).css(\"opacity\",1).hide().clone().appendTo((l.p?o:m)).css(\"opacity\",0.2).hide();f=new j(l,t,q,o,m,function(){e.css({left:-p+\"00%\"}).show();t.remove();q.remove();f=0})}else{a.find(\"ul\").stop(true).animate({left:(p?-p+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},i.duration,\"easeInOutExpo\")}function j(A,E,D,C,B,F){var z=E,y=D,x=C,w=B,v=\"rotateY(\"+A.item1dodeg+\")\";var u=\"rotateY(\"+A.item2dodeg+\")\";if(!A.p){z=D;y=E;x=B;w=C;v=\"rotateY(\"+A.item2dodeg+\")\";u=\"rotateY(\"+A.item1dodeg+\")\"}a.parent().css(\"perspective\",w.width()*4);x.css(\"transform\",v);x.children().fadeIn(c/2);z.children().fadeOut(c/2,function(){w.css(\"transform\",u);w.children().fadeOut(c/2);y.children().fadeIn(c/2)});setTimeout(F,c);return{stop:function(){F()}}}return p};var h={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(k){var j=this.domPrefixes.length;while(j--){if(typeof document.body.style[this.domPrefixes[j]+k]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){if(typeof document.body.style.perspectiveProperty!==\"undefined\"){return true}return this.testDom(\"Perspective\")}}}", "function applyTransforms(el, nobodyscale) {\n\t\t// zoomer area and scale value\n\t\tvar zoomerArea = el.querySelector('.zoomer__area'),\n\t\t\tzoomerAreaSize = {width: zoomerArea.offsetWidth, height: zoomerArea.offsetHeight},\n\t\t\tzoomerOffset = zoomerArea.getBoundingClientRect(),\n\t\t\tscaleVal = zoomerAreaSize.width/zoomerAreaSize.height < win.width/win.height ? win.width/zoomerAreaSize.width : win.height/zoomerAreaSize.height;\n\n\t\tif( bodyScale && !nobodyscale ) {\n\t\t\tscaleVal /= bodyScale;\n\t\t}\n\n\t\t// apply transform\n\t\tel.style.WebkitTransform = 'translate3d(' + Number(win.width/2 - (zoomerOffset.left+zoomerAreaSize.width/2)) + 'px,' + Number(win.height/2 - (zoomerOffset.top+zoomerAreaSize.height/2)) + 'px,0) scale3d(' + scaleVal + ',' + scaleVal + ',1)';\n\t\tel.style.transform = 'translate3d(' + Number(win.width/2 - (zoomerOffset.left+zoomerAreaSize.width/2)) + 'px,' + Number(win.height/2 - (zoomerOffset.top+zoomerAreaSize.height/2)) + 'px,0) scale3d(' + scaleVal + ',' + scaleVal + ',1)';\n\t}", "function styleApp(el, data) {\r\n\t var _tram = tram(el);\r\n\r\n\t // Get computed transition value\r\n\t el.css('transition', '');\r\n\t var computed = el.css('transition');\r\n\r\n\t // If computed is set to none, clear upstream\r\n\t if (computed === transNone) computed = _tram.upstream = null;\r\n\r\n\t // Set upstream transition to none temporarily\r\n\t _tram.upstream = transNone;\r\n\r\n\t // Set values immediately\r\n\t _tram.set(tramify(data));\r\n\r\n\t // Only restore upstream in preview mode\r\n\t _tram.upstream = computed;\r\n\t }", "function addTransition() {\n carouselList.style.transition = isResizing\n ? \"\"\n : \"transform 0.5s ease-in-out\";\n}", "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n element.removeClass(NO_TRANSITION);\r\n return element.css({\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n element.removeClass(NO_TRANSITION);\r\n return element.css({\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n element.removeClass(NO_TRANSITION);\r\n return element.css({\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "getDomTransform() {\n return Math.ceil(getComputedStyle(this.characterChild).transform.split(',')[this.splitNum]) + this.calculateWithDif();\n }", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function transitionSupport() {\n\t\n\t// env.window is not defined yet when this is called\n\tif (!win) return false;\n\t\n\tvar b = win.document.body || win.document.documentElement,\n\t\ts = b.style,\n\t\tp = 'transition',\n\t\tv = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'];\n\t\n\tif (typeof s[p] == 'string') { return true; }\n\t\n\tp = p.charAt(0).toUpperCase() + p.substr(1);\n\tfor (var i=0; i<v.length; i++) {\n\t\tif (typeof s[v[i] + p] == 'string') { return true; }\n\t}\n\treturn false;\n}", "function setupTransition(element, properties, duration, timing) {\n\t if (cssTransitionsSupported) {\n\t var style = (element).style;\n\t style.webkitTransitionProperty = properties;\n\t style.webkitTransitionDuration = duration + 'ms';\n\t style.webkitTransitionTimingFunction = timing;\n\t }\n\t}", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function ws_stack(t,e,n){function i(e,n,i,s,o){t.support.transform&&t.support.transition?(n.transform||(n.transform=\"\"),n.left&&(n.transform+=\" translate3d(\"+(n.left?n.left:0)+\"px,0,0)\"),delete n.left,n.transition=i+\"ms all \"+s+\"ms cubic-bezier(0.770, 0.000, 0.175, 1.000)\",e.css(n),o&&e.on(\"transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd\",o)):i?e.animate(n,i,\"easeInOutExpo\",o):e.css(n)}var s=jQuery,o=s(this),a=s(\"li\",n),d=s(\"<div>\").addClass(\"ws_effect\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).appendTo(n.parent());this.go=function(r,f,l){var h=a.length>2?(r-f+1)%a.length:1;Math.abs(l)>=1&&(h=l>0?0:1),h=!!h^!!t.revers;var p=(t.revers?1:-1)*n.width();a.each(function(t){h&&t!=f&&(this.style.zIndex=Math.max(0,this.style.zIndex-1))});var u=s(\".ws_list\",n),c=s(\"<div>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",overflow:\"hidden\",zIndex:4}).append(s(e.get(h?r:f)).clone()),v=s(\"<div>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",overflow:\"hidden\",zIndex:4}).append(s(e.get(h?f:r)).clone());t.responsive<3&&(c.find(\"img\").css(\"width\",\"100%\"),v.find(\"img\").css(\"width\",\"100%\")),i(c,{left:h?p:0}),i(v,{left:h?0:.5*-p}),h?(v.appendTo(d),c.appendTo(d)):(c.insertAfter(u),v.insertAfter(u)),h?t.fadeOut&&u.fadeOut(t.duration):(u.stop(!0,!0).hide().css({left:-r+\"00%\"}),t.fadeOut?u.fadeIn(t.duration):u.show()),setTimeout(function(){i(c,{left:h?0:p},t.duration,t.duration*(h?0:.1),function(){o.trigger(\"effectEnd\"),c.remove(),v.remove()}),i(v,{left:(h?1:0)*n.width()*.5},t.duration,t.duration*(h?.1:0))},0)}}// -----------------------------------------------------------------------------------", "function $transformer(elm) {\n\t\t\tvar self = {};\n\t\t\tvar raw = elm[0];\n\t\t\tvar currentTransformer = elm.data('$scrolly.transformer');\n\t\t\tif (currentTransformer) {\n\t\t\t\treturn currentTransformer;\n\t\t\t} else {\n\t\t\t\telm.data('$scrolly.transformer', self);\n\t\t\t}\n\n\t\t\telm.bind('$destroy', function() {\n\t\t\t\tself.pos = null;\n\t\t\t\tchangingDoneCallback = null;\n\t\t\t});\n\n\t\t\tself.pos = {x: 0, y: 0};\n\n\t\t\t//Gets the current x and y transform of the element\n\t\t\tself.updatePosition = function() {\n\t\t\t\tvar style = $window.getComputedStyle(elm[0]);\n\t\t\t\tvar matrix = (style[transformProp] || '')\n\t\t\t\t\t.replace(/[^0-9-.,]/g,'')\n\t\t\t\t\t.split(',');\n\t\t\t\tif (matrix.length > 1) {\n\t\t\t\t\tself.pos.x = parseInt(matrix[4], 10);\n\t\t\t\t\tself.pos.y = parseInt(matrix[5], 10);\n\t\t\t\t}\n\t\t\t\treturn self.pos;\n\t\t\t};\n\t\t\tself.updatePosition();\n\n\t\t\tvar changingDoneCallback;\n\t\t\telm.bind(transitionEndProp, onTransitionEnd);\n\t\t\tfunction onTransitionEnd() {\n\t\t\t\tif (self.changing) {\n\t\t\t\t\tself.stop(changingDoneCallback);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself.stop = function(done) {\n\t\t\t\t//Stop transitions, and set self.pos to wherever we were.\n\t\t\t\traw.style[transitionProp] = '';\n\t\t\t\tself.updatePosition();\n\t\t\t\tself.changing = false;\n\n\t\t\t\t//On next frame, set our element's position - this wait is so the\n\t\t\t\t//transition style on the element has time to 'remove' itself\n\t\t\t\t$nextFrame(function() {\n\t\t\t\t\tself.setTo(self.pos);\n\t\t\t\t\t(done || noop)();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tself.easeTo = function(pos, transitionTime, done) {\n\t\t\t\tif (!angular.isNumber(transitionTime) || transitionTime < 0) {\n\t\t\t\t\tthrow new Error(\"Expected a positive number for time, got '\" +\n\t\t\t\t\t\ttransitionTime + \"'.\");\n\t\t\t\t}\n\t\t\t\t//If we're currently animating, we need to stop before we try to\n\t\t\t\t//animate differently.\n\t\t\t\tif (self.changing) {\n\t\t\t\t\tself.stop(doTransition);\n\t\t\t\t} else {\n\t\t\t\t\tdoTransition();\n\t\t\t\t}\n\t\t\t\tfunction doTransition() {\n\t\t\t\t\telm.css(transitionProp, transitionString(transitionTime));\n\n\t\t\t\t\tself.changing = true;\n\t\t\t\t\tchangingDoneCallback = done;\n\n\t\t\t\t\t//On next frame, start transition - this wait is so the transition\n\t\t\t\t\t//style on the element has time to 'apply' itself before the elm's\n\t\t\t\t\t//position is set\n\t\t\t\t\t$nextFrame(function() {\n\t\t\t\t\t\tself.setTo(pos);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t//Allow setting with setTo(x,y) or setTo({x:x, y:y})\n\t\t\tself.setTo = function(pos) {\n\t\t\t\tisDefined(pos.x) && (self.pos.x = pos.x);\n\t\t\t\tisDefined(pos.y) && (self.pos.y = pos.y);\n\t\t\t\telm.css(transformProp, transformString(self.pos.x, self.pos.y));\n\t\t\t};\n\n\t\t\tself.clear = function() {\n\t\t\t\telm.css(transformProp, '');\n\t\t\t\telm.css(transitionProp, '');\n\t\t\t};\n\n\t\t\treturn self;\n\t\t}", "function AnimateCss(shiftValue){\n\t\t\tvar _endValue = \"translate3d(\" + shiftValue + \"px,0,0)\";\n\t\t\tmainContainer.css('-webkit-transition', 'all ' + transitionTime + 'ms ease-in-out');\n\t\t\tmainContainer.css(_cssProperty, _endValue);\n}", "function setTransforms() {\n itemsStyle.style.transform = 'translate3d(' + (posI * 550) + 'px,0,0)';\n}", "function setupTransitionTransform(element, duration, timing) {\n\t if (!timing) {\n\t timing = \"ease\";\n\t }\n\t setupTransition(element, \"-webkit-transform\", duration, timing);\n\t}", "function addAnimation(element){\n \t\t\tvar transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n \t\t\telement.removeClass('fp-notransition');\n \t\t\treturn element.css({\n \t\t\t\t'-webkit-transition': transition,\n \t\t\t'transition': transition\n \t\t});\n \t\t}", "getTransitionMethod (transition) {\n\n switch (transition) {\n // ease linear\n case \"easeLinear\":\n return d3EaseLinear; \n break;\n // easeQuadIn as d3EaseQuadIn,\n case \"easeQuadIn\":\n return d3EaseQuadIn;\n break;\n // easeQuadOut as d3EaseQuadOut\n case \"easeQuadOut\":\n return d3EaseQuadOut;\n break;\n // easeQuadInOut as d3EaseQuadInOut\n case \"easeQuadInOut\":\n return d3EaseQuadInOut;\n break;\n // easeCubicIn as d3EaseCubicIn\n case \"easeCubicIn\":\n return d3EaseCubicIn;\n break;\n // easeCubicOut as d3EaseCubicOut,\n case \"easeCubicOut\":\n return d3EaseCubicOut;\n break;\n // easeCubicInOut as d3EaseCubicInOut,\n case \"easeCubicInOut\":\n return d3EaseCubicInOut;\n break;\n // easePolyIn as d3EasePolyIn,\n case \"easePolyIn\":\n return d3EasePolyIn;\n break;\n // easePolyOut as d3EasePolyOut,\n case \"easePolyOut\":\n return d3EasePolyOut;\n break;\n // easePolyInOut as d3EasePolyInOut,\n case \"easePolyInOut\":\n return d3EasePolyInOut;\n break;\n // easeSinIn as d3EaseSinIn,\n case \"easeSinIn\":\n return d3EaseSinIn;\n break;\n // easeSinOut as d3EaseSinOut,\n case \"easeSinOut\":\n return d3EaseSinOut;\n break;\n // easeSinInOut as d3EaseSinInOut,\n case \"easeSinInOut\":\n return d3EaseSinInOut;\n break;\n // easeExpIn as d3EaseExpIn,\n case \"easeExpIn\":\n return d3EaseExpIn;\n break;\n // easeExpOut as d3EaseExpOut,\n case \"easeExpOut\":\n return d3EaseExpOut;\n break;\n // easeExpInOut as d3EaseExpInOut,\n case \"easeExpInOut\":\n return d3EaseExpInOut;\n break;\n // easeCircleIn as d3EaseCircleIn,\n case \"easeCircleIn\":\n return d3EaseCircleIn;\n break;\n // easeCircleOut as d3EaseCircleOut,\n case \"easeCircleOut\":\n return d3EaseCircleOut;\n break;\n // easeCircleInOut as d3EaseCircleInOut,\n case \"easeCircleInOut\":\n return d3EaseCircleInOut;\n break;\n // easeBounceIn as d3EaseBounceIn,\n case \"easeBounceIn\":\n return d3EaseBounceIn;\n break;\n // easeBounceOut as d3EaseBounceOut,\n case \"easeBounceOut\":\n return d3EaseBounceOut;\n break;\n // easeBounceInOut as d3EaseBounceInOut,\n case \"easeBounceInOut\":\n return d3EaseBounceInOut;\n break;\n // easeBackIn as d3EaseBackIn,\n case \"easeBackIn\":\n return d3EaseBackIn;\n break;\n // easeBackOut as d3EaseBackOut,\n case \"easeBackOut\":\n return d3EaseBackOut;\n break;\n // easeBackInOut as d3EaseBackInOut,\n case \"easeBackInOut\":\n return d3EaseBackInOut;\n break;\n // easeElasticIn as d3EaseElasticIn,\n case \"easeElasticIn\":\n return d3EaseElasticIn;\n break;\n // easeElasticOut as d3EaseElasticOut,\n case \"easeElasticOut\":\n return d3EaseElasticOut;\n break;\n // easeElasticInOut as d3EaseElasticInOut,\n case \"easeElasticInOut\":\n return d3EaseElasticInOut;\n break;\n // easeElastic as d3EaseElastic,\n case \"easeElastic\":\n return d3EaseElastic;\n break;\n\n // ease elastic transition\n case \"easeElastic\":\n return d3EaseElastic; \n break;\n };\n\n }", "function addAnimation(element) {\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n element.removeClass(NO_TRANSITION);\n return element.css({\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function css3animationEffect() {\n $().waypoint && Modernizr.mq(\"only all and (min-width: 320px)\") && $(\".animated\").waypoint(function () {\n var i = $(this).data(\"animation-type\");\n (\"undefined\" == typeof i || 0 == i) && (i = \"fadeIn\"), $(this).addClass(i);\n var t = $(this).data(\"animation-duration\");\n (\"undefined\" == typeof t || 0 == t) && (t = \"1\"), $(this).css(\"animation-duration\", t + \"s\");\n var n = $(this).data(\"animation-delay\");\n \"undefined\" != typeof n && 0 != n && $(this).css(\"animation-delay\", n + \"s\"), $(this).css(\"visibility\", \"visible\"), setTimeout(function () {\n $.waypoints(\"refresh\")\n }, 1e3)\n }, {triggerOnce: !0, offset: \"bottom-in-view\"})\n }", "function transformContainer(translate3d, animated){\n \t\t\tif(animated){\n \t\t\t\taddAnimation(container);\n \t\t\t}else{\n \t\t\t\tremoveAnimation(container);\n \t\t\t}\n\n \t\t\tcontainer.css(getTransforms(translate3d));\n\n \t\t\t//syncronously removing the class after the animation has been applied.\n \t\t\tsetTimeout(function(){\n \t\t\t\tcontainer.removeClass('fp-notransition');\n \t\t\t},10)\n \t\t}", "function getTransform(x, y) {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return \"translate3d(\".concat(Math.round(x), \"px, \").concat(Math.round(y), \"px, 0)\");\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n removeClass(element, NO_TRANSITION);\r\n return css(element, {\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n removeClass(element, NO_TRANSITION);\r\n return css(element, {\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }", "function onComplete(target) {\r\n\t\ttarget.style.setProperty('-webkit-transition', \".25s all ease-out\");\r\n\t\ttarget.style.setProperty('-o-transition', \".25s all ease-out\");\r\n\t\ttarget.style.setProperty('-moz-transition', \".25s all ease-out\");\r\n\t\ttarget.style.setProperty('transition', \".25s all ease-out\");\r\n\t}", "function prepareTransition(element) {\n element.addEventListener(\n 'transitionend',\n function(event) {\n event.currentTarget.classList.remove('is-transitioning');\n },\n { once: true }\n );\n\n var properties = [\n 'transition-duration',\n '-moz-transition-duration',\n '-webkit-transition-duration',\n '-o-transition-duration'\n ];\n\n var duration = 0;\n\n properties.forEach(function(property) {\n var computedValue = getComputedStyle(element)[property];\n\n if (computedValue) {\n computedValue.replace(/\\D/g, '');\n duration || (duration = parseFloat(computedValue));\n }\n });\n\n if (duration !== 0) {\n element.classList.add('is-transitioning');\n element.offsetWidth;\n }\n }", "function supportTransitions() {\n\t\tvar b = document.body || document.documentElement;\n\t\tvar s = b.style;\n\t\tvar p = 'transition';\n\t\tif(typeof s[p] == 'string') {return true; }\n\n\t\t// Tests for vendor specific prop\n\t\tv = ['Moz', 'Webkit', 'Khtml', 'O', 'ms', 'Icab'],\n\t\tp = p.charAt(0).toUpperCase() + p.substr(1);\n\t\tfor(var i=0; i<v.length; i++) {\n\t\t if(typeof s[v[i] + p] == 'string') { return true; }\n\t\t}\n\t\treturn false;\n\t}", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n removeClass(element, NO_TRANSITION);\n return css(element, {\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n removeClass(element, NO_TRANSITION);\n return css(element, {\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function addAnimation(element){\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n\n removeClass(element, NO_TRANSITION);\n return css(element, {\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "_animateCSS() {\n console.debug('Animate CSS');\n let container = this.shadowRoot.getElementById('container');\n let slides = container.querySelector(\".slider__slides\");\n slides.style.transform = \"translateX(-\" + 100 * this.position + \"%)\";\n // console.debug('Animate CSS: slider__slides: ', slides);\n // console.debug('Animate CSS: slides.style.transform: ', slides.style.transform);\n // console.debug('Animate CSS: indSel.style.left: ', indSel.style.left);\n // console.debug('Animate CSS: indSel.style.right: ', indSel.style.right);\n }", "function Transformation() {\r\n\t\tvar fn = {\r\n\t\t\ttranslate: new TransformFunction('translate({x}px,{y}px)', {x:0, y:0}),\r\n\t\t\tscale: new TransformFunction('scale({x},{y})', {x:1, y:1}),\r\n\t\t\trotate: new TransformFunction('rotate({deg}deg)', {deg:0})\r\n\t\t};\r\n\t\t\r\n\t\tif (supports3d) {\r\n\t\t\t// Use 3D transforms for better performance\r\n\t\t\tfn.translate = new TransformFunction('translate3d({x}px,{y}px,0px)', {x:0, y:0});\r\n\t\t\tfn.scale = new TransformFunction('scale3d({x},{y},1)', {x:1, y:1});\r\n\t\t}\t\r\n\t\t\r\n\t\tvar commands = {\r\n\t\t\trotate: function(deg) {\r\n\t\t\t\tfn.rotate.deg = deg;\r\n\t\t\t},\r\n\t\t\trotateBy: function(deg) {\r\n\t\t\t\tfn.rotate.deg += deg;\r\n\t\t\t},\r\n\t\t\tscale: function(s) {\r\n\t\t\t\tif (typeof s == 'number') {\r\n\t\t\t\t\ts = {x: s, y: s};\r\n\t\t\t\t}\r\n\t\t\t\tfn.scale.x = s.x;\r\n\t\t\t\tfn.scale.y = s.y;\r\n\t\t\t},\r\n\t\t\tscaleBy: function(s) {\r\n\t\t\t\tif (typeof s == 'number') {\r\n\t\t\t\t\ts = {x: s, y: s};\r\n\t\t\t\t}\r\n\t\t\t\tfn.scale.x *= s.x;\r\n\t\t\t\tfn.scale.y *= s.y;\r\n\t\t\t},\r\n\t\t\ttranslate: function(s) {\r\n\t\t\t\tvar t = fn.translate;\r\n\t\t\t\tif (!s) {\r\n\t\t\t\t\ts = {x: 0, y: 0};\r\n\t\t\t\t}\r\n\t\t\t\tt.x = (s.x !== undefined) ? parseInt(s.x, 10) : t.x;\r\n\t\t\t\tt.y = (s.y !== undefined) ? parseInt(s.y, 10) : t.y;\r\n\t\t\t},\r\n\t\t\ttranslateBy: function(s) {\r\n\t\t\t\tvar t = fn.translate;\r\n\t\t\t\tt.x += parseInt(s.x, 10) || 0;\r\n\t\t\t\tt.y += parseInt(s.y, 10) || 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.fn = fn;\r\n\t\tthis.exec = function(cmd) {\r\n\t\t\tfor (var n in cmd) {\r\n\t\t\t\tif (commands[n]) {\r\n\t\t\t\t\tcommands[n](cmd[n]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.reset = function() {\r\n\t\t\t$.each(fn, function() {\r\n\t\t\t\tthis.reset();\r\n\t\t\t});\r\n\t\t};\r\n\t\tthis.format = function() {\r\n\t\t\tvar s = '';\r\n\t\t\t$.each(fn, function(k, v) {\r\n\t\t\t\ts += v.format() + ' ';\r\n\t\t\t});\r\n\t\t\treturn s;\r\n\t\t};\r\n\t}", "function getCSS(properties, duration, easing){\n\t\tvar frames = parse(properties),\n\t\t\tprop = frames[0],\n\t\t\tisTransition = (prop.isTransition != undefined)?prop.isTransition:0,\n\t\t\tn = prop.name || global.className,\n\t\t\td = prop.duration || duration || 0.5,\n\t\t\tl = prop.animationIterationCount || prop.loop || '1',\n\t\t\te = prop.animationTimingFunction || prop.ease || easing || 'ease',\n\t\t\tad = prop.direction || 'normal',\n\t\t\tdy = prop.delay || 0,\n\t\t\tfm = prop.fillMode || (parseFloat(dy) !== 0)?'both':'forwards',\n\t\t\tp = prop.percent || 'to',\n\t\t\tisPlaying = prop.play || prop.animationPlayState || 'running',\n\t\t\tuseAll = prop.useAll || false,\n\t\t\tuseShortHand = prop.useShortHand || false,\n\t\t\tuseHacks = Boolean(prop.useHacks) || false,\n\t\t\thacks = '',\n\t\t\tt = '',\n\t\t\ts = '',\n\t\t\t_c = ':',\n\t\t\t_e = ';',\n\t\t\t_d = '.',\n\t\t\t_s = ' ',\n\t\t\t_n = '\\n',\n\t\t\t_t = '\\t',\n\t\t\t_o = '{',\n\t\t\t_x = '}'\n\t\t\t_k = 'keyframes ',\n\t\t\t_w = '-webkit-',\n\t\t\tprefix = ['',_w],\n\t\t\tnTimes = 1,\n\t\t\tnDirection = '>';\n\t\tif(n.indexOf('*') != -1){\n\t\t\tvar nRaw = n.split('*');\n\t\t\tn = nRaw[0];\n\t\t\tif((nRaw[1]).indexOf(',') != -1){\n\t\t\t\tvar nRawB = (nRaw[1]).split(',');\n\t\t\t\tnTimes = parseInt(nRawB[0]);\n\t\t\t\tnDirection = nRawB[1];\n\t\t\t}else{\n\t\t\t\tnTimes = parseInt(nRaw[1]);\n\t\t\t}\n\t\t}\n\t\tif(n.toLowerCase() == 'randomname'){\n\t\t\tn = global.className = 'myTween-' + Math.round(Math.random() * 1000);\n\t\t}\n\t\tglobal.className = n;\n\t\tvar dpx = (d + '').indexOf('ms') != -1?'ms':(d + '').indexOf('s') == -1?'s':'s';\n\t\tvar dypx = (dy + '').indexOf('ms') != -1?'ms':(dy + '').indexOf('s') == -1?'s':'s';\n\t\td = parseFloat(d);\n\t\tdy = parseFloat(dy);\n\t\tif(useHacks){\n\t\t\tif(!global.has3D){\n\t\t\t\thacks += _t + '/*enable hardware acceleration*/' + _n;\n\t\t\t\thacks += _t + 'transform:translateZ(0)' + _e + _n;\n\t\t\t\thacks += _t + _w + 'transform:translateZ(0)' + _e + _n + _n;\t\n\t\t\t}\n\t\t\thacks += _t + '/*improve anti-alias*/' + _n;\n\t\t\thacks += _t + 'box-shadow: 0 0 1px rgba(0, 0, 0, 0)' + _e + _n + _n;\n\t\t\thacks += _t + '/*font smoothing*/' + _n;\n\t\t\tif(!global.has3D){\n\t\t\t\thacks += _t + 'backface-visibility: hidden' + _e + _n;\n\t\t\t\thacks += _t + _w + 'backface-visibility: hidden' + _e + _n;\t\n\t\t\t\tglobal.has3D = false;\n\t\t\t}\n\t\t\thacks += _t + '-moz-osx-font-smoothing: grayscale' + _e + _n + _n;\t\n\t\t}\n\t\tif(l == '-1'){\n\t\t\tl = 'infinite';\n\t\t}\n\t\ts += '/* '+ global.command + ' */' + _n;\n\t\t//KEYFRAMES\n\t\tif(isTransition < 1){\n\t\t\t//keyframes\n\t\t\tvar fQty = global.frameQty;\n\t\t\tfor(var px=0; px < prefix.length; px++){\n\t\t\t\tif(fQty == 1){\n\t\t\t\t\tp = (p != '0%')?(p != 'class')?p:'to':'to';\n\t\t\t\t\tt += '@' + prefix[px] + _k + n + _s + _o + _n;\n\t\t\t\t\tt += _t + p + _s + _o + _n;\n\t\t\t\t\tfor(var k in prop){\n\t\t\t\t\t\tt += getKeyframeCSS(k,prop[k],prefix[px]);\n\t\t\t\t\t}\n\t\t\t\t\tt += _t + _x + _n;\n\t\t\t\t\tt += _x + _n;\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tt += '@' + prefix[px] + _k + n + _s + _o + _n;\n\t\t\t\t\tfor(var i = global.startFrom; i < fQty; i++){\n\t\t\t\t\t\tp = (fQty == 2)?(i == 0)?(frames[i].percent === '0%')?'from':frames[i].percent:(frames[i].percent === '100%')?'to':frames[i].percent:frames[i].percent;\n\t\t\t\t\t\tt += _t + p + _s + _o + _n;\n\t\t\t\t\t\tfor(var k in frames[i]){\n\t\t\t\t\t\t\tt += getKeyframeCSS(k,frames[i][k],prefix[px]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tt += _t + _x + _n;\t\n\t\t\t\t\t}\n\t\t\t\t\tt += _x + _n;\n\t\t\t\t}\n\t\t\t}\n\t\t\ts += t;\n\t\t\t//class\n\t\t\tfunction nChildName(i,direction){\n\t\t\t\tvar dir = direction || '>';\n\t\t\t\tvar map = {\n\t\t\t\t\t'>' :':nth-child',\n\t\t\t\t\t'<' :':nth-last-child',\n\t\t\t\t\t'>>':':nth-of-type',\n\t\t\t\t\t'<<':':nth-last-of-type'\n\t\t\t\t}\n\t\t\t\treturn map[dir] + '(' +(i + 1)+ ')';\n\t\t\t}\n\t\t\tvar states = _d + n + ':hover, ' + _d + n + ':focus, ' + _d + n + ':active ';\n\t\t\tif(isTransition === 0){\n\t\t\t\ts += _d + n + _s + _o + _n;\n\t\t\t\ts += hacks;\t\n\t\t\t}else if(isTransition === -1){\n\t\t\t\ts += _d + n + _s + _o + _n;\n\t\t\t\ts += hacks;\t\n\t\t\t\ts += _x + _n + _s;\n\t\t\t\ts += states + _o + _n;\n\t\t\t}else if(isTransition === -2){\n\t\t\t\ts += _d + n + _s + _o + _n;\n\t\t\t\ts += hacks;\n\t\t\t}\n\t\t\t//global properties within the class\n\t\t\tif(prop.percent == 'class'){\n\t\t\t\tt = '';\n\t\t\t\tfor(var k in prop){\n\t\t\t\t\tt += getSimpleCSS(k,prop[k],'',false);\n\t\t\t\t}\n\t\t\t\ts += t;\t\t\t\t\n\t\t\t}\n\t\t\t//animation code\n\t\t\tt = '';\n\t\t\tif(useShortHand){\n\t\t\t\t//name time ease delay\n\t\t\t\tt += 'animation: ' + n + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + ((dy == 0)?'':((nTimes == 1)?dy + dypx + _s : '' + _s)) + ((l == 1)?'':l + _s) + ((ad == 'normal')?'':ad + _s) + fm + ((isPlaying == 'running')? '' : ((isTransition === -2)?_s + 'paused':_s + isPlaying)) + _e + _n;\n\t\t\t\ts += _t + t;\n\t\t\t\ts += _t + _w + t;\t\t\t\t\n\t\t\t}else{\n\t\t\t\tfor(var px=0; px < prefix.length; px++){\n\t\t\t\t\tt += _t + prefix[px] +'animation-name: ' + n + _e + _n;\n\t\t\t\t\tt += _t + prefix[px] +'animation-duration: ' + d + dpx + _e + _n;\n\t\t\t\t\tt += _t + prefix[px] +'animation-timing-function: ' + (ceaser[e]?ceaser[e]:e) + _e + _n;\n\t\t\t\t\tt += (nTimes == 1)? _t + prefix[px] +'animation-delay: ' + dy + dypx + _e + _n : '';\n\t\t\t\t\tt += _t + prefix[px] +'animation-iteration-count: ' + l + _e + _n;\n\t\t\t\t\tt += _t + prefix[px] +'animation-direction: ' + ad + _e + _n;\n\t\t\t\t\tt += _t + prefix[px] +'animation-fill-mode: ' + fm + _e + _n;\n\t\t\t\t\tt += (isTransition === -2)? _t + prefix[px] +'animation-play-state: paused' + _e + _n : _t + prefix[px] +'animation-play-state: ' + isPlaying + _e + _n;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ts += t;\n\t\t\t}\n\t\t\ts += _x + _n;\n\t\t\t//:nth-child\n\t\t\tfor(var nCounter = 0; nCounter < nTimes; ++nCounter){\n\t\t\t\tif(isTransition === 0 && nTimes > 1){\n\t\t\t\t\ts += _d + ((nTimes > 1)?n+nChildName(nCounter,nDirection):n) + _s + _o + _n;\n\t\t\t\t\tfor(var px=0; px < prefix.length; px++){\n\t\t\t\t\t\ts += _t + prefix[px] +'animation-delay: ' + (dy * nCounter) + dypx + _e + _n;\n\t\t\t\t\t}\n\t\t\t\t\ts += _x + _n;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//:hover :focus :active\n\t\t\tif(isTransition === -2){\n\t\t\t\ts += states + _o + _n;\n\t\t\t\ts += _t +'animation-play-state: running' + _e + _n;\n\t\t\t\ts += _t + _w + 'animation-play-state: running' + _e + _n;\n\t\t\t\ts += _x + _n;\n\t\t\t}\n\t\t}else{\n\t\t\t//TRANSITION\n\t\t\ts += _d + n + _s + _o + _n;\n\t\t\ts += hacks;\n\t\t\tt += 'transition:'\n\t\t\tif(!useAll){\n\t\t\t\tfor(var k in prop){\n\t\t\t\t\tif(isCSS(k)){\n\t\t\t\t\t\tt += _s + (k).replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() + _s + d + dpx + _s + ceaser[e] + _s + dy + dypx + ',';\n\t\t\t\t\t}else if(k === 'transform'){\n\t\t\t\t\t\tt += _s + 'transform ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t\tt += _s + _w +'transform ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t}else if(k === 'transformOrigin'){\n\t\t\t\t\t\tt += _s + 'transform-origin ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t\tt += _s + _w +'transform-origin ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t}else if(k === 'backfaceVisibility'){\n\t\t\t\t\t\tt += _s + 'backface-visibility ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t\tt += _s + _w +'backface-visibility ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t}else if(k === 'filter'){\n\t\t\t\t\t\t//t += _s + 'filter ' + _s + d + dpx + _s + ceaser[e] + _s + dy + dypx + ',';\n\t\t\t\t\t\tt += _s + _w +'filter ' + _s + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}else {\n\t\t\t\tt += ' all ' + d + dpx + _s + (ceaser[e]?ceaser[e]:e) + _s + dy + dypx + ',';\n\t\t\t}\n\t\t\tt = t.replace(/,\\s*$/, _e);\n\t\t\tt += _n;\n\t\t\ts += _t + t;\n\t\t\ts += _t + _w + t;\n\t\t\ts += _x + _n;\n\t\t\t//hover\n\t\t\tvar states = _d + n + ':hover, ' + _d + n + ':focus, ' + _d + n + ':active ';\n\t\t\ts += states + _o + _n;\n\t\t\tt = '';\n\t\t\tfor(var k in prop){\n\t\t\t\tt += getSimpleCSS(k,prop[k]);\n\t\t\t}\n\t\t\ts += t;\n\t\t\ts += _x + _n;\n\t\t}\n\t\tglobal.code = s;\n\t\treturn s;\n\t}", "function transformWithTransition(element, transition) {\n // transition's properties:\n // - duration: Number representing the duration of the animation in milliseconds.\n // - timing: String representing the CSS timing function that controls the progress of the animation.\n // - to: The value of *element*'s transform property after the animation.\n var duration = transition.duration * _TransitionAnimation._animationFactor;\n var transitionProperty = _BaseUtils._browserStyleEquivalents[\"transition\"].scriptName;\n element.style[transitionProperty] = duration + \"ms \" + transformNames.cssName + \" \" + transition.timing;\n element.style[transformNames.scriptName] = transition.to;\n\n var finish;\n return new Promise(function (c) {\n var onTransitionEnd = function (eventObject) {\n if (eventObject.target === element && eventObject.propertyName === transformNames.cssName) {\n finish();\n }\n };\n\n var didFinish = false;\n finish = function () {\n if (!didFinish) {\n _Global.clearTimeout(timeoutId);\n element.removeEventListener(_BaseUtils._browserEventEquivalents[\"transitionEnd\"], onTransitionEnd);\n element.style[transitionProperty] = \"\";\n didFinish = true;\n }\n c();\n };\n\n // Watch dog timeout\n var timeoutId = _Global.setTimeout(function () {\n timeoutId = _Global.setTimeout(finish, duration);\n }, 50);\n\n element.addEventListener(_BaseUtils._browserEventEquivalents[\"transitionEnd\"], onTransitionEnd);\n }, function () {\n finish(); // On cancelation, complete the promise successfully to match PVL\n });\n }", "function applyCssTransform(element, transformValue) {\n // It's important to trim the result, because the browser will ignore the set operation\n // if the string contains only whitespace.\n var value = transformValue.trim();\n element.style.transform = value;\n element.style.webkitTransform = value;\n}", "function easeOutBack (t, b, c, d, s)\n {\n if (!s) \n {\n s = 1.70158;\n }\n return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n }", "_calcTransform() {\n return 'translate(' + this._margin.left + ',' + this._margin.top + ')';\n }", "function this_delay(){\n $Elem.css('-webkit-transition','height .25s, border 0s linear .21s, padding .15s');\n $Elem.css('-moz-transition','height .25s, border 0s linear .21s, padding .15s');\n $Elem.css('-o-transition','height .25s, border 0s linear .21s, padding .15s');\n $Elem.css('transition','height .25s, border 0s linear .21s, padding .15s');\n }", "function fixTransforms(props, el) {\n // clone props at this state\n var propsCopy = {};\n for (var k in props) {\n propsCopy[k] = props[k];\n }\n\n var propVal;\n for (var p in props) {\n propVal = props[p];\n\n // if not a transform: translate, just move on\n if (p != 'transform' || !isTranslate(propVal)) {\n continue;\n }\n\n var x = null;\n var y = null;\n var xy = null;\n var xyz = null;\n\n propVal = propVal.substr(0, propVal.indexOf(')') + 1);\n\n if (startsWith(propVal, 'translateX(')) {\n x = propVal.match(/translateX\\((.*)\\)/)[1].trim();\n } else if (startsWith(propVal, 'translateY(')) {\n y = propVal.match(/translateY\\((.*)\\)/)[1].trim();\n } else if (startsWith(propVal, 'translate(')) {\n xy = propVal.match(/translate\\((.*)\\)/)[1].replace(' ', '').split(',');\n x = xy[0];\n y = xy[1];\n } else { // translate3d( --> X,Y,Z\n xyz = propVal.match(/translate3d\\((.*)\\)/)[1].replace(' ', '').split(',');\n x = xyz[0];\n y = xyz[1];\n }\n\n if (x) {\n var xVal = parseInt(x);\n var xUnits = x.replace(xVal.toString(), '');\n\n if (props.left && props.right && props.left != 'auto' && props.right != 'auto') {\n continue;\n }\n\n if (props.left && props.left != 'auto') {\n var left = props.left.trim();\n var leftVal = parseInt(left);\n var leftUnits = left.replace(leftVal.toString(), '');\n\n if (leftVal == 0|| isNaN(leftVal) || xUnits != leftUnits) {\n continue;\n }\n\n if (xUnits == 'px') {\n propsCopy.left = leftVal + xVal + 'px';\n } else if (xUnits == '%') {\n propsCopy.left = computeNewPctPos(el, 'left', leftVal, xVal);\n }\n } else if (props.right && props.right != 'auto') {\n var right = props.right.trim();\n var rightVal = parseInt(right);\n var rightUnits = right.replace(rightVal.toString(), '');\n\n if (rightVal == 0|| isNaN(rightVal) || xUnits != rightUnits) {\n continue;\n }\n\n xVal = -1 * xVal; // swap around signs\n\n if (xUnits == 'px') {\n propsCopy.right = rightVal + xVal + 'px';\n } else if (xUnits == '%') {\n propsCopy.right = computeNewPctPos(el, 'right', rightVal, xVal);\n }\n } else {\n propsCopy.left = x;\n }\n }\n\n if (y) {\n var yVal = parseInt(y);\n var yUnits = y.replace(yVal.toString(), '');\n\n if (props.top && props.bottom && props.top != 'auto' && props.bottom != 'auto') {\n continue;\n }\n\n if (props.top) {\n var top = props.top.trim();\n var topVal = parseInt(top);\n var topUnits = top.replace(topVal.toString(), '');\n\n if (topVal == 0|| isNaN(topVal) || yUnits != topUnits) {\n continue;\n }\n\n if (yUnits == 'px') {\n propsCopy.top = topVal + yVal + 'px';\n } else if (yUnits == '%') {\n propsCopy.top = computeNewPctPos(el, 'top', topVal, yVal);\n }\n } else if (props.bottom) {\n var bottom = props.bottom.trim();\n var bottomVal = parseInt(bottom);\n var bottomUnits = bottom.replace(bottomVal.toString(), '');\n\n if (bottomVal == 0|| isNaN(bottomVal) || yUnits != bottomUnits) {\n continue;\n }\n\n yVal = -1 * yVal; // swap around signs\n\n if (yUnits == 'px') {\n propsCopy.bottom = bottomVal + yVal + 'px';\n } else if (yUnits == '%') {\n propsCopy.bottom = computeNewPctPos(el, 'bottom', bottomVal, yVal);\n }\n } else {\n propsCopy.top = y;\n }\n }\n\n if (['relative', 'absolute', 'fixed'].indexOf(props['position']) == -1) {\n propsCopy.position = 'relative';\n }\n\n if (x || y) {\n continue;\n }\n }\n\n return propsCopy;\n}", "function supportsTransitions() {\n\t\tvar b = document.body || document.documentElement,\n\t\t\ts = b.style,\n\t\t\tp = 'transition',\n\t\t\tv = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'];\n\t\t\n\t\tif (typeof s[p] == 'string') { return true; }\n\t\t\n\t\tp = p.charAt(0).toUpperCase() + p.substr(1);\n\t\tfor (var i=0; i<v.length; i++) {\n\t\t\tif (typeof s[v[i] + p] == 'string') { return true; }\n\t\t}\n\t\treturn false;\n\t}", "function getTransform(el) {\n // @ts-ignore\n var transform = window.getComputedStyle(el)[transformProperty];\n if (!transform || transform === 'none') {\n transform = 'matrix(1, 0, 0, 1, 0, 0)';\n }\n return transform.replace(/\\(|\\)|matrix|\\s+/g, '').split(',');\n}", "function captionTransition(caption, duration) { // 3264\n if (caption.hasClass(\"center-align\")) { // 3265\n caption.velocity({opacity: 0, translateY: -100}, {duration: duration, queue: false}); // 3266\n } // 3267\n else if (caption.hasClass(\"right-align\")) { // 3268\n caption.velocity({opacity: 0, translateX: 100}, {duration: duration, queue: false}); // 3269\n } // 3270\n else if (caption.hasClass(\"left-align\")) { // 3271\n caption.velocity({opacity: 0, translateX: -100}, {duration: duration, queue: false}); // 3272\n } // 3273\n } // 3274", "function Transformation(mm,e) {\n\tvar\n\t\tself=this,\n\t\tT=mm?(mm.M?mm:new Matrix(mm)):new Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]),\n\t\tparent=e;\n\t\t\n\tjQuery.extend(self,{\n\t\t\n\t\trotateX: function(angle) {\n\t\t\tvar c = Math.cos(self.angle2rad(angle));\n\t\t\tvar s = Math.sin(self.angle2rad(angle));\n\t\t\t\n\t\t\tT=T.mult([[1, 0, 0, 0],[0, c, -s, 0],[0, s, c, 0],[0, 0, 0, 1]]);\n\t\t\t\n\t\t\treturn self;\n\t\t},\n\t\t\n\t\trotateY: function(angle) {\n\t\t\tvar c = Math.cos(self.angle2rad(angle));\n\t\t\tvar s = Math.sin(self.angle2rad(angle));\n\t\t\t\n\t\t\tT=T.mult([[c, 0, s, 0],[0, 1, 0, 0],[-s, 0, c, 0],[0, 0, 0, 1]]);\n\t\t\t\n\t\t\treturn self;\n\t\t},\n\t\t\n\t\trotateZ: function(angle) {\n\t\t\tvar c = Math.cos(self.angle2rad(angle));\n\t\t\tvar s = Math.sin(self.angle2rad(angle));\n\t\t\t\n\t\t\tT=T.mult([[c, -s, 0, 0],[s, c, 0, 0],[0, 0, 1, 0],[0, 0, 0, 1]]);\n\t\t\t\n\t\t\treturn self;\n\t\t},\n\t\t\n\t\tscale: function(sx,sy,sz) {\n\t\t\tT=T.mult([[sx, 0, 0, 0],[0, sy, 0, 0],[0, 0, sz, 0],[0, 0, 0, 1]]);\n\t\t\treturn self;\n\t\t},\n\t\t\n\t\ttranslate: function(tx,ty,tz) {\n\t\t\tT=T.mult([[1, 0, 0, tx],[0, 1, 0, ty],[0, 0, 1, tz],[0, 0, 0, 1]]);\n\t\t\treturn self;\n\t\t},\n\t\t\n\t\tangle2rad: function(angle) {\n\t\t\tangle=String(angle).toLowerCase();\n\t\t\tif (String(angle).indexOf(\"deg\")!=-1)\n\t\t\t\tangle=angle.substr(0,angle.length-3)*Math.PI/180;\n\t\t\telse if (String(angle).indexOf(\"grad\")!=-1)\n\t\t\t\tangle=angle.substr(0,angle.length-4)*Math.PI/200;\n\t\t\telse if (String(angle).indexOf(\"rad\")!=-1)\n\t\t\t\tangle=angle.substr(0,angle.length-3)*1.0;\n\t\t\treturn angle*1.0;\n\t\t},\n\t\t\n\t\tset: function(mm,e) {\n\t\t\tT=mm?(mm.M?mm:new Matrix(mm)):new Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);\n\t\t\tif (e) parent=e;\n\t\t},\n\t\t\n\t\t'T':function(){return T},\n\t\tobject:function(){return parent;}\n\t});\n}", "function StyleTransformCur() {\n /**\n * SETUP CURRENT VALUE EACH TRANSFORM PROPERTIES\n */\n var optsCur = myData['opts'][an.optsPos], tfBegin = optsCur.tfBegin, tfEnd = optsCur.tfEnd, tfCur = {};\n for (var name in tfEnd) {\n // Setup value 'plus' of each properties\n var tfBeginCur = TF.ConvertValueToPX($anim, name, tfBegin[name]), tfEndCur = TF.ConvertValueToPX($anim, name, tfEnd[name]), valuePlus = (tfEndCur - tfBeginCur) * an.xCur, valueCur = tfBeginCur + valuePlus;\n // Value of current property\n tfCur[name] = valueCur;\n }\n /**\n * CONVERT PARTICULAR PROPERTY OF TRANSFORM TO CSS\n */\n var cssTf = TF.ToCss(tfCur, optsCur);\n /**\n * STORE CURRENT TRANSFORM CSS\n */\n var nameTf = VA.prefix + 'transform';\n styleCur[nameTf] = cssTf;\n // Store current Transform into system\n myData.tfCur = tfCur;\n }", "transitionToRemap() {\n if (this.tick <= 50) {\n this.tutorial.alpha -= 0.02;\n this.fireToContinue.alpha -= 0.02;\n }\n else if (this.tick <= 100) {\n this.remapHeaderText.alpha += 0.02;\n this.remapKB.alpha += 0.02;\n this.remapButtonText.alpha += 0.02;\n }\n else {\n this.state = 4;\n this.tick = 0;\n this.remapPressText.alpha = 1;\n }\n }", "apply() {\n this.scene.multMatrix(this.animTransform);\n }", "function getTransition(properties, duration, easing, type){\n\t\tvar ob = parse(properties);\n\t\tob[0].isTransition = type || 1;\n\t\tob[0].useAll = true;\n\t\treturn getCSS(ob, duration, easing);\n\t}", "updateTransform() {\n this.transform = Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"toSVG\"])(Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"smoothMatrix\"])(this.transformationMatrix, 100));\n }", "function addAnimation(element) {\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\n removeClass(element, NO_TRANSITION);\n return css(element, {\n '-webkit-transition': transition,\n 'transition': transition\n });\n }", "function AnimateDomUtils($mdUtil,$q,$timeout,$mdConstant,$animateCss){var self;return self={/**\n\t *\n\t */translate3d:function translate3d(target,from,to,options){return $animateCss(target,{from:from,to:to,addClass:options.transitionInClass,removeClass:options.transitionOutClass}).start().then(function(){// Resolve with reverser function...\n\treturn reverseTranslate;});/**\n\t * Specific reversal of the request translate animation above...\n\t */function reverseTranslate(newFrom){return $animateCss(target,{to:newFrom||from,addClass:options.transitionOutClass,removeClass:options.transitionInClass}).start();}},/**\n\t * Listen for transitionEnd event (with optional timeout)\n\t * Announce completion or failure via promise handlers\n\t */waitTransitionEnd:function waitTransitionEnd(element,opts){var TIMEOUT=3000;// fallback is 3 secs\n\treturn $q(function(resolve,reject){opts=opts||{};// If there is no transition is found, resolve immediately\n\t//\n\t// NOTE: using $mdUtil.nextTick() causes delays/issues\n\tif(noTransitionFound(opts.cachedTransitionStyles)){TIMEOUT=0;}var timer=$timeout(finished,opts.timeout||TIMEOUT);element.on($mdConstant.CSS.TRANSITIONEND,finished);/**\n\t * Upon timeout or transitionEnd, reject or resolve (respectively) this promise.\n\t * NOTE: Make sure this transitionEnd didn't bubble up from a child\n\t */function finished(ev){if(ev&&ev.target!==element[0])return;if(ev)$timeout.cancel(timer);element.off($mdConstant.CSS.TRANSITIONEND,finished);// Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n\tresolve();}/**\n\t * Checks whether or not there is a transition.\n\t *\n\t * @param styles The cached styles to use for the calculation. If null, getComputedStyle()\n\t * will be used.\n\t *\n\t * @returns {boolean} True if there is no transition/duration; false otherwise.\n\t */function noTransitionFound(styles){styles=styles||window.getComputedStyle(element[0]);return styles.transitionDuration=='0s'||!styles.transition&&!styles.transitionProperty;}});},calculateTransformValues:function calculateTransformValues(element,originator){var origin=originator.element;var bounds=originator.bounds;if(origin||bounds){var originBnds=origin?self.clientRect(origin)||currentBounds():self.copyRect(bounds);var dialogRect=self.copyRect(element[0].getBoundingClientRect());var dialogCenterPt=self.centerPointFor(dialogRect);var originCenterPt=self.centerPointFor(originBnds);return{centerX:originCenterPt.x-dialogCenterPt.x,centerY:originCenterPt.y-dialogCenterPt.y,scaleX:Math.round(100*Math.min(0.5,originBnds.width/dialogRect.width))/100,scaleY:Math.round(100*Math.min(0.5,originBnds.height/dialogRect.height))/100};}return{centerX:0,centerY:0,scaleX:0.5,scaleY:0.5};/**\n\t * This is a fallback if the origin information is no longer valid, then the\n\t * origin bounds simply becomes the current bounds for the dialogContainer's parent\n\t */function currentBounds(){var cntr=element?element.parent():null;var parent=cntr?cntr.parent():null;return parent?self.clientRect(parent):null;}},/**\n\t * Calculate the zoom transform from dialog to origin.\n\t *\n\t * We use this to set the dialog position immediately;\n\t * then the md-transition-in actually translates back to\n\t * `translate3d(0,0,0) scale(1.0)`...\n\t *\n\t * NOTE: all values are rounded to the nearest integer\n\t */calculateZoomToOrigin:function calculateZoomToOrigin(element,originator){var zoomTemplate=\"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )\";var buildZoom=angular.bind(null,$mdUtil.supplant,zoomTemplate);return buildZoom(self.calculateTransformValues(element,originator));},/**\n\t * Calculate the slide transform from panel to origin.\n\t * NOTE: all values are rounded to the nearest integer\n\t */calculateSlideToOrigin:function calculateSlideToOrigin(element,originator){var slideTemplate=\"translate3d( {centerX}px, {centerY}px, 0 )\";var buildSlide=angular.bind(null,$mdUtil.supplant,slideTemplate);return buildSlide(self.calculateTransformValues(element,originator));},/**\n\t * Enhance raw values to represent valid css stylings...\n\t */toCss:function toCss(raw){var css={};var lookups='left top right bottom width height x y min-width min-height max-width max-height';angular.forEach(raw,function(value,key){if(angular.isUndefined(value))return;if(lookups.indexOf(key)>=0){css[key]=value+'px';}else{switch(key){case'transition':convertToVendor(key,$mdConstant.CSS.TRANSITION,value);break;case'transform':convertToVendor(key,$mdConstant.CSS.TRANSFORM,value);break;case'transformOrigin':convertToVendor(key,$mdConstant.CSS.TRANSFORM_ORIGIN,value);break;case'font-size':css['font-size']=value;// font sizes aren't always in px\n\tbreak;}}});return css;function convertToVendor(key,vendor,value){angular.forEach(vendor.split(' '),function(key){css[key]=value;});}},/**\n\t * Convert the translate CSS value to key/value pair(s).\n\t */toTransformCss:function toTransformCss(transform,addTransition,transition){var css={};angular.forEach($mdConstant.CSS.TRANSFORM.split(' '),function(key){css[key]=transform;});if(addTransition){transition=transition||\"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important\";css.transition=transition;}return css;},/**\n\t * Clone the Rect and calculate the height/width if needed\n\t */copyRect:function copyRect(source,destination){if(!source)return null;destination=destination||{};angular.forEach('left top right bottom width height'.split(' '),function(key){destination[key]=Math.round(source[key]);});destination.width=destination.width||destination.right-destination.left;destination.height=destination.height||destination.bottom-destination.top;return destination;},/**\n\t * Calculate ClientRect of element; return null if hidden or zero size\n\t */clientRect:function clientRect(element){var bounds=angular.element(element)[0].getBoundingClientRect();var isPositiveSizeClientRect=function isPositiveSizeClientRect(rect){return rect&&rect.width>0&&rect.height>0;};// If the event origin element has zero size, it has probably been hidden.\n\treturn isPositiveSizeClientRect(bounds)?self.copyRect(bounds):null;},/**\n\t * Calculate 'rounded' center point of Rect\n\t */centerPointFor:function centerPointFor(targetRect){return targetRect?{x:Math.round(targetRect.left+targetRect.width/2),y:Math.round(targetRect.top+targetRect.height/2)}:{x:0,y:0};}};}", "function ws_book(p,n,b){var f=jQuery;var m=f(this);var i=f(\".ws_list\",b);var k=f(\"<div>\").addClass(\"ws_effect ws_book\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"}).appendTo(b),e=p.duration,d=p.perspective||0.4,g=p.shadow||0.35,a=p.noCanvas||false,l=p.no3d||false;var o={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(r){var q=this.domPrefixes.length;while(q--){if(typeof document.body.style[this.domPrefixes[q]+r]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){var r=(typeof document.body.style.perspectiveProperty!==\"undefined\")||this.testDom(\"Perspective\");if(r&&/AppleWebKit/.test(navigator.userAgent)){var t=document.createElement(\"div\"),q=document.createElement(\"style\"),s=\"Test3d\"+Math.round(Math.random()*99999);q.textContent=\"@media (-webkit-transform-3d){#\"+s+\"{height:3px}}\";document.getElementsByTagName(\"head\")[0].appendChild(q);t.id=s;document.body.appendChild(t);r=t.offsetHeight===3;q.parentNode.removeChild(q);t.parentNode.removeChild(t)}return r},canvas:function(){if(typeof document.createElement(\"canvas\").getContext!==\"undefined\"){return true}}};if(!l){l=o.cssTransitions()&&o.cssTransforms3d()}if(!a){a=o.canvas()}var j;this.go=function(r,q,E){if(j){return -1}var v=n.get(r),G=n.get(q);if(E==undefined){E=(q==0&&r!=q+1)||(r==q-1)}else{E=!E}var s=f(\"<div>\").appendTo(k);var t=f(v);t={width:t.width(),height:t.height(),marginLeft:parseFloat(t.css(\"marginLeft\")),marginTop:parseFloat(t.css(\"marginTop\"))};if(l){var y={background:\"#000\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};perspect=b.width()*(3-d*2);s.css(y).css({perspective:perspect,transform:\"translate3d(0,0,0)\"});var z=90;var D=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t)).appendTo(s);var C=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t).css({marginLeft:-t.width/2})).appendTo(s);var I=f(\"<div>\").css(y).css({display:E?\"block\":\"none\",width:\"50%\",transform:\"rotateY(\"+(E?0.1:z)+\"deg)\",transition:(E?\"ease-in \":\"ease-out \")+e/2000+\"s\",transformOrigin:\"right\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t)).appendTo(s);var F=f(\"<div>\").css(y).css({display:E?\"none\":\"block\",left:\"50%\",width:\"50%\",transform:\"rotateY(-\"+(E?z:0.1)+\"deg)\",transition:(E?\"ease-out \":\"ease-in \")+e/2000+\"s\",transformOrigin:\"left\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t).css({marginLeft:-t.width/2})).appendTo(s)}else{if(a){var x=f(\"<div>\").css({position:\"absolute\",top:0,left:E?0:\"50%\",width:\"50%\",height:\"100%\",overflow:\"hidden\",zIndex:6}).append(f(n.get(r)).clone().css({position:\"absolute\",height:\"100%\",right:E?\"auto\":0,left:E?0:\"auto\"})).appendTo(s).hide();var B=f(\"<div>\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,zIndex:8}).appendTo(s).hide();var H=f(\"<canvas>\").css({position:\"absolute\",zIndex:2,left:0,top:-B.height()*d/2}).attr({width:B.width(),height:B.height()*(d+1)}).appendTo(B);var A=H.clone().css({top:0,zIndex:1}).attr({width:B.width(),height:B.height()}).appendTo(B);var w=H.get(0).getContext(\"2d\");var u=A.get(0).getContext(\"2d\")}else{i.stop(true).animate({left:(r?-r+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},e,\"easeInOutExpo\")}}if(!l&&a){var D=w;var C=u;var I=G;var F=v}j=new h(E,z,D,C,I,F,B,H,A,x,t,function(){m.trigger(\"effectEnd\");s.remove();j=0})};function c(G,s,A,v,u,E,D,C,B,t,r){numSlices=u/2,widthScale=u/B,heightScale=(1-E)/numSlices;G.clearRect(0,0,r.width(),r.height());for(var q=0;q<numSlices+widthScale;q++){var z=(D?q*p.width/u+p.width/2:(numSlices-q)*p.width/u);var H=A+(D?2:-2)*q,F=v+t*heightScale*q/2;if(z<0){z=0}if(H<0){H=0}if(F<0){F=0}G.drawImage(s,z,0,2.5,p.height,H,F,2,t*(1-(heightScale*q)))}G.save();G.beginPath();G.moveTo(A,v);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),t*(1-heightScale*(numSlices+widthScale))+v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A,v+t);G.closePath();G.clip();G.fillStyle=\"rgba(0,0,0,\"+Math.round(C*100)/100+\")\";G.fillRect(0,0,r.width(),r.height());G.restore()}function h(A,r,C,B,y,x,v,w,u,z,t,E){if(l){if(!A){r*=-1;var D=B;B=C;C=D;D=x;x=y;y=D}setTimeout(function(){C.children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);y.css(\"transform\",\"rotateY(\"+r+\"deg)\").children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2,function(){y.hide();x.show().css(\"transform\",\"rotateX(0deg) rotateY(0deg)\").children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);B.children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2)})},0);setTimeout(E,e)}else{if(a){v.show();var q=new Date;var s=true;wowAnimate(function(F){var I=jQuery.easing.easeInOutQuint(1,F,0,1,1),H=jQuery.easing.easeInOutCubic(1,F,0,1,1),L=!A;if(F<0.5){I*=2;H*=2;var G=y}else{L=A;I=(1-I)*2;H=(1-H)*2;var G=x}var J=v.height()*d/2,N=(1-I)*v.width()/2,M=1+H*d,K=v.width()/2;c(C,G,K,J,N,M,L,H*g,K,v.height(),w);if(s){z.show();s=false}B.clearRect(0,0,u.width(),u.height());B.fillStyle=\"rgba(0,0,0,\"+(g-H*g)+\")\";B.fillRect(L?K:0,0,u.width()/2,u.height())},0,1,e,E)}}}}", "function ws_book(p,n,b){var f=jQuery;var m=f(this);var i=f(\".ws_list\",b);var k=f(\"<div>\").addClass(\"ws_effect ws_book\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"}).appendTo(b),e=p.duration,d=p.perspective||0.4,g=p.shadow||0.35,a=p.noCanvas||false,l=p.no3d||false;var o={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(r){var q=this.domPrefixes.length;while(q--){if(typeof document.body.style[this.domPrefixes[q]+r]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){var r=(typeof document.body.style.perspectiveProperty!==\"undefined\")||this.testDom(\"Perspective\");if(r&&/AppleWebKit/.test(navigator.userAgent)){var t=document.createElement(\"div\"),q=document.createElement(\"style\"),s=\"Test3d\"+Math.round(Math.random()*99999);q.textContent=\"@media (-webkit-transform-3d){#\"+s+\"{height:3px}}\";document.getElementsByTagName(\"head\")[0].appendChild(q);t.id=s;document.body.appendChild(t);r=t.offsetHeight===3;q.parentNode.removeChild(q);t.parentNode.removeChild(t)}return r},canvas:function(){if(typeof document.createElement(\"canvas\").getContext!==\"undefined\"){return true}}};if(!l){l=o.cssTransitions()&&o.cssTransforms3d()}if(!a){a=o.canvas()}var j;this.go=function(r,q,E){if(j){return -1}var v=n.get(r),G=n.get(q);if(E==undefined){E=(q==0&&r!=q+1)||(r==q-1)}else{E=!E}var s=f(\"<div>\").appendTo(k);var t=f(v);t={width:t.width(),height:t.height(),marginLeft:parseFloat(t.css(\"marginLeft\")),marginTop:parseFloat(t.css(\"marginTop\"))};if(l){var y={background:\"#000\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};perspect=b.width()*(3-d*2);s.css(y).css({perspective:perspect,transform:\"translate3d(0,0,0)\"});var z=90;var D=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t)).appendTo(s);var C=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t).css({marginLeft:-t.width/2})).appendTo(s);var I=f(\"<div>\").css(y).css({display:E?\"block\":\"none\",width:\"50%\",transform:\"rotateY(\"+(E?0.1:z)+\"deg)\",transition:(E?\"ease-in \":\"ease-out \")+e/2000+\"s\",transformOrigin:\"right\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t)).appendTo(s);var F=f(\"<div>\").css(y).css({display:E?\"none\":\"block\",left:\"50%\",width:\"50%\",transform:\"rotateY(-\"+(E?z:0.1)+\"deg)\",transition:(E?\"ease-out \":\"ease-in \")+e/2000+\"s\",transformOrigin:\"left\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t).css({marginLeft:-t.width/2})).appendTo(s)}else{if(a){var x=f(\"<div>\").css({position:\"absolute\",top:0,left:E?0:\"50%\",width:\"50%\",height:\"100%\",overflow:\"hidden\",zIndex:6}).append(f(n.get(r)).clone().css({position:\"absolute\",height:\"100%\",right:E?\"auto\":0,left:E?0:\"auto\"})).appendTo(s).hide();var B=f(\"<div>\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,zIndex:8}).appendTo(s).hide();var H=f(\"<canvas>\").css({position:\"absolute\",zIndex:2,left:0,top:-B.height()*d/2}).attr({width:B.width(),height:B.height()*(d+1)}).appendTo(B);var A=H.clone().css({top:0,zIndex:1}).attr({width:B.width(),height:B.height()}).appendTo(B);var w=H.get(0).getContext(\"2d\");var u=A.get(0).getContext(\"2d\")}else{i.stop(true).animate({left:(r?-r+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},e,\"easeInOutExpo\")}}if(!l&&a){var D=w;var C=u;var I=G;var F=v}j=new h(E,z,D,C,I,F,B,H,A,x,t,function(){m.trigger(\"effectEnd\");s.remove();j=0})};function c(G,s,A,v,u,E,D,C,B,t,r){numSlices=u/2,widthScale=u/B,heightScale=(1-E)/numSlices;G.clearRect(0,0,r.width(),r.height());for(var q=0;q<numSlices+widthScale;q++){var z=(D?q*p.width/u+p.width/2:(numSlices-q)*p.width/u);var H=A+(D?2:-2)*q,F=v+t*heightScale*q/2;if(z<0){z=0}if(H<0){H=0}if(F<0){F=0}G.drawImage(s,z,0,2.5,p.height,H,F,2,t*(1-(heightScale*q)))}G.save();G.beginPath();G.moveTo(A,v);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),t*(1-heightScale*(numSlices+widthScale))+v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A,v+t);G.closePath();G.clip();G.fillStyle=\"rgba(0,0,0,\"+Math.round(C*100)/100+\")\";G.fillRect(0,0,r.width(),r.height());G.restore()}function h(A,r,C,B,y,x,v,w,u,z,t,E){if(l){if(!A){r*=-1;var D=B;B=C;C=D;D=x;x=y;y=D}setTimeout(function(){C.children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);y.css(\"transform\",\"rotateY(\"+r+\"deg)\").children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2,function(){y.hide();x.show().css(\"transform\",\"rotateX(0deg) rotateY(0deg)\").children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);B.children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2)})},0);setTimeout(E,e)}else{if(a){v.show();var q=new Date;var s=true;wowAnimate(function(F){var I=jQuery.easing.easeInOutQuint(1,F,0,1,1),H=jQuery.easing.easeInOutCubic(1,F,0,1,1),L=!A;if(F<0.5){I*=2;H*=2;var G=y}else{L=A;I=(1-I)*2;H=(1-H)*2;var G=x}var J=v.height()*d/2,N=(1-I)*v.width()/2,M=1+H*d,K=v.width()/2;c(C,G,K,J,N,M,L,H*g,K,v.height(),w);if(s){z.show();s=false}B.clearRect(0,0,u.width(),u.height());B.fillStyle=\"rgba(0,0,0,\"+(g-H*g)+\")\";B.fillRect(L?K:0,0,u.width()/2,u.height())},0,1,e,E)}}}}", "function ws_book(p,n,b){var f=jQuery;var m=f(this);var i=f(\".ws_list\",b);var k=f(\"<div>\").addClass(\"ws_effect ws_book\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"}).appendTo(b),e=p.duration,d=p.perspective||0.4,g=p.shadow||0.35,a=p.noCanvas||false,l=p.no3d||false;var o={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(r){var q=this.domPrefixes.length;while(q--){if(typeof document.body.style[this.domPrefixes[q]+r]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){var r=(typeof document.body.style.perspectiveProperty!==\"undefined\")||this.testDom(\"Perspective\");if(r&&/AppleWebKit/.test(navigator.userAgent)){var t=document.createElement(\"div\"),q=document.createElement(\"style\"),s=\"Test3d\"+Math.round(Math.random()*99999);q.textContent=\"@media (-webkit-transform-3d){#\"+s+\"{height:3px}}\";document.getElementsByTagName(\"head\")[0].appendChild(q);t.id=s;document.body.appendChild(t);r=t.offsetHeight===3;q.parentNode.removeChild(q);t.parentNode.removeChild(t)}return r},canvas:function(){if(typeof document.createElement(\"canvas\").getContext!==\"undefined\"){return true}}};if(!l){l=o.cssTransitions()&&o.cssTransforms3d()}if(!a){a=o.canvas()}var j;this.go=function(r,q,E){if(j){return -1}var v=n.get(r),G=n.get(q);if(E==undefined){E=(q==0&&r!=q+1)||(r==q-1)}else{E=!E}var s=f(\"<div>\").appendTo(k);var t=f(v);t={width:t.width(),height:t.height(),marginLeft:parseFloat(t.css(\"marginLeft\")),marginTop:parseFloat(t.css(\"marginTop\"))};if(l){var y={background:\"#000\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};perspect=b.width()*(3-d*2);s.css(y).css({perspective:perspect,transform:\"translate3d(0,0,0)\"});var z=90;var D=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t)).appendTo(s);var C=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t).css({marginLeft:-t.width/2})).appendTo(s);var I=f(\"<div>\").css(y).css({display:E?\"block\":\"none\",width:\"50%\",transform:\"rotateY(\"+(E?0.1:z)+\"deg)\",transition:(E?\"ease-in \":\"ease-out \")+e/2000+\"s\",transformOrigin:\"right\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t)).appendTo(s);var F=f(\"<div>\").css(y).css({display:E?\"none\":\"block\",left:\"50%\",width:\"50%\",transform:\"rotateY(-\"+(E?z:0.1)+\"deg)\",transition:(E?\"ease-out \":\"ease-in \")+e/2000+\"s\",transformOrigin:\"left\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t).css({marginLeft:-t.width/2})).appendTo(s)}else{if(a){var x=f(\"<div>\").css({position:\"absolute\",top:0,left:E?0:\"50%\",width:\"50%\",height:\"100%\",overflow:\"hidden\",zIndex:6}).append(f(n.get(r)).clone().css({position:\"absolute\",height:\"100%\",right:E?\"auto\":0,left:E?0:\"auto\"})).appendTo(s).hide();var B=f(\"<div>\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,zIndex:8}).appendTo(s).hide();var H=f(\"<canvas>\").css({position:\"absolute\",zIndex:2,left:0,top:-B.height()*d/2}).attr({width:B.width(),height:B.height()*(d+1)}).appendTo(B);var A=H.clone().css({top:0,zIndex:1}).attr({width:B.width(),height:B.height()}).appendTo(B);var w=H.get(0).getContext(\"2d\");var u=A.get(0).getContext(\"2d\")}else{i.stop(true).animate({left:(r?-r+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},e,\"easeInOutExpo\")}}if(!l&&a){var D=w;var C=u;var I=G;var F=v}j=new h(E,z,D,C,I,F,B,H,A,x,t,function(){m.trigger(\"effectEnd\");s.remove();j=0})};function c(G,s,A,v,u,E,D,C,B,t,r){numSlices=u/2,widthScale=u/B,heightScale=(1-E)/numSlices;G.clearRect(0,0,r.width(),r.height());for(var q=0;q<numSlices+widthScale;q++){var z=(D?q*p.width/u+p.width/2:(numSlices-q)*p.width/u);var H=A+(D?2:-2)*q,F=v+t*heightScale*q/2;if(z<0){z=0}if(H<0){H=0}if(F<0){F=0}G.drawImage(s,z,0,2.5,p.height,H,F,2,t*(1-(heightScale*q)))}G.save();G.beginPath();G.moveTo(A,v);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),t*(1-heightScale*(numSlices+widthScale))+v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A,v+t);G.closePath();G.clip();G.fillStyle=\"rgba(0,0,0,\"+Math.round(C*100)/100+\")\";G.fillRect(0,0,r.width(),r.height());G.restore()}function h(A,r,C,B,y,x,v,w,u,z,t,E){if(l){if(!A){r*=-1;var D=B;B=C;C=D;D=x;x=y;y=D}setTimeout(function(){C.children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);y.css(\"transform\",\"rotateY(\"+r+\"deg)\").children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2,function(){y.hide();x.show().css(\"transform\",\"rotateX(0deg) rotateY(0deg)\").children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);B.children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2)})},0);setTimeout(E,e)}else{if(a){v.show();var q=new Date;var s=true;wowAnimate(function(F){var I=jQuery.easing.easeInOutQuint(1,F,0,1,1),H=jQuery.easing.easeInOutCubic(1,F,0,1,1),L=!A;if(F<0.5){I*=2;H*=2;var G=y}else{L=A;I=(1-I)*2;H=(1-H)*2;var G=x}var J=v.height()*d/2,N=(1-I)*v.width()/2,M=1+H*d,K=v.width()/2;c(C,G,K,J,N,M,L,H*g,K,v.height(),w);if(s){z.show();s=false}B.clearRect(0,0,u.width(),u.height());B.fillStyle=\"rgba(0,0,0,\"+(g-H*g)+\")\";B.fillRect(L?K:0,0,u.width()/2,u.height())},0,1,e,E)}}}}", "function ws_book(p,n,b){var f=jQuery;var m=f(this);var i=f(\".ws_list\",b);var k=f(\"<div>\").addClass(\"ws_effect ws_book\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"}).appendTo(b),e=p.duration,d=p.perspective||0.4,g=p.shadow||0.35,a=p.noCanvas||false,l=p.no3d||false;var o={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(r){var q=this.domPrefixes.length;while(q--){if(typeof document.body.style[this.domPrefixes[q]+r]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){var r=(typeof document.body.style.perspectiveProperty!==\"undefined\")||this.testDom(\"Perspective\");if(r&&/AppleWebKit/.test(navigator.userAgent)){var t=document.createElement(\"div\"),q=document.createElement(\"style\"),s=\"Test3d\"+Math.round(Math.random()*99999);q.textContent=\"@media (-webkit-transform-3d){#\"+s+\"{height:3px}}\";document.getElementsByTagName(\"head\")[0].appendChild(q);t.id=s;document.body.appendChild(t);r=t.offsetHeight===3;q.parentNode.removeChild(q);t.parentNode.removeChild(t)}return r},canvas:function(){if(typeof document.createElement(\"canvas\").getContext!==\"undefined\"){return true}}};if(!l){l=o.cssTransitions()&&o.cssTransforms3d()}if(!a){a=o.canvas()}var j;this.go=function(r,q,E){if(j){return -1}var v=n.get(r),G=n.get(q);if(E==undefined){E=(q==0&&r!=q+1)||(r==q-1)}else{E=!E}var s=f(\"<div>\").appendTo(k);var t=f(v);t={width:t.width(),height:t.height(),marginLeft:parseFloat(t.css(\"marginLeft\")),marginTop:parseFloat(t.css(\"marginTop\"))};if(l){var y={background:\"#000\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",zIndex:3,outline:\"1px solid transparent\"};perspect=b.width()*(3-d*2);s.css(y).css({perspective:perspect,transform:\"translate3d(0,0,0)\"});var z=90;var D=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t)).appendTo(s);var C=f(\"<div>\").css(y).css({position:\"relative\",\"float\":\"left\",width:\"50%\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t).css({marginLeft:-t.width/2})).appendTo(s);var I=f(\"<div>\").css(y).css({display:E?\"block\":\"none\",width:\"50%\",transform:\"rotateY(\"+(E?0.1:z)+\"deg)\",transition:(E?\"ease-in \":\"ease-out \")+e/2000+\"s\",transformOrigin:\"right\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?G:v).src).css(t)).appendTo(s);var F=f(\"<div>\").css(y).css({display:E?\"none\":\"block\",left:\"50%\",width:\"50%\",transform:\"rotateY(-\"+(E?z:0.1)+\"deg)\",transition:(E?\"ease-out \":\"ease-in \")+e/2000+\"s\",transformOrigin:\"left\",overflow:\"hidden\"}).append(f(\"<img>\").attr(\"src\",(E?v:G).src).css(t).css({marginLeft:-t.width/2})).appendTo(s)}else{if(a){var x=f(\"<div>\").css({position:\"absolute\",top:0,left:E?0:\"50%\",width:\"50%\",height:\"100%\",overflow:\"hidden\",zIndex:6}).append(f(n.get(r)).clone().css({position:\"absolute\",height:\"100%\",right:E?\"auto\":0,left:E?0:\"auto\"})).appendTo(s).hide();var B=f(\"<div>\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,zIndex:8}).appendTo(s).hide();var H=f(\"<canvas>\").css({position:\"absolute\",zIndex:2,left:0,top:-B.height()*d/2}).attr({width:B.width(),height:B.height()*(d+1)}).appendTo(B);var A=H.clone().css({top:0,zIndex:1}).attr({width:B.width(),height:B.height()}).appendTo(B);var w=H.get(0).getContext(\"2d\");var u=A.get(0).getContext(\"2d\")}else{i.stop(true).animate({left:(r?-r+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},e,\"easeInOutExpo\")}}if(!l&&a){var D=w;var C=u;var I=G;var F=v}j=new h(E,z,D,C,I,F,B,H,A,x,t,function(){m.trigger(\"effectEnd\");s.remove();j=0})};function c(G,s,A,v,u,E,D,C,B,t,r){numSlices=u/2,widthScale=u/B,heightScale=(1-E)/numSlices;G.clearRect(0,0,r.width(),r.height());for(var q=0;q<numSlices+widthScale;q++){var z=(D?q*p.width/u+p.width/2:(numSlices-q)*p.width/u);var H=A+(D?2:-2)*q,F=v+t*heightScale*q/2;if(z<0){z=0}if(H<0){H=0}if(F<0){F=0}G.drawImage(s,z,0,2.5,p.height,H,F,2,t*(1-(heightScale*q)))}G.save();G.beginPath();G.moveTo(A,v);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A+(D?2:-2)*(numSlices+widthScale),t*(1-heightScale*(numSlices+widthScale))+v+t*heightScale*(numSlices+widthScale)/2);G.lineTo(A,v+t);G.closePath();G.clip();G.fillStyle=\"rgba(0,0,0,\"+Math.round(C*100)/100+\")\";G.fillRect(0,0,r.width(),r.height());G.restore()}function h(A,r,C,B,y,x,v,w,u,z,t,E){if(l){if(!A){r*=-1;var D=B;B=C;C=D;D=x;x=y;y=D}setTimeout(function(){C.children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);y.css(\"transform\",\"rotateY(\"+r+\"deg)\").children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2,function(){y.hide();x.show().css(\"transform\",\"rotateX(0deg) rotateY(0deg)\").children(\"img\").css(\"opacity\",g).animate({opacity:1},e/2);B.children(\"img\").css(\"opacity\",1).animate({opacity:g},e/2)})},0);setTimeout(E,e)}else{if(a){v.show();var q=new Date;var s=true;wowAnimate(function(F){var I=jQuery.easing.easeInOutQuint(1,F,0,1,1),H=jQuery.easing.easeInOutCubic(1,F,0,1,1),L=!A;if(F<0.5){I*=2;H*=2;var G=y}else{L=A;I=(1-I)*2;H=(1-H)*2;var G=x}var J=v.height()*d/2,N=(1-I)*v.width()/2,M=1+H*d,K=v.width()/2;c(C,G,K,J,N,M,L,H*g,K,v.height(),w);if(s){z.show();s=false}B.clearRect(0,0,u.width(),u.height());B.fillStyle=\"rgba(0,0,0,\"+(g-H*g)+\")\";B.fillRect(L?K:0,0,u.width()/2,u.height())},0,1,e,E)}}}}" ]
[ "0.6393169", "0.63363785", "0.6116096", "0.60325706", "0.59854114", "0.59188414", "0.58959925", "0.58895886", "0.58418053", "0.5778939", "0.57483596", "0.57483596", "0.5739082", "0.57356673", "0.56955856", "0.56765735", "0.56765735", "0.56765735", "0.56696326", "0.56696326", "0.56696326", "0.56696326", "0.56696326", "0.5667098", "0.56222945", "0.56052434", "0.5598295", "0.5598295", "0.5573233", "0.5564058", "0.5561984", "0.5556136", "0.5533966", "0.55210686", "0.55190814", "0.55108964", "0.55052084", "0.55052084", "0.55052084", "0.5497595", "0.5497435", "0.5497435", "0.5497435", "0.5497435", "0.5489238", "0.54867417", "0.5458037", "0.5458037", "0.5458037", "0.5458037", "0.5458037", "0.54545045", "0.545276", "0.54436433", "0.544299", "0.54409146", "0.54388905", "0.5436747", "0.5436095", "0.5419314", "0.5415825", "0.5411153", "0.5384496", "0.5384496", "0.5384496", "0.5384496", "0.5384496", "0.5384496", "0.5384496", "0.53797", "0.53797", "0.53754276", "0.5374258", "0.5368384", "0.53594637", "0.53594637", "0.53594637", "0.5351125", "0.5345231", "0.53381497", "0.5318237", "0.53171813", "0.5309045", "0.5307588", "0.5283105", "0.5269407", "0.52613354", "0.52536064", "0.5244568", "0.52393645", "0.5238217", "0.5237525", "0.5233552", "0.52309227", "0.5226622", "0.5226541", "0.52237934", "0.5220243", "0.5220243", "0.5220243", "0.5220243" ]
0.0
-1
SCROLLSPY CLASS DEFINITION ==========================
function ScrollSpy(element, options) { var href var process = $.proxy(this.process, this) this.$element = $(element).is('body') ? $(window) : $(element) this.$body = $('body') this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 || '') + ' .nav li > a' this.offsets = $([]) this.targets = $([]) this.activeTarget = null this.refresh() this.process() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set scrolling(scrolling) {\n this._scrolling = scrolling;\n }", "function ScrollPosition() {}", "constructor() {\n this.instance = createScrollBar();\n }", "get scrollTarget(){return this.$.scrollable}", "constructor(props){\n super(props);\n this.state = {\n show: true,\n scrollPos: 0\n };\n this.handleScroll = this.handleScroll.bind(this);\n }", "function VirtualScrollStrategy() {}", "function VirtualScrollStrategy() {}", "function VirtualScrollStrategy() {}", "function VirtualScrollStrategy() {}", "function _scrollable() {\n // Private variables\n var position = {};\n\n // Private method\n function getEvent(event) {\n return event.originalEvent.targetTouches[0] ? event.originalEvent.targetTouches[0] : event.originalEvent.changedTouches[0];\n };\n\n // Public method\n this.onStart = function(e) {\n var touchObject = getEvent(e);\n\n position.start = {x: touchObject.pageX, y: touchObject.pageY};\n\n e.stopPropagation();\n };\n\n this.onMove = function(e) {\n var touchObject = getEvent(e);\n var dist = position.start.y - touchObject.pageY;\n\n if(this.scrollTop + dist >= this.scrollHeight - this.clientHeight) {\n e.preventDefault();\n e.returnValue = false;\n return false;\n }\n\n e.stopPropagation();\n };\n\n this.onWheel = function(e) {\n var up = (e.type == 'DOMMouseScroll' ? e.originalEvent.detail * -40 : e.originalEvent.wheelDelta) > 0,\n h = this.scrollHeight - this.clientHeight,\n c = this.scrollTop / h;\n\n if ((!up && c === 1) || (up && c === 0) || h === 0) {\n e.preventDefault();\n e.returnValue = false;\n return false;\n }\n\n e.stopPropagation();\n };\n}", "function scroller() {\n if (this.id == \"arrow1\") {\n smoothScroll(\"SP\");\n }\n else if (this.id == \"arrow2\") {\n smoothScroll(\"VP\");\n }\n else if (this.id == \"arrow3\") {\n smoothScroll(\"TP\");\n }\n else if (this.id == \"arrow4\") {\n smoothScroll(\"top\");\n }\n}", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "_scrollHandler () {}", "stepScrollAnimation_() {\n if (!this.scrollTarget) {\n return;\n }\n\n const currentScrollPos = -this.workspace_.scrollY;\n const diff = this.scrollTarget - currentScrollPos;\n if (Math.abs(diff) < 1) {\n this.workspace_.scrollbar.setY(this.scrollTarget);\n this.scrollTarget = null;\n return;\n }\n this.workspace_.scrollbar.setY(\n currentScrollPos + diff * this.scrollAnimationFraction);\n\n requestAnimationFrame(this.stepScrollAnimation_.bind(this));\n }", "function Scrolltrack (options) {\n if (!(this instanceof Scrolltrack)) return new Scrolltrack(options)\n if (!options) options = {}\n\n this.selector = options.selector || 'h1, h2, h3, h4, h5, h6'\n this.parent = options.parent || document\n this.onupdate = options.onupdate || function () {}\n this.menu = options.menu || document\n this.scrollParent = options.scrollParent || document\n this.offsetPercent = options.offsetPercent || 0.1\n\n this.listener = debounce(this.onScroll, 5).bind(this)\n this.update = debounce(this._update, 20).bind(this)\n this.active = undefined\n this.index = []\n\n this.listen()\n this.update()\n}", "function scroller_multiselect() {\n $('.multi_choice').find('ul').addClass('scroller');\n $('.multi_choice').find('ul').slimScroll({\n height: 'auto'\n });\n}", "function ScrollBar(options) {\r\n if (options === void 0) { options = {}; }\r\n var _this = _super.call(this, { node: Private.createNode() }) || this;\r\n /**\r\n * A timeout callback for repeating the mouse press.\r\n */\r\n _this._onRepeat = function () {\r\n // Clear the repeat timer id.\r\n _this._repeatTimer = -1;\r\n // Bail if the mouse has been released.\r\n if (!_this._pressData) {\r\n return;\r\n }\r\n // Look up the part that was pressed.\r\n var part = _this._pressData.part;\r\n // Bail if the thumb was pressed.\r\n if (part === 'thumb') {\r\n return;\r\n }\r\n // Schedule the timer for another repeat.\r\n _this._repeatTimer = setTimeout(_this._onRepeat, 20);\r\n // Get the current mouse position.\r\n var mouseX = _this._pressData.mouseX;\r\n var mouseY = _this._pressData.mouseY;\r\n // Handle a decrement button repeat.\r\n if (part === 'decrement') {\r\n // Bail if the mouse is not over the button.\r\n if (!domutils_1.ElementExt.hitTest(_this.decrementNode, mouseX, mouseY)) {\r\n return;\r\n }\r\n // Emit the step requested signal.\r\n _this._stepRequested.emit('decrement');\r\n // Finished.\r\n return;\r\n }\r\n // Handle an increment button repeat.\r\n if (part === 'increment') {\r\n // Bail if the mouse is not over the button.\r\n if (!domutils_1.ElementExt.hitTest(_this.incrementNode, mouseX, mouseY)) {\r\n return;\r\n }\r\n // Emit the step requested signal.\r\n _this._stepRequested.emit('increment');\r\n // Finished.\r\n return;\r\n }\r\n // Handle a track repeat.\r\n if (part === 'track') {\r\n // Bail if the mouse is not over the track.\r\n if (!domutils_1.ElementExt.hitTest(_this.trackNode, mouseX, mouseY)) {\r\n return;\r\n }\r\n // Fetch the thumb node.\r\n var thumbNode = _this.thumbNode;\r\n // Bail if the mouse is over the thumb.\r\n if (domutils_1.ElementExt.hitTest(thumbNode, mouseX, mouseY)) {\r\n return;\r\n }\r\n // Fetch the client rect for the thumb.\r\n var thumbRect = thumbNode.getBoundingClientRect();\r\n // Determine the direction for the page request.\r\n var dir = void 0;\r\n if (_this._orientation === 'horizontal') {\r\n dir = mouseX < thumbRect.left ? 'decrement' : 'increment';\r\n }\r\n else {\r\n dir = mouseY < thumbRect.top ? 'decrement' : 'increment';\r\n }\r\n // Emit the page requested signal.\r\n _this._pageRequested.emit(dir);\r\n // Finished.\r\n return;\r\n }\r\n };\r\n _this._value = 0;\r\n _this._page = 10;\r\n _this._maximum = 100;\r\n _this._repeatTimer = -1;\r\n _this._pressData = null;\r\n _this._thumbMoved = new signaling_1.Signal(_this);\r\n _this._stepRequested = new signaling_1.Signal(_this);\r\n _this._pageRequested = new signaling_1.Signal(_this);\r\n _this.addClass('p-ScrollBar');\r\n _this.setFlag(widget_1.Widget.Flag.DisallowLayout);\r\n // Set the orientation.\r\n _this._orientation = options.orientation || 'vertical';\r\n _this.dataset['orientation'] = _this._orientation;\r\n // Parse the rest of the options.\r\n if (options.maximum !== undefined) {\r\n _this._maximum = Math.max(0, options.maximum);\r\n }\r\n if (options.page !== undefined) {\r\n _this._page = Math.max(0, options.page);\r\n }\r\n if (options.value !== undefined) {\r\n _this._value = Math.max(0, Math.min(options.value, _this._maximum));\r\n }\r\n return _this;\r\n }", "function setScrollable()\r\n{\r\n //Added document readiness to set classes if the link toggles\r\n $(document).ready(function()\r\n {\r\n //Event to auto-position next/previous arrowheads\r\n document.scrollableOnResizeListener = function(e)\r\n {\r\n //Exit if the body height has not changed since it's unlikely that the arrowheads need to be repositioned\r\n if (isDefined(document.scrollableBodyHeight))\r\n if (document.scrollableBodyHeight == $(\"body\").height())\r\n return false;\r\n document.scrollableBodyHeight = $(\"body\").height();\r\n \r\n $(\".scrollable\").each(function()\r\n {\r\n var currentElement = $(this);\r\n var buttonTop = (currentElement.offset().top + currentElement.outerHeight() / 2);\r\n var previous = currentElement.children(\".previous:first\");\r\n var next = currentElement.children(\".next:first\");\r\n var previousLeft = previous.hasClass(\"autoPosition\") ? (currentElement.offset().left - previous.outerWidth()) : previous.offset().left;\r\n var nextLeft = next.hasClass(\"autoPosition\") ? (currentElement.offset().left + currentElement.outerWidth()) : next.offset().left;\r\n var nextWidth = next.outerWidth();\r\n\r\n //Position and show scroll buttons only if they're within the visible area of the screen\r\n if ((previousLeft >= 0) && ((nextLeft + nextWidth) < document.body.clientWidth))\r\n {\r\n if (previous.hasClass(\"autoPosition\"))\r\n previous.css({position:\"absolute\", left: previousLeft, top: buttonTop});\r\n if (next.hasClass(\"autoPosition\"))\r\n next.css({position:\"absolute\", left: nextLeft, top: buttonTop});\r\n previous.show();\r\n next.show();\r\n }\r\n else\r\n {\r\n previous.hide();\r\n next.hide();\r\n }\r\n });\r\n };\r\n\r\n //Initialize tinyCarousel\r\n $(\".scrollable\").each(function()\r\n {\r\n var currentElement = $(this);\r\n var classes = currentElement.attr(\"class\");\r\n var millisecondsInASecond = 1000;\r\n var scrollItems = 1;\r\n var scrollTime = 1000;\r\n var animationTime = 150;\r\n var previous = currentElement.children(\".previous:first\");\r\n var next = currentElement.children(\".next:first\");\r\n\r\n //Read custom parameters from the CSS class value\r\n if ((isDefined(document.isMobileOptimized)) && (classes.indexOf(\"mobileScrollItems\") >= 0))\r\n scrollItems = parseInt(classes.split(\"mobileScrollItems\")[1].split(\" \")[0]);\r\n else if (classes.indexOf(\"scrollItems\") >= 0)\r\n scrollItems = parseInt(classes.split(\"scrollItems\")[1].split(\" \")[0]);\r\n if (classes.indexOf(\"scrollTime\") >= 0)\r\n scrollTime = parseInt(classes.split(\"scrollTime\")[1].split(\" \")[0]) * millisecondsInASecond;\r\n \r\n //Assign swipe functionality\r\n currentElement.bind(\"swipeleft\", function(e)\r\n {\r\n $(this).find(\".next:not(.hidden):first\").trigger(\"click\");\r\n });\r\n currentElement.bind(\"swiperight\", function(e)\r\n {\r\n $(this).find(\".previous:not(.hidden):first\").trigger(\"click\");\r\n });\r\n \r\n currentElement.tinycarousel({interval:true, display:scrollItems, intervaltime:scrollTime, duration:animationTime, callback:document.scrollableOnResizeListener});\r\n });\r\n \r\n //Auto-position next/previous arrowheads\r\n document.scrollableOnResizeListener();\r\n $(window).resize(document.scrollableOnResizeListener);\r\n });\r\n}", "get scroller() {\n return this.getScrollerForMode(this.mode);\n }", "function cust_PageScroll(ref) {\n\n}", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "_setupScrollspy() {\n if (!this.scrollContent) {\n return;\n }\n\n new ScrollSpy(document.querySelector(this.scrollContent), {\n target: this.menu,\n // Top offset position of the sticky menu\n offset: 220\n });\n }", "function init(){\n\tnew SmoothScroll(document,200,2)\n}", "_setupScroll() {\n this._expanderEl = document.createElement('div');\n this._expanderEl.setAttribute('class', 'expander');\n document.body.appendChild(this._expanderEl);\n }", "function VirtualScrollStrategy() { }", "function VirtualScrollStrategy() { }", "get scrollSpeed() { return this._scrollSpeed; }", "_scrollTop(){\n let self = this;\n \n if(this.props.speed == 'fast') {\n let hasScrollTop = 'scrollTop' in window;\n //if (value === undefined) return hasScrollTop ? node.scrollTop : node.pageYOffset\n hasScrollTop ? (() => {window.scrollTop = 0})() : (() => { window.scrollTo(window.scrollX, 0) })();\n }else{\n function moveScroll(){ \n self.scrollTop = self.scrollTop / 1.2; \n if(self.scrollTop === 0){ \n clearInterval(moveInterval); \n moveInterval = null;\n } \n } \n let moveInterval = setInterval(moveScroll, 10); \n } \n }", "initScroll() {\n const me = this,\n scroller = me.scrollable,\n virtualScrollerElement = me.virtualScrollerElement;\n\n if (BrowserHelper.isFirefox) {\n scroller.element.addEventListener('wheel', (event) => {\n if (event.deltaX) {\n scroller.x += event.deltaX;\n event.preventDefault();\n }\n });\n }\n\n scroller.yScroller = me.grid.scrollable;\n\n // Add our Scroller to the controlling GridScroller\n scroller.yScroller.addScroller(scroller);\n\n // Create a Scroller for the fake horizontal scrollbar so that it can partner\n me.fakeScroller = new Scroller({\n element: virtualScrollerElement,\n overflowX: true\n });\n\n // Fire horizontalscroll when our xScroller reports a scroll\n scroller.on('scroll', me.createOnFrame(me.syncScrollingPartners));\n scroller.on('scrollend', () => {\n me.scrolling = false;\n });\n\n scroller.addPartner(me.fakeScroller, 'x');\n if (me.header) {\n scroller.addPartner(me.header.scrollable, 'x');\n }\n if (me.footer) {\n scroller.addPartner(me.footer.scrollable, 'x');\n }\n }", "updateScrollIndicators () {\n let container = this.refs.container;\n let up = false;\n let down = false;\n let scrollTop = container.scrollTop;\n let scrollHeight = container.scrollHeight;\n let offsetHeight = container.offsetHeight;\n\n if (scrollTop > 0) {\n up = true;\n }\n\n if (\n scrollHeight > offsetHeight && scrollTop + offsetHeight !== scrollHeight\n ) {\n down = true;\n }\n\n container.className = classNames('scroll-indicator', this.props.className, {\n 'scroll-up': up,\n 'scroll-down': down,\n });\n }", "function Scroller(X,Y,refresh) {\n\tthis.canScroll=0;\n\tthis.refresh=refresh;\n\tthis.x=X;\n\tthis.y=Y;\n\tthis.timer=setTimeout(\"repositionOver()\",this.refresh);\n}", "[scroll]() {\n if (!this.scrollableElement || !this.currentMousePosition) {\n return;\n }\n\n cancelAnimationFrame(this.scrollAnimationFrame);\n\n const { speed, sensitivity } = this.options;\n\n const rect = this.scrollableElement.getBoundingClientRect();\n const bottomCutOff = rect.bottom > window.innerHeight;\n const topCutOff = rect.top < 0;\n const cutOff = topCutOff || bottomCutOff;\n\n const documentScrollingElement = getDocumentScrollingElement();\n const scrollableElement = this.scrollableElement;\n const clientX = this.currentMousePosition.clientX;\n const clientY = this.currentMousePosition.clientY;\n\n if (scrollableElement !== document.body && scrollableElement !== document.documentElement && !cutOff) {\n const { offsetHeight, offsetWidth } = scrollableElement;\n\n if (rect.top + offsetHeight - clientY < sensitivity) {\n scrollableElement.scrollTop += speed;\n } else if (clientY - rect.top < sensitivity) {\n scrollableElement.scrollTop -= speed;\n }\n\n if (rect.left + offsetWidth - clientX < sensitivity) {\n scrollableElement.scrollLeft += speed;\n } else if (clientX - rect.left < sensitivity) {\n scrollableElement.scrollLeft -= speed;\n }\n } else {\n const { innerHeight, innerWidth } = window;\n\n if (clientY < sensitivity) {\n documentScrollingElement.scrollTop -= speed;\n } else if (innerHeight - clientY < sensitivity) {\n documentScrollingElement.scrollTop += speed;\n }\n\n if (clientX < sensitivity) {\n documentScrollingElement.scrollLeft -= speed;\n } else if (innerWidth - clientX < sensitivity) {\n documentScrollingElement.scrollLeft += speed;\n }\n }\n\n this.scrollAnimationFrame = requestAnimationFrame(this[scroll]);\n }", "function scrollListener() {\n activeInWrapper()\n scrollAnimation()\n}", "function setScrolling()\n {\n scrolling = true;\n }", "function createNiceScroll(elmntClass,scrollColor=\"#e8e8e8\",width=\"5px\"){\n $(elmntClass).niceScroll({\n cursorwidth:width,\n cursorcolor:scrollColor,\n cursorborder: \"0px solid #fff\", // css definition for cursor border\n cursorborderradius: \"0px\", // border radius in pixel for cursor\n autohidemode:false,\n zindex:999,\n emulatetouch: true,\n });\n }", "_refreshScrollerPosition() {\n this.__carouselScrollerWidth = qx.bom.element.Dimension.getWidth(\n this.__carouselScroller.getContentElement()\n );\n\n this._scrollToPage(this.getCurrentIndex());\n }", "function O_Scrollbar()\n\t{\n\t\tvar $=this,\n\t\t\t_=null;\n\t\t\n\t\t$.varchar___id\t\t\t\t\t\t\t\t='';\n\t\t$.varchar___position\t\t\t\t\t\t='';\n\t\t$.object_dom___component\t\t\t\t\t=_;\n\t\t\n\t\t$.integer___left_offset\t\t\t\t\t\t=0;\n\t\t$.integer___top_offset\t\t\t\t\t\t=0;\n\t\t\n\t\t$.object_dom___o_Slider\t\t\t\t\t\t=_;\n\t\t$.integer___o_Slider_offset_width\t\t\t=0;\n\t\t$.integer___o_Slider_offset_height\t\t\t=0;\n\t\t$.integer___o_Slider_minimal_left_offset\t=0;\n\t\t$.integer___o_Slider_maximal_left_offset\t=0;\n\t\t\n//\tTEMP:\n\t\t$.integer___minimal_value_limit=0;\n\t\t$.integer___maximal_value_limit=0;\n\t\t$.integer___value_changing_step=0;\n\t\t\n//\tTEMP:\n\t\t$.array_object___mouse_cursor_position_info\t\t=[];\n\t\t$.object_object___mouse_cursor_position_info\t={};\n\t\t$.object_integer___o_Slider_left_offset_by_value={};\n\t\t\n\t\t\n//\tANALYZE:\n\t\t$.integer___target_scrolling_minimal_left_offset\t=0;\n\t\t$.integer___target_scrolling_maximal_left_offset\t=0;\n\t\t$.integer___target_scrolling_minimal_top_offset\t\t=0;\n\t\t$.integer___target_scrolling_maximal_top_offset\t\t=0;\t\t\n\t\t\n\t\t\n\t\t$.integer___minimal_mouse_cursor_coordinate_x=0;\n\t\t$.integer___maximal_mouse_cursor_coordinate_x=0;\n\t\t$.integer___minimal_mouse_cursor_coordinate_y=0;\n\t\t$.integer___maximal_mouse_cursor_coordinate_y=0;\n\n\t\t$.integer___mouse_cursor_coordinate_x=0;\n\t\t$.integer___mouse_cursor_coordinate_y=0;\n\t\t\n\t\t$.integer___previous_mouse_cursor_coordinate_x=0;\n\t\t$.integer___previous_mouse_cursor_coordinate_y=0;\n\t\t\n\t\t$.integer___mouse_cursor_horizontal_offset\t=0;\n\t\t$.integer___mouse_cursor_vertical_offset\t=0;\n\t\t\n\t\t$.float___o_Slider_movement_step\t\t\t=0;\n\t\t\n\t\t\n\t\t$.F_ExecuteActionAfterScrollReachedRightEnd=_;\n\t\t\n\t\t\n\t\t$.F_Initialize=function(object___configuration)\n\t\t{\n\t\t\tif (object___configuration)\n\t\t\t{\n\t\t\t\t$.varchar___id=object___configuration.varchar___id;\n\t\t\t\t\n\t\t\t\t$.varchar___position=object___configuration.varchar___position;\n\t\t\t\t\n\t\t\t\t$.object_dom___component\t=object___configuration.object_dom___component||document.getElementById(object___configuration.string___DOM_id);\n\t\t\t\t$.object_dom___o_Slider\t\t=jQuery(\"div div\",$.object_dom___component)[0];\n\t\t\t\t\n\t\t\t\tif (!object___configuration.object_dom___target && !object___configuration.string___target_DOM_id)\n\t\t\t\t\t$.object_dom___target\t=$.object_dom___component.parentNode.children[0];\n\t\t\t\telse \n\t\t\t\t\t$.object_dom___target\t=object___configuration.object_dom___target||document.getElementById(object___configuration.string___target_DOM_id);\n\t\t\t\t\t\n\n\t\t\t\tif ($.varchar___position=='horizontal')\n\t\t\t\t{\n\t\t\t\t\t$.integer___offset_width\t\t\t\t\t\t=$.object_dom___component.offsetWidth;//Math.floor(jQuery($.object_dom___component).outerWidth());\n\t\n//\tTODO: need update on window resize and recalculate depended values\n\t\t\t\t\t$.integer___left_offset\t\t\t\t\t\t\t=__GetElementAbsoluteXCoordinate($.object_dom___component); //Math.floor(jQuery($.object_dom___component).offset().left);\n\t\t\t\t\t\n\t\t\t\t\t$.integer___o_Slider_minimal_offset_width\t\t=50;\n\t\t\t\t\t$.integer___o_Slider_maximal_left_offset\t\t=$.integer___offset_width-$.integer___o_Slider_minimal_offset_width;\n\t\t\t\t\t\n//\tANALYZE: case, when separate controls present, need include their dimensions\n//\tANALYZE: when start offset not 0, saved scrolling position\n\t\t\t\t\t$.integer___o_Slider_minimal_left_offset\t\t=0;\n\t\t\t\t\t\n\t\t\t\t\t$.integer___target_scrolling_minimal_left_offset=0;\n//\tIMPORTANT,ANALYZE: possible problem width border, padding/margin while calculating offsetWidth/offsetHeight\n\t\t\t\t\t$.integer___target_scrolling_maximal_left_offset=$.object_dom___target.scrollWidth-$.object_dom___target.offsetWidth;\n\t\t\t\t\t\n\t\t\t\t\tvar integer___borders_width=jQuery($.object_dom___component).children('div').children('b').width()+jQuery($.object_dom___component).children('div').children('i').width();\n\n\t\t\t\t\tjQuery($.object_dom___component).children('div').children('em').css('width',$.integer___offset_width-integer___borders_width+'px');\n\t\t\t\t\t\n\t\t\t\t\tif ($.integer___target_scrolling_maximal_left_offset>$.integer___o_Slider_maximal_left_offset)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.integer___o_Slider_offset_width\t\t\t=$.integer___o_Slider_minimal_offset_width;\n\t\t\t\t\t\t$.integer___o_Slider_maximal_left_offset\t=$.integer___offset_width-$.integer___o_Slider_offset_width;\n\n\t\t\t\t\t\t$.object___o_Slider.F_InitializeWidth(integer___borders_width);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.integer___minimal_mouse_cursor_coordinate_x=$.integer___left_offset;\n\t\t\t\t\t\t$.integer___maximal_mouse_cursor_coordinate_x=$.integer___left_offset+$.integer___offset_width-$.integer___o_Slider_offset_width;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar integer___target_scrolling_step\t\t\t\t\t\t=Math.ceil($.integer___target_scrolling_maximal_left_offset/$.integer___o_Slider_maximal_left_offset);\n\t\t\t\t\t\t$.float___o_Slider_movement_step\t\t\t\t\t\t=$.integer___o_Slider_maximal_left_offset/$.integer___target_scrolling_maximal_left_offset;\n//\tif (integer___o_Slider.movement_step==1)\n\t\t\t\t\t\tvar integer___target_scrolling_steps_amount\t\t\t\t=Math.ceil($.integer___o_Slider_maximal_left_offset);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar integer___target_scrolling_step_adjustments_amount\t=integer___target_scrolling_step*integer___target_scrolling_steps_amount-$.integer___target_scrolling_maximal_left_offset;\n\t\t\t\t\t\tvar integer___target_scrolling_step_adjustments_interval=Math.floor(integer___target_scrolling_steps_amount/integer___target_scrolling_step_adjustments_amount);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_CalculateMovementSteps\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tinteger___target_scrolling_step,\n\t\t\t\t\t\t\tinteger___target_scrolling_steps_amount,\n\t\t\t\t\t\t\tinteger___target_scrolling_step_adjustments_amount,\n\t\t\t\t\t\t\tinteger___target_scrolling_step_adjustments_interval\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n//\tANALYZE,TODO: need adjustment of accuracy\n\n//\tset slider position by target\n\t\t\t\t\t\t$.object___o_Slider.F_InitializePosition();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_ProcessEvent_mousemove=function(object_dom___event)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobject_dom___event=object_dom___event||event;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_x=object_dom___event.clientX||object_dom___event.pageX;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_x+=Math.ceil(jQuery(document).scrollLeft()); //document.body.scrollLeft\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_horizontal_offset=$.integer___mouse_cursor_coordinate_x-$.integer___previous_mouse_cursor_coordinate_x;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($.object_dom___o_Slider.offsetLeft+$.integer___mouse_cursor_horizontal_offset>=$.integer___o_Slider_maximal_left_offset)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index\t=integer___target_scrolling_steps_amount;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left\t\t\t=$.integer___o_Slider_maximal_left_offset+'px';\n\t\t\t\t\t\t\t\t$.object_dom___target.scrollLeft\t\t\t=$.integer___target_scrolling_maximal_left_offset;\n\n\t\t\t\t\t\t\t\tif (typeof($.F_ExecuteActionAfterScrollReachedRightEnd)=='function')\n\t\t\t\t\t\t\t\t\t$.F_ExecuteActionAfterScrollReachedRightEnd();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ($.object_dom___o_Slider.offsetLeft+$.integer___mouse_cursor_horizontal_offset<=$.integer___o_Slider_minimal_left_offset)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index\t=0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left\t\t\t=$.integer___o_Slider_minimal_left_offset+'px';\n\t\t\t\t\t\t\t\t$.object_dom___target.scrollLeft\t\t\t=$.integer___target_scrolling_minimal_left_offset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t$.integer___mouse_cursor_vertical_offset\t=$.integer___mouse_cursor_coordinate_y-$.integer___previous_mouse_cursor_coordinate_y;\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left\t\t\t=$.object_dom___o_Slider.offsetLeft+$.integer___mouse_cursor_horizontal_offset+'px';\n\n\n//\t\t\t\t\t\t\t\tconsole.log($.object___o_Slider.integer___mouse_cursor_top_offset+\":\"+$.object___o_Slider.integer___action_point_top_offset);\n\t\t\t\t\t\t\t\t\n//\tif $.object___o_Slider step ==1 \n/*\t\t\t\t\t\t\t\tif ($.integer___mouse_cursor_coordinate_y>$.integer___previous_mouse_cursor_coordinate_y)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index++;\n\t\t\t\t\t\t\t\telse if ($.integer___mouse_cursor_coordinate_y<$.integer___previous_mouse_cursor_coordinate_y)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index--;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($.object___o_Slider.integer___movement_step_index>integer___target_scrolling_steps_amount)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index=integer___target_scrolling_steps_amount;\n\t\t\t\t\t\t\t\telse if ($.object___o_Slider.integer___movement_step_index<0)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index=0;\n*/\n/*\tif $.object___o_Slider step >1\n\t\t\t\t\t\t\t\t$.object___o_Slider.integer___mouse_cursor_top_offset=$.integer___mouse_cursor_coordinate_y-$.integer___top_offset-$.object_dom___o_Slider.offsetTop;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($.object___o_Slider.integer___mouse_cursor_top_offset>$.object___o_Slider.integer___action_point_top_offset)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index++;\n\t\t\t\t\t\t\t\telse if ($.object___o_Slider.integer___mouse_cursor_top_offset<$.object___o_Slider.integer___action_point_top_offset)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index--;\n*/\n//console.log($.object___o_Slider.array_object___movement_step_info[$.object___o_Slider.integer___movement_step_index].integer___target_scrolling_offset)\n\t\t\t\t\t\t\t\t$.object_dom___target.scrollLeft=$.object___o_Slider.array_object___movement_step_info[$.object_dom___o_Slider.offsetLeft].integer___target_scrolling_offset;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.integer___previous_mouse_cursor_coordinate_x=$.integer___mouse_cursor_coordinate_x;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$.integer___o_Slider_offset_width\t\t\t=$.integer___offset_width-$.integer___target_scrolling_maximal_left_offset;\n\t\t\t\t\t\t$.integer___o_Slider_maximal_left_offset\t=$.integer___offset_width-$.integer___o_Slider_offset_width;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($.object_dom___target.scrollLeft>0)\n\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.object_dom___target.scrollLeft+'px';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_InitializeWidth(integer___borders_width);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_ProcessEvent_mousemove=function(object_dom___event)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobject_dom___event=object_dom___event||event;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_x=object_dom___event.clientX||object_dom___event.pageX;\n\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_x+=Math.ceil(jQuery(document).scrollLeft()); //document.body.scrollLeft\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_horizontal_offset=$.integer___mouse_cursor_coordinate_x-$.integer___previous_mouse_cursor_coordinate_x;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($.object_dom___o_Slider.offsetLeft+$.integer___mouse_cursor_horizontal_offset>=$.integer___o_Slider_maximal_left_offset)\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___o_Slider_maximal_left_offset+'px';\n\t\t\t\t\t\t\telse if ($.object_dom___o_Slider.offsetLeft+$.integer___mouse_cursor_horizontal_offset<=$.integer___o_Slider_minimal_left_offset)\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___o_Slider_minimal_left_offset+'px';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.object_dom___o_Slider.offsetLeft+$.integer___mouse_cursor_horizontal_offset+'px';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.integer___previous_mouse_cursor_coordinate_x=$.integer___mouse_cursor_coordinate_x;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.object_dom___target.scrollLeft=$.object_dom___o_Slider.offsetLeft;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if ($.varchar___position=='vertical')\n\t\t\t\t{\n\t\t\t\t\t$.integer___offset_height\t\t\t\t\t\t=$.object_dom___component.offsetHeight;//Math.floor(jQuery($.object_dom___component).outerWidth());\n\t\n//\tTODO: need update on window resize and recalculate depended values\n\t\t\t\t\t$.integer___top_offset\t\t\t\t\t\t\t=__GetElementAbsoluteYCoordinate($.object_dom___component); //Math.floor(jQuery($.object_dom___component).offset().left);\n\t\t\t\t\t\n\t\t\t\t\t$.integer___o_Slider_minimal_offset_height\t\t=50;\n\t\t\t\t\t$.integer___o_Slider_maximal_top_offset\t\t\t=$.integer___offset_height-$.integer___o_Slider_minimal_offset_height;\n\t\t\t\t\t\n//\tANALYZE: case, when separate controls present, need include their dimensions\n//\tANALYZE: when start offset not 0, saved scrolling position\n\t\t\t\t\t$.integer___o_Slider_minimal_top_offset\t\t\t=0;\n\t\t\t\t\t\n\t\t\t\t\t$.integer___target_scrolling_minimal_top_offset\t=0;\n//\tIMPORTANT,ANALYZE: possible problem width border, padding/margin while calculating offsetWidth/offsetHeight\n\t\t\t\t\t$.integer___target_scrolling_maximal_top_offset\t=$.object_dom___target.scrollHeight-$.object_dom___target.offsetHeight;\n\t\t\t\t\t\n\t\t\t\t\tvar integer___borders_height=jQuery($.object_dom___component).children('div').children('b').height()+jQuery($.object_dom___component).children('div').children('i').height();\n\n\t\t\t\t\tjQuery($.object_dom___component).children('div').children('em').css('height',$.integer___offset_height-integer___borders_height+'px');\n\t\t\t\t\t\n\t\t\t\t\tif ($.integer___target_scrolling_maximal_top_offset>$.integer___o_Slider_maximal_top_offset)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.integer___o_Slider_offset_height\t\t=$.integer___o_Slider_minimal_offset_height;\n\t\t\t\t\t\t$.integer___o_Slider_maximal_top_offset\t=$.integer___offset_height-$.integer___o_Slider_offset_height;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_InitializeHeight(integer___borders_height);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.integer___minimal_mouse_cursor_coordinate_y=$.integer___top_offset;\n\t\t\t\t\t\t$.integer___maximal_mouse_cursor_coordinate_y=$.integer___top_offset+$.integer___offset_height-$.integer___o_Slider_offset_height;\n\t\t\t\t\t\t\n//\t\t\t\t\t\t$.integer___minimal_value_limit\t=object___configuration.integer___minimal_value_limit;\n//\t\t\t\t\t\t$.integer___maximal_value_limit\t=object___configuration.integer___maximal_value_limit;\n\t\t\n//\t\t\t\t\t\t$.integer___value_changing_step\t\t\t\t\t=object___configuration.integer___value_changing_step||1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar integer___target_scrolling_step\t\t\t\t\t\t=Math.ceil($.integer___target_scrolling_maximal_top_offset/$.integer___o_Slider_maximal_top_offset);\n\t\t\t\t\t\t$.float___o_Slider_movement_step\t\t\t\t\t\t=$.integer___o_Slider_maximal_top_offset/$.integer___target_scrolling_maximal_top_offset;\n//\tif (integer___o_Slider.movement_step==1)\n\t\t\t\t\t\tvar integer___target_scrolling_steps_amount\t\t\t\t=Math.ceil($.integer___o_Slider_maximal_top_offset);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar integer___target_scrolling_step_adjustments_amount\t=integer___target_scrolling_step*integer___target_scrolling_steps_amount-$.integer___target_scrolling_maximal_top_offset;\n\t\t\t\t\t\tvar integer___target_scrolling_step_adjustments_interval=Math.floor(integer___target_scrolling_steps_amount/integer___target_scrolling_step_adjustments_amount);\n\t\t\t\t\t\t\n/*\t\t\t\t\t\tconsole.log\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tinteger___target_scrolling_step*integer___target_scrolling_steps_amount+\"\\r\\n\"\n\t\t\t\t\t\t\t\t+\":\"+$.integer___o_Slider_maximal_top_offset+\"\\r\\n\"\n\t\t\t\t\t\t\t\t+\":\"+integer___target_scrolling_step+\"\\r\\n\"\n\t\t\t\t\t\t\t\t+\":\"+integer___target_scrolling_steps_amount+\"\\r\\n\"\n\t\t\t\t\t\t\t\t+\":\"+integer___target_scrolling_step_adjustments_amount+\"\\r\\n\"\n\t\t\t\t\t\t\t\t+\":\"+integer___target_scrolling_step_adjustments_interval+\"\\r\\n\"\n\t\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\tF_CalculateMovementSteps(integer___maximal_step,integer___maximal_steps_amount,integer___step_adjustments_amount,integer___maximal_step_adjustments_interval);\n\t\t\t\t\t\t$.object___o_Slider.F_CalculateMovementSteps\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tinteger___target_scrolling_step,\n\t\t\t\t\t\t\tinteger___target_scrolling_steps_amount,\n\t\t\t\t\t\t\tinteger___target_scrolling_step_adjustments_amount,\n\t\t\t\t\t\t\tinteger___target_scrolling_step_adjustments_interval\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n//\tANALYZE,TODO: need adjustment of accuracy\n//\t\t\t\t\t\tconsole.log($.object_dom___target.scrollTop+\":\"+$.float___o_Slider_movement_step);\n//\tset slider position by target\n\t\t\t\t\t\t$.object___o_Slider.F_InitializePosition();\n\t\t\t\t\t\t\n//\t\t\t\t\t\tconsole.log($.object___o_Slider.array_object___movement_step_info);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_ProcessEvent_mousemove=function(object_dom___event)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobject_dom___event=object_dom___event||event;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_y=object_dom___event.clientY||object_dom___event.pageY;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_y+=Math.ceil(jQuery(document).scrollTop()); //document.body.scrollLeft\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_vertical_offset=$.integer___mouse_cursor_coordinate_y-$.integer___previous_mouse_cursor_coordinate_y;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($.object_dom___o_Slider.offsetTop+$.integer___mouse_cursor_vertical_offset>=$.integer___o_Slider_maximal_top_offset)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index\t=integer___target_scrolling_steps_amount;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top\t\t\t\t\t=$.integer___o_Slider_maximal_top_offset+'px';\n\t\t\t\t\t\t\t\t$.object_dom___target.scrollTop\t\t\t=$.integer___target_scrolling_maximal_top_offset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ($.object_dom___o_Slider.offsetTop+$.integer___mouse_cursor_vertical_offset<=$.integer___o_Slider_minimal_top_offset)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index\t=0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top\t\t\t\t\t=$.integer___o_Slider_minimal_top_offset+'px';\n\t\t\t\t\t\t\t\t$.object_dom___target.scrollTop\t\t\t=$.integer___target_scrolling_minimal_top_offset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t$.integer___mouse_cursor_vertical_offset\t=$.integer___mouse_cursor_coordinate_y-$.integer___previous_mouse_cursor_coordinate_y;\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top\t\t\t=$.object_dom___o_Slider.offsetTop+$.integer___mouse_cursor_vertical_offset+'px';\n\n\n//\t\t\t\t\t\t\t\tconsole.log($.object___o_Slider.integer___mouse_cursor_top_offset+\":\"+$.object___o_Slider.integer___action_point_top_offset);\n\t\t\t\t\t\t\t\t\n//\tif $.object___o_Slider step ==1 \n/*\t\t\t\t\t\t\t\tif ($.integer___mouse_cursor_coordinate_y>$.integer___previous_mouse_cursor_coordinate_y)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index++;\n\t\t\t\t\t\t\t\telse if ($.integer___mouse_cursor_coordinate_y<$.integer___previous_mouse_cursor_coordinate_y)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index--;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($.object___o_Slider.integer___movement_step_index>integer___target_scrolling_steps_amount)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index=integer___target_scrolling_steps_amount;\n\t\t\t\t\t\t\t\telse if ($.object___o_Slider.integer___movement_step_index<0)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index=0;\n*/\n/*\tif $.object___o_Slider step >1\n\t\t\t\t\t\t\t\t$.object___o_Slider.integer___mouse_cursor_top_offset=$.integer___mouse_cursor_coordinate_y-$.integer___top_offset-$.object_dom___o_Slider.offsetTop;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($.object___o_Slider.integer___mouse_cursor_top_offset>$.object___o_Slider.integer___action_point_top_offset)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index++;\n\t\t\t\t\t\t\t\telse if ($.object___o_Slider.integer___mouse_cursor_top_offset<$.object___o_Slider.integer___action_point_top_offset)\n\t\t\t\t\t\t\t\t\t$.object___o_Slider.integer___movement_step_index--;\n*/\n//console.log($.object___o_Slider.array_object___movement_step_info[$.object___o_Slider.integer___movement_step_index].integer___target_scrolling_offset)\n\t\t\t\t\t\t\t\t$.object_dom___target.scrollTop=$.object___o_Slider.array_object___movement_step_info[$.object_dom___o_Slider.offsetTop].integer___target_scrolling_offset;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.integer___previous_mouse_cursor_coordinate_y=$.integer___mouse_cursor_coordinate_y;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$.integer___o_Slider_offset_height\t\t=$.integer___offset_height-$.integer___target_scrolling_maximal_top_offset;\n\t\t\t\t\t\t$.integer___o_Slider_maximal_top_offset\t=$.integer___offset_height-$.integer___o_Slider_offset_height;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($.object_dom___target.scrollTop>0)\n\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.object_dom___target.scrollTop+'px';\n\n\t\t\t\t\t\t$.object___o_Slider.F_InitializeHeight(integer___borders_height);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.object___o_Slider.F_ProcessEvent_mousemove=function(object_dom___event)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobject_dom___event=object_dom___event||event;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_y=object_dom___event.clientY||object_dom___event.pageY;\n\n\t\t\t\t\t\t\t$.integer___mouse_cursor_coordinate_y+=Math.ceil(jQuery(document).scrollTop()); //document.body.scrollLeft\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.integer___mouse_cursor_vertical_offset=$.integer___mouse_cursor_coordinate_y-$.integer___previous_mouse_cursor_coordinate_y;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($.object_dom___o_Slider.offsetTop+$.integer___mouse_cursor_vertical_offset>=$.integer___o_Slider_maximal_top_offset)\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___o_Slider_maximal_top_offset+'px';\n\t\t\t\t\t\t\telse if ($.object_dom___o_Slider.offsetTop+$.integer___mouse_cursor_vertical_offset<=$.integer___o_Slider_minimal_top_offset)\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___o_Slider_minimal_top_offset+'px';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.object_dom___o_Slider.offsetTop+$.integer___mouse_cursor_vertical_offset+'px';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.integer___previous_mouse_cursor_coordinate_y=$.integer___mouse_cursor_coordinate_y;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.object_dom___target.scrollTop=$.object_dom___o_Slider.offsetTop;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n/*\t\t\t\t\tconsole.log($.object_dom___component.offsetHeight);\n\t\t\t\t\tconsole.log\n\t\t\t\t\t(\n\t\t\t\t\t\t$.integer___offset_height+\"\\r\\n\"\n\t\t\t\t\t\t\t+\":\"+$.integer___top_offset+\"\\r\\n\"\n\t\t\t\t\t\t\t+\":\"+$.integer___o_Slider_maximal_top_offset+\"\\r\\n\"\n\t\t\t\t\t\t\t+\":\"+$.integer___target_scrolling_maximal_top_offset+\"\\r\\n\"\n\t\t\t\t\t\t\t+\":\"+$.object_dom___target.scrollHeight+\":\"+$.object_dom___target.offsetHeight+\"\\r\\n\"\n\t\t\t\t\t\t\t+\"-----------------------------------------------------------------------\"\n\t\t\t\t\t);\n*/\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$.object_dom___o_Slider.onmousedown=function(object_dom___event)\n\t\t\t\t{\n\t\t\t\t\t$.object___o_Slider.F_ProcessEvent_mousedown(object_dom___event);\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tjQuery($.object_dom___component).children('div').children('em').on('mousedown',function(object_dom___event)\n\t\t\t\t{\n\t\t\t\t\t$.object___o_Slider.F_MoveToMouseCursor(object_dom___event);\n\t\t\t\t});\n\n\n/*\t\t\t\tconsole.log($.integer___o_Slider_offset_width\n\t\t\t\t\t\t\t+\":\"+integer___o_Slider_maximal_moving_step\n\t\t\t\t\t\t\t+\":\"+integer___o_Slider_maximal_moving_steps_amount\n\t\t\t\t\t\t\t+\":\"+integer___o_Slider_moving_step_adjustments_amount\n\t\t\t\t\t\t\t+\":\"+integer___o_Slider_maximal_moving_step_adjustments_interval\n\t\t\t\t\t\t\t+\"-----------------------------------------------------------------------\");\n*/\n//\tANALYZE: necessity to check availability before full initialization\n\t\t\t\t$.F_CheckAvailability();\n\t\t\t}\n\t\t};\n\t\t\n\t\t$.object___o_Slider=\n\t\t{\n\t\t\tinteger___action_point_top_offset\t:0,\n\t\t\tinteger___action_point_left_offset\t:0,\n\n\t\t\tinteger___mouse_cursor_left_offset\t:0,\n\t\t\tinteger___mouse_cursor_top_offset\t:0,\n\t\t\t\n\t\t\tarray_object___movement_step_info \t:[],\n\t\t\t\n\t\t\tinteger___movement_step_index\t\t:0,\n\t\t\tinteger___movement_steps_amount\t\t:0,\n\t\t\t\n\t\t\tF_InitializePosition:function()\n\t\t\t{\n\t\t\t\tif ($.object_dom___target.scrollLeft>0)\n\t\t\t\t{\n\t\t\t\t\tif (Math.ceil($.object_dom___target.scrollLeft*$.float___o_Slider_movement_step)>=$.integer___o_Slider_maximal_left_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___o_Slider_maximal_left_offset+'px';\n\t\t\t\t\telse if (Math.ceil($.object_dom___target.scrollLeft*$.float___o_Slider_movement_step)<=$.integer___o_Slider_minimal_left_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___o_Slider_minimal_left_offset+'px';\n\t\t\t\t\telse \n\t\t\t\t\t\t$.object_dom___o_Slider.style.left=Math.ceil($.object_dom___target.scrollLeft*$.float___o_Slider_movement_step)+'px';\n\t\t\t\t}\n\t\t\t\telse if ($.object_dom___target.scrollTop>0)\n\t\t\t\t{\n\t\t\t\t\tif (Math.ceil($.object_dom___target.scrollTop*$.float___o_Slider_movement_step)>=$.integer___o_Slider_maximal_top_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___o_Slider_maximal_top_offset+'px';\n\t\t\t\t\telse if (Math.ceil($.object_dom___target.scrollTop*$.float___o_Slider_movement_step)<=$.integer___o_Slider_minimal_top_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___o_Slider_minimal_top_offset+'px';\n\t\t\t\t\telse \n\t\t\t\t\t\t$.object_dom___o_Slider.style.top=Math.ceil($.object_dom___target.scrollTop*$.float___o_Slider_movement_step)+'px';\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\tF_InitializeWidth:function(integer___borders_width)\n\t\t\t{\n\t\t\t\tjQuery($.object_dom___o_Slider).css('width',$.integer___o_Slider_offset_width+'px');\n\t\t\t\tjQuery($.object_dom___o_Slider).children('em').css('width',$.integer___o_Slider_offset_width-integer___borders_width+'px');\n\t\t\t},\n\t\t\tF_InitializeHeight:function(integer___borders_height)\n\t\t\t{\n\t\t\t\tjQuery($.object_dom___o_Slider).css('height',$.integer___o_Slider_offset_height+'px');\n\t\t\t\tjQuery($.object_dom___o_Slider).children('em').css('height',$.integer___o_Slider_offset_height-integer___borders_height+'px');\n\t\t\t},\n\t\t\t\n\t\t\tF_ProcessEvent_mousedown:function(object_dom___event)\n\t\t\t{\n\t\t\t\tobject_dom___event=object_dom___event||event;\n\t\t\t\t\n\t\t\t\t$.integer___mouse_cursor_coordinate_x=object_dom___event.clientX||object_dom___event.pageX;\n\t\t\t\t$.integer___mouse_cursor_coordinate_y=object_dom___event.clientY||object_dom___event.pageY;\n\t\t\t\t\n\t\t\t\t$.integer___mouse_cursor_coordinate_x+=Math.ceil(jQuery(document).scrollLeft()); //document.body.scrollLeft\n\t\t\t\t$.integer___mouse_cursor_coordinate_y+=Math.ceil(jQuery(document).scrollTop()); //document.body.scrollTop\n\t\t\t\t\n\t\t\t\t$.integer___previous_mouse_cursor_coordinate_x=$.integer___mouse_cursor_coordinate_x;\n\t\t\t\t$.integer___previous_mouse_cursor_coordinate_y=$.integer___mouse_cursor_coordinate_y;\n\t\t\t\t\n\t\t\t\t$.object___o_Slider.integer___action_point_left_offset\t=$.integer___mouse_cursor_coordinate_x-$.integer___left_offset-$.object_dom___o_Slider.offsetLeft;\n\t\t\t\t$.object___o_Slider.integer___action_point_top_offset\t=$.integer___mouse_cursor_coordinate_y-$.integer___top_offset-$.object_dom___o_Slider.offsetTop;\n\n\t\t\t\t__object___O_Scrollbar_configuration.varchar___active_component_id=$.varchar___id+'-'+$.varchar___position;\n\t\t\t\t__object___O_Scrollbar_configuration.bool___mouse_text_selection_availability=false;\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"id_div___layer-Main\").style.cursor=\"pointer\"; //fix for FF (document.body.style.cursor='pointer';)\n\t\t\t},\n\t\t\tF_ProcessEvent_mouseup:function()\n\t\t\t{\n\t\t\t\t$.integer___previous_mouse_cursor_coordinate_x=_;\n\t\t\t\t$.integer___previous_mouse_cursor_coordinate_y=_;\n\t\t\t\t\n\t\t\t\t__object___O_Scrollbar_configuration.varchar___active_component_id=_;\n\t\t\t\t__object___O_Scrollbar_configuration.bool___mouse_text_selection_availability=true;\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"id_div___layer-Main\").style.cursor=\"default\"; //fix for FF (document.body.style.cursor='default';)\n\t\t\t},\n\t\t\t\n\t\t\tF_ProcessEvent_mousemove:_,\n\t\t\t\n//\tANALYZE: case, when pass direct offsets (left,top,scrolling_left,scrolling_top) necessity and performance\n\t\t\tF_MoveToPosition:function(integer___offset,integer___scrolling_offset)\n\t\t\t{\n\t\t\t\tif ($.varchar___position=='horizontal')\n\t\t\t\t{\n\t\t\t\t\t$.object_dom___o_Slider.style.left\t=integer___offset+'px';\n\t\t\t\t\t$.object_dom___target.scrollLeft\t=integer___scrolling_offset;\n\t\t\t\t}\n\t\t\t\telse if ($.varchar___position=='vertical')\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$.object_dom___o_Slider.style.top\t=integer___offset+'px';\n\t\t\t\t\t$.object_dom___target.scrollTop\t\t=integer___scrolling_offset;\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\tF_MoveToMouseCursor:function(object_dom___event)\n\t\t\t{\n\t\t\t\tobject_dom___event=object_dom___event||event;\n\t\t\t\t\n\t\t\t\tif ($.varchar___position=='horizontal')\n\t\t\t\t{\n\t\t\t\t\t$.integer___mouse_cursor_coordinate_x=object_dom___event.clientX||object_dom___event.pageX;\n\t\n\t\t\t\t\t$.integer___mouse_cursor_coordinate_x+=Math.ceil(jQuery(document).scrollLeft()); //document.body.scrollLeft\n\t\t\t\t\t\n\t\t\t\t\t$.integer___mouse_cursor_horizontal_offset=$.integer___mouse_cursor_coordinate_x-$.integer___left_offset;\n\t\t\t\t\t\n\t\t\t\t\tif ($.integer___mouse_cursor_horizontal_offset>=$.integer___o_Slider_maximal_left_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___o_Slider_maximal_left_offset+'px';\n\t\t\t\t\telse if ($.integer___mouse_cursor_horizontal_offset<=$.integer___o_Slider_minimal_left_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___o_Slider_minimal_left_offset+'px';\n\t\t\t\t\telse \n\t\t\t\t\t\t$.object_dom___o_Slider.style.left=$.integer___mouse_cursor_horizontal_offset+'px';\n\t\t\t\t\t\n\t\t\t\t\tif ($.integer___target_scrolling_maximal_left_offset>$.integer___o_Slider_maximal_left_offset)\n\t\t\t\t\t\t$.object_dom___target.scrollLeft=$.object___o_Slider.array_object___movement_step_info[$.object_dom___o_Slider.offsetLeft].integer___target_scrolling_offset;\n\t\t\t\t\telse \n\t\t\t\t\t\t$.object_dom___target.scrollLeft=$.object_dom___o_Slider.offsetLeft;\n\t\t\t\t}\n\t\t\t\telse if ($.varchar___position=='vertical')\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$.integer___mouse_cursor_coordinate_y=object_dom___event.clientY||object_dom___event.pageY;\n\t\n\t\t\t\t\t$.integer___mouse_cursor_coordinate_y+=Math.ceil(jQuery(document).scrollTop()); //document.body.scrollLeft\n\t\t\t\t\t\n\t\t\t\t\t$.integer___mouse_cursor_vertical_offset=$.integer___mouse_cursor_coordinate_y-$.integer___top_offset;\n\t\t\t\t\t\n\t\t\t\t\tif ($.integer___mouse_cursor_vertical_offset>=$.integer___o_Slider_maximal_top_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___o_Slider_maximal_top_offset+'px';\n\t\t\t\t\telse if ($.integer___mouse_cursor_vertical_offset<=$.integer___o_Slider_minimal_top_offset)\n\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___o_Slider_minimal_top_offset+'px';\n\t\t\t\t\telse \n\t\t\t\t\t\t$.object_dom___o_Slider.style.top=$.integer___mouse_cursor_vertical_offset+'px';\n\t\t\t\t\t\n\t\t\t\t\tif ($.integer___target_scrolling_maximal_top_offset>$.integer___o_Slider_maximal_top_offset)\n\t\t\t\t\t\t$.object_dom___target.scrollTop=$.object___o_Slider.array_object___movement_step_info[$.object_dom___o_Slider.offsetTop].integer___target_scrolling_offset;\n\t\t\t\t\telse \n\t\t\t\t\t\t$.object_dom___target.scrollTop=$.object_dom___o_Slider.offsetTop;\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\tF_CalculateMovementSteps:function(integer___maximal_step,integer___maximal_steps_amount,integer___step_adjustments_amount,integer___maximal_step_adjustments_interval)\n\t\t\t{\n\t\t\t\tvar integer___step_adjustments_counter=0;\n\t\t\t\tvar integer___offset=0;\n\t\t\t\t\n\t\t\t\t$.object___o_Slider.array_object___movement_step_info[0]=\n\t\t\t\t{\n\t\t\t\t\tinteger___offset\t\t\t\t\t\t\t:$.integer___o_Slider_minimal_top_offset,\n\t\t\t\t\tinteger___target_scrolling_offset\t:$.integer___target_scrolling_minimal_top_offset\n\t\t\t\t};\n\n\t\t\t\tfor (var integer___index=1;integer___index<=integer___maximal_steps_amount;integer___index++)\n\t\t\t\t{\n//\tTODO,IMPORTANT: for case with 'integer___maximal_step_adjustments_interval=1' avoid first come min steps then all max, its cause outcentering indicator on middle values (shifted to right)\n\t\t\t\t\tif (integer___index%integer___maximal_step_adjustments_interval==0 \n\t\t\t\t\t\t&& integer___step_adjustments_counter<integer___step_adjustments_amount)\n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tinteger___step_adjustments_counter++;\n\t\t\t\t\t\tinteger___offset+=integer___maximal_step-1;\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t\tinteger___offset+=integer___maximal_step;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$.object___o_Slider.array_object___movement_step_info[integer___index]=\n\t\t\t\t\t{\n\t\t\t\t\t\tinteger___offset\t\t\t\t\t\t\t:integer___offset,\n//\tEND: calculate target offset\n\t\t\t\t\t\tinteger___target_scrolling_offset\t:integer___offset//integer___index*$.integer___value_changing_step>$.integer___maximal_value_limit?$.integer___maximal_value_limit:integer___index*$.integer___value_changing_step\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t$.F_CheckAvailability=function()\n\t\t{\n//\t\t\tconsole.log($.object_dom___target.scrollHeight+\":\"+$.object_dom___target.offsetHeight);\n\t\t\tif ($.varchar___position=='horizontal' && $.object_dom___target.scrollWidth>$.object_dom___target.offsetWidth)\n\t\t\t{\n\t\t\t\t$.object_dom___component.style.visibility='visible';\n\t\t\t\t\n\t\t\t\tjQuery($.object_dom___target).addClass(\"class_div___element-horizontal_scrollbar_status__visible\");\n\t\t\t\t\n//\t\t\t\t$.object___o_Slider.F_InitializePosition();\n\t\t\t}\n\t\t\telse if ($.varchar___position=='vertical' && $.object_dom___target.scrollHeight>$.object_dom___target.offsetHeight)\n\t\t\t{\n\t\t\t\t$.object_dom___component.style.visibility='visible';\n//\tANALYZE: class name 'class_div___element-ScrollableContainer-vertical_scrollbar_status__visible' and status....(enabled,active etc...)\n\t\t\t\tjQuery($.object_dom___target).addClass(\"class_div___element-vertical_scrollbar_status__visible\");\n\t\t\t\t\n//\t\t\t\t$.object___o_Slider.F_InitializePosition();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$.object_dom___component.style.visibility='hidden';\n\t\t\t\t\n//\tANALYZE,OPTMIZE: per companent need only one operation horizontal or vertical, but using composit name conversion BAD way due to optimization algorithm (hard to compress composit names)\n\t\t\t\tjQuery($.object_dom___target).removeClass(\"class_div___element-horizontal_scrollbar_status__visible\");\n\t\t\t\tjQuery($.object_dom___target).removeClass(\"class_div___element-vertical_scrollbar_status__visible\");\n\t\t\t}\n\t\t};\n\t}", "moveDown() {\n this.point.y += this.scrollSpeed;\n }", "restoreScroll(state = this.storedScrollState) {\n const me = this;\n\n // TODO: Implement special multi-element Scroller subclass for Grids which\n // encapsulates the x axis only Scrollers of all its SubGrids.\n me.eachSubGrid((subGrid) => {\n subGrid.scrollable.x = state.scrollLeft[subGrid.region];\n });\n\n me.scrollable.y = state.scrollTop;\n }", "function ScrollSpy(element,options){this.$body=$(document.body);this.$scrollElement=$(element).is(document.body)?$(window):$(element);this.options=$.extend({},ScrollSpy.DEFAULTS,options);this.selector=(this.options.target||'')+' .nav li > a';this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on('scroll.bs.scrollspy',$.proxy(this.process,this));this.refresh();this.process();}", "function ScrollSpy(element,options){this.$body=$(document.body);this.$scrollElement=$(element).is(document.body)?$(window):$(element);this.options=$.extend({},ScrollSpy.DEFAULTS,options);this.selector=(this.options.target||'')+' .nav li > a';this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on('scroll.bs.scrollspy',$.proxy(this.process,this));this.refresh();this.process();}", "scrollIntoView() {\n this.updated |= UPDATED_SCROLL;\n return this;\n }", "_horizontalScrollbarHandler() {\n const that = this;\n\n that.closeMenu();\n that.isScrolling = true;\n\n requestAnimationFrame(() => {\n that._recycle();\n that.isScrolling = false;\n });\n }", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.scrollspy');var options=(typeof option==='undefined'?'undefined':_typeof(option))=='object'&&option;if(!data)$this.data('bs.scrollspy',data=new ScrollSpy(this,options));if(typeof option=='string')data[option]();});}", "_scrollingStart() {\n this.scrolling = true\n this.style.focus.border.fg = this.borderScrolling\n this.focus()\n this.screen.render()\n this.emit(\"scrolling-start\")\n }", "get _scrollBottom(){return this._scrollPosition+this._viewportHeight;}", "function _scrollToY() {\r\n return scrollToObjY(this);\r\n}", "initScrollbar(){\n\t\tconst { fade = true } = this.options.scrollbar;\n\t\tthis.indicators = [];\n\t\tlet indicator;\n\n\t\tif (this.options.scrollX) {\n\t\t\tindicator = {\n\t\t\t\tel: createScrollbar('horizontal'),\n\t\t\t\tdirection: 'horizontal',\n\t\t\t\tfade\n\t\t\t};\n\t\t\tthis.insertScrollBar(indicator.el);\n\n\t\t\tthis.indicators.push(new Indicator(this, indicator));\n\t\t}\n\n\t\tif (this.options.scrollY) {\n\t\t\tindicator = {\n\t\t\t\tel: createScrollbar('vertical'),\n\t\t\t\tdirection: 'vertical',\n\t\t\t\tfade\n\t\t\t};\n\t\t\tthis.insertScrollBar(indicator.el);\n\t\t\tthis.indicators.push(new Indicator(this, indicator));\n\t\t}\n\n\t\tthis.on('refresh', () => {\n\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\tthis.indicators[i].refresh();\n\t\t\t}\n\t\t});\n\n\t\tif (fade) {\n\t\t\tthis.on('scrollEnd', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade(true);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade(true, true);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function initScroll(){var windowH=$(window).height(),newW=windowH/1400*29232+1e3/windowH*3;scrollWidth=newW-$(window).width(),$(\".helper\").width(newW),$(\"#wrapper,.helper\").height(windowH),myscroll=new iScroll(\"wrapper\",{hScrollbar:!0,useTransition:!0,hScroll:!0,vScroll:!1,checkDOMChanges:!0,bounce:!1,scrollbarClass:\"myScrollbar\"}),\n// \nmyscroll.options.onScrollStart=function(){\"block\"==$(\".detail\").css(\"display\")&&($(\".detail\").css(\"display\",\"none\"),$(\"#daoyu\").attr(\"id\",\"\")),\"block\"==$(\".detail-w\").css(\"display\")&&($(\".detail-w\").css(\"display\",\"none\"),$(\"#daoyu\").attr(\"id\",\"\"))},myscroll.options.onScrollEnd=function(){$(\".myScrollbarH\").hide(),timer&&clearTimeout(timer),timer=setTimeout(function(){clearTimeout(timer),timer=null,myscroll.scrollTo(myscroll.x+scrollWidth,0,Math.abs(5e5*(scrollWidth+myscroll.x)/scrollWidth),\"relative\")},2e4)},myscroll.scrollTo(scrollWidth,0,5e5,\"relative\"),$(\".myScrollbarH\").hide()}", "start() {\n\t\tthis.scroll.start();\n\t}", "function OCM_scrolling() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$offCanvasEl.mousewheel(function (event, delta) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.scrollTop -= (delta * 30);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "get scrollTarget() {\n return this.$.scrollable;\n }", "get scrollTarget() {\n return this.$.scrollable;\n }", "get scrollTarget() {\n return this.$.scrollable;\n }", "get scrollTarget() {\n return this.$.scrollable;\n }", "function makeScroll(obj){\n\t $(obj).attr('data-scroll', 'y');\n\t $(\"[data-scroll='y']\", obj.parentNode).each(function() {\n\n\t var $this = $(this);\n\t if ($this.hasClass(\"ui-scrolllistview\")) $this.scrolllistview();\n\t else {\n\t var st = $this.jqmData(\"scroll\") + \"\";\n\t var paging = st && st.search(/^[xy]p$/) != -1;\n\t var dir = st && st.search(/^[xy]/) != -1 ? st.charAt(0) : null;\n\t var opts = {};\n\t if (dir) opts.direction = st;\n\t //if (paging)\n\t opts.pagingEnabled = false;\n\t var method = $this.jqmData(\"scroll-method\");\n\t if (method) opts.scrollMethod = method;\n\t $this.scrollview(opts);\n\t }\n\t });\n\t}", "updateScroll() {\n\t\t\tthis.scrollPosition = window.scrollY;\n\t\t}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.scrollspy');var options=(typeof option===\"undefined\"?\"undefined\":_typeof2(option))=='object'&&option;if(!data)$this.data('bs.scrollspy',data=new ScrollSpy(this,options));if(typeof option=='string')data[option]();});}", "setScroll() {\n this.canScroll = true\n }", "initScroll() {\n this.libraryView.effetLibrarySelect.scrollTop += 1;\n this.libraryView.exempleLibrarySelect.scrollTop += 1;\n this.libraryView.intrumentLibrarySelect.scrollTop += 1;\n }", "setScrollPosition() {\n var step = this.state.step;\n var isVertical = this.props.vertical;\n var left = !isVertical ? step * this.state.width : 0;\n var top = isVertical ? step * this.state.height : 0;\n\n this.scroller.setPosition(left, top);\n this.scroller.scrollTo(left, top, false);\n }", "function scroller(){\n\t\t\t\t\t$('.scrollPage').click(function(){\n\t\t\t\t\t\tvar elementClicked = $(this).attr(\"href\");\n\t\t\t\t\t\tvar destination = $(elementClicked).offset().top;\n\t\t\t\t\t\t$(\"html:not(:animated),body:not(:animated)\").animate({\n\t\t\t\t\t\t\tscrollTop: destination - 1 //Number being the pixel distance from destination.\n\t\t\t\t\t\t}, 1000, 'easeInOutQuint');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}", "set scrolling(scrolling) {\n this._scrolling = scrolling;\n this.bodyContainer.classList[scrolling ? 'add' : 'remove']('b-scrolling');\n }", "function onScroll() {\n latest = getScrollY();\n requestTick();\n }", "setScrollClass() {\n if (!this.bodyWrapperCenter[0] || !this.bodyWrapperCenter[0].offsetHeight) return;\n const height = parseInt(this.bodyWrapperCenter[0].offsetHeight, 10);\n const headerHeight = this.headerRow ? this.headerRow[0].offsetHeight : 0;\n const tableHeight = parseInt(this.tableBody[0].offsetHeight, 10);\n this.element.removeClass('has-vertical-scroll has-visible-last-row has-horizontal-scroll');\n\n if (tableHeight < height - headerHeight) {\n this.element.addClass('has-visible-last-row');\n }\n\n if (!this.hasLeftPane && !this.hasRightPane) {\n return;\n }\n\n const hasScrollBarV = parseInt(this.bodyWrapperCenter[0].scrollHeight, 10) > height + 2;\n const width = parseInt(this.bodyWrapperCenter[0].offsetWidth, 10);\n const hasScrollBarH = parseInt(this.bodyWrapperCenter[0].scrollWidth, 10) > width;\n\n if (hasScrollBarV) {\n this.element.addClass('has-vertical-scroll');\n }\n if (hasScrollBarH) {\n this.element.addClass('has-horizontal-scroll');\n }\n }", "function DragToScroll() {\n this.boundaries = null;\n this.callback = null;\n}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function initializeScrollbar() { \n $(\".mcustomScroll\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"yx\",\n advanced:{\n updateOnContentResize: true\n }\n });\n\n $(\".mcustomScroll.mcustomScrollVerticalOnly\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"y\",\n advanced:{\n updateOnContentResize: true\n }\n });\n }", "calcScrollBarY() {\n let scrollBarBoxHeight = this.getScrollBarBoxHeight()\n let scrollRate = this.scrollRange.start / this.calcListItemCount()\n return scrollBarBoxHeight * scrollRate\n }", "scrollTo() {\n window.scroll({\n top: this.getCurrSlide().offsetTop,\n left: 0,\n behavior: 'smooth'\n })\n }", "update() {\n\t\tthis.scroll.update();\n\t}", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\t\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\t\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\t\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "cycle() {\n const self = this;\n const { element, options, isPaused } = self;\n\n Timer.clear(element, carouselString);\n if (isPaused) {\n Timer.clear(element, pausedClass);\n removeClass(element, pausedClass);\n }\n\n Timer.set(element, () => {\n if (!self.isPaused && isElementInScrollRange(element)) {\n self.index += 1;\n self.to(self.index);\n }\n }, options.interval, carouselString);\n }", "init() {\n this.scroller = document.querySelector('.scroller');\n\n if (this.scroller === null) return;\n\n this.wrapper = this.scroller.querySelector('.scroller__wrapper-inner');\n this.slides = this.wrapper.querySelectorAll('.scroller__slide');\n this.count = this.slides.length;\n\n if (this.count === 0) {\n this.scroller.parentNode.removeChild(this.slides);\n delete this.wrapper;\n delete this.slides;\n delete this.scroller;\n delete this.count;\n return;\n }\n\n this.transitions = document.documentElement.classList.contains('csstransitions');\n this.transforms = document.documentElement.classList.contains('csstransforms');\n\n this.paginator = this.scroller.querySelector('.scroller__paginator');\n this.prev_button = this.scroller.querySelector('.scroller__prev');\n this.next_button = this.scroller.querySelector('.scroller__next');\n\n this.prev_button.addEventListener('click', this.openPrevSlide.bind(this));\n this.next_button.addEventListener('click', this.openNextSlide.bind(this));\n\n let first_slide = this.slides[0].cloneNode(true)\n , last_slide = this.slides[this.count - 1].cloneNode(true);\n\n first_slide.classList.add('cloned');\n last_slide.classList.add('cloned');\n this.wrapper.appendChild(first_slide);\n this.wrapper.insertBefore(last_slide, this.slides[0]);\n\n let index = this.count;\n while (index--) {\n this.createButton(this.count - index - 1);\n }\n\n this.current_page = 0;\n this.paginator_buttons = this.paginator.querySelectorAll('.scroller__page');\n this.current_button = this.paginator_buttons[0];\n this.current_button.classList.add('scroller__page_current');\n\n this.animation = false;\n this.tansition_timer = null;\n\n if (this.transitions) {\n let transEndEventNames = {\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'oTransitionEnd',\n 'msTransition': 'MSTransitionEnd',\n 'transition': 'transitionend'\n };\n this.wrapper.addEventListener(transEndEventNames[Modernizr.prefixed('transition')], this.checkIndex.bind(this));\n }\n\n this.moveToFirst().delay().then(this.turnOn.bind(this));\n window.addEventListener('resize', this.resized.bind(this));\n }", "initSnap(){\n\t\tthis.currentPage = {};\n\t\tconst snap = this.options.snap;\n\n\t\tif (snap.loop) {\n\t\t\tlet children = this.scroller.children;\n\t\t\tif (children.length > 0) {\n\t\t\t\tprepend(children[children.length - 1].cloneNode(true), this.scroller);\n\t\t\t\tthis.scroller.appendChild(children[1].cloneNode(true));\n\t\t\t}\n\t\t}\n\n\t\tlet el = snap.el;\n\t\tif (typeof el === 'string') {\n\t\t\tel = this.scroller.querySelectorAll(el);\n\t\t}\n\n\t\tthis.on('refresh', () => {\n\t\t\tthis.pages = [];\n\n\t\t\tif (!this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet stepX = snap.stepX || this.wrapperWidth;\n\t\t\tlet stepY = snap.stepY || this.wrapperHeight;\n\n\t\t\tlet x = 0;\n\t\t\tlet y;\n\t\t\tlet cx;\n\t\t\tlet cy;\n\t\t\tlet i = 0;\n\t\t\tlet l;\n\t\t\tlet m = 0;\n\t\t\tlet n;\n\t\t\tlet rect;\n\t\t\tif (!el) {\n\t\t\t\tcx = Math.round(stepX / 2);\n\t\t\t\tcy = Math.round(stepY / 2);\n\n\t\t\t\twhile (x > -this.scrollerWidth) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile (y > -this.scrollerHeight) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor (; i < l; i++) {\n\t\t\t\t\trect = getRect(el[i]);\n\t\t\t\t\tif (i === 0 || rect.left <= getRect(el[i - 1]).left) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.pages[m]) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif (x > this.maxScrollX) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet initPage = snap.loop ? 1 : 0;\n\t\t\tthis.goToPage(this.currentPage.pageX || initPage, this.currentPage.pageY || 0, 0);\n\n\t\t\tconst snapThreshold = snap.threshold;\n\t\t\tif (snapThreshold % 1 === 0) {\n\t\t\t\tthis.snapThresholdX = snapThreshold;\n\t\t\t\tthis.snapThresholdY = snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('scrollEnd', () => {\n\t\t\tif (snap.loop) {\n\t\t\t\tif (this.currentPage.pageX === 0) {\n\t\t\t\t\tthis.goToPage(this.pages.length - 2, this.currentPage.pageY, 0);\n\t\t\t\t}\n\t\t\t\tif (this.currentPage.pageX === this.pages.length - 1) {\n\t\t\t\t\tthis.goToPage(1, this.currentPage.pageY, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (snap.listenFlick !== false) {\n\t\t\tthis.on('flick', () => {\n\t\t\t\tlet time = snap.speed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\t\tthis.goToPage(\n\t\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\t\ttime\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t}", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "function ScrollSpy(element, options) {\n\t this.$body = $(document.body)\n\t this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\n\t this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n\t this.refresh()\n\t this.process()\n\t }", "get scrollDistance() { return this._scrollDistance; }", "restoreScroll(state = this.storedScrollState) {\n const me = this; // TODO: Implement special multi-element Scroller subclass for Grids which\n // encapsulates the x axis only Scrollers of all its SubGrids.\n\n me.eachSubGrid(subGrid => {\n subGrid.scrollable.x = state.scrollLeft[subGrid.region];\n });\n me.scrollable.y = state.scrollTop;\n }", "function ViewportScrollPosition() { }", "function ViewportScrollPosition() { }", "scroll() {\n const env = this;\n const container = this['$container']['$node'];\n container.parentNode.addEventListener( 'scroll', function( e ) {\n env['$content'].scrollTop = container.parentNode.scrollTop;\n env['$content'].scrollLeft = container.parentNode.scrollLeft;\n env.setPage();\n });\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function ScrollSpy(element, options) {\n\t var process = $.proxy(this.process, this)\n\t\n\t this.$body = $('body')\n\t this.$scrollElement = $(element).is('body') ? $(window) : $(element)\n\t this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n\t this.selector = (this.options.target || '') + ' .nav li > a'\n\t this.offsets = []\n\t this.targets = []\n\t this.activeTarget = null\n\t this.scrollHeight = 0\n\t\n\t this.$scrollElement.on('scroll.bs.scrollspy', process)\n\t this.refresh()\n\t this.process()\n\t }", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scrollAnimate() {\n\n\t/*\t\t\t\tassignClassByNumber(\n\t\t\t\t\t\t\t$('#history'), // pass the jQuery object we're animating\n\t\t\t\t\t\t\tgetElementHeightAboveFold($('#history')),\n\t\t\t\t\t\t\thistoryFrames\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\tassignClassByNumber(\n\t\t\t\t\t\t\t$('#timeline-2010 h3'), // pass the jQuery object we're animating\n\t\t\t\t\t\t\tgetElementHeightAboveFold($('#timeline-2010 h3')), // pass the current (relative) scroll position\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t['popped', 300, 99999] // the 'script' array [ css class, scroll start pos, scroll end pos]\n\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\t\t\t\t\tassignClassByNumber(\n\t\t\t\t\t\t\t$('#timeline-2013 h3'), // pass the jQuery object we're animating\n\t\t\t\t\t\t\tgetElementHeightAboveFold($('#timeline-2013 h3')), // pass the current (relative) scroll position\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t['popped', 300, 99999] // the 'script' array [ css class, scroll start pos, scroll end pos]\n\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tassignClassByNumber(\n\t\t\t\t\t\t\t$('#timeline-2010 img'), // pass the jQuery object we're animating\n\t\t\t\t\t\t\tgetElementHeightAboveFold($('#timeline-2010 img')), // pass the current (relative) scroll position\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t['popped', 200, 99999] // the 'script' array [ css class, scroll start pos, scroll end pos]\n\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\t\t\t\t\tassignClassByNumber(\n\t\t\t\t\t\t\t$('#timeline-2013 img'), // pass the jQuery object we're animating\n\t\t\t\t\t\t\tgetElementHeightAboveFold($('#timeline-2013 img')), // pass the current (relative) scroll position\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t['popped', 200, 99999] // the 'script' array [ css class, scroll start pos, scroll end pos]\n\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t*/\n\t\t\t\t}", "get [scrollTarget]() {\n return this[ids].grippedContent;\n }" ]
[ "0.6424849", "0.6409387", "0.63328534", "0.6303255", "0.62154484", "0.6214183", "0.6214183", "0.6214183", "0.6214183", "0.6203554", "0.6202512", "0.61928904", "0.61734974", "0.6135548", "0.6109564", "0.6094813", "0.6077772", "0.6066652", "0.6066099", "0.6064882", "0.6058574", "0.6032346", "0.60298556", "0.60170746", "0.60141724", "0.60141724", "0.6009286", "0.5985609", "0.59836525", "0.5976141", "0.59747845", "0.5972973", "0.5972516", "0.59697115", "0.596707", "0.5956953", "0.5954773", "0.59529907", "0.5939143", "0.59337986", "0.59337986", "0.5923458", "0.590679", "0.5898672", "0.58984315", "0.58901954", "0.5880018", "0.58795315", "0.5878861", "0.5876486", "0.5870706", "0.58637077", "0.58637077", "0.58637077", "0.58637077", "0.58599824", "0.5858348", "0.5856699", "0.5853514", "0.5850746", "0.58431137", "0.583931", "0.58387434", "0.58351016", "0.58332396", "0.5832505", "0.58267695", "0.58267695", "0.58267695", "0.58267695", "0.5816764", "0.5813437", "0.58119893", "0.58101386", "0.58050674", "0.58050674", "0.58050674", "0.57916874", "0.57909864", "0.57878405", "0.5783712", "0.5783712", "0.5783712", "0.5783712", "0.5783712", "0.5783427", "0.577098", "0.5769765", "0.5769765", "0.5768946", "0.57651484", "0.57651484", "0.57651484", "0.5758062", "0.5756753", "0.5756753", "0.5756753", "0.5756753", "0.5756753", "0.5756353", "0.5750411" ]
0.0
-1
var that = this;
function urllib(d) { // nothing yet //console.log(this); //console.log(that); return {current: varval,}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contextOfThis(){\n return this\n}", "function whatIsThis() {\n return this;\n}", "function whatIsThis() {\n return this;\n}", "function whatIsThis() {\n console.log(\"this = \", this);\n}", "function whatisthis() {\n return this;\n }", "function foo() {\n alert(this);\n}", "function whatIsThis() {\n console.log(this);\n}", "function getThis(){\n // console.log(this);\n}", "function callThat(){\n console.log(this)\n }", "function checkThis()\n{\nconsole.log(this);\n}", "function logThis() {\n console.log(this);\n}", "function foo(){\n\tconsole.log(this); //window object\n}", "function calling() {\n console.log(this)\n}", "function foo(){\n console.log(this.bar);\n}", "function foo () {\n console.log(this); // what does this point to? // the global object, which is window\n}", "function self($this) {\n\treturn $this;\n}", "function foo() {\n console.log(this.bar);\n}", "function foo() {\n console.log(this.bar);\n}", "function foo() {\n console.log(this.bar);\n}", "function a() {\n console.log(this);\n}", "function functionThis() {\n val = this;\n}", "function thisFunction() {\n console.log(this);\n}", "function checkThis() {\n console.log(this);\n}", "function alertThis() {\n alert(this);\n}", "function a(){\n console.log(this)\n}", "function printThis() {\n console.log(this);\n}", "function foo() {\n\tconsole.log( this.bar );\n}", "function foo() {\n console.log( this.bar );\n}", "function myfunc(){\n console.log(this);\n}", "function a(){\n\tconsole.log(this)\t\n}", "function this1() {\n console.log(\"this in function\", this);\n}", "function hello() {\n\tconsole.log(this);\n}", "function demo(){\n console.log(this);\n}", "function myfunc() {\n console.log(this);\n}", "function thisExample(){\n\tconsole.log(this); //will also represent the Window\n}", "function SomeFunc() {\n //console.log(this);\n \n}", "function thisWindow(){\n console.log(this);\n}", "function a() {\n console.log(this)\n}", "function greet()\n{\n console.log(this);\n}", "constructor(o) {\n var self = this;\n }", "constructor(o) {\n var self = this;\n }", "function f(){\n console.log(this);\n }", "function x()\n{\n\tconsole.log(this);\n}", "function qwe(){\n // \"this\" is different here too!\n console.log(this); // not what we wanted!\n }", "function sayBye() {\n log(this);\n}", "function myname() {\n console.log('i am this', this) // 'this' have current calling reference\n\n} // undefined", "function whodis() {\n console.log(this);\n}", "function Welcome(){\n return this; //example\n}", "function foo() {\n console.log(\"gl \" + this.bar);\n}", "function perro(){\r\n console.log(this)\r\n}", "function log() {\n console.log(this);\n}", "initHandler() {\n var self = this;\n }", "function myPrivateMethod(){\n alert(that.myProperty);//alerts \"42\"\n alert(this.myProperty);//alerts \"undefined\"\n }", "function this_in_strict() {\n log(this)\n}", "function aFunction () {\n console.log(this); \n}", "function foo(){\n console.log(this.a);\n}", "function func() {\n return this;\n}", "function foo(){\n console.log(this.a);\n}", "function myFunction() {\n console.log(this);\n}", "function obj() { return this; }", "function foo() {\n console.log(this.a);\n}", "draw() {\n console.log(this);\n }", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}", "function getWindow(){\n return this;\n}", "function showThis() {\n console.log(this);\n}", "function myFunction() {\n console.log(this);\n}", "function GPT() {\n return this;\n}", "function thisLogger(){\n console.log(this)\n}", "start() {\n //let self = this;\n }", "play() {\n console.log(this);\n }", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo2() {\n console.log(this.a);\n}", "function foo2() {\n console.log(this.a);\n}", "function window() {\n console.log(this);\n}", "function window() {\n console.log(this);\n}", "function foo1() {\n console.log(\"Hello Foo1\");\n console.log(this);\n}", "function receiver() {\n return this;\n}", "print() {\n console.log(this) // here this means actually object\n }", "function globalBinding() {\n console.log(this); //points to the window object\n}", "function WindowGlobal = function() {\n return this\n }", "constructor(o) {\n super(o);\n var self = this;\n }", "constructor(o) {\n super(o);\n var self = this;\n }", "constructor(o) {\n super(o);\n var self = this;\n }", "constructor(o) {\n super(o);\n var self = this;\n }", "constructor(o) {\n super(o);\n var self = this;\n }", "constructor(o) {\n super(o);\n var self = this;\n }", "get target(){ return this.__target; }", "function doStuff() {\n console.log('I am doing things.');\n console.log(this);\n}", "function myName() {\n return this;\n}", "function h$getGlobal(that) {\n if(typeof global !== 'undefined') return global;\n return that;\n}", "function foo() {\n console.log( this.a );\n}", "function foo() {\n console.log( this.a );\n}" ]
[ "0.7088679", "0.6996949", "0.6996949", "0.6807182", "0.67879534", "0.66984016", "0.66964555", "0.6665635", "0.66271317", "0.6569171", "0.651752", "0.6454584", "0.6454572", "0.6438382", "0.6424949", "0.6420771", "0.6401824", "0.6401824", "0.6370205", "0.63697195", "0.63694257", "0.63480914", "0.6342675", "0.63283545", "0.6325506", "0.63153875", "0.6307196", "0.63043094", "0.6258763", "0.62534773", "0.6238758", "0.6229826", "0.62245196", "0.62174696", "0.6211214", "0.6210114", "0.6207693", "0.62052417", "0.6203778", "0.6202006", "0.6202006", "0.62017816", "0.6198094", "0.61923504", "0.6185547", "0.61798775", "0.61704564", "0.615326", "0.61061066", "0.60838103", "0.607234", "0.606734", "0.6066123", "0.6060293", "0.6058153", "0.6048483", "0.6044431", "0.6036939", "0.6024832", "0.60226494", "0.6018918", "0.6011231", "0.60015166", "0.60015166", "0.60015166", "0.60015166", "0.59855753", "0.59826434", "0.59760463", "0.5968127", "0.5963561", "0.5962086", "0.5957844", "0.59446317", "0.59446317", "0.59446317", "0.59446317", "0.59446317", "0.59446317", "0.59446317", "0.5944271", "0.5944271", "0.5943225", "0.5943225", "0.5932494", "0.59315026", "0.59277093", "0.5921197", "0.5917497", "0.5912538", "0.5912538", "0.5912538", "0.5912538", "0.5912538", "0.5912538", "0.59107715", "0.5910052", "0.5900429", "0.5894064", "0.58820295", "0.58820295" ]
0.0
-1
begin with some helper functions
function capitaliseFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "static private internal function m121() {}", "protected internal function m252() {}", "function _____SHARED_functions_____(){}", "static private protected internal function m118() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "transient private internal function m185() {}", "function Utils() {}", "function Utils() {}", "static transient private protected internal function m55() {}", "function Utils(){}", "transient final protected internal function m174() {}", "function Helper() {}", "static private protected public internal function m117() {}", "static protected internal function m125() {}", "function AeUtil() {}", "function DWRUtil() { }", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "static transient private protected public internal function m54() {}", "prepare() {}", "function miFuncion (){}", "function TMP(){return;}", "function TMP(){return;}", "static transient final private protected internal function m40() {}", "transient private protected public internal function m181() {}", "function Util() {}", "static transient private internal function m58() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "static transient final protected public internal function m46() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "static final private protected internal function m103() {}", "transient final private protected internal function m167() {}", "function TMP(){}", "function TMP(){}", "obtain(){}", "function __it() {}", "function fm(){}", "static final private protected public internal function m102() {}", "function FunctionUtils() {}", "function customHandling() { }", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "function TMP() {\n return;\n }", "function FAADataHelper() {\n}", "function Scdr() {\r\n}", "function oi(){}", "function ea(){}", "static transient final protected function m44() {}", "__previnit(){}", "function __func(){}", "transient final private internal function m170() {}", "static final protected internal function m110() {}", "function wa(){}", "prep(src) {\n\n // console.log('Before -----> \\n', src)\n\n let h = this.src.use_for[0] // TODO: add props here\n src = '\\t\\t let _pref = `${_id}<-'+h+'<-`\\n' + src\n\n FDEFS2.lastIndex = 0\n let call_id = 0 // Function call id (to make each call unique)\n\n do {\n var m = FDEFS2.exec(src)\n if (m) {\n let fkeyword = m[1].trim()\n let fname = m[2]\n let fargs = m[3]\n\n if (fkeyword === 'function') {\n // TODO: add _ids to inline functions\n } else {\n let off = m.index + m[0].indexOf('(')\n if (this.std[fname]) {\n src = this.postfix(src, m, ++call_id)\n //console.log(src)\n off+=4 // 'std_'\n }\n // Quick fix\n FDEFS2.lastIndex = off\n }\n }\n } while (m)\n\n // console.log('After ----->\\n', u.wrap_idxs(src))\n\n return u.wrap_idxs(src, 'std_')\n }", "function comportement (){\n\t }", "static transient final private protected public internal function m39() {}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static final private public function m104() {}", "static transient private public function m56() {}", "function setup() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "static private public function m119() {}", "function gather() {\n base();\n hootsuite();\n socialpilot();\n socialoomph();\n agorapulse();\n communit();\n crowdfire();\n loomly();\n planable();\n missinglettr();\n viraltag();\n}", "function StupidBug() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function _setup () {\n }", "transient private public function m183() {}", "static transient final private public function m41() {}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function userinfo_requester_routines() {\n\n}", "function Utils() {\n}", "function createInitialStuff() {\n\n\t//Sniðugt að búa til alla units í Levelinu hér og svoleiðis til \n\t// allt sé loadað áðurenn hann byrjar render/update\n\t//AKA það er betra að hafa þetta sem part af \"loading\" frekar en \n\t//byrjunar laggi\n}", "static transient final private protected public function m38() {}", "function fn() {\n\t\t }", "function Common(){}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "transient final private protected public internal function m166() {}", "function da(){}", "function da(){}", "function da(){}", "function HelperConstructor() {}", "function l(){t={},u=\"\",w=\"\"}", "prepare() {\n }", "function Common() {}", "function Ha(){}", "function hc(){}" ]
[ "0.65662664", "0.6473638", "0.63775975", "0.632043", "0.6246416", "0.61226255", "0.61174905", "0.61029696", "0.59229034", "0.59147596", "0.5820397", "0.5820397", "0.5814083", "0.5804759", "0.5804489", "0.57668304", "0.573242", "0.5730247", "0.5707165", "0.56519043", "0.5618232", "0.5598461", "0.5575258", "0.55678695", "0.555989", "0.55550385", "0.55550385", "0.5550317", "0.5534477", "0.5510197", "0.5505704", "0.54651725", "0.54651725", "0.54651725", "0.5442565", "0.54270875", "0.54270875", "0.54270875", "0.5417408", "0.5399864", "0.5383877", "0.5383877", "0.5360344", "0.53551835", "0.5345254", "0.5332124", "0.53310525", "0.53248006", "0.531814", "0.5314907", "0.5314509", "0.52709866", "0.5259606", "0.52509034", "0.5242732", "0.5221414", "0.52166593", "0.5205638", "0.5201675", "0.5199624", "0.51939636", "0.5187849", "0.51859146", "0.51658326", "0.5162429", "0.5162429", "0.5153843", "0.5153109", "0.51505554", "0.5145048", "0.514204", "0.5131611", "0.5126947", "0.51266253", "0.51266253", "0.51266253", "0.51266253", "0.5126292", "0.51101166", "0.5100909", "0.509827", "0.509827", "0.509827", "0.5097556", "0.5094149", "0.5089884", "0.5084241", "0.5082879", "0.50649774", "0.5062491", "0.5062491", "0.5059045", "0.50461817", "0.50461817", "0.50461817", "0.5039398", "0.5038236", "0.5022711", "0.5022144", "0.50219727", "0.5019929" ]
0.0
-1
begin with some helper functions
function capitaliseFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "static private internal function m121() {}", "protected internal function m252() {}", "function _____SHARED_functions_____(){}", "static private protected internal function m118() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "transient private internal function m185() {}", "function Utils() {}", "function Utils() {}", "static transient private protected internal function m55() {}", "function Utils(){}", "transient final protected internal function m174() {}", "function Helper() {}", "static private protected public internal function m117() {}", "static protected internal function m125() {}", "function AeUtil() {}", "function DWRUtil() { }", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "static transient private protected public internal function m54() {}", "prepare() {}", "function miFuncion (){}", "function TMP(){return;}", "function TMP(){return;}", "static transient final private protected internal function m40() {}", "transient private protected public internal function m181() {}", "function Util() {}", "static transient private internal function m58() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "static transient final protected public internal function m46() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "static final private protected internal function m103() {}", "transient final private protected internal function m167() {}", "function TMP(){}", "function TMP(){}", "obtain(){}", "function __it() {}", "function fm(){}", "static final private protected public internal function m102() {}", "function FunctionUtils() {}", "function customHandling() { }", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "function TMP() {\n return;\n }", "function FAADataHelper() {\n}", "function Scdr() {\r\n}", "function oi(){}", "function ea(){}", "static transient final protected function m44() {}", "__previnit(){}", "function __func(){}", "transient final private internal function m170() {}", "static final protected internal function m110() {}", "function wa(){}", "prep(src) {\n\n // console.log('Before -----> \\n', src)\n\n let h = this.src.use_for[0] // TODO: add props here\n src = '\\t\\t let _pref = `${_id}<-'+h+'<-`\\n' + src\n\n FDEFS2.lastIndex = 0\n let call_id = 0 // Function call id (to make each call unique)\n\n do {\n var m = FDEFS2.exec(src)\n if (m) {\n let fkeyword = m[1].trim()\n let fname = m[2]\n let fargs = m[3]\n\n if (fkeyword === 'function') {\n // TODO: add _ids to inline functions\n } else {\n let off = m.index + m[0].indexOf('(')\n if (this.std[fname]) {\n src = this.postfix(src, m, ++call_id)\n //console.log(src)\n off+=4 // 'std_'\n }\n // Quick fix\n FDEFS2.lastIndex = off\n }\n }\n } while (m)\n\n // console.log('After ----->\\n', u.wrap_idxs(src))\n\n return u.wrap_idxs(src, 'std_')\n }", "function comportement (){\n\t }", "static transient final private protected public internal function m39() {}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static final private public function m104() {}", "static transient private public function m56() {}", "function setup() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "static private public function m119() {}", "function gather() {\n base();\n hootsuite();\n socialpilot();\n socialoomph();\n agorapulse();\n communit();\n crowdfire();\n loomly();\n planable();\n missinglettr();\n viraltag();\n}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function StupidBug() {}", "function _setup () {\n }", "transient private public function m183() {}", "static transient final private public function m41() {}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function userinfo_requester_routines() {\n\n}", "function Utils() {\n}", "function createInitialStuff() {\n\n\t//Sniðugt að búa til alla units í Levelinu hér og svoleiðis til \n\t// allt sé loadað áðurenn hann byrjar render/update\n\t//AKA það er betra að hafa þetta sem part af \"loading\" frekar en \n\t//byrjunar laggi\n}", "static transient final private protected public function m38() {}", "function fn() {\n\t\t }", "function Common(){}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "transient final private protected public internal function m166() {}", "function da(){}", "function da(){}", "function da(){}", "function HelperConstructor() {}", "function l(){t={},u=\"\",w=\"\"}", "prepare() {\n }", "function Ha(){}", "function Common() {}", "function hc(){}" ]
[ "0.6565186", "0.64724314", "0.63765097", "0.63196456", "0.62453985", "0.61215764", "0.6115861", "0.6101588", "0.5922311", "0.59130716", "0.5819228", "0.5819228", "0.5812798", "0.5803729", "0.5802676", "0.5765833", "0.57315266", "0.5729387", "0.570645", "0.5650666", "0.5616967", "0.55969626", "0.5573677", "0.55684626", "0.55593175", "0.55551547", "0.55551547", "0.55491954", "0.5532996", "0.5509345", "0.55043685", "0.5465687", "0.5465687", "0.5465687", "0.5441201", "0.542648", "0.542648", "0.542648", "0.5416556", "0.5398042", "0.53841853", "0.53841853", "0.5359941", "0.5355357", "0.5344864", "0.5331023", "0.5330015", "0.5324192", "0.5319583", "0.5314784", "0.5312489", "0.52703846", "0.52594733", "0.52508587", "0.52413654", "0.5221645", "0.5216366", "0.52040225", "0.5200641", "0.519999", "0.5194771", "0.51877064", "0.5185071", "0.51653254", "0.51611555", "0.51611555", "0.51525766", "0.51513386", "0.5150627", "0.5145129", "0.5141006", "0.5131987", "0.51268816", "0.51268816", "0.51268816", "0.51268816", "0.5126737", "0.5125952", "0.5108207", "0.5099692", "0.50986284", "0.50986284", "0.50986284", "0.50967234", "0.5092727", "0.5089709", "0.5083105", "0.508265", "0.5065361", "0.50621116", "0.50621116", "0.5057711", "0.50463986", "0.50463986", "0.50463986", "0.5038939", "0.50387895", "0.5023002", "0.50224733", "0.5022399", "0.50199854" ]
0.0
-1
Export selected area on the map as a json encoded geoJson standard file, no backend calls simple HTML5 trick ;)
function exportToGeoJSON(element, content) { // HTML5 features has been used here var geoJsonData = 'data:application/json;charset=utf-8,' + encodeURIComponent(content); // TODO: replace closest() by using persistence id for templates, template id prefixed by unique id(i.e leaflet_id) var fileName = $(element).closest('form').attr('area-name') || 'geoJson'; var link = document.createElement("a"); link.download = fileName + '.json'; // Use the fence name given by the user as the file name of the JSON file; link.href = geoJsonData; document.body.appendChild(link); link.click(); document.body.removeChild(link); delete link; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exportToGeoJSON(link, content) {\n // HTML5 features has been used here\n var geoJsonData = 'data:application/json;charset=utf-8,' + encodeURIComponent(content);\n // TODO: replace closest() by using persistence id for templates, template id prefixed by unique id(i.e leaflet_id)\n var fileName = $(link).closest('form').find('#areaName').val() || 'geoJson';\n $(link).attr({\n 'href': geoJsonData,\n 'target': '_blank',\n 'download': fileName + '.json' // Use the fence name given by the user as the file name of the JSON file\n });\n}", "toGeoJSON () {\n return this.area\n }", "function exportGJ(e) {\n settings = {\n id: e.parameter.idBox,\n lon: e.parameter.lonBox,\n lat: e.parameter.latBox\n };\n \n // Update ui to show status\n updateUi();\n \n // Create GeoJSON file and pass back it's filepath\n var file = createGJFile();\n \n // Update ui to deliver file\n displayFile(file);\n}", "function serialize(feature) {\n\tvar type = document.getElementById(\"formatType\").value;\n // scrive la stringa in formato pretty json (solo geojson)\n var pretty = document.getElementById(\"prettyPrint\").checked;\n var str = formats['out'][type].write(feature, pretty);\n\n str = str.replace(/,/g, ', ');\n document.getElementById('output').value = str;\n}", "exportGeoJSON (options, callback) {\n this.overpass.get(\n this.id,\n {\n properties: OverpassFrontend.TAGS | OverpassFrontend.MEMBERS | OverpassFrontend.META | OverpassFrontend.GEOM\n },\n () => {},\n (err) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, this.GeoJSON(options))\n }\n )\n }", "function geoJsonToOutput(geojson) {\n\t// for now, only support one polygon feature at a time\n\tvar geometry = geojson[\"features\"][0][\"geometry\"];\n\tvar coords = geometry[\"coordinates\"][0];\n\t// create the OpenLayers map element\n\t// with GeoJSON object visualized\n\tcreateMap(coords);\n\t// convert object to string and format it nicely for output\n document.getElementById(\"geojson\").innerHTML = JSON.stringify(geojson,null,2);\n // convert object to string without formatting\n document.getElementById(\"geojson_uf\").innerHTML = JSON.stringify(geojson);\n // convert coords to BigQuery format\n // init with prefix\n var bq_string = \"POLYGON((\";\n for (var i=0; i < coords.length; i++) {\n \tvar latlon = coords[i];\n \t// append coord pair\n \tbq_string += latlon[0] + \" \" + latlon[1];\n \tif (i == coords.length - 1) {\n \t\t// don't add comma after last pair\n \t\tbreak;\n \t} else {\n \t\tbq_string += \",\";\n \t}\n }\n // add suffix\n bq_string += \"))\";\n // output string in BigQuery format\n document.getElementById(\"bigquery\").innerHTML = bq_string;\n}", "function get_geojson(area_id, client) {\n\tconst queries = [\n\t\tnew Query(\n\t\t\t'areas_vw',\n\t\t\t['id', 'name'],\n\t\t\t'id=$1',\n\t\t\t'GeoJSON',\n\t\t\t'en',\n\t\t\ttrue\n\t\t),\n\t\tnew Query(\n\t\t\t'points_of_interest',\n\t\t\t['id', 'area_id', 'name', 'type', 'comments'],\n\t\t\t'area_id=$1',\n\t\t\t'GeoJSON'\n\t\t),\n\t\tnew Query(\n\t\t\t'access_roads',\n\t\t\t['id', 'area_id', 'description'],\n\t\t\t'area_id=$1',\n\t\t\t'GeoJSON'\n\t\t),\n\t\tnew Query(\n\t\t\t'avalanche_paths',\n\t\t\t['id', 'area_id', 'name'],\n\t\t\t'area_id=$1',\n\t\t\t'GeoJSON'\n\t\t),\n\t\tnew JoinQuery(\n\t\t\tnew Query(\n\t\t\t\t'decision_points',\n\t\t\t\t['id', 'name', 'area_id', 'comments'],\n\t\t\t\t'area_id=$1',\n\t\t\t\t'GeoJson',\n\t\t\t\t'en'\n\t\t\t),\n\t\t\tnew Query(\n\t\t\t\t'decision_points_warnings',\n\t\t\t\t['warning', 'type'],\n\t\t\t\t'decision_point_id=$1',\n\t\t\t\t'GeoJson',\n\t\t\t\t'en',\n\t\t\t\tfalse\n\t\t\t),\n\t\t\t'decision_point_id=decision_points.id',\n\t\t\t'decision_points.area_id = $1'\n\t\t),\n\t\tnew Query(\n\t\t\t'zones',\n\t\t\t['id', 'area_id', 'class_code', 'comments'],\n\t\t\t'area_id=$1',\n\t\t\t'GeoJSON',\n\t\t\t'en',\n\t\t\ttrue\n\t\t)\n\t];\n\n\t// {debug} is just a way for me to redirect the output to files\n\tconst debug = true; // TODO set false in production\n\n\tpromiseOfGeoJson(area_id, client, queries)\n\t\t.then(geoJsonDoc => {\n\t\t\tclient.end();\n\t\t\tif (debug) {\n\t\t\t\tconsole.log(JSON.stringify(geoJsonDoc));\n\t\t\t}\n\t\t});\n}", "function writeJson(){\n mapjson = JSON.stringify(map, null, 4);\n fs.writeFile('asd/map.json', mapjson, 'utf8', function(){\n });\n}", "function saveZoneAsJSON() {\n let filepath = path.join(__dirname, '../data/json');\n if(!fs.existsSync(filepath)) {\n fs.mkdirSync(filepath)\n }\n filepath = path.join(__dirname, '../data/json/ZonesGeoJSON.json');\n jsonfile.writeFile(filepath, zoneGeoJSON)\n .catch(console.error);\n}", "function editorDownloadFile() {\n const blob = new Blob([JSON.stringify(mapBlueprint)], { type: 'application/json;charset=utf-8' });\n const url = window.URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.style.display = 'none';\n a.href = url;\n a.download = 'map.json';\n document.body.appendChild(a);\n a.click();\n window.URL.revokeObjectURL(url);\n}", "function savemap(){\r\n\r\n let download = document.getElementById(\"DownloadMap\");\r\n download.href = createFile(JSON.stringify(LEVELS));\r\n download.style.display = \"block\";\r\n\r\n}", "function serialize(feature) {\n var str = formats['out'][outformaType].write(feature);\n\t\t\tExt.getCmp('outputgeom').setValue(str);\n }", "function extentToGeoJson(x, y) {\n mapImplementation.ExtentToGeoJson(x, y);\n }", "function sendJSON() {\n if (_model.polylines.length < 1) {\n alert('There is no polygon yet. Hit enter to accept');\n return;\n } else if (selfIntersecting()) {\n alert('Your polygon can not interset itself');\n return;\n } else {\n //Works with ShapeDiver JSON components\n var polyJSON = {\n type: \"polyline\",\n data: polyToJSON()\n }\n ///Only works with Rhino7//////////\n //var poly = _model.polylines[0].toPolylineCurve();\n //var polyJSON = poly.toJSON(poly);\n ///////////////////////////////////\n console.log(JSON.stringify(polyJSON));\n downloadJSON(JSON.stringify(polyJSON), 'polygon.json', 'application/json');\n }\n}", "export() {\n // create the export ob\n let expOb = { panes: [] }\n let rnames = Object.keys(this.panes[0].dataForPlot)\n let csvData = []\n let csvString = \"regionname\"\n let i = 0\n // iterate over the panes\n for (let pane of this.panes) {\n // collect the relevant information\n // omit the boundary file\n let { regionBoundaryData, application, ...rest } = pane\n rest.ta = pane.ta.value\n expOb.panes.push(rest)\n csvData.push(Object.values(pane.dataForPlot))\n csvString += \",pane\" + i\n i += 1\n }\n let a = document.createElement(\"a\")\n let today = new Date()\n let datename = `neuro_choropleth_session_${today.getFullYear()}_${today.getMonth()}_${today.getDate()}_${today.getHours()}_${today.getSeconds()}`\n a.download = datename + \".json\" // note that the date elements start with 0 so december is going to be tthe 11th month, and jan is the 0th\n a.href = URL.createObjectURL(new Blob([JSON.stringify(expOb)]))\n a.click()\n // csv download\n // make header with pane listing\n csvString += \"\\n\"\n for (let i = 0; i < rnames.length; i++) {\n csvString += `${rnames[i]}`\n for (let j = 0; j < csvData.length; j++) {\n csvString += `,${csvData[j][i].toFixed(3)}`\n }\n csvString += \"\\n\"\n }\n a.download = datename + \".csv\"\n a.href = URL.createObjectURL(new Blob([csvString]))\n a.click()\n\n\n }", "function saveData() {\n // get the format the user has chosen\n var data_type = \"GeoJSON\",\n // define a format the data shall be converted to\n format = new ol.format[data_type](),\n // this will be the data in the chosen format\n data\n try {\n // convert the data of the vector_layer into the chosen format\n data = format.writeFeatures(\n vector_layer.getSource().getFeatures()\n )\n } catch (e) {\n // at time of creation there is an error in the GPX format (18.7.2014)\n $(\"#data\").val(e.name + \": \" + e.message)\n return\n }\n // $('#data').val(JSON.stringify(data, null, 4));\n return data\n }", "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.24342929034426,\n 38.150691355539586\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.277074920227072,\n 38.18335224460118\n\n ],\n [\n 13.30660067706301,\n 38.18389197106355\n\n ],\n [\n 13.278104888488791,\n 38.165808957979515\n\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.309476005126974,\n 38.13233005362,\n ],\n [\n\n 13.337628470947287,\n 38.135030534863766\n ],\n [\n 13.31805907397463,\n 38.11153300139878\n ]\n ]\n ]\n }\n }\n ]\n }\n}", "function saveKF(){\r\n var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify({speed,polygon,keyframes}));\r\n var downloadAnchorNode = document.createElement('a');\r\n downloadAnchorNode.setAttribute(\"href\", dataStr);\r\n downloadAnchorNode.setAttribute(\"download\", \"data.json\");\r\n downloadAnchorNode.click();\r\n downloadAnchorNode.remove();\r\n }", "function saveJSON() {\n // save stage as a json string\n var json = stage.toJSON();\n var data = \"text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(json));\n var a = document.createElement('a');\n a.href = 'data:' + data;\n a.download = 'canvas.json';\n a.innerHTML = 'download JSON';\n var container = document.getElementById('container');\n container.appendChild(a);\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}", "function downloadGeoJson(text, name) {\n var a = document.createElement('a');\n var type = name.split(\".\").pop();\n a.href = URL.createObjectURL( new Blob([text], { type:`text/${type === \"txt\" ? \"plain\" : type}` }) );\n a.download = name;\n a.click();\n }", "function annotationJSON()\n {\n // function to adjust precision of numbers when converting to JSON\n function twoDigits(key, val) {\n if (val != undefined)\n return val.toFixed ? Number(val.toFixed(2)) : val;\n }\n var blob = new Blob( [ JSON.stringify( storage, twoDigits ) ], { type: \"application/json\"} );\n return blob;\n }", "function drawnItemToJSON(layer) {\n\n // Calculate feature coordinates\n var latlngs;\n if (layer instanceof L.Polygon) {\n latlngs = layer._defaultShape ? layer._defaultShape() : layer.getLatLngs();\n } else {\n latlngs = layer.getLatLng();\n }\n\n const feature = {\n \"options\": layer.options,\n \"properties\": layer.properties,\n \"latlngs\": latlngs\n };\n\n return feature;\n\n}", "function renderGeoJson(map) {\n // Leaflet has no direct support to load GeoJSON from a URL, so using jQuery\n $.getJSON(\"regions.json\", function(data) {\n geojsonGroup = new L.GeoJSON(data, { style: { color: \"#FF0000\" },\n onEachFeature: multiSelectSupport\n });\n geojsonGroup.addTo(map)\n });\n}", "function export_grid() {\n var array = [];\n\n for (var i = 0; i < grid.children.length; i++) {\n array.push(grid.getChildAt(i).currentFrame);\n }\n var thisMap = { \n \"width\":width, \n \"height\":height, \n \"tile_size\":tile_size, \n \"map\":array\n };\n\n return(JSON.stringify(thisMap));\n}", "function showAreaOnMap()\n{\n fillPoly(areaIDData,pointArray);\n}", "function drawArea(area){\n\tvar verts = [];\n\n\tfor(var i=0; i < area.area_vertices.length; i++){\n\t\tarea_verts = area.area_vertices[i];\n\t\tverts.push([area_verts.x,area_verts.y]);\n\t}\n\tvar poly = L.polygon(verts);\n\tpoly.bindPopup(area.area_name);\n\n\treturn poly;\n}", "function geoWrite(config, geoData) {\n // mongoose.connect(config.db);\n // var db = mongoose.connection;\n // var collection = db.collection('geo');\n // console.log(\"about to update\")\n // console.log(geoData);\n // collection.update({ _id: ObjectId(\"5773497a893c69e9b7a86dad\") }, { $push: { $each: geoData}}, function(err, result){\n // if (err){\n // console.log(err);\n // }\n // else{\n // console.log('inserted %d into the \"geo\" collection. The documents inserted with \"_id\" are: ', result.length, result);\n // }\n // db.close();\n // });\n \n jsonfile.writeFile(\"./public/geo.geojson\", geoData, {spaces: 2}, function(err){\n if (err){\n console.error(err)\n }\n });\n \n}", "function convertJson() {\n\tvar jsonstring = document.getElementById(\"geojson\").textContent;\n\tif (jsonstring == '') {\n\t\tjsonstring = document.getElementById(\"geojson_uf\").textContent;\n\t}\n\ttry {\n\t\tvar geojson = JSON.parse(jsonstring);\n\t\t// check for full GeoJSON (if copied directly from http://geojson.io/)\n\t\tif (geojson[\"type\"] == \"FeatureCollection\" && geojson[\"features\"] != undefined) {\n\t\t\t// geojson is formatted correctly already\n\t\t\t// so we don't need to do anything\n\t\t} else if (geojson[\"type\"] == \"Feature\" && geojson[\"geometry\"] != undefined) {\n\t\t\tgeojson = {\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [\n\t\t\t\t\tgeojson\n\t\t\t\t]\n\t\t\t}\n\t\t} else if (geojson[\"type\"] == \"Polygon\" && geojson[\"coordinates\"] != undefined) {\n\t\t\tgeojson = {\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [{\n\t\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\t\"properties\": {},\n\t\t\t\t\t\"geometry\": geojson\n\t\t\t\t}]\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Warning: GeoJSON is not formatted correctly.\")\n\t\t}\n\t\t// check switch toggle for input coordinate system\n\t\t// and convert if necessary\n\t\tif (document.getElementById('EPSG4326').checked != true) {\n\t\t\tgeojson = convertEPSG3857to4326(geojson);\n\t\t}\n\t\tgeoJsonToOutput(geojson);\n\t} catch(error) {\n\t\talert(\"Warning: GeoJSON is not formatted correctly. \\n\" + error);\n\t}\n}", "function exportLayerAsGeoJSON(lyr, dataset, opts, asFeatures, ofmt) {\n var properties = exportProperties(lyr.data, opts),\n shapes = lyr.shapes,\n ids = exportIds(lyr.data, opts),\n items, stringify;\n\n if (opts.ndjson) {\n stringify = stringifyAsNDJSON;\n } else if (opts.prettify) {\n stringify = getFormattedStringify(['bbox', 'coordinates']);\n } else {\n stringify = JSON.stringify;\n }\n\n if (properties && shapes && properties.length !== shapes.length) {\n error(\"Mismatch between number of properties and number of shapes\");\n }\n\n return (shapes || properties || []).reduce(function(memo, o, i) {\n var shape = shapes ? shapes[i] : null,\n exporter = GeoJSON.exporters[lyr.geometry_type],\n geom = shape ? exporter(shape, dataset.arcs, opts) : null,\n obj = null;\n if (asFeatures) {\n obj = GeoJSON.toFeature(geom, properties ? properties[i] : null);\n if (ids) {\n obj.id = ids[i];\n }\n } else if (!geom) {\n return memo; // don't add null objects to GeometryCollection\n } else {\n obj = geom;\n }\n if (ofmt) {\n // stringify features as soon as they are generated, to reduce the\n // number of JS objects in memory (so larger files can be exported)\n obj = stringify(obj);\n if (ofmt == 'buffer') {\n obj = encodeString(obj, 'utf8');\n // obj = stringToBuffer(obj);\n // obj = new Buffer(obj, 'utf8');\n }\n }\n memo.push(obj);\n return memo;\n }, []);\n }", "function createDownloadZipShapefile (filename) {\n return function (dispatch, getState) {\n const geoJSON = getState().layerCustomFeature.geoJSONDrawnFeatures;\n geoJSON.features.forEach(feature => {\n const singleGeoJSONFeature = {\n type: \"FeatureCollection\",\n features: [feature]\n };\n let zip = createZipFileFromGeoJSON(singleGeoJSONFeature, filename);\n const content = zip.generate({compression: 'STORE'});\n location.href = 'data:application/zip;base64,' + content;\n });\n };\n}", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "function ufoToGeoJson(ufo) {\n return {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [\n ufo.fields.location.lon,\n ufo.fields.location.lat\n ]\n },\n properties: {\n title: ufo.fields.locationName,\n ufo: ufo\n }\n };\n}", "function toJson() {\n\tjson = JSON.stringify(graph);\n\tvar blob = new Blob([json], {\n\t\ttype: \"text/plain;charset=utf-8\"\n\t});\n\tsaveAs(blob, \"save\" + \".json\");\n}", "addFeature(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n \"layer\": \"default\",\n \"values\": {}\n }, json);\n let map = self.maps[options.map].object;\n let layer = self.maps[options.map].layers[options.layer];\n let view = map.getView();\n let source = layer.getSource();\n console.log(layer);\n let projection = \"EPSG:\" + options.geometry.match(/SRID=(.*?);/)[1];\n let wkt = options.geometry.replace(/SRID=(.*?);/, '');\n let format = new ol_format_WKT__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n let feature = format.readFeature(wkt);\n options.values.geometry = feature.getGeometry().transform(projection, view.getProjection().getCode());\n source.addFeature(new ol__WEBPACK_IMPORTED_MODULE_1__[\"Feature\"](options.values));\n self.finished(pid, self.queue.DEFINE.FIN_OK);\n }", "function refreshGeoJsonFromData() {\n map.data.toGeoJson(function(geoJson) {\n geoJsonInput.value = JSON.stringify(geoJson, null, 2);\n\n refreshDownloadLinkFromGeoJson();\n });\n}", "function csvToGeoJSON(){ //csv = reader.result\r\n\t\t\tvar lines=csv.split(/[\\r\\n]+/); // split for windows and mac csv (newline or carriage return)\r\n\t\t\tdelete window.csv; // reader.result from drag&drop not needed anymore\r\n\t\t\tvar headers=lines[0].split(\",\"); //not needed?\r\n\t\t\tvar matchID = document.getElementById(\"coordIDSelect\").value;\r\n\t\t\tvar xColumn = document.getElementById(\"xSelect\").value;\r\n\t\t\tvar yColumn = document.getElementById(\"ySelect\").value;\r\n\r\n\t\t\t// get the positions of the seleted columns in the header\r\n\t\t\tvar positionMatchID = headers.indexOf(matchID);\r\n\t\t\tvar positionX = headers.indexOf(xColumn);\r\n\t\t\tvar positionY = headers.indexOf(yColumn);\r\n\r\n\t\t\tvar obj_array = []\r\n\t\t\tfor(var i=1;i<lines.length-1;i++){\r\n\t\t\t\tvar json_obj = {\"type\": \"Feature\"};\r\n\t\t\t\tvar currentline=lines[i].split(\",\");\r\n\t\t\t\t//for(var j=0;j<headers.length;j++){\r\n\t\t\t\t\tjson_obj[\"geometry\"] = {\r\n\t\t\t\t\t\t\t\"type\" : \"Point\",\r\n\t\t\t\t\t\t\t\"coordinates\" : [parseFloat(currentline[positionX]), parseFloat(currentline[positionY])]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tjson_obj[\"properties\"] = {};\r\n\t\t\t\t\tjson_obj[\"properties\"][matchID] = currentline[positionMatchID]; // get the name of zaehlstellen variable\r\n\t\t\t\t\tobj_array.push(json_obj);\r\n\t\t\t};\r\n\r\n\t\tvar complete_geojson = {\"type\":\"FeatureCollection\",\r\n\t\t\t\t\t\t\t\t\"features\": obj_array // all objects of the csv\r\n\t\t\t\t\t\t\t\t}\r\n\t//\talert(complete_geojson);\r\n\t\treturn complete_geojson; //return geoJSON\r\n\t}", "function convertEPSG3857to4326(geojson) {\n\tvar geom = [];\n\tvar vectorSource = new ol.source.Vector({\n\t\tfeatures: (new ol.format.GeoJSON()).readFeatures(geojson)\n\t});\n\tvectorSource.forEachFeature(function(feature) {\n\t\tgeom.push(new ol.Feature(feature.getGeometry().clone().transform('EPSG:3857', 'EPSG:4326')));\n\t});\n\tvar writer = new ol.format.GeoJSON();\n\tvar geoJsonStr = writer.writeFeatures(geom);\n\tgeojson = JSON.parse(geoJsonStr);\n\tconsole.log(geojson)\n\treturn geojson;\n}", "function addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}", "function exportMap() {\n var centerMap = vm.map.getCenter();\n var exportUrl = angular.copy(staticMapUrl);\n exportUrl += '&center=' + centerMap.lat() + ',' + centerMap.lng();\n exportUrl += '&size=640x480';\n exportUrl += '&maptype=google.maps.MapTypeId.ROADMAP';\n exportUrl += '&zoom=' + vm.map.getZoom();\n vm.markers.forEach(function (marker) {\n exportUrl += '&markers=color:red|' + marker.lat + ',' +\n marker.lng;\n });\n $window.open(exportUrl);\n }", "function refreshGeoJsonFromData() {\n map.data.toGeoJson(function(geoJson) {\n geoJsonInput.value = JSON.stringify(geoJson, null, 2);\n refreshDownloadLinkFromGeoJson();\n });\n}", "function serializeArea(area) {\n if (!area || !area.type) {\n return null;\n }\n if (area.type === 'tab-area') {\n return {\n type: 'tab-area',\n currentIndex: area.currentIndex,\n widgets: area.widgets\n .map(function (widget) { return Private.nameProperty.get(widget); })\n .filter(function (name) { return !!name; })\n };\n }\n return {\n type: 'split-area',\n orientation: area.orientation,\n sizes: area.sizes,\n children: area.children.map(serializeArea)\n };\n }", "function createGeojsonOverlay(data, overlay, outlineColor)\n{\n L.geoJson(data, \n {\n // Style each feature \n style: function(feature) \n {\n if (feature.properties.STATE != \"27\")\n {\n console.log(feature);\n return {\n color: \"clear\",\n fillOpacity: 0.0,\n weight: 1.0\n };\n }\n else return {\n color: outlineColor,\n fillOpacity: 0.0,\n weight: 1.0\n };\n }\n }).addTo(overlay);\n}", "function exportToJsonFile() {\n let dataStr = JSON.stringify(data.dayData);\n let dataUri =\n 'data:application/json;charset=utf-8,' + encodeURIComponent(dataStr);\n let exportFileDefaultName = 'data.json';\n let linkElement = document.createElement('a');\n linkElement.setAttribute('href', dataUri);\n linkElement.setAttribute('download', exportFileDefaultName);\n linkElement.click();\n}", "function saveAreaButton()\n{\n\tareaData = new Object();\n\tareaData.name = document.getElementById(\"AreaName\").value;\n\t\n\t//Data checking\n\tif(!areaData.name){\n\t\tdocument.getElementById(\"alertMessageText\").style.color = \"#FFFFFF\";\n document.getElementById(\"alertMessageText\").style.fontWeight = \"bold\";\n document.getElementById(\"alertMessageText\").innerHTML = \"You must enter a name for the area you wish to create.\";\n\t\treturn false;\n\t}\n\t\n if(currentAreaPoly.length >= 3)\n {\n google.maps.event.clearListeners(map, 'click');\n //send area to database\n \n \n areaData.userID = userID;\n areaData.points = currentAreaPoly;\n areaData.color = document.getElementById(\"area_color\").value;\n\n var returnedAreaID = 0;\n $.ajax({\n type: \"POST\",\n url: \"AreaHandler.php\",\n data: { createArea:JSON.stringify(areaData) },\n dataType: \"json\",\n success: function(msg){ returnedAreaID = parseInt(msg); //check if team was assigned to area\n if(document.getElementById(\"teamList\").value != \"all\")\n { \n assignArea(returnedAreaID,document.getElementById(\"teamList\").value); \n }}});\n\n\n\n //reset all data for next area\n poly.setMap(null);\n currentAreaPoly = [];\n pointCount = 0;\n var polyOptions = \n {\n strokeColor: document.getElementById(\"area_color\").value,\n strokeOpacity: 1.0,\n strokeWeight: 3\n };\n poly = new google.maps.Polyline(polyOptions);\n poly.setMap(map);\n updateAreaSelectMenu();\n fillPoly(areaData.name,areaData.points);\n //clear current points on map\n for(var cnt=0; cnt <workingAreaPointArray.length; cnt++)\n {\n workingAreaPointArray[cnt].setMap(null);\n }\n document.getElementById(\"alertMessageText\").style.color = \"#FFFFFF\";\n document.getElementById(\"alertMessageText\").style.fontWeight = \"bold\";\n document.getElementById(\"alertMessageText\").innerHTML = \"Area created!\";\n\t\thideAreaBox();\n }\n else\n {\n document.getElementById(\"alertMessageText\").style.color = \"#FF0000\";\n document.getElementById(\"alertMessageText\").style.fontWeight = \"bold\";\n document.getElementById(\"alertMessageText\").innerHTML = \"You must have 3 or more points on the maps to create an area.\";\n }\n \n \n\n \n}", "function save() { \n const a = document.createElement(\"a\") \n const settings = { atype: \"setting\", canvasWidth: currentCanvasSizeX, canvasHeight: currentCanvasSizeY, foreTexture: document.getElementById('foreImage').dataset.aid, backTexture: document.getElementById('backImage').dataset.aid }\n const symbols = { atype : \"symbol\", contents : actionArray } \n const paths = { atype : \"path\", contents : pathRawArray } \n const obj = { settings: settings, symbols: symbols, paths: paths }\n a.href = URL.createObjectURL(new Blob([JSON.stringify(obj)], {type: \"text/plain; charset=utf-8\"}))\n a.setAttribute(\"download\", \"data.json\")\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n }", "function debugAjax(){\n //use ajax and jQuery to open map.geojson\n \t$.ajax(\"data/map.geojson\", {\n //datatype of file is geojson\n \t\tdataType: \"JSON\",\n //if map.geojson is opened, jQueryCallback function is called\n \t\t\"success\": jQueryCallback\n });\n console.log(data)\n }", "function displayGeojson(dataIn) {\n var routeLayer = new google.maps.Data();\n //routeLayer.setMap(null);\n var geojsonURL1 = 'http://localhost:9000/routeserver/';\n var geojsonURL2 = 'TMRoutes?=format%3Djson&format=json&rte=';\n var geojsonRteURL = dataIn;\n routeLayer.loadGeoJson(geojsonURL1 + geojsonURL2 + geojsonRteURL);\n routeLayer.setStyle(function(feature){\n return{\n strokeColor: 'blue',\n strokeOpacity: 0.5,\n };\n })\n routeLayer.setMap(map);\n mapObjects.push(routeLayer);\n}", "async function getIso(coords) {\n\n var lon = coords[0];\n var lat = coords[1];\n\n\n const query = await fetch(\n `${urlBase}${profile}/${lon},${lat}?contours_minutes=${minutes}&polygons=true&access_token=${mapboxgl.accessToken}`,\n { method: 'GET' }\n );\n const data = await query.json();\n console.log(data);\n\n\n\n if(map.getLayer('iso')) {\n map.removeLayer('iso');\n map.removeLayer('iso')\n }\n\n\n map.addSource('iso', {\n type: 'geojson',\n data: {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n \n map.addLayer(\n {\n 'id': 'iso',\n 'type': 'fill',\n 'source': 'iso',\n 'layout': {},\n 'paint': {\n 'fill-color': '#5a3fc0',\n 'fill-opacity': 0.7\n }\n },\n 'poi-label'\n );\n\n map.getSource('iso').setData(data);\n\n console.log(turf.bbox(data))\n\n\n map.fitBounds(turf.bbox(data), {\n linear: true,\n padding: 100\n })\n\n\n\n}", "function Map_geojson() {\r\n\r\n map = L.map('map').setView([18.4339230205526, 77.3208450000667], 11);\r\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\r\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\r\n}).addTo(map);\r\n\r\n// this style use in polygon map in react js \r\n var myStyle = {\r\n \"color\": '#800026',\r\n \"weight\": 5,\r\n \"opacity\": 0.65\r\n };\r\n //All polygon show the map using GEOJSON Data \r\n \r\n // var geoJsonLayer = \r\n L.geoJSON(testmap.features, {\r\n style: myStyle,\r\n //onEach feature use the importent in proprities system \r\n \r\n onEachFeature: function( feature, layer) {\r\n //Popup use the sho the text id=?, And Village Name =?\r\n layer.on('mouseover', function () {\r\n this.setStyle({\r\n 'fillColor': '#0000ff'\r\n });\r\n });\r\n layer.on('mouseout', function () {\r\n this.setStyle({\r\n 'fillColor': '#ff0000'\r\n });\r\n })\r\n layer.on('click', function () {\r\n // Let's say you've got a property called url in your geojsonfeature:\r\n window.location = feature.properties.f1;\r\n });\r\n \r\n var popupText = 'id: <b>' + feature.properties.f1 + '</b>' + '<br/>NAME: <b>' + feature.properties.f2 + '</b>';\r\n layer.bindPopup(popupText);\r\n },\r\n //All variabale are Add to this map \r\n }).addTo(map)}", "function getData(map){\r\n $.ajax(\"data/MidWesternCities5.geojson\", {\r\n dataType: \"json\",\r\n success: function(response){\r\n \r\n var attributes = processData(response);\r\n \r\n createPropSymbols(response, map, attributes);\r\n createSequenceControls(map, attributes);\r\n createLegend(map, attributes);\r\n \r\n \r\n }\r\n \r\n });\r\n}", "function drawAreas(data) {\n allAreas = data.object;\n if (allAreas.length == 1) {\n // todo ???\n }\n else {\n for (var i = 0; i < allAreas.length; i++) {\n var id = allAreas[i].ID;\n if (id == \"universe\" || id == \"University\") {\n // don't do anything --> University isn't been drawn\n }\n else {\n var x = allAreas[i].topLeftX;\n var y = allAreas[i].topLeftY;\n var width = allAreas[i].width;\n var height = allAreas[i].height;\n\n\n var div = document.getElementById(\"map_png_div\");\n var clickedArea = \"\";\n clickedArea += '<div id=\"' + id + '\" onClick=\"clickOnArea(' + id + ')\" style=\" cursor:pointer; background-color: #990099; border: 2px solid black; opacity: .5; filter: alpha(opacity=50); position:absolute; margin-top:' + (+y + +2) + 'px; margin-left: ' + (+x + +2) + 'px; width: ' + (+width - +4) + 'px; height: ' + (+height - +4) + 'px;\"></div>';\n div.innerHTML = div.innerHTML + clickedArea;\t//#C2DFFF\n }\n } // for end\n }\n}", "function gjDialog() {\n var headersRaw = getHeaders(sheet, activeRange, 1);\n\n // Create a new UI\n var app = UiApp.createApplication()\n .setTitle('Export GeoJSON')\n .setStyleAttribute('width', '460')\n .setStyleAttribute('padding', '20');\n\n // Create a grid to hold the form\n var grid = app.createGrid(4, 2);\n\n // Add form elements to the grid\n grid.setWidget(0, 0, app.createLabel('Unique ID:'));\n grid.setWidget(0, 1, app.createListBox().setName('idBox').setId('idBox'));\n grid.setWidget(1, 0, app.createLabel('Longitude:'));\n grid.setWidget(1, 1, app.createListBox().setName('lonBox').setId('lonBox'));\n grid.setWidget(2, 0, app.createLabel('Latitude:'));\n grid.setWidget(2, 1, app.createListBox().setName('latBox').setId('latBox'));\n\n // Set the list boxes to the header values\n for (var i = 0; i < headersRaw.length; i++) {\n app.getElementById('idBox').addItem(headersRaw[i]);\n app.getElementById('lonBox').addItem(headersRaw[i]);\n app.getElementById('latBox').addItem(headersRaw[i]);\n }\n\n // Create a vertical panel...\n var panel = app.createVerticalPanel().setId('settingsPanel');\n\n panel.add(app.createLabel(\n 'To format your spreadsheet as GeoJSON file, select the following columns:'\n ).setStyleAttribute('margin-bottom', '20'));\n\n // ...and add the grid to the panel\n panel.add(grid);\n\n // Create a button and click handler; pass in the grid object as a\n // callback element and the handler as a click handler\n // Identify the function b as the server click handler\n var button = app.createButton('Export')\n .setStyleAttribute('margin-top', '10')\n .setId('export');\n var handler = app.createServerClickHandler('exportGJ');\n handler.addCallbackElement(grid);\n button.addClickHandler(handler);\n\n // Add the button to the panel and the panel to the application,\n // then display the application app in the spreadsheet doc\n grid.setWidget(3, 1, button);\n app.add(panel);\n ss.show(app);\n}", "function save() {\n var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(lastSketch));\n var downloadAnchorNode = document.createElement('a');\n downloadAnchorNode.setAttribute(\"href\", dataStr);\n downloadAnchorNode.setAttribute(\"download\", \"test.json\");\n document.body.appendChild(downloadAnchorNode); // required for firefox\n downloadAnchorNode.click();\n downloadAnchorNode.remove();\n }", "function saveToFile(latLng, edges) {\n var path = '/tmp/' + String(latLng.lat) + 'x' + String(latLng.lng) + '.json';\n fs.writeFile(path, JSON.stringify(edges, null, '\\t'), function(err) {\n if (err)\n console.log(err);\n else\n console.log(\"saved tmp data to:\", path);\n });\n}", "function getData(req, res) {\n\n var coords = req,\n sql_poly = [],\n points = [];\n\n for (var i in coords) {\n sql_poly.push(coords[i].lng);\n sql_poly.push(coords[i].lat);\n };\n\n // close the polygon\n sql_poly.push(coords[0].lng);\n sql_poly.push(coords[0].lat);\n\n // write the correct number of st_point functions\n for (var j=1; j<=sql_poly.length; j+=2) {\n points.push('ST_SetSRID(ST_Point($' + j + ',' + '$' +(j+1) + '), 4326)');\n }\n\n var sql = \"SELECT address, zipcode, borough, borocode, block, lot, cd, ownername, ownertype,\"+\n \"numfloors, yearbuilt, zonedist1, zonedist2, zonedist3,\" +\n \"zoning_style, \" +\n \" ST_AsGeoJSON(geom)\" + \n \" AS geom FROM map_pluto2014v2 WHERE \" +\n \" ST_Intersects(geom, ST_MakePolygon(ST_MakeLine( ARRAY[\" + \n points.join() +\n \" ] )));\";\n \n console.log('the sql: ', sql);\n\n var fc = {\n \"type\" : \"FeatureCollection\",\n \"features\" : []\n };\n\n\n client.query(sql, sql_poly, function(err, result) {\n \n if (err) { \n console.log(\"error: \", err);\n return;\n }\n\n // console.log('client query sql res: ', result);\n \n result.rows.forEach(function(feature) {\n\n var f = {\n \"type\" : \"Feature\",\n \"geometry\" : JSON.parse(feature.geom),\n \"properties\" : {\n \"borough\" : feature.borough,\n \"boroughcode\" : feature.borocode,\n \"block\": feature.block,\n \"lot\": feature.lot,\n \"address\": feature.address,\n \"zipcode\": feature.zipcode,\n \"communitydistrict\": feature.cd,\n \"ownername\" : feature.ownername,\n \"ownertype\" : feature.ownertype,\n \"numberfloors\" : feature.numfloors,\n \"yearbuilt\" : feature.yearbuilt,\n \"zoningprimary\" : feature.zonedist1,\n \"zoningsecondary\" : feature.zonedist2,\n \"zoningtertiary\" : feature.zonedist3,\n \"zonestyle\" : feature.zoning_style\n }\n };\n fc.features.push(f);\n });\n\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\")\n res.send(fc);\n //client.end(); \n // console.log('queried data: ', fc);\n });\n\n}", "function drawIsochrone(isochrone, zoomToFit) {\n try {\n isochroneLayer = cartodb.L.geoJson(isochrone, {\n clickable: false,\n style: {\n clickable: false,\n color: '#60a244',\n fillColor: '#60a244',\n lineCap: 'round',\n lineJoin: 'round',\n opacity: 0.4,\n fillOpacity: 0.3,\n stroke: true,\n weight: 2\n }\n });\n } catch (err) {\n console.error('isochrone layer failed to load from GeoJSON');\n console.error(err);\n isochroneLayer = null;\n }\n\n if (isochroneLayer) {\n isochroneLayer.addTo(map);\n if (zoomToFit) {\n map.fitBounds(isochroneLayer.getBounds());\n }\n }\n }", "function onCountryMouseOut(e) {\n C.geojson.resetStyle(e.target);\n //\t$(\"#countryHighlighted\").text(\"No selection\");\n\n var countryName = e.target.feature.properties.name;\n var countryCode = e.target.feature.properties.iso_a2;\n //callback when mouse exits a country polygon goes here, for additional actions\n}", "function exportToJsonFile(json)\r\n{\r\n let str = JSON.stringify(json);\r\n let dataUri = 'data:application/json;charset=utf-8,'+ encodeURIComponent(str);\r\n let exportFileDefaultName = 'machine.json';\r\n\r\n let linkElement = document.createElement('a');\r\n linkElement.setAttribute('href', dataUri);\r\n linkElement.setAttribute('download', exportFileDefaultName);\r\n linkElement.click();\r\n}", "function saveToFile(nodes) {\n //Only keep the needed values\n var nodes_minimal = [];\n nodes.forEach(function (d) {\n nodes_minimal.push({\n id: d.id,\n community: d.community,\n degree: d.degree,\n x_fixed: roundTo(d.x_fixed, 2),\n y_fixed: roundTo(d.y_fixed, 2)\n });\n }); //forEach\n\n var graph = _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_3___default()(nodes_minimal);\n\n var file = new Blob([graph], {\n type: 'text/plain'\n });\n var a = document.createElement('a');\n a.href = URL.createObjectURL(file);\n a.download = 'constellation-node-locations.json';\n a.click();\n } //function saveToFile", "function fillPoly(areaID, arrayOfPoints)\n{\n //check if area exists on map\n if(checkArrayForName(polyStorage, areaID) == -1)\n {\n //create the \"fill polygon\"\n var polyObj = new Object();\n var tempColor = \"#00ff00\";\n if(document.getElementById(\"area_color\") != null)\n {\n tempColor = document.getElementById(\"area_color\").value;\n }\n var areaFill = new google.maps.Polygon(\n {\n paths: arrayOfPoints,\n strokeColor: tempColor,\n strokeOpacity: 0.8,\n strokeWeight: 3,\n fillColor: tempColor,\n fillOpacity: 0.35\n });\n //map.panTo(new google.maps.LatLng(arrayOfPoints[0].k,arrayOfPoints[0].A));\n areaFill.setMap(map);\n polyObj.name = areaID;\n polyObj.area = areaFill;\n polyStorage.push(polyObj);\n }\n}", "function loadAreas() { //Loads Rooms and Scenes onto the map with their respective data\n var sceneData = Array();\n var roomData = Array();\n var coords = currentMap.folder + \"Coords\";\n for(var i in mapData)\n {\n var currentScene = mapData[i];\n if(Array.isArray(currentScene[coords]))\n {\n for(var j in currentScene[coords]){\n currentSection = currentScene[coords][j];\n sceneData.push(\n {\n \"type\": \"Feature\", \n \"geometry\": { \n \"type\": \"Polygon\", \n \"coordinates\": [currentSection]\n }, \n \"properties\": { \n \"name\": currentScene.name,\n \"className\": \"scene\"+currentScene.id+ \" scene\",\n \"type\": \"scene\",\n \"id\": currentScene.id\n } \n });\n }\n }\n var rooms = currentScene.rooms;\n if(Array.isArray(rooms))\n {\n for(var j in rooms)\n {\n var currentRoom = rooms[j];\n if(Array.isArray(currentRoom[coords]))\n {\n for(var k in currentRoom[coords]){\n currentSection = currentRoom[coords][k];\n roomData.push(\n {\n \"type\": \"Feature\", \n \"geometry\": { \n \"type\": \"Polygon\", \n \"coordinates\": [currentSection]\n }, \n \"properties\": { \n \"name\": currentRoom.name,\n \"className\": \"room\"+currentRoom.id+\"s\"+currentScene.id+\" room\",\n \"type\": \"room\",\n \"scene\": currentScene.id,\n \"id\": currentRoom.id\n } \n });\n }\n }\n }\n }\n }\n return {sceneData, roomData};\n}", "function download() {\n \n console.log(\"MENSAJE DE SAVE TXT ===========================\")\n console.log(listObjects)\n\n var pom = document.createElement('a');\n pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(listObjects));\n pom.setAttribute('download', 'info_coordinates.json');\n\n if (document.createEvent) {\n var event = document.createEvent('MouseEvents');\n event.initEvent('click', true, true);\n pom.dispatchEvent(event);\n }\n else {\n pom.click();\n }\n}", "function updateArea(e) {\n var geoJsondata = draw.getAll();\n var areaHtml = document.getElementById('area');\n var solarPanelsHtml = document.getElementById('solar-panels');\n var nominalPowerHtml = document.getElementById('nominal-power');\n\n if (geoJsondata.features.length > 0) {\n var solarData = solarCalculator(geoJsondata);\n\n areaHtml.innerHTML = solarData.roundedArea + ' square meters';\n solarPanelsHtml.innerHTML = solarData.totalPanels.toString();\n nominalPowerHtml.innerHTML = solarData.nominalPower + ' W';\n } else {\n areaHtml.innerHTML = '';\n solarPanelsHtml.innerHTML = '';\n nominalPowerHtml.innerHTML = '';\n }\n}", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function geojsonPolygonMarker(data) {\n return L.geoJson(data, {\n style: {\n color: '#3b9972',\n weight: 2,\n opacity: 0.6,\n fillOpacity: 0.1,\n }\n });\n}", "function exportFileHandler () {\n var lat, lon, url, notes;\n var SEP = \"|\";\n var i;\n\n var csvContent = 'sep=' + SEP + '\\n';\n csvContent += 'lat' + SEP + 'long' + SEP + 'google maps link' + SEP + 'notes\\n';\n for (i = 0; i < points.length; i++) {\n lat = points[i].lonlat.lat;\n lon = points[i].lonlat.lon;\n url = makeMapUrl(lat, lon);\n notes = getNotes(i);\n csvContent += lat + SEP + lon + SEP + url + SEP + notes + '\\n';\n }\n\n var date = new Date();\n var year = date.getFullYear().toString();\n var month = (date.getMonth() + 1).toString();\n if (month.length === 1) {\n month = \"0\" + month;\n }\n var day = date.getDate().toString();\n if (day.length === 1) {\n day = \"0\" + day;\n }\n\n var filename = 'poi_' + year + month + day + '.csv';\n\n var csv = new Blob([csvContent], {\n type: \"text/csv;\"\n });\n\n if (typeof ga !== 'undefined') { \n ga('send', {\n 'hitType': 'event', // Required.\n 'eventCategory': 'User Generated Points', // Required.\n 'eventAction': 'Click', // Required.\n 'eventLabel': 'Download Points'\n });\n }\n\n saveAs(csv, filename);\n }", "function exportFileHandler () {\n var lat, lon, url, notes;\n var SEP = \"|\";\n var i;\n\n var csvContent = 'sep=' + SEP + '\\n';\n csvContent += 'lat' + SEP + 'long' + SEP + 'google maps link' + SEP + 'notes\\n';\n for (i = 0; i < points.length; i++) {\n lat = points[i].lonlat.lat;\n lon = points[i].lonlat.lon;\n url = makeMapUrl(lat, lon);\n notes = getNotes(i);\n csvContent += lat + SEP + lon + SEP + url + SEP + notes + '\\n';\n }\n\n var date = new Date();\n var year = date.getFullYear().toString();\n var month = (date.getMonth() + 1).toString();\n if (month.length === 1) {\n month = \"0\" + month;\n }\n var day = date.getDate().toString();\n if (day.length === 1) {\n day = \"0\" + day;\n }\n\n var filename = 'poi_' + year + month + day + '.csv';\n\n var csv = new Blob([csvContent], {\n type: \"text/csv;\"\n });\n\n if (typeof ga !== 'undefined') { \n ga('send', {\n 'hitType': 'event', // Required.\n 'eventCategory': 'User Generated Points', // Required.\n 'eventAction': 'Click', // Required.\n 'eventLabel': 'Download Points'\n });\n }\n\n saveAs(csv, filename);\n }", "function transformToGeoJson(WKT, fGroup, map) {\n\t\t\tvar wkt = new Wkt.Wkt();\n\t\t\t// Read wkt\n\t\t\ttry { // Catch any malformed WKT strings\n wkt.read(WKT);\n } catch (e1) {\n try {\n wkt.read(WKT.replace('\\n', '').replace('\\r', '').replace('\\t', ''));\n } catch (e2) {\n if (e2.name === 'WKTError') {\n console.log('Could not understand the WKT string. Check that you have parentheses balanced, and try removing tabs and newline characters.');\n return;\n }\n }\n }\n\t\t\t// Convert to object\n\t\t\tvar obj = wkt.toObject({\n icon: new L.Icon({\n iconUrl: 'red_dot.png',\n iconSize: [16, 16],\n iconAnchor: [8, 8],\n shadowUrl: 'dot_shadow.png',\n shadowSize: [16, 16],\n shadowAnchor: [8, 8]\n }),\n editable: true,\n color: '#AA0000',\n weight: 3,\n opacity: 1.0,\n editable: true,\n fillColor: '#AA0000',\n fillOpacity: 0.2\n });\n\t\t\t\n\t\t\t// Draw geometries\n if (Wkt.isArray(obj)) { // Distinguish multigeometries (Arrays) from objects\n for (i in obj) {\n if (obj.hasOwnProperty(i) && !Wkt.isArray(obj[i])) {\n\t\t\t\t\t\tobj[i].addTo(map);\n\t\t\t\t\t\tfGroup.addLayer(obj[i]);\n }\n }\n } else {\n\t\t\t\tobj.addTo(map);\n\t\t\t\tfGroup.addLayer(obj);\n }\n\t\t\treturn obj;\n\t\t}", "function saveToFile(nodes) {\n //Only keep the needed values\n var nodes_minimal = [];\n nodes.forEach(function (d) {\n nodes_minimal.push({\n id: d.id,\n biome_main: d.biome_main,\n degree: d.degree,\n x_fixed: roundTo(d.x_fixed, 2),\n y_fixed: roundTo(d.y_fixed, 2)\n });\n }); //forEach\n\n var graph = _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_3___default()(nodes_minimal);\n\n var file = new Blob([graph], {\n type: 'text/plain'\n });\n var a = document.createElement('a');\n a.href = URL.createObjectURL(file);\n a.download = 'biome-node-locations.json';\n a.click();\n } //function saveToFile", "function saveAsPNG() {\n html2canvasAngular.renderBody().then(function(canvas){\n canvas.toBlob(function (blob) {\n //console.log(blob);\n saveAs(blob, 'map.png');\n }, 'image/png');\n //document.body.appendChild(canvas);\n });\n }", "function exportToJsonFile(json)\n{\n let str = JSON.stringify(json);\n let dataUri = 'data:application/json;charset=utf-8,'+ encodeURIComponent(str);\n let exportFileDefaultName = 'machine.json';\n\n let linkElement = document.createElement('a');\n linkElement.setAttribute('href', dataUri);\n linkElement.setAttribute('download', exportFileDefaultName);\n linkElement.click();\n}", "function showExternalFile() {\n $.get(document.getElementById('externalfile').value, function(response) {\n L.geoJSON(JSON.parse(response)).addTo(map);\n });\n}", "function exportUniversityWcVisAsJson(data, filename) {\n ScholarsVis.Utilities.exportAsJson(filename, data);\n}", "function saveToJson(jsnObject, fileName) {\n \n var blob = new Blob([jsnObject], {type: \"application/json\"}),\n anchor = document.getElementById(\"autoTrigger\");\n \n anchor.download = fileName;\n anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);\n anchor.dataset.downloadurl = ['application/json', anchor.download, anchor.href].join(':');\n anchor.click();\n}", "function convertToGeoJson(data) {\n var lat = data.coord.lat;\n var lon = data.coord.lon;\n var pm10Value = getPM10Value(pm10Measures,lat,lon);\n\n var pm10Index = getPM10Index(pm10Value);\n var windIndex = getWindIndex(data.wind.speed * 3.6);\n var grasslandIndex = getGrasslandIndex(lat, lon);\n var weatherIndex = getWeatherIndex(data.weather[0].id);\n\n //new season index\n var seasonIndex = getSeasonIndex();\n\n var score = pm10Index + windIndex + grasslandIndex + weatherIndex + seasonIndex;\n var riskRating = getRiskRating(score).rating;\n var feature = {\n type: \"Feature\",\n properties: {\n city: data.name,\n temp: data.main.temp,\n weather: data.weather[0].main,\n windSpeed: data.wind.speed * 3.6,\n pm10: pm10Value,\n riskScore: score,\n riskRating: riskRating,\n icon: mapMarkers[riskRating],\n coordinates: [lon, lat]\n },\n geometry: {\n type: \"Point\",\n coordinates: [lon, lat]\n }\n };\n // Set the custom marker icon\n map.data.setStyle(function(feature) {\n return {\n icon: {\n url: feature.getProperty('icon'),\n anchor: new google.maps.Point(25, 25),\n scaledSize: new google.maps.Size(30,30)\n }\n };\n });\n // returns object\n return feature;\n}", "function saveToImageFile() { \n const a = document.createElement('a')\n a.href = rcanvas.toDataURL()\n a.download = \"map.png\"\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n console.log('file created!')\n rcanvas.parentNode.removeChild(rcanvas)\n }", "function fetch_rectangle_dr() {\n var sdata = $(\"#request_rectangle_data\").serializeArray();\n var data = {};\n var sdatao = [];\n for (var i=0; i<sdata.length; i++){\n sdatao[sdata[i].name] = parseFloat(sdata[i].value);\n }\n var area = [[[sdatao.NW_lon, sdatao.NW_lat],\n [sdatao.NW_lon, sdatao.SE_lat],\n [sdatao.SE_lon, sdatao.SE_lat],\n [sdatao.SE_lon, sdatao.NW_lat],\n [sdatao.NW_lon, sdatao.NW_lat]]]\n data = {'area': area, col:\"point_split\"};\n console.log(data);\n\n $.ajax({\n type: 'POST',\n url: 'php/get_polygon_points_mongo.php',\n data: data,\n beforeSend: function () {\n $(\"#error\").fadeOut();\n },\n success: function (response) {\n console.log(\"Returned OK\");\n console.log(response);\n\n if ( Object.keys(JSON.parse(response)).length === 0){\n console.log('nothing here');\n return;\n } else {\n var returned = JSON.parse(response);\n response = \"ok\";\n }\n\n if (response == \"ok\") {\n // Prompt user to download data.\n console.log('have data');\n console.log(returned);\n returned = JSON.stringify(returned);\n download(returned, 'tmp.json', 'text/plain');\n }\n else {\n console.log('Not OK response');\n $(\"#error\").fadeIn(1000, function () {\n console.log(response);\n $(\"#error\").html('<div class=\"alert alert-danger\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; ' + response + '</div>');\n });\n }\n },\n error: function (response) {\n console.log('Code error, failed to make data request for point');\n console.log(response);\n $(\"#btn-login\").html('<span class=\"glyphicon glyphicon-log-in\"></span>&nbsp; Log In');\n }\n });\n return false;\n }", "function saveAsDlibPts(){\n var ptsData,shape;\n if(!imgSelected){\n showSnackBar(\"This option is applicable on the image loaded in workarea.\");\n return;\n }else if(selectedElements.length === 1){\n //TODO: bug element gets unselected when select any tool\n shape = getShape(selectedElements[0].id);\n }else if(labellingData[imgSelected.name].shapes.length === 1){\n shape = labellingData[imgSelected.name].shapes[ 0 ];\n }else{\n showSnackBar(\"Please create or select one shape.\");\n return;\n }\n\n ptsData = toDlibPts( shape );\n askFileName(imgSelected.name + \"_imglab.pts\", function(fileName){\n analytics_reportExportType(\"dlib_pts\", shape.featurePoints.length );\n download(ptsData, fileName, \"text/plain\");\n });\n}", "function areaChanged() {\n if (selectedArea === undefined) {\n //get the selected area name\n selectedArea = $(\"#areas\").val();\n } else {\n var deselectId = reverseLookup[selectedArea].LAD14CD;\n topoLayer.eachLayer(function(layer) {\n if (layer.feature.id == deselectId) {\n deselectLayer(layer);\n }\n });\n }\n selectedArea = $(\"#areas\").val();\n analyze();\n var id = reverseLookup[selectedArea].LAD14CD;\n topoLayer.eachLayer(function(layer) {\n if (layer.feature.id == id) {\n selectLayer(layer);\n map.fitBounds(layer.getBounds(), {padding: [100, 100]});\n }\n });\n}", "function getData(map)\n{\n\t// get the data from the geojson file\n\t$.ajax(\"data/agg.geojson\",\n\t{\n\t\tdataType: \"json\",\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t// call function to create proportional symbols\n\t\t\tcreatePropSymbols(response, map);\n\t\t}\n\t});\n}", "function saveRegions() {\n localStorage.regions = JSON.stringify(\n Object.keys(wavesurfer.regions.list).map(function (id) {\n var region = wavesurfer.regions.list[id];\n return {\n start: region.start,\n end: region.end,\n data: region.data\n };\n })\n );\n}", "function exportGeoJSON2(dataset, opts) {\n opts = utils.extend({}, opts);\n opts.v2 = !opts.gj2008; // use RFC 7946 as the default\n return exportGeoJSON(dataset, opts);\n }", "function getGeoJSON(){\r\n $.getJSON(\"https://\"+cartoDBusername+\".cartodb.com/api/v2/sql?format=GeoJSON&q=\"+sqlQuery, function(data) {\r\n cartoDBPoints = L.geoJson(data,{\r\n pointToLayer: function(feature,latlng){\r\n var marker = L.marker(latlng);\r\n marker.bindPopup('' +'Info: '+ feature.properties.description + '<br>Contact: ' + feature.properties.email + '<br>Date: ' + feature.properties.date +'');\r\n return marker;\r\n }\r\n }).addTo(map);\r\n });\r\n}", "function saveRegions() {\n localStorage.regions = JSON.stringify(\n Object.keys(wavesurfer.regions.list).map(function (id) {\n var region = wavesurfer.regions.list[id];\n return {\n start: region.start,\n end: region.end,\n attributes: region.attributes,\n data: region.data\n };\n })\n );\n}", "function getGeoJson() {\n console.log({\n iso3: 'it',\n country: country\n });\n\n console.log(`http://api.geonames.org/countryInfoJSON?formatted=true&lang=it&country=${country}&username=Romancevic&style=full`)\n\n console.log('Hello')\n\n $.ajax({\n url: \"libs/php/getCountryPolygon.php\",\n type: 'POST',\n dataType: 'json',\n data: {\n iso3: 'it',\n country: country\n },\n success: function(result){\n console.log(result.data.border);\n if(result){\n if (result.data.countryInfo.geonames.length > 0) {\n if(bounds != undefined){\n map.removeLayer(bounds);\n }\n bounds = L.geoJSON(result.data.border, {style: polyStyle}).addTo(map);\n map.flyToBounds(bounds.getBounds(), {\n animate: true,\n duration: 2.5\n });\n locationMarker.bindPopup(`Capital: ${capital}`).openPopup();\n } else {\n alert('Данные для данного места не найдены!')\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown){\n alert(`Error in geojson: ${textStatus} ${errorThrown} ${jqXHR}`);\n }\n });\n}", "function polyToJSON() {\n let polylineJSON = {\n points: []\n };\n let poly = _model.polylines[0];\n\n for (let i = 0; i < poly.count; i++) {\n polylineJSON.points.push(poly.get(i));\n }\n return polylineJSON;\n}", "function save() {\n fs.writeFile('aaddress.json', JSON.stringify(addressData), 'utf-8', function (err) {\n if (err) throw err\n console.log('saved')\n })\n }", "function toGeographic(geojson) {\n return applyConverter(geojson, positionToGeographic);\n }", "function toGeographic(geojson) {\n return applyConverter(geojson, positionToGeographic);\n }", "function toGeographic(geojson) {\n return applyConverter(geojson, positionToGeographic);\n }", "function jQueryCallback(data){\n console.log(data)\n //assign my data to 'GeoJSON data:' with a new line break\n var mydata = '<br>GeoJSON data:</br>';\n //add the variable to the string text of map.geojson\n mydata += JSON.stringify(data);\n //appends the script to add the text to the page\n $('#mydiv').append('<p>'+mydata+'</p>')\n\n }", "function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }", "saveAsJson() {\n //TODO: To do transfer learning\n }", "function showPolygons(data){ \n $.each(data.polygonGroup, function (key, value) { \n var polygon = [value.latLng]; \n drawPolygon(polygon[0], value.color, false, value.polygonId); \n });\n}", "function debugCallback(mydata){\n\t//appending the text label of \"GeoJSON data: \" as well as the actual\n\t//text of the GeoJSON file.\n\t//JSON stringify is what helps label the data file.\n $(\"#mydiv\").append('<br>GeoJSON data: <br>' + JSON.stringify(mydata));\n\n}", "function serializeMap(map) {\n if (map === null || map === undefined) return null;\n\n var meta = {\n geometries: {},\n materials: {},\n textures: {},\n images: {}\n };\n\n var json = map.toJSON(meta);\n var images = extractFromCache(meta.images);\n if (images.length > 0) json.images = images;\n json.sourceFile = map.sourceFile;\n\n return json;\n }", "function updateCoords(){\n storage.write('coords.json', coords);\n}", "function convertToGeoJSON(tmpLayer) {\n let shape = tmpLayer.toGeoJSON()\n return JSON.stringify(shape['geometry']['coordinates']);\n }", "function toGeoJSON(list, cordinate_name, prop_name){\n var listGeoJson = [];\n for(var x = 0; x < list.length; x++){\n listGeoJson.push(turf.polygon([list[x][cordinate_name]], listPolygon[x][prop_name]));\n }\n return listGeoJson;\n }", "function sendPositionToServer(geojsonFeature){\n $.ajax({\n type: \"POST\",\n url: \"https://giv-project13.uni-muenster.de:8443/api/1.0/GPS\",\n data: geojsonFeature,\n success: function (data, textStatus){\n //alert (\"Your location has been submitted to server!\" + textStatus);\n },\n error: function (xhr, textStatus, error){\n alert (\"An error has occured sending position to server: \" + error);\n }\n });\n}" ]
[ "0.7177311", "0.7154892", "0.66580635", "0.6548282", "0.64752775", "0.6453165", "0.6437649", "0.64189875", "0.62069756", "0.6124514", "0.61042166", "0.6078614", "0.6049572", "0.60482675", "0.6022068", "0.600245", "0.5965552", "0.590308", "0.58901584", "0.5842907", "0.5841846", "0.58231395", "0.5776405", "0.57622516", "0.5738825", "0.56849605", "0.5673341", "0.56474453", "0.56341493", "0.5631875", "0.5610663", "0.55732155", "0.5558146", "0.5527471", "0.5525681", "0.5517038", "0.5503796", "0.549991", "0.5482403", "0.54790515", "0.5472367", "0.5467228", "0.54585487", "0.54580635", "0.54536223", "0.5424286", "0.54098886", "0.5396053", "0.5380234", "0.53734034", "0.53728396", "0.5371515", "0.53696936", "0.5349017", "0.5345725", "0.5342825", "0.5335238", "0.5327311", "0.53157264", "0.53148735", "0.5313437", "0.53108376", "0.53097725", "0.5304952", "0.5300966", "0.529715", "0.529715", "0.5289586", "0.52877766", "0.52782756", "0.5271001", "0.5264727", "0.5263278", "0.52629006", "0.52420354", "0.52403164", "0.5227096", "0.5221033", "0.52199614", "0.5218555", "0.52143466", "0.52101535", "0.5208839", "0.5205367", "0.52022094", "0.5200867", "0.51927847", "0.51920414", "0.51920414", "0.51920414", "0.519146", "0.5185389", "0.5184746", "0.5184297", "0.51664823", "0.516093", "0.51593864", "0.51591945", "0.51574713", "0.51483667" ]
0.72194403
0
ensures a vertical line will not pass from the left to the right
lineTest (left, right) { let leftLine = true, rightLine = true left.forEach(index => { if (index % this.width !== 0) leftLine = false }) right.forEach(index => { if (index % this.width !== this.width - 1) rightLine = false }) return leftLine && rightLine }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vertical_line_line(line, x) {\n const px = line.p[0], py = line.p[1];\n const ux = line.u[0], uy = line.u[1];\n return vec2.fromValues(x, py + uy * (x - px) / ux);\n}", "function verticalline(prevcol) {\n var currchip = null;\n var prevchip = 0;\n var count = 0;\n\n for (var row = 0; row < 6; row++) {\n currchip = board[row][prevcol];\n if (currchip == prevchip && currchip != 0) {\n count++;\n }\n else {\n count = 0;\n }\n //count == 3 when four chips are in a line\n if (count == UI.wincondition - 1) {\n return true;\n }\n //set previous chip to current chip for next comparison\n prevchip = currchip;\n }\n\n //else no vertical line\n return false;\n}", "function line_side(l, p){\n\tvar side = ((l[1].x - l[0].x)*(p.y - l[0].y) - (l[1].y - l[0].y)*(p.x - l[0].x));\n\treturn side ? side < 0 ? -1 : 1 : 0;\n}", "function breakUpLineOrth(line){\n \n var smallerLines = [];\n \n var xDiff = line.x2 - line.x1;\n var yDiff = line.y2 - line.y1;\n \n //Check to see if line is horizontal or vertical first\n //if a line is vertical, x will always be the same value\n //if the difference between y2 and y1 is greater than 1, the line is made up of many smaller lines\n if (line.x1 == line.x2){\n if ((line.y2 - line.y1) > 1) {\n for(var i = 0; i < (line.y2 - line.y1); i++){\n smallerLines[i] = new Line(line.x1, (line.y1 + i), line.x1, (line.y1 + i + 1));\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n //if a line is horizontal, y will always be the same value\n //if the difference between x2 and x1 is greater than 1, the line is made up of many smaller lines\n if (line.y1 == line.y2){\n if ((line.x2 - line.x1) > 1) {\n for(var i = 0; i < (line.x2 - line.x1); i++){\n smallerLines[i] = new Line((line.x1 + i), line.y1, (line.x1 + i + 1), line.y1);\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n \n //Diagonals\n \n //work out the gradient based upon whether xdiff or ydiff is higher\n //y can be negative so use the absolute value for testing\n var gradient;\n \n //Check to see whether the diagonal line doesn't need breaking up and return it if this is the case\n if(xDiff == 1 && Math.abs(yDiff) == 1){\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n \n \n \n //x grows at the same rate as y\n else if (xDiff == Math.abs(yDiff)){\n //diagonal that slopes downwards\n if(yDiff > 0){\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + i), (line.x1 + i + 1), (line.y1 + i + 1));\n smallerLines[i].type = line.type;\n }\n }\n else if(yDiff < 0){\n //diagonal that slopes upwards\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - i), (line.x1 + i + 1), (line.y1 - i - 1));\n smallerLines[i].type = line.type;\n }\n }\n }\n //x grows faster than y\n else if (xDiff > Math.abs(yDiff)){\n gradient = ((line.x2 - line.x1)/(line.y2 - line.y1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (xDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * gradient)), (line.y1 + i), (line.x1 + (i * gradient) + gradient), (line.y1 + i + 1)); \n smallerLines[i].type = line.type;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (xDiff / Math.abs(gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * Math.abs(gradient))), (line.y1 - i), (line.x1 + (i * Math.abs(gradient)) + Math.abs(gradient)), (line.y1 - i - 1)); \n smallerLines[i].type = line.type;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n \n \n }\n // y grows faster than x\n else if (xDiff < Math.abs(yDiff)){\n gradient = ((line.y2 - line.y1)/(line.x2 - line.x1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (yDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + (i * gradient)), (line.x1 + i + 1), (line.y1 + (i * gradient) + gradient)); \n smallerLines[i].typed = line.typed;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (Math.abs(yDiff / gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - (i * Math.abs(gradient))), (line.x1 + i + 1), (line.y1 - (i * Math.abs(gradient)) - Math.abs(gradient))); \n smallerLines[i].typed = line.typed;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n \n }\n \n else {\n // smallerLines.add(line);\n }\n \n return smallerLines;\n}", "function renderAxisLine() {\n ctx.save();\n ctx.setLineDash(renderAttrs.lineDash || []);\n if( renderAttrs.orientation === 'horizontal') {\n drawLine( ctx, { x: renderMin, y: originCrossAxisCoord },\n { x: renderMax, y: originCrossAxisCoord });\n }\n else {\n drawLine( ctx, { x: originCrossAxisCoord, y: renderMin },\n { x: originCrossAxisCoord, y: renderMax });\n }\n ctx.restore();\n }", "vertLine (idx) { return this._vert[idx] }", "function collideHLine(x0, x1, y, rect, v)\r\n{\r\n var left = rect.x;\r\n var right = rect.x+rect.width;\r\n var top = rect.y;\r\n var bottom = rect.y+rect.height;\r\n var dy;\r\n if (y <= top && top < y+v.y) {\r\n dy = top - y;\r\n } else if (bottom <= y && y+v.y < bottom) {\r\n dy = bottom - y;\r\n } else {\r\n return v;\r\n }\r\n // assert(v.y != 0);\r\n var dx = v.x*dy / v.y;\r\n if ((v.x <= 0 && x1+dx <= left) ||\r\n (0 <= v.x && right <= x0+dx) ||\r\n (x1+dx < left || right < x0+dx)) {\r\n return v;\r\n }\r\n return new Vec2(dx, dy);\r\n}", "function breakUpLine(line){\n \n var smallerLines = [];\n var xDiff = line.x2 - line.x1;\n var yDiff = line.y2 - line.y1;\n \n //Check to see if line is horizontal or vertical first\n //if a line is vertical, x will always be the same value\n //if the difference between y2 and y1 is greater than 2, the line is made up of many smaller lines\n if (line.x1 == line.x2){\n if ((line.y2 - line.y1) > 2) {\n for(var i = 0; i < ((line.y2 - line.y1) / 2); i++){\n smallerLines[i] = new Line(line.x1, (line.y1 + (2 * i)), line.x1, (line.y1 + (2 * i) + 2));\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n //if a line is horizontal, y will always be the same value\n //if the difference between x2 and x1 is greater than 2, the line is made up of many smaller lines\n if (line.y1 == line.y2){\n if ((line.x2 - line.x1) > 2) {\n for(var i = 0; i < ((line.x2 - line.x1) / 2); i++){\n smallerLines[i] = new Line((line.x1 + (2 * i)), line.y1, (line.x1 + (2 * i) + 2), line.y1);\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n //Diagonals\n \n //work out the gradient based upon whether xdiff or ydiff is higher\n //y can be negative so use the absolute value for testing\n var gradient;\n //Check to see whether the diagonal line doesn't need breaking up and return it if this is the case\n if(xDiff == 1 && Math.abs(yDiff) == 1){\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n //x grows at the same rate as y\n else if (xDiff == Math.abs(yDiff)){\n //diagonal that slopes downwards\n if(yDiff > 0){\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + i), (line.x1 + i + 1), (line.y1 + i + 1));\n smallerLines[i].type = line.type;\n }\n }\n //diagonal that slopes upwards\n else if(yDiff < 0){\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - i), (line.x1 + i + 1), (line.y1 - i - 1));\n smallerLines[i].type = line.type;\n }\n }\n }\n //x grows faster than y\n else if (xDiff > Math.abs(yDiff)){\n gradient = ((line.x2 - line.x1)/(line.y2 - line.y1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (xDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * gradient)), (line.y1 + i), (line.x1 + (i * gradient) + gradient), (line.y1 + i + 1)); \n smallerLines[i].type = line.type;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (xDiff / Math.abs(gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * Math.abs(gradient))), (line.y1 - i), (line.x1 + (i * Math.abs(gradient)) + Math.abs(gradient)), (line.y1 - i - 1));\n smallerLines[i].type = line.type;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n } \n }\n // y grows faster than x\n else if (xDiff < Math.abs(yDiff)){\n gradient = ((line.y2 - line.y1)/(line.x2 - line.x1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (yDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + (i * gradient)), (line.x1 + i + 1), (line.y1 + (i * gradient) + gradient)); \n smallerLines[i].type = line.type;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (Math.abs(yDiff / gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - (i * Math.abs(gradient))), (line.x1 + i + 1), (line.y1 - (i * Math.abs(gradient)) - Math.abs(gradient)));\n smallerLines[i].type = line.type;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n } \n }\n else {\n // smallerLines.add(line);\n }\n \n return smallerLines; \n}", "updateLastLine(line) { // this is used when drawing with the pen\r\n if (line.length < 2) return;\r\n var point1 = line.points[line.points.length - 1];\r\n var point2 = line.points[line.points.length - 2];\r\n point1 = this.worldPointToChunkScreenPoint(point1);\r\n point2 = this.worldPointToChunkScreenPoint(point2);\r\n this.ctx.beginPath();\r\n this.ctx.lineWidth = Main.Camera.getRelativeWidth(line.width);\r\n this.ctx.strokeStyle = line.style;\r\n this.ctx.lineTo(point1.x, point1.y);\r\n this.ctx.lineTo(point2.x, point2.y);\r\n this.ctx.stroke();\r\n }", "vertLineAt (x) { return this._vert[this.vertIdxAt(x)] }", "get verticalLineStroke() {\r\n return brushToString(this.i.pc);\r\n }", "function drawLine() {\n var i = term.width;\n while(i--) {\n term.blue(\"-\");\n }\n term.blue(\"\\n\");\n}", "get verticalLineVisibility() {\r\n return this.i.pm;\r\n }", "get vertical() { return this._vertical; }", "get vertical() { return this._vertical; }", "layoutEmptyLineWidget(paragraph, isEmptyLine, line, isShiftEnter) {\n let paraFormat = paragraph.paragraphFormat;\n let subWidth = 0;\n let whiteSpaceCount = 0;\n isShiftEnter = isNullOrUndefined(isShiftEnter) ? false : isShiftEnter;\n //Calculate line height and descent based on formatting defined in paragraph.\n let paragraphMarkSize = this.viewer.textHelper.getParagraphMarkSize(paragraph.characterFormat);\n let maxHeight = paragraphMarkSize.Height;\n let beforeSpacing = this.getBeforeSpacing(paragraph);\n let lineWidget;\n if (paragraph.childWidgets.length > 0 && !isShiftEnter) {\n lineWidget = paragraph.childWidgets[0];\n if (lineWidget.children.length > 0) {\n if (!this.isBidiReLayout && (paraFormat.bidi || this.isContainsRtl(lineWidget))) {\n this.reArrangeElementsForRtl(lineWidget, paraFormat.bidi);\n }\n let isParagraphStart = lineWidget.isFirstLine();\n let isParagraphEnd = lineWidget.isLastLine();\n let firstLineIndent = 0;\n if (isParagraphStart) {\n beforeSpacing = this.getBeforeSpacing(paragraph);\n firstLineIndent = HelperMethods.convertPointToPixel(paraFormat.firstLineIndent);\n }\n let textAlignment = paraFormat.textAlignment;\n if (textAlignment !== 'Left' && this.viewer.textWrap\n && (!(textAlignment === 'Justify' && isParagraphEnd)\n || (textAlignment === 'Justify' && paraFormat.bidi))) {\n // tslint:disable-next-line:max-line-length\n let getWidthAndSpace = this.getSubWidth(lineWidget, textAlignment === 'Justify', whiteSpaceCount, firstLineIndent, isParagraphEnd);\n subWidth = getWidthAndSpace.subWidth;\n whiteSpaceCount = getWidthAndSpace.spaceCount;\n }\n }\n }\n else {\n lineWidget = isEmptyLine ? this.addLineWidget(paragraph) : line;\n }\n //isNullOrUndefined(this.viewer.currentHeaderFooter) && \n if (this.viewer instanceof PageLayoutViewer\n && this.viewer.clientActiveArea.height < beforeSpacing + maxHeight\n && this.viewer.clientActiveArea.y !== this.viewer.clientArea.y) {\n this.moveToNextPage(this.viewer, lineWidget);\n }\n //Gets line spacing.\n let lineSpacing = this.getLineSpacing(paragraph, maxHeight);\n let maxDescent = maxHeight - paragraphMarkSize.BaselineOffset;\n //Calculate the bottom position of current line - max height + line spacing.\n if (!isNaN(this.maxTextHeight)\n && maxHeight < this.maxTextHeight) {\n maxHeight = this.maxTextHeight;\n maxDescent = maxHeight - this.maxTextBaseline;\n }\n let topMargin = 0;\n let bottomMargin = 0;\n let leftMargin = 0;\n let height = maxHeight;\n let lineSpacingType = paragraph.paragraphFormat.lineSpacingType;\n if (lineSpacingType === 'Multiple') {\n if (lineSpacing > maxHeight) {\n bottomMargin += lineSpacing - maxHeight;\n }\n else {\n topMargin += lineSpacing - maxHeight;\n }\n }\n else if (lineSpacingType === 'Exactly') {\n topMargin += lineSpacing - (topMargin + height + bottomMargin);\n }\n else if (lineSpacing > topMargin + height + bottomMargin) {\n topMargin += lineSpacing - (topMargin + height + bottomMargin);\n }\n topMargin += beforeSpacing;\n bottomMargin += HelperMethods.convertPointToPixel(this.getAfterSpacing(paragraph));\n for (let i = 0; i < lineWidget.children.length; i++) {\n let element = lineWidget.children[i];\n if (i === 0 && element instanceof ListTextElementBox) {\n let textAlignment = paragraph.paragraphFormat.textAlignment;\n if (textAlignment === 'Right') { //Aligns the text as right justified.\n leftMargin = subWidth;\n }\n else if (textAlignment === 'Center') { //Aligns the text as center justified.\n leftMargin = subWidth / 2;\n }\n element.margin = new Margin(leftMargin, topMargin, 0, bottomMargin);\n element.line = lineWidget;\n lineWidget.height = topMargin + height + bottomMargin;\n }\n }\n lineWidget.height = topMargin + height + bottomMargin;\n this.viewer.cutFromTop(this.viewer.clientActiveArea.y + lineWidget.height);\n //Clears the previous line elements from collection. \n }", "visitLinePixels(visitor, line) {\n const vec = { dx: line.x1 - line.x0, dy: line.y1 - line.y0 }\n // If line is a point we're lazy (and eliminate some special cases)\n if (vec.dx === 0 && vec.dy === 0) {\n const x = Math.floor(line.x0);\n const y = Math.floor(line.y0);\n const idx = x + this.width * y;\n visitor(x, y, idx);\n return;\n }\n const len = Math.sqrt(Math.pow(vec.dx, 2) + Math.pow(vec.dy, 2));\n const unit = { dx: vec.dx / len, dy: vec.dy / len };\n const ortho = { dx: unit.dy, dy: -unit.dx };\n // Using a Set makes it easy to comply with the pixel uniqueness\n // requirement\n const indices = new Set();\n const addPixel = (x, y) => {\n x = Math.floor(x);\n y = Math.floor(y);\n if (x < 0 || x >= this.width)\n return\n if (y < 0 || y >= this.height)\n return;\n const idx = x + this.width * y;\n if (idx !== idx)\n throw new Error('Trying to add NaN as a line pixel index');\n indices.add(idx);\n };\n const pos = { x: line.x0, y: line.y0 };\n const sigX = line.x1 - line.x0;\n const sigY = line.y1 - line.y0;\n do {\n addPixel(pos.x, pos.y);\n for (let i = 0; i < this.strokeWidth; i++) {\n const xt = pos.x + .5 * ortho.dx;\n const yt = pos.y + .5 * ortho.dy;\n addPixel(xt, yt);\n const xb = pos.x - .5 * ortho.dx;\n const yb = pos.y - .5 * ortho.dy;\n addPixel(xb, yb);\n }\n pos.x += unit.dx;\n pos.y += unit.dy;\n } while((line.x1 - pos.x) * sigX > 0 || (line.y1 - pos.y) * sigY > 0);\n const iterator = indices.values();\n for (let i = 0; i < indices.size; i++) {\n const idx = iterator.next().value;\n const x = idx % this.width;\n const y = Math.floor(idx / this.width);\n if (x !== x || y !== y)\n throw new Error('Encountered line coordinates which are NaN');\n const res = visitor(x, y, idx);\n // Bailing mechanism\n if (res === false)\n break;\n }\n }", "function drawHorizonalLine(y, color) {\n ctx.beginPath();\n ctx.strokeStyle = color;\n ctx.moveTo(0, y);\n ctx.lineTo(canvas.width, y);\n ctx.stroke();\n}", "function Line(x1,y1,x2,y2){\n\tthis.x1 = x1;\n\tthis.y1 = y1;\n\tthis.x2 = x2;\n\tthis.y2 = y2;\n\tthis.vertical = x1==x2;\n\tif(!this.vertical){\n\t\tthis.m = (y2-y1)/(x2-x1);\n\t\tthis.n = y2 - this.m*x2;\n\t}else{\n\t\tthis.m = Number.POSITIVE_INFINITY;\n\t\tthis.n = undefined;\n\t}\n}", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function line(x0, y0, x1, y1){\n var dx = Math.abs(x1-x0);\n var dy = Math.abs(y1-y0);\n var sx = (x0 < x1) ? 1 : -1;\n var sy = (y0 < y1) ? 1 : -1;\n var err = dx-dy;\n var terminationConst = 1.1;\n\n while(true){\n // putPixel\n ctx.fillStyle = 'black';\n ctx.fillRect(x0, y0, 1, 1);\n\n if ((Math.abs(x0-x1) < terminationConst) && (Math.abs(y0-y1) < terminationConst)) break;\n var e2 = 2*err;\n if (e2 >-dy){ err -= dy; x0 += sx; }\n if (e2 < dx){ err += dx; y0 += sy; }\n }\n }", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj.left + newLineObj.width : newLineObj.left ,\n y2: (newLineObj.y1 < 0) ? newLineObj.top + newLineObj.height : newLineObj.top\n });\n}", "drawLineOnGrid(x1, y1, x2, y2) { \n\n let deltaX = x2 - x1;\n let deltaY = y2 - y1; \n \n // function to return one of \"-\" or \"X\" depending on line orientation\n let keyCharacter = this.getKeyCharacterForLine(deltaX, deltaY);\n \n // if the line has gradient < 1\n if (Math.abs(deltaY) <= Math.abs(deltaX)) { \n if (deltaX >= 0) {\n // line is drawn left to right\n this.drawShallowLine(x1, y1, x2, deltaX, deltaY, keyCharacter);\n } else {\n // line is drawn right to left\n this.drawShallowLine(x2, y2, x1, deltaX, deltaY, keyCharacter);\n } \n // if the line has gradient > 1 \n } else { \n if (deltaY >= 0) {\n // line is drawn downwards\n this.drawSteepLine(x1, y1, y2, deltaX, deltaY, keyCharacter)\n } else { \n // line is drawn upwards\n this.drawSteepLine(x2, y2, y1, deltaX, deltaY, keyCharacter)\n } \n }\n // log the end square so we can get the highlighting dimensions when required\n this.endSquare = this.filledSquares[this.filledSquares.length - 1];\n }", "function handerLines() {\n if (lines) {\n return Object.keys(lines).forEach(key => {\n var row = lines[key];\n var start = lines[key].start;\n var end = lines[key].end;\n\n if (start) {\n // For now we focus on the horiztonal and vertical first. \n if (start.x === '0' && start.y === '0') {\n x1 = DEFAULT_X;\n y1 = DEFAULT_Y;\n }\n\n else if (start.y !== '0') {\n x1 = (parseInt(start.x) * 80) + DEFAULT_X;\n y1 = (parseInt(start.y) * 72) + (DEFAULT_Y * parseInt(start.y));\n }\n\n // For some reason, second and fourth row in ys are showing off the corridation. \n else {\n x1 = (parseInt(start.x) * 80) + DEFAULT_X;\n y1 = (parseInt(start.y) * 72) + DEFAULT_Y;\n }\n }\n\n if (end) {\n if (end.x === '0' && end.y === '0') {\n x2 = DEFAULT_X;\n y2 = DEFAULT_Y;\n }\n else if (end.y !== '0') {\n x2 = parseInt(end.x) * 80 + DEFAULT_X;\n y2 = (parseInt(end.y) * 72) + (DEFAULT_Y * parseInt(end.y));\n }\n else {\n x2 = parseInt(end.x) * 80 + DEFAULT_X;\n y2 = (parseInt(end.y) * 72) + DEFAULT_Y;\n }\n }\n return temp.push([x1, y1, x2, y2]);\n // temp.push(<line x1={x1} y1={y1} x2={x2} y2={y2} />) // DON'T TOUCH THIS!\n });\n\n }\n // setTest(prevState => [prevState, x1])\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function LineH (y : float, col : Color32)\n\t\t{\n\t\tif (m_alpha >= 0) col.a = Mathf.Clamp01(m_alpha) * 255;\n\t\tTexSegmentH(m_pixelsXMin, m_pixelsXMax, (y-m_viewArea.yMin)*m_scaleY, col);\n\t\tm_changed = true;\n\t\t}", "function drawVerLine(grid, row, col) {\r\n for (var i = row; i <= row + 2; i += 1) {\r\n drawPoint(grid, i, col);\r\n }\r\n }", "function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}", "function drawStandVertical()\r\n{\r\n ctx.beginPath();\r\n ctx.moveTo(30,10);\r\n ctx.strokeStyle=\"red\";\r\n ctx.lineTo(30,140);\r\n ctx.stroke();\r\n}", "get lineWrapping() { return this.viewState.heightOracle.lineWrapping; }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function draw_line(x1,y1,x2,y2,width) { \n pos1 = [x1,y1];\n pos2 = [x2,y2];\n \n direction = get_direction_vector(pos1,pos2);\n rot = rotate90(direction);\n\n x1 = pos1[0] + width/2 * rot[0];\n y1 = pos1[1] + width/2 * rot[1];\n\n x2 = pos2[0] + width/2 * rot[0];\n y2 = pos2[1] + width/2 * rot[1];\n\n x3 = pos2[0] - width/2 * rot[0];\n y3 = pos2[1] - width/2 * rot[1];\n\n x4 = pos1[0] - width/2 * rot[0];\n y4 = pos1[1] - width/2 * rot[1];\n\n var st = paper.path(\"M \" + x1 + \" \" + y1 + \" L \"\n\t\t\t+ x2 + \" \" + y2 + \" L \"\n\t\t\t+ x3 + \" \" + y3 + \" L \"\n\t\t\t+ x4 + \" \" + y4 + \" z\");\n st.attr(\"fill\", \"black\");\n return st;\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function Line(x1, y1, x2, y2, settings){\r\n\t\tICollider.apply(this, [settings]);\r\n\t\tthis.p1 = new Vec(x1, y1), this.p2 = new Vec(x2, y2);\r\n\t\t\r\n\t\tthis.filled = 0; //-1 for left, 1 for right\r\n\t\tthis.capped = true;\r\n\t}", "moveToNextLine(line) {\n let paragraph = line.paragraph;\n let paraFormat = paragraph.paragraphFormat;\n let isParagraphStart = line.isFirstLine();\n let isParagraphEnd = line.isLastLine();\n let height = 0;\n let maxDescent = 0;\n let afterSpacing = 0;\n let beforeSpacing = 0;\n let lineSpacing = 0;\n let firstLineIndent = 0;\n this.updateLineWidget(line);\n height = this.maxTextHeight;\n maxDescent = height - this.maxTextBaseline;\n //Updates before spacing at the top of Paragraph first line.\n if (isParagraphStart) {\n beforeSpacing = this.getBeforeSpacing(paragraph);\n firstLineIndent = HelperMethods.convertPointToPixel(paraFormat.firstLineIndent);\n }\n //Updates after spacing at the bottom of Paragraph last line.\n if (isParagraphEnd) {\n afterSpacing = HelperMethods.convertPointToPixel(this.getAfterSpacing(paragraph));\n }\n if (!this.isBidiReLayout && (paraFormat.bidi || this.isContainsRtl(line))) {\n this.reArrangeElementsForRtl(line, paraFormat.bidi);\n this.isRTLLayout = true;\n }\n if (isNaN(this.maxTextHeight)) {\n //Calculate line height and descent based on formatting defined in paragraph.\n let measurement = this.viewer.textHelper.measureText('a', paragraph.characterFormat);\n height = measurement.Height;\n maxDescent = height - measurement.BaselineOffset;\n }\n else {\n height = this.maxTextHeight;\n maxDescent = height - this.maxTextBaseline;\n }\n // Gets line spacing.\n lineSpacing = this.getLineSpacing(paragraph, height);\n if (paraFormat.lineSpacingType === 'Exactly'\n && lineSpacing < maxDescent + this.maxBaseline) {\n lineSpacing = maxDescent + this.maxBaseline;\n }\n let subWidth = 0;\n let whiteSpaceCount = 0;\n let textAlignment = paraFormat.textAlignment;\n // calculates the sub width, for text alignments - Center, Right, Justify.\n // if the element is paragraph end and para bidi is true and text alignment is justify\n // we need to calculate subwidth and add it to the left margin of the element.\n if (textAlignment !== 'Left' && this.viewer.textWrap && (!(textAlignment === 'Justify' && isParagraphEnd)\n || (textAlignment === 'Justify' && paraFormat.bidi))) {\n // tslint:disable-next-line:max-line-length\n let getWidthAndSpace = this.getSubWidth(line, textAlignment === 'Justify', whiteSpaceCount, firstLineIndent, isParagraphEnd);\n subWidth = getWidthAndSpace.subWidth;\n whiteSpaceCount = getWidthAndSpace.spaceCount;\n }\n let addSubWidth = false;\n let lineSpacingType = paraFormat.lineSpacingType;\n for (let i = 0; i < line.children.length; i++) {\n let topMargin = 0;\n let bottomMargin = 0;\n let leftMargin = 0;\n let elementBox = line.children[i];\n // tslint:disable-next-line:max-line-length\n let alignElements = this.alignLineElements(elementBox, topMargin, bottomMargin, maxDescent, addSubWidth, subWidth, textAlignment, whiteSpaceCount, i === line.children.length - 1);\n topMargin = alignElements.topMargin;\n bottomMargin = alignElements.bottomMargin;\n addSubWidth = alignElements.addSubWidth;\n whiteSpaceCount = alignElements.whiteSpaceCount;\n //Updates line spacing, paragraph after/ before spacing and aligns the text to base line offset.\n if (lineSpacingType === 'Multiple') {\n if (lineSpacing > height) {\n bottomMargin += lineSpacing - height;\n }\n else {\n topMargin += lineSpacing - height;\n }\n }\n else if (lineSpacingType === 'Exactly') {\n topMargin += lineSpacing - (topMargin + elementBox.height + bottomMargin);\n }\n else if (lineSpacing > topMargin + elementBox.height + bottomMargin) {\n topMargin += lineSpacing - (topMargin + elementBox.height + bottomMargin);\n }\n topMargin += beforeSpacing;\n bottomMargin += afterSpacing;\n if (i === 0) {\n line.height = topMargin + elementBox.height + bottomMargin;\n if (textAlignment === 'Right' || (textAlignment === 'Justify' && paraFormat.bidi && isParagraphEnd)) {\n //Aligns the text as right justified and consider subwidth for bidirectional paragrph with justify.\n leftMargin = subWidth;\n }\n else if (textAlignment === 'Center') {\n //Aligns the text as center justified.\n leftMargin = subWidth / 2;\n }\n }\n elementBox.margin = new Margin(leftMargin, topMargin, 0, bottomMargin);\n elementBox.line = line;\n }\n this.viewer.cutFromTop(this.viewer.clientActiveArea.y + line.height);\n }", "function Line(){}", "function draw_line(p1, p2) {\n var dist = Math.sqrt((p1.x - p2.x) * (p1.x - p2.x)\n + (p1.y - p2.y) * (p1.y - p2.y));\n var line = document.createElement(\"div\");\n line.className = \"line\";\n line.style.width = dist + \"px\";\n line.style.backgroundColor = \"#bbbbbb\";\n lines_div.appendChild(line);\n var m = (p1.y - p2.y) / (p1.x - p2.x);\n var ang = Math.atan(m);\n var ps = [p1, p2];\n var left = ps[0].x < ps[1].x ? 0 : 1;\n var top = ps[0].y < ps[1].y ? 0 : 1;\n if (left == top) {\n line.style.transformOrigin = \"top left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n else {\n line.style.transformOrigin = \"bottom left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[1 - top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n}", "drawLine() {\n ctx.moveTo(this.u0, this.v0);\n ctx.lineTo(this.u1, this.v1);\n ctx.stroke();\n }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function drawForLine(from, to, line) {\n let top = 1e9, bottom = -1e9, horizontal = [];\n function addSpan(from, fromOpen, to, toOpen, dir) {\n // Passing 2/-2 is a kludge to force the view to return\n // coordinates on the proper side of block widgets, since\n // normalizing the side there, though appropriate for most\n // coordsAtPos queries, would break selection drawing.\n let fromCoords = view.coordsAtPos(from, (from == line.to ? -2 : 2));\n let toCoords = view.coordsAtPos(to, (to == line.from ? 2 : -2));\n if (!fromCoords || !toCoords)\n return;\n top = Math.min(fromCoords.top, toCoords.top, top);\n bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);\n if (dir == exports.Direction.LTR)\n horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);\n else\n horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);\n }\n let start = from !== null && from !== void 0 ? from : line.from, end = to !== null && to !== void 0 ? to : line.to;\n // Split the range by visible range and document line\n for (let r of view.visibleRanges)\n if (r.to > start && r.from < end) {\n for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end);;) {\n let docLine = view.state.doc.lineAt(pos);\n for (let span of view.bidiSpans(docLine)) {\n let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;\n if (spanFrom >= endPos)\n break;\n if (spanTo > pos)\n addSpan(Math.max(spanFrom, pos), from == null && spanFrom <= start, Math.min(spanTo, endPos), to == null && spanTo >= end, span.dir);\n }\n pos = docLine.to + 1;\n if (pos >= endPos)\n break;\n }\n }\n if (horizontal.length == 0)\n addSpan(start, from == null, end, to == null, view.textDirection);\n return { top, bottom, horizontal };\n }", "function invLerp(line, point) {\n var t = vec2.create();\n vec2.sub(t, point, line.ends[0]);\n return vec2.dot(t, line.vec) / line.len_2;\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function vertical_distance(x, line1_p1, line1_p2, line2_p1, line2_p2){\n // detect invalid values (not between x-ranges of both segments)\n if (!(between(x, line1_p1[0], line1_p2[0]) && (between(x, line2_p1[0], line2_p2[0])))){\n return NaN;\n }\n // find corresponding points on both lines\n var slope1 = (line1_p1[1]-line1_p2[1]) / (line1_p1[0]-line1_p2[0]);\n var slope2 = (line2_p1[1]-line2_p2[1]) / (line2_p1[0]-line2_p2[0]);\n var y1 = line1_p1[1] + ((x - line1_p1[0]) * slope1);\n var y2 = line2_p1[1] + ((x - line2_p1[0]) * slope2);\n return Math.abs(y1-y2);\n}", "_drawLine(x1, y1, x2, y2, opt_boundRect) {\n if (opt_boundRect) {\n let minX = Math.min(x1, x2);\n let maxX = Math.max(x1, x2);\n let minY = Math.min(y1, y2);\n let maxY = Math.max(y1, y2);\n\n if (opt_boundRect.left <= minX && maxX < opt_boundRect.right &&\n opt_boundRect.top <= minY && maxY < opt_boundRect.bottom) {\n opt_boundRect = null; // the line is fully inside the drawing area\n } else if (opt_boundRect.left > maxX || minX >= opt_boundRect.right ||\n opt_boundRect.top > maxY || minY > opt_boundRect.bottom) {\n return; // the line is outside the drawing area\n }\n }\n\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n if (dx !== 0 || dy !== 0) {\n if (Math.abs(dx) > Math.abs(dy)) {\n let a = dy / dx;\n let b = -a * x1 + y1;\n\n if (dx < 0) {\n let x0 = x1;\n x1 = x2;\n x2 = x0;\n }\n\n for (let x = x1; x <= x2; x++) {\n let y = Math.round(a * x + b);\n this._drawPixel(x, y, opt_boundRect);\n }\n } else {\n let a = dx / dy;\n let b = -a * y1 + x1;\n\n if (dy < 0) {\n let y0 = y1;\n y1 = y2;\n y2 = y0;\n }\n\n for (let y = y1; y <= y2; y++) {\n let x = Math.round(a * y + b);\n this._drawPixel(x, y, opt_boundRect);\n }\n }\n }\n }", "_drawLineLow( x1, y1, x2, y2, id ) {\n const dx = x2 - x1;\n let dy = y2 - y1;\n let yIncrement = 1;\n if ( dy < 0 ) {\n yIncrement = -1;\n dy = -dy;\n }\n\n let decision = 2 * dy - dx;\n let y = y1;\n\n for ( let x = x1; x <= x2; x += 1 ) {\n this.setPixel( x, y, id );\n\n if ( decision > 0 ) {\n y += yIncrement;\n decision = decision - ( 2 * dx );\n }\n\n decision = decision + ( 2 * dy );\n }\n }", "igniteAt (x, y) { return this.horzLineAt(y).igniteAt(x) && this.vertLineAt(x).igniteAt(y) }", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function IsPointOnLine(linePointA, linePointB, point) {\n var isOn = false;\n //quick bounding check\n if ((point.x >= linePointA.x && point.x <= linePointB.x) || (point.x >= linePointB.x && point.x <= linePointA.x)) {\n if ((point.y >= linePointA.y && point.y <= linePointB.y) || (point.y >= linePointB.y && point.y <= linePointA.y)) {\n var a = (linePointB.y - linePointA.y) / (linePointB.x - linePointA.x);\n var b = linePointA.y - a * linePointA.x;\n //adjust the tolerance by the zoom level\n var delta = Math.abs(point.y - (a * point.x + b));\n var tolerance = (EPSILON * (zoomLevel / 100));\n //$('#line-data').text(delta.toFixed(4) + \",\" + tolerance.toFixed(4));\n if (delta <= tolerance) {\n // point is on line segment\n isOn = true;\n }\n if (!isOn) {\n //still not on, but check for other verticies\n a = (linePointB.x - linePointA.x) / (linePointB.y - linePointA.y);\n b = linePointA.x - a * linePointA.y;\n //adjust the tolerance by the zoom level\n var delta = Math.abs(point.x - (a * point.y + b));\n var tolerance = (EPSILON * (zoomLevel / 100));\n if (delta <= tolerance) {\n // point is on line segment\n isOn = true;\n }\n }\n // point not on line segment\n return isOn;\n } else {\n // y isn't in range of line segment\n return false;\n }\n } else {\n // x isn't in range of line segment\n return false;\n }\n\n}", "function draw_vertical_road(noOfLines, xPos) {\n\tdraw_line(xPos, 0, xPos, (mapHeight/noOfLines), true);\t\t\n\tfor (var i = 1; i <= noOfLines; i++) {\n\t\tdraw_line(xPos,\n\t\t(mapHeight/noOfLines)*i - lineWidth,\n\t\txPos,\n\t\t(mapHeight/noOfLines) * (i+1),\n\t\ttrue);\t\n\t}\n}", "function drawUpdate( current ) {\n\n\t\tif ( previous.x !== current.x || previous.y !== current.y ) {\n\t\t\tmultiline( previous.x, previous.y, current.x, current.y, splits, lineSymmetryCtrl.checked );\n\t\t}\n\t}", "drawVerticalLine(color, height) {\n const width = 2;\n\n let draw = new DrawContext();\n draw.opaque = false;\n draw.respectScreenScale = true;\n draw.size = new Size(width, height);\n\n let barPath = new Path();\n // const barHeight = height;\n barPath.addRoundedRect(\n new Rect(0, 0, height, height),\n width / 2,\n width / 2\n );\n draw.addPath(barPath);\n draw.setFillColor(color);\n draw.fillPath();\n return draw.getImage();\n }", "function draw() {\n line(lineX, lineY, lineXEnd, lineY);\n lineX+=5;\n lineXEnd +=5;\n if(lineX==width && lineXEnd==width){\n noLoop();\n }\n}", "function shouldShowLineThisSide(ax, side, counterAx) {\n // does counterAx get a line at all?\n if (!counterAx.showline || !counterAx._lw) return false;\n\n // are we drawing *all* lines for counterAx?\n if (counterAx.mirror === 'all' || counterAx.mirror === 'allticks') return true;\n var anchorAx = counterAx._anchorAxis;\n\n // is this a free axis? free axes can only have a subplot side-line with all(ticks)? mirroring\n if (!anchorAx) return false;\n\n // in order to handle cases where the user forgot to anchor this axis correctly\n // (because its default anchor has the same domain on the relevant end)\n // check whether the relevant position is the same.\n var sideIndex = alignmentConstants.FROM_BL[side];\n if (counterAx.side === side) {\n return anchorAx.domain[sideIndex] === ax.domain[sideIndex];\n }\n return counterAx.mirror && anchorAx.domain[1 - sideIndex] === ax.domain[1 - sideIndex];\n}", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function reverseLine(line){\n \n var tempX = line.x1;\n var tempY = line.y1;\n line.x1 = line.x2;\n line.y1 = line.y2;\n line.x2 = tempX;\n line.y2 = tempY;\n \n return line;\n}", "function single(){\n ctx.moveTo(0, height-(rows*step));\n ctx.lineTo((width/2), height-((rows-1)*step));\n }", "function _layoutLine(next, endReached) {\n\t if (!lineNodes.length) {\n\t return 0;\n\t }\n\t\n\t // Determine size of the line\n\t var i;\n\t var lineSize = [0, 0];\n\t var lineNode;\n\t for (i = 0; i < lineNodes.length; i++) {\n\t lineSize[direction] = Math.max(lineSize[direction], lineNodes[i].size[direction]);\n\t lineSize[lineDirection] += ((i > 0) ? spacing[lineDirection] : 0) + lineNodes[i].size[lineDirection];\n\t }\n\t\n\t // Layout nodes from left to right or top to bottom\n\t var justifyOffset = justify[lineDirection] ? ((lineLength - lineSize[lineDirection]) / (lineNodes.length * 2)) : 0;\n\t var lineOffset = (direction ? margins[3] : margins[0]) + justifyOffset;\n\t var scrollLength;\n\t for (i = 0; i < lineNodes.length; i++) {\n\t lineNode = lineNodes[i];\n\t var translate = [0, 0, 0];\n\t translate[lineDirection] = lineOffset;\n\t translate[direction] = next ? offset : (offset - (lineSize[direction]));\n\t scrollLength = 0;\n\t if (i === 0) {\n\t scrollLength = lineSize[direction];\n\t if (endReached && ((next && !alignment) || (!next && alignment))) {\n\t scrollLength += direction ? (margins[0] + margins[2]) : (margins[3] + margins[1]);\n\t }\n\t else {\n\t scrollLength += spacing[direction];\n\t }\n\t }\n\t lineNode.set = {\n\t size: lineNode.size,\n\t translate: translate,\n\t scrollLength: scrollLength\n\t };\n\t lineOffset += lineNode.size[lineDirection] + spacing[lineDirection] + (justifyOffset * 2);\n\t }\n\t\n\t // Set nodes\n\t for (i = 0; i < lineNodes.length; i++) {\n\t lineNode = next ? lineNodes[i] : lineNodes[(lineNodes.length - 1) - i];\n\t context.set(lineNode.node, lineNode.set);\n\t }\n\t\n\t // Prepare for next line\n\t lineNodes = [];\n\t return lineSize[direction] + spacing[direction];\n\t }", "get horizontalLineVisibility() {\r\n return this.i.pl;\r\n }" ]
[ "0.6729954", "0.6622322", "0.64239997", "0.6312249", "0.63114655", "0.6309668", "0.6269432", "0.6267897", "0.6216122", "0.62157315", "0.6188763", "0.6178433", "0.613286", "0.61135954", "0.61135954", "0.6106936", "0.6100049", "0.60898376", "0.6086674", "0.60331523", "0.6022578", "0.6022134", "0.60174435", "0.6009416", "0.5974978", "0.59734315", "0.5944371", "0.5944017", "0.59282875", "0.59262353", "0.5925669", "0.5912322", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5910522", "0.5903952", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5901574", "0.5894311", "0.5891012", "0.58801293", "0.5876384", "0.58759147", "0.5874315", "0.5874315", "0.5874315", "0.58651394", "0.58651394", "0.586487", "0.58646655", "0.585095", "0.585095", "0.585095", "0.585095", "0.585095", "0.585095", "0.585095", "0.5848604", "0.5844157", "0.5839739", "0.583973", "0.58371156", "0.58371156", "0.58371156", "0.58371156", "0.58371156", "0.5833708", "0.5833025", "0.5830528", "0.5826953", "0.5822649", "0.58207685", "0.5819831", "0.58188957", "0.58165795", "0.5800818", "0.5791474" ]
0.6440199
2
OICE Output: a string representing the longest common prefix Input: an array of strings Constraints: O(n) empty string, strs.length = 0 => null ["colorado", "color", "cold"] result = 'col' sorted: ["cold", "color", "colorado"] fVal: 'd' lVal: 'o' return 'col' Pseudo: 1. declare a results variable which would be an empty string 2. sort the array into alphabetical order 3. loop over the array comparing the first and last elements if the values of the first and last are the same, then concat that value to the string break if the two do not equal each other 4. return result
function longestCommonPrefix(strs) { if (strs.length === 0) { return null; } if (strs.length === 1) { return strs[0]; } let result = ''; strs = strs.sort(); // nlogn for (let i = 0; i < strs[0].length; i++) { //n if (strs[0][i] === strs[strs.length - 1][i]) { result += strs[0][i]; } else { break; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestCommonPrefix(arr) {\n let result = '';\n if (!arr || arr.length === 0) { return ''; }\n for (let i = 0; i < arr[0].length; i++){\n let newLetter = arr[0][i];\n\n for (let j = 0; j < arr.length; j++){\n let testLetter = arr[j][i];\n if (testLetter !== newLetter) {\n return result;\n }\n }\n result += newLetter;\n }\n return result;\n}", "function longestCommonPrefix(s) {\n if (s == null || s.length == 0) return \"\";\n\n var same = s[0];\n for (var i = 1; i < s.length; i++) {\n var str = s[i];\n\n for (var j = 0; j < same.length; j++) {\n if (same[j] != str.charAt(j)) {\n break;\n }\n }\n\n same = same.slice(0, j);\n }\n return same;\n}", "function longestCommonPrefix(words) {\n var prefix = '';\n var letters = {};\n var shortest = Infinity\n for (var k = 0; k < words.length; k++) {\n if (words[k].length < shortest) {\n shortest = words[k].length;\n }\n }\n var j = 0;\n var prefix = '';\n var temp;\n while (j < shortest) {\n var i = 0;\n while (i < words.length) {\n if (i === 0) {\n temp = words[i][j]\n }\n if (words[i][j] !== temp || words[i][j].length === 0) {\n return prefix;\n }\n i++\n }\n prefix += words[i-1][j]\n j++;\n }\n return prefix;\n}", "function commonSuffix(arr) {\n if (arr.length === 0){return\"\";}\n if (arr.length === 1){return arr[0];}\n// find common suffix of the first 2 words and save it in a variable. Use an array variable instead of a string for the ease of cutting this variable later on.\n let currReversedSuffixArr = [];\n let len1 = arr[1].length;\n let len0 = arr[0].length;\n // console.log(\"arr[1].length: \", arr[1].length);\n\n for (let i = len0-1, j = len1-1; i>=0, j>=0; i--, j--){\n if (arr[1][j] === arr[0][i]){\n // console.log(\"i: \", i,\"j: \", j, currReversedSuffixArr);\n currReversedSuffixArr.push(arr[1][j]);\n }\n else if (arr[1][j] !== arr[0][i]){\n break;\n }\n }\n // console.log(\"line 26: \", currReversedSuffixArr);\n\n // iterate through the rest of the array, compare the array value with the saved suffix\n for (let i = 2; i<arr.length; i++) {\n let prevReversedSuffixArr = currReversedSuffixArr;\n let len = arr[i].length;\n let sLen = prevReversedSuffixArr.length;\n currReversedSuffixArr = [];\n for (let j = len-1, k=0; j>=0, k<sLen; j--, k++) {\n if (arr[i][j] === prevReversedSuffixArr[k]){\n currReversedSuffixArr.push(arr[i][j]);\n }\n else if (arr[i][j] !== prevReversedSuffixArr[k]){\n break;\n }\n }\n // console.log(\"line 39: \",prevReversedSuffixArr);\n }\n // iterate thru the reversed suffix array from back to front and make a string from it\n sLen = currReversedSuffixArr.length;\n let suffix = \"\";\n for (let i=sLen-1; i>=0; i--) {\n suffix += currReversedSuffixArr[i];\n }\n return suffix;\n}", "function findLongestPrefix(array) {\n let prefix = undefined;\n //iterate through input array\n array.forEach(item => {\n //\n if (prefix === undefined) {\n prefix = item;\n } else {\n //find shared prefix with newest word and store in temp\n let temp = \"\";\n for (let i = 0; i < item.length; i++) {\n if (item[i] === prefix[i]) {\n temp = temp + item[i];\n } else break;\n }\n //update prefix\n prefix = temp;\n if (prefix === \"\") {\n return prefix;\n }\n }\n });\n return prefix;\n}", "function commonPrefix(array) {\n let firstString = array.sort((a, b) => a.length - b.length)[0];\n let result = \"\";\n\n for (let idx = 1; idx <= firstString.length; idx += 1) {\n let prefix = firstString.slice(0, idx);\n for (let string of array) {\n if (string.startsWith(prefix)) {\n continue;\n } else {\n return result;\n }\n }\n result = prefix;\n }\n return result;\n}", "function longestCommonPrefix(words) {\n var prefix = '';\n var letters = {};\n var shortest = Infinity\n for (var k = 0; k < words.length; k++) {\n if (words[k].length < shortest) {\n shortest = words[k].length;\n }\n }\n var j = 0;\n var prefix = '';\n var temp;\n while (j < shortest) {\n var i = 0;\n while (i < words.length) {\n letters[words[i][j]] = words[i][j];\n temp = words[i][j]\n i++;\n }\n if (Object.keys(letters).length === 1) {\n prefix += temp;\n } else {\n return prefix;\n }\n letters = {};\n j++;\n }\n return prefix;\n}", "function longestCommon(str1, str2) {\n let shortest = (str1.length > str2.length ? str2 : str1);\n let longest = (str1.length > str2.length ? str1 : str2);\n let ans = \"\";\n for (let i = 0; i < shortest.length; i++) {\n for (let j = shortest.length - 1; j > i; j--) {\n let slice = shortest.slice(i, j);\n if (longest.includes(slice) && ans.length < slice.length) {\n ans = slice;\n }\n }\n }\n return ans;\n}", "function findLongestPrefix(array) {\n var A = array.concat().sort(),\n a1 = A[0],\n a2 = A[A.length - 1],\n L = a1.length,\n i = 0;\n while (i < L && a1.charAt(i) === a2.charAt(i)) i++;\n return a1.substring(0, i);\n}", "function lcs(word1, word2) {\r\n\tvar max = 0;\r\n\tvar index = 0;\r\n\tvar lcsarr = new Array(word1.length+1);\r\n\tfor (var i = 0; i <= word1.length+1; ++i) {\r\n\t\tlcsarr[i] = new Array(word2.length+1);\r\n\t\tfor (var j = 0; j <= word2.length+1; ++j) {\r\n\t\tlcsarr[i][j] = 0;\r\n\t\t}\r\n\t}\r\n\tfor (var i = 0; i <= word1.length; ++i) {\r\n\t\tfor (var j = 0; j <= word2.length; ++j) {\r\n\t\t\tif (i == 0 || j == 0) {\r\n\t\t\t\tlcsarr[i][j] = 0;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (word1[i-1] == word2[j-1]) {\r\n\t\t\t\t\tlcsarr[i][j] = lcsarr[i-1][j-1] + 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlcsarr[i][j] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (max < lcsarr[i][j]) {\r\n\t\t\t\tmax = lcsarr[i][j];\r\n\t\t\t\tindex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar str = \"\";\r\n\tif (max == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\telse {\r\n\t\tfor (var i = index-max; i <= max; ++i) {\r\n\t\t\tstr += word2[i];\r\n\t}\r\n\treturn str;\r\n\t}\r\n}", "function longestCommonSubstring(a, b)\n{\n\tlet len = b.length, originalLen = b.length;\n\tdo\n\t{\n\t\tfor ( let i = 0; i <= originalLen - len; i++ )\n\t\t{\n\t\t\tlet needle = b.substr( i, len );\n\t\t\tif ( a.indexOf( needle ) !== -1 ) return needle;\n\t\t}\n\t} while ( len-- > 0 );\n\n\treturn \"\";\n}", "function longest(a, b) {\n let c = [];\n let arr1 = a.toLowerCase().split('');\n let arr2 = b.toLowerCase().split('');\n let arr3 = (arr1.concat(arr2)).sort();\n for (let i = 0; i < arr3.length; i++) {\n if (c.includes(arr3[i]) !== true) {\n c.push(arr3[i]);\n }\n }\n return c.join('');\n}", "function solution(A) {\n var terms = A.length;\n var match = 1;\n var prefix = \"\";\n while (match == 1) {\n for (var c = 0; c < 100; c++) {\n for (var i = 0; i < terms-1; i++) {\n if (A[i][c] != A[i+1][c]) {\n match = 0 \n }\n } \n }\n }\n return prefix;\n}", "function commonChild(a, b) {\r\n \r\n \r\n var len = a.length;\r\n \r\n var pre = [];\r\n var now = [];\r\n \r\n \r\n \r\n for(var i=0;i<len;i++) pre[i] = 0;\r\n \r\n \r\n for(var i=0;i<len;i++){\r\n for(var j=0;j<len;j++){\r\n if(a[i].charAt(0) == b[j].charAt(0)){\r\n if(i==0) now[j] = 1;\r\n else if(j==0) now[j] = 1;\r\n else now[j] = pre[j-1] + 1;\r\n }\r\n else{\r\n var max = 0;\r\n if(i>0 && max < pre[j]) max = pre[j];\r\n if(j>0 && max < now[j-1]) max = now[j-1];\r\n if(i>0 && j>0 && max < pre[j-1]) max = pre[j-1];\r\n now[j] = max;\r\n }\r\n }\r\n for(j=0;j<len;j++)\r\n pre[j] = now[j];\r\n }\r\n\r\n \r\n \r\n \r\n return now[len-1];\r\n\r\n\r\n}", "function populateAndFindLongestCommonSubstring(arr, s1, s2) {\n\tvar diagonal, newCommonLen, retStr;\n\tvar longestStrLen = -1,\n\t\tlongestStrLenRow = -1,\n\t\tlongestStrLenCol = -1,\n\t\trowLen = s1.length + 1,\n\t\tcolLen = s2.length + 1;\n\n\tfor(var i = 1; i < rowLen; i++) {\n\t\tfor(var j = 1; j < colLen; j++) {\n\t\t\t// If the letter of the column and the row are the same then\n\t\t\t// take 1 + the diagonal else just use zero\n\t\t\tif(s1[i - 1] === s2[j - 1]) {\n\t\t\t\tdiagonal = arr[i - 1][j - 1];\n\t\t\t\tnewCommonLen = 1 + diagonal;\n\n\t\t\t\t// Keeping track of the index and length of the longest common substring\n\t\t\t\tif(newCommonLen > longestStrLen) {\n\t\t\t\t\tlongestStrLen = newCommonLen;\n\t\t\t\t\t[longestStrLenRow, longestStrLenCol] = [i, j];\n\t\t\t\t}\n\n\t\t\t\tarr[i].push(newCommonLen);\n\t\t\t} else {\n\t\t\t\tarr[i].push(0);\n\t\t\t}\n\t\t}\n\t}\n\n\tretStr = traverseDiagonal(arr, s1, longestStrLenRow, longestStrLenCol);\n\treturn retStr;\n}", "function longest(s1, s2) {\n let fullStr = s1+s2\n let outputArr = []\n fullStr = fullStr.split(\"\").forEach(el => {\n if(outputArr.indexOf(el) == -1){\n outputArr.push(el)\n }\n })\n \n outputArr.sort((a,b)=>{\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n })\n return outputArr.join(\"\")\n }", "function removeCommonPrefix(strings) {\n if (strings.length < 2) {\n return strings;\n }\n var index = 0;\n var largestIndex = 0;\n // Find the shortest name across all strings.\n var minLength = _.min(_.map(strings, function (str) { return str.length; }));\n var _loop_1 = function () {\n index++;\n var prefixes = _.map(strings, function (str) { return str.substring(0, index); });\n var allTheSame = prefixes.every(function (prefix, i) {\n return (i === 0 ? true : prefix === prefixes[i - 1]);\n });\n if (allTheSame) {\n if (index >= minLength) {\n return { value: strings };\n }\n largestIndex = index;\n }\n else {\n return \"break\";\n }\n };\n while (true) {\n var state_1 = _loop_1();\n if (typeof state_1 === \"object\")\n return state_1.value;\n if (state_1 === \"break\")\n break;\n }\n return _.map(strings, function (str) { return str.substring(largestIndex); });\n }", "function LongestCommonSub_Iterative(str1, str2, m, n) {\n\n var tabulation = [];\n\n for (var i = 0; i <= m; i++) {\n for (var j = 0; j <= n; j++) {\n // initialize i=0 and j=0 rows and cols with 0, as we need these as initial state \n if (i === 0 || j === 0) {\n if (tabulation[i] === undefined) {\n tabulation[i] = [];\n }\n //takes care of populating a row with all Zero\n //Happens only for first row and first column i.e., i=0 || j=0\n tabulation[i][j] = 0;\n } else {\n if (str1.charAt(i - 1) === str2.charAt(j - 1)) {\n //If they match then its reduced to 1 + LCS( str1 - 1char, str2 - 1char)\n tabulation[i][j] = 1 + tabulation[i - 1][j - 1]\n } else {\n //If they don't match then its reduced to Max of [ LCS( str1 - 1char, str2) , LCS( str1, str2 - 1char) ] \n tabulation[i][j] = Math.max(tabulation[i - 1][j], tabulation[i][j - 1]);\n }\n }\n }\n }\n\n printLCS(str1, str2, m, n, tabulation);\n return tabulation;\n\n}", "function findCommonPrefix (a, b) {\n let i\n for (i = 0; i < a.length && i < b.length; i++) {\n if (a.charCodeAt(i) !== b.charCodeAt(i)) break\n }\n if (i === a.length) return a\n if (i === b.length) return b\n return a.substring(0, i)\n}", "async function mostCommonSubstring(testingArray1) {\n try {\n console.log(\"into mostcommon string\")\n let pathArray = [];\n await Promise.all(\n testingArray1.map(async element => {\n const urlParse = URL.parse(element);\n if (urlParse.hash != null && urlParse.path == null) {\n pathArray.push(urlParse.hash);\n } else if (urlParse.hash != null) {\n pathArray.push(urlParse.hash);\n pathArray.push(urlParse.path);\n } else {\n pathArray.push(urlParse.path);\n }\n })\n );\n pathArray = await spliting(pathArray);\n // console.log(pathArray)\n pathArray = Array.prototype.concat.apply([], pathArray);\n // \n pathArray = await pathArray.filter(function (el) {\n return el != null && el != \"\";\n });\n pathArray = await arrayCounter(pathArray);\n let pathString = []\n let myStrings = []\n for (let [key, value] of Object.entries(pathArray)) {\n if (key.length > 3) {\n pathString.push({\n \"str\": `${key}`,\n \"value\": value\n })\n }\n pathString.sort(function (a, b) {\n return b.value - a.value\n })\n\n }\n // console.log(chalk.blue(pathString))\n\n topValue = pathString[0].value\n await Promise.all(pathString.map(async element => {\n if (((element.value / topValue) * 100) > 85) {\n myStrings.push(element.str)\n\n }\n }))\n\n var longest = myStrings.sort(function (a, b) {\n return b.length - a.length;\n })[0]\n console.log(chalk.yellow(longest))\n if (longest.lastIndexOf('=') > longest.lastIndexOf('/')) {\n longest = longest.slice(0, longest.lastIndexOf('=') + 1);\n } else if (longest.lastIndexOf('.') > longest.lastIndexOf('/')) {\n longest = longest.slice(0, longest.lastIndexOf('.') + 1);\n } else if (longest.lastIndexOf('-') > longest.lastIndexOf('/')) {\n longest = longest.slice(0, longest.lastIndexOf('-') + 1);\n } else if (longest.includes('/')) {\n if (longest.slice(0, longest.lastIndexOf('/')).includes('/')) {\n longest = longest.slice(0, longest.lastIndexOf('/') + 1);\n };\n }\n return longest.replace(/\\d+$/, \"\");\n } catch (error) {\n return \"\"\n }\n}", "function longest(s1, s2) {\n let arr = [];\n let temp = s1.concat(s2).split('').sort();\n temp.reduce(function(previous, current){\n if (current !== previous) {\n arr.push(current);\n return current;\n }\n return previous;\n }, 0);\n return arr.join('');\n}", "function longest(s1, s2) {\n s1 = s1.split(\"\");\n s2 = s2.split(\"\");\n var nstring = s1.concat(s2);\n nstring = nstring.sort();\n var result = [];\n for(var i = 0; i<nstring.length; i++){\n if(result.indexOf(nstring[i])===-1){\n result.push(nstring[i]);\n }\n }\n result = result.join(\"\");\n return result; \n }", "function longestConsec(strarr, k) {\n let longest = 0, arr = [], len = strarr.length;\n for (let i = 0; i < len; i++) {\n let af = strarr.slice(i, i + k).join('');\n arr.push(af);\n }\n if (len === 0 || k > len || k <= 0) {\n return '';\n }else return arr.reduce((a, b) => {\n return a.length >= b.length ? a : b;\n });\n}", "function most_common_letter(string) {\n var array = string.split(\"\").sort();\n var returnedArray = [array[i],0];\n var i =0;\n while(i<array.length){\n var difference = array.lastIndexOf(array[i]) - i +1;\n if(difference> returnedArray[1]){\n returnedArray[0] = array[i]\n returnedArray[1] = difference;\n }\n i=i+difference; \n }\n return returnedArray;\n}", "function LCS(x, y) {\n let string = \"\";\n let n = 0;\n for (let i = 0; i < y.length; i++) {\n for (let k = n; k < x.length; k++)\n if (y[i] === x[k]) {\n string += y[i];\n n = ++k;\n break;\n }\n }\n return string;\n}", "function longest(s1, s2) {\n let combined = s1 + s2;\n let uniqueSet = new Set(combined);\n let uniqueArray = [...uniqueSet];\n return uniqueArray.sort().join(\"\");\n\n}", "function longestString(arr){\n\tvar result = \"\";\n\tfor(var i=0; i<arr.length; i++){\n\t\tif(arr[i].length >= arr[0].length){\n\t\t\tresult = arr[i];\n\t\t}\n\t}\n\treturn result;\n}", "function MinWindowSubstring(strArr) { \n if (strArr.length < 2) return \"\"\n \n let stringN = strArr[0]\n let stringK = strArr[1]\n let result = \"\"\n \n let stringKMap = {}\n for (let i = 0; i < stringK.length; i++) {\n let letter = stringK.charAt(i)\n \n if (stringKMap[letter] != null) {\n stringKMap[letter] = stringKMap[letter] + 1\n } else {\n stringKMap[letter] = 1\n }\n }\n \n let stringNMap = {}\n let counter = 0\n let remaining = 0\n let minLength = stringN.length + 1\n for (let i = 0; i < stringN.length; i++) {\n let letter = stringN.charAt(i)\n \n if (stringKMap[letter] != null) {\n if (stringNMap[letter] != null) {\n if (stringNMap[letter] < stringKMap[letter]) {\n counter++\n }\n \n stringNMap[letter] = stringNMap[letter] + 1\n } else {\n stringNMap[letter] = 1\n counter++\n }\n }\n \n if (counter === stringK.length) {\n let track = stringN.charAt(remaining)\n \n while ((stringNMap[track] == null) || stringNMap[track] > stringKMap[track]) {\n if (stringNMap[track] != null && stringNMap[track] > stringKMap[track]) {\n stringNMap[track] = stringNMap[track] - 1\n }\n \n remaining++\n track = stringN.charAt(remaining)\n }\n \n if (i - remaining + 1 < minLength) {\n result = stringN.substring(remaining, i + 1)\n minLength = i - remaining + 1\n }\n }\n }\n \n return result; \n }", "function longest(s1, s2) {\n \n return Array.from(new Set(s1.split(\"\").concat(s2.split(\"\")).sort())).join(\"\");\n\n}", "function lcs(s1, s2) {\n let result = \"\";\n helper(s1.length - 1, s2.length - 1, \"\");\n return result;\n\n function helper(n, m, string) {\n if (n < 0 || m < 0) {\n if ( result.length < string.length ) result = string;\n return;\n }\n\n if (s1[n] === s2[m]) {\n helper(n - 1, m - 1, string + s1[n]);\n\n } else {\n helper(n - 1, m, string);\n helper(n, m - 1, string);\n }\n }\n}", "function commonPrefix (arr, options) {\n if (arr.length === 0) {\n return options.emptyPrefix\n } else if (arr.length === 1) {\n return options.getKey(arr[0])\n }\n const first = options.getKey(arr[0])\n const last = options.getKey(arr[arr.length - 1])\n const n = options.match(first, last)\n return options.prefix(first, n)\n}", "function longest(s1, s2) {\n var answer = [];\n var arr = s1.split('');\n var arr1 = s2.split('');\n for(var i = 0; i < arr.length; i++){\n if(!answer.includes(arr[i])){\n answer.push(arr[i])\n }\n }\n for(var i = 0; i < arr1.length; i++){\n if(!answer.includes(arr1[i])){\n answer.push(arr1[i])\n }\n }\n return answer.sort().join('');\n }", "function longest(s1, s2) {\n return [...new Set([...s1.split('') ,...s2.split('')])].sort().join().replace(/[^\\w]/g,'');\n}", "function findLongestWordReduce(strs) {\n return strs.reduce((a,b) => a.length < b.length ? b : a, \"\");\n}", "function get_shared_start(strs) {\n\tif (strs.length <= 1) return ''\n\n\tconst A = [...strs].sort()\n\tconst a1 = A[0]\n\tconst a2 = A[A.length - 1]\n\tconst L = a1.length\n\n\tlet i = 0\n\twhile (i < L && a1.charAt(i) === a2.charAt(i)) { i++ }\n\n\treturn a1.substring(0, i)\n}", "function generateLCS(stringA, stringB) {\n // obtain the lengths of both strings\n const m = stringA.length;\n const n = stringB.length;\n\n /* create a 2D array for dynamic programming approach, this will be the LCS\n table, which will yield the lengths of the LCS's for the (sub)strings, and\n backtracking along it yields the actual LCS. */\n lcsTable = []\n for (let i = 0; i < m + 1; i++) {\n lcsTable[i] = [];\n }\n\n // make the first row of the lcs table all 0's\n for (let i = 0; i < n + 1; i++) {\n lcsTable[0][i] = 0;\n }\n\n // make the first column of the lcs table all 0's\n for (let i = 0; i < m + 1; i++) {\n lcsTable[i][0] = 0;\n }\n\n // fill the rest of the lcs table\n for (let i = 1; i < m + 1; i++) {\n for (let j = 1; j < n + 1; j++) {\n if (stringA.charAt(i - 1) == stringB.charAt(j - 1)) {\n lcsTable[i][j] = lcsTable[i - 1][j - 1] + 1;\n } else {\n lcsTable[i][j] = Math.max(lcsTable[i][j - 1],\n lcsTable[i - 1][j]);\n }\n }\n }\n\n // obtain the length of the lcs\n const lcsLength = lcsTable[m][n];\n\n // backtrack along the lcs table to build the lcs string\n let lcsString = \"\";\n let cornerRow = m, cornerCol = n;\n for (let i = lcsLength; i >= 1; i--) {\n // find the next corner\n while (lcsTable[cornerRow][cornerCol - 1] == i) {\n cornerCol--;\n }\n while (lcsTable[cornerRow - 1][cornerCol] == i) {\n cornerRow--;\n }\n\n // prepend the character of that corner to the lcs string\n lcsString = stringA.charAt(cornerRow - 1) + lcsString;\n\n // decrement cornerRow and cornerCol\n cornerRow--;\n cornerCol--;\n }\n\n // return a small array containing the lcs string and its length\n return [\"\\\"\" + lcsString + \"\\\"\", lcsLength];\n}", "function longestCommonSubstring(string1, string2) {\n\t// Convert strings to arrays to treat unicode symbols length correctly.\n\t// For example:\n\t// '𐌵'.length === 2\n\t// [...'𐌵'].length === 1\n\tconst s1 = [...string1];\n\tconst s2 = [...string2];\n\n\t// Init the matrix of all substring lengths to use Dynamic Programming approach.\n\tconst substringMatrix = Array(s2.length + 1)\n\t\t.fill(null)\n\t\t.map(() => {\n\t\t\treturn Array(s1.length + 1).fill(null);\n\t\t});\n\n\t// Fill the first row and first column with zeros to provide initial values.\n\tfor (let columnIndex = 0; columnIndex <= s1.length; columnIndex += 1) {\n\t\tsubstringMatrix[0][columnIndex] = 0;\n\t}\n\n\tfor (let rowIndex = 0; rowIndex <= s2.length; rowIndex += 1) {\n\t\tsubstringMatrix[rowIndex][0] = 0;\n\t}\n\n\t// Build the matrix of all substring lengths to use Dynamic Programming approach.\n\tlet longestSubstringLength = 0;\n\tlet longestSubstringColumn = 0;\n\tlet longestSubstringRow = 0;\n\n\t//creates a table comparing each character in the strings\n\tfor (let rowIndex = 1; rowIndex <= s2.length; rowIndex += 1) {\n\t\tfor (let columnIndex = 1; columnIndex <= s1.length; columnIndex += 1) {\n\t\t\t//if (s1[columnIndex - 1] === s2[rowIndex - 1]) {\n\t\t\t//hack to change rowIndex to <= 6 since that was the longest substring...so it stops looking after the 6th match\n\t\t\tif (s1[columnIndex - 1] === s2[rowIndex - 1] && rowIndex <= 6) {\n\t\t\t\tsubstringMatrix[rowIndex][columnIndex] =\n\t\t\t\t\tsubstringMatrix[rowIndex - 1][columnIndex - 1] + 1;\n\t\t\t} else {\n\t\t\t\tsubstringMatrix[rowIndex][columnIndex] = 0;\n\t\t\t}\n\n\t\t\t// Try to find the biggest length of all common substring lengths\n\t\t\t// and to memorize its last character position (indices)\n\t\t\t// if (substringMatrix[rowIndex][columnIndex] > longestSubstringLength) {\n\t\t\tif (substringMatrix[rowIndex][columnIndex] > longestSubstringLength) {\n\t\t\t\tlongestSubstringLength = substringMatrix[rowIndex][columnIndex];\n\t\t\t\tlongestSubstringColumn = columnIndex;\n\t\t\t\tlongestSubstringRow = rowIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (longestSubstringLength === 0) {\n\t\t// Longest common substring has not been found.\n\t\treturn \"\";\n\t}\n\n\t// Detect the longest substring from the matrix.\n\tlet longestSubstring = \"\";\n\n\twhile (substringMatrix[longestSubstringRow][longestSubstringColumn] > 0) {\n\t\t//\twhile (substringMatrix[longestSubstringRow][longestSubstringColumn] > 0 &&\tlongestSubstringRow <= 2) {\n\t\tlongestSubstring = s1[longestSubstringColumn - 1] + longestSubstring;\n\t\tlongestSubstringRow -= 1;\n\t\tlongestSubstringColumn -= 1;\n\t}\n\n\treturn longestSubstring;\n}", "function alg(str1, str2) {\n\tlet out = \"\";\n\tlet arr = [];\n\n\tfor (let l of str1) {\n\t\tlet index = str1.indexOf(l);\n\t\t// If the chars are the same\n\t\tif (l === str2[index]) {\n\t\t\tout += l;\n\t\t} else {\n\t\t\t// if there is a substring add to arr\n\t\t\tif (out.length > 0) {\n\t\t\t\tarr.push(out);\n\t\t\t}\n\t\t\tout = \"\";\n\t\t}\n\t}\n\tconsole.log(arr);\n\t// Compare and return If there is sub strings\n\tlet output = arr[0];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (output.length > arr[i].length) output = arr[i];\n\t}\n\tif (output !== undefined) return output;\n\n\treturn undefined;\n}", "function longestConsec(strarr, k) {\n let final = \"\";\n if (strarr.length === 0 || strarr.length < k || k<= 0) {\n return final;\n }\n let temp;\n let count = 0;\n for (let i=0; i<strarr.length; i++) {\n temp = strarr.slice(i,i+k).join(\"\").length;\n if (temp > count) {\n final = strarr.slice(i,i+k).join(\"\");\n count = temp;\n }\n }\n return final;\n}", "function findShortestWordAmongMixedElements(arr) {\n if (arr.length < 1) {\n return '';\n } else {\n\n var auxArray = [];\n for (i = 0; i < arr.length; i++) {\n if (typeof arr[i] === 'string') {\n auxArray.push(arr[i]);\n }\n }\n\n if (auxArray.length < 1) {\n return '';\n } else {\n\n compareStrings(auxArray);\n return auxArray[0];\n }\n }\n\n function compareStrings(array) {\n\n for(var i = 0; i < array.length; i++) {\n var indexOfShortestString = i;\n\n for(var v = i + 1; v < array.length; v++) {\n if(array[v].length < array[indexOfShortestString].length) {\n indexOfShortestString = v;\n }\n }\n\n if (i !== indexOfShortestString) {\n var temporaryArray = array[i];\n array[i] = array[indexOfShortestString];\n array[indexOfShortestString] = temporaryArray;\n }\n }\n }\n}", "function mostCommonLetter(string){\n var max_val = 0;\n var max = [];\n const hash = makeObject(string.split(\"\"));\n for (var property in hash){\n var value = hash[property];\n if (value > max_val && property.match(/[a-z]/)){\n max_val = value;\n max = [property,value];\n }\n }\n \n \n return max;\n}", "function longestConsec(arr, k) {\n let temp = '';\n\n if (k <= 0 || k > arr.length) return '';\n\n while (arr.length > 0) {\n if (temp.length < arr.slice(0, k).join('').length) {\n temp = arr.slice(0, k).join('');\n }\n arr.shift();\n }\n\n return temp;\n}", "function longestCommonSubsequence(text1, text2) {\n /*\n - Think of the rows as the outer loop and the columns as the inner loop.\n - Use 2 pointers, one for each string (imagine it being a matrix). One is for rows and the other for columns.\n - Rows -> text1\n - Columns -> text2\n - Like in the Coin Change problem, build the matrix and traverse it backwards when necessary.\n - When initializing the matrix, add an additional row and column BEFORE and initialize them to 0s.\n - If both characters match, move 1 row and col forward and add 1 to it (down diagonally).\n - If characters don't match, calculate the max of going back in the col (cell above) and going back in the row (cell to the left). Doing this we carry forward the maximum common subsequence\n X a b c d e X a b c d e\n X 0 0 0 0 0 0 X 0 0 0 0 0 0\n a 0 1 0 0 0 0 a 0 1 1 1 1 1\n c 0 0 0 0 0 0 c 0 1 1 2 2 2\n e 0 0 0 0 0 0 e 0 3 3 3 3 3\n */\n\n const dp = []\n\n // Generate the starting matrix adding the additional row and col. Fill the matrix with 0s\n for (let i = 0; i < text1.length + 1; i++) {\n dp.push(Array(text2.length + 1).fill(0))\n }\n\n // Scan from left to right through the string\n for (let i = 0; i < text1.length; i++) {\n for (let j = 0; j < text2.length; j++) {\n // If the values match move 1 row and col forward and add 1 to it (down-right diagonally).\n if (text1[i] === text2[j]) {\n // The new value will be the diagonal\n const diagonal = dp[i][j]\n // Calculate the cell taking into account the offset of the additional row/col\n // Increment by the value of the diagonal\n dp[i + 1][j + 1] = diagonal + 1\n }\n // If characters don't match carry forward the maximum common subsequence\n else {\n const above = dp[i][j + 1]\n const left = dp[i + 1][j]\n // Calculate the max of the cell above and the one to the left\n dp[i + 1][j + 1] = Math.max(above, left)\n }\n }\n }\n\n // If we found the LCS the it's length would be saved in the bottom-right corner.\n // If no subsequence was found the value of the last cell will be 0\n return dp[text1.length][text2.length]\n}", "function longestPossible(s1, s2) {\n const all = (s1 + s2).split('')\n const uniqueSortedLetters = [...new Set(all)].sort()\n return uniqueSortedLetters.join('')\n}", "function lcs2(wordX, wordY) {\n var m = wordX.length,\n n = wordY.length,\n l = [],\n solution = [],\n i, j, a, b;\n\n for (i = 0; i <= m; ++i) {\n l[i] = [];\n solution[i] = [];\n for (j = 0; j <= n; ++j) {\n l[i][j] = 0;\n solution[i][j] = '0';\n }\n }\n\n for (i=0; i<=m; i++) {\n for (j=0; j<=n; j++) {\n if (i === 0 || j === 0){\n l[i][j] = 0;\n } else if (wordX[i-1] == wordY[j-1]) {\n l[i][j] = l[i-1][j-1] + 1;\n solution[i][j] = 'diagonal';\n } else {\n a = l[i-1][j];\n b = l[i][j-1];\n l[i][j] = (a > b) ? a : b; //max(a,b)\n solution[i][j] = (l[i][j] == l[i - 1][j]) ? 'top' : 'left';\n }\n }\n console.log(l[i].join());\n console.log(solution[i].join());\n }\n printSolution(solution, l, wordX, wordY, m, n);\n return l[m][n];\n}", "function longestStringReducing(array) {\n const reduced = array.reduce(function (longestWord, word) {\n return word.length > longestWord ? word : longestWord;\n }, \"\");\n console.log(reduced.length);\n console.log(reduced);\n return reduced.length;\n return reduced;\n}", "function largestPrefix(array, prefixOne, prefixTwo) {\n let prefixOneCounter = 0;\n let prefixTwoCounter = 0;\n let result = -1;\n\n for (let i = 0; i < array.length; i++) {\n if(array[i] == prefixOne){\n prefixOneCounter++;\n }\n if(array[i] == prefixTwo){\n prefixTwoCounter++;\n }\n if(prefixOneCounter != 0 && prefixOneCounter === prefixTwoCounter){\n result = i;\n }\n }\n\n return result;\n\n}", "function longestString(arr) {\n function _helper_(arr, longest) {\n if(!arr.length) return longest\n if(head(arr).length > longest.length) {\n return _helper_(rest(arr), head(arr))\n }\n else return _helper_(rest(arr), longest)\n }\n return _helper_(arr, '')\n}", "function firstRecurringCharacter2(input) {\n for(let i = 0; i < input.length - 1; i++ ){\n for (let j = i + 1; j < input.length; j++) {\n if (input[i] === input[j]) {\n return input[i];\n }\n }\n }\n return undefined;\n}", "function longest(s1, s2) {\n return [...new Set(s1 + s2)].sort().join('');\n}", "function ArrayMatching(strArr) {\n var a = strArr[0].match(/d+/g).map(Number);\n var b = strArr[1].match(/d+/g).map(Number);\n\n var longest = a.length >= b.length ? a : b;\n var other = longest === a ? b : a;\n\n return longest.map((e, i) => (other[i] ? e + other[i] : e)).join(\"-\");\n}", "function longestString(strings) {\n let carachters = \"\";\n strings.forEach(string => {\n if (string.length > carachters.length) {\n carachters = string;\n }\n });\n return carachters;\n //\n}", "function loneliest(str) {\n let newStr = str.trim().split('');\n let loneliest = [];\n \n for(let i = 0; i <= newStr.length - 1; i++){\n if(newStr[i] != ' '){\n let ctr = 0;\n let goingLeft = i - 1;\n let goingRight = i + 1;\n \n while(newStr[goingLeft] == ' '){\n ctr++;\n goingLeft--;\n };\n \n while(newStr[goingRight] == ' '){\n ctr++;\n goingRight++;\n };\n \n if(loneliest.length == 0 || ctr > loneliest[0][1]){\n loneliest = [[newStr[i], ctr]];\n } else if(ctr == loneliest[0][1]){\n loneliest.push([newStr[i], ctr]);\n };\n };\n };\n \n return loneliest.map(x => x[0]);\n}", "function getCommonLetters(s1, s2) {\n let result_string = \"\"\n for (let i = 0; i < s1.length; i++) {\n if (s1[i] == s2[i]) {\n result_string += s1[i];\n }\n }\n return result_string;\n}", "function firstRecurringCharacter3(input) {\n for(let i = 0; i < input.length - 1; i++ ){\n for (let j = i + 1; j >= 0; j--) {\n if (input[i] === input[j] && i !== j) {\n return input[i];\n }\n }\n }\n return undefined;\n}", "function findLongestWord(array) {\n return array.reduce(function (long1, long2) {\n return long2.length > long1.length ? long2 : long1;\n }, '');\n}", "function firstRecurringCharacter(input) {\n for (let i = 0; i < input.length; i++) {\n for (let j = i + 1; j < input.length; j++) {\n if(input[i] === input[j]) {\n return input[i];\n }\n }\n }\n return undefined\n}//O(n^2) with Space Complexicity O(1)", "function longestRepetition(s) {\n let count = 0;\n let prevLetter = \"\";\n\n return s\n .toLowerCase()\n .split(\"\")\n .reduce(\n (acc, curr) => {\n if (curr === prevLetter) {\n count++;\n } else {\n count = 1;\n }\n\n if (count > acc[1]) {\n acc[1] = count;\n acc[0] = curr;\n }\n\n prevLetter = curr;\n return acc;\n },\n [\"\", 0]\n );\n}", "function distSameLetter(s){\n var uniques = s.split('').filter((a, i) => s.indexOf(a) === i).join('');\n var arr = ['', 0];\n for(var i = 0; i < uniques.length; i++){\n diff = s.lastIndexOf(uniques[i]) - s.indexOf(uniques[i]) + 1;\n if(diff > arr[1]){\n arr = [uniques[i], diff];\n }\n }\n return arr.join('');\n}", "function solve(s){\n let initialarr = s.split(\"\")\n let lower = 0\n let higher = 0\n for(var i=0;i<s.length;i++){\n if(initialarr[i] === initialarr[i].toLowerCase()){\n lower++\n } else if(initialarr[i] === initialarr[i].toUpperCase()){\n higher++\n }\n }\n if(lower>higher | lower == higher){\n return initialarr.join(\"\").toLowerCase()\n } else if (lower<higher){\n return initialarr.join(\"\").toUpperCase()\n }\n}", "function findShortestWordAmongMixedElements(arr) {\n if (arr.length < 1) {\n return '';\n } else {\n\n var auxArray = [];\n for (i = 0; i < arr.length; i++) {\n if (typeof arr[i] === 'string') {\n auxArray.push(arr[i]);\n }\n }\n\n if (auxArray.length < 1) {\n return '';\n } else {\n\n auxArray.sort(function compareStrings(a, b) {\n if (a.length < b.length) {\n return -1;\n }\n if (a.length > b.length) {\n return 1;\n }\n return 0;\n });\n\n return auxArray[0];\n }\n }\n}", "function longestPalindrome(str) {\n\n //it's only a palindrome if the first and last letter are the same and the pattern repeats to the \"center\"\n //check first and last character, if they are different, check first and second-to-last character\n //when you find a match, repeat the process\n\n let leftIndex = 0;\n let longest = \"\";\n\n while (leftIndex < str.length) {\n\n let rightIndex = str.length - 1;\n\n while (rightIndex >= leftIndex) {\n let offset = 0;\n\n while (str[leftIndex + offset] === str[rightIndex - offset] && leftIndex + offset < str.length) {\n offset++;\n }\n\n if (leftIndex + (2 * offset) >= rightIndex) {\n let palindrome = str.substring(leftIndex, rightIndex + 1);\n\n if (palindrome.length === str.length) {\n return str;\n }\n\n if (palindrome.length > longest.length) {\n longest = palindrome;\n }\n\n }\n rightIndex--;\n }\n leftIndex++;\n }\n\n return longest;\n\n // let longest = \"\";\n //\n // let rightIndex = str.length - 1;\n //\n // while (rightIndex >= 0) {\n //\n // let leftIndex = 0;\n //\n // while (leftIndex < rightIndex) {\n //\n // let count = 0;\n //\n // while (str[leftIndex] === str[rightIndex] && rightIndex > leftIndex) {\n // leftIndex++;\n // rightIndex--;\n // count++;\n // }\n //\n // if (rightIndex <= leftIndex) {\n // let palindrome = str.substring(leftIndex - count, rightIndex + count + 1);\n // if (palindrome.length > longest.length) {\n // longest = palindrome;\n // }\n // }\n // leftIndex++;\n // }\n // rightIndex--;\n // }\n //\n // return longest;\n\n //length <= 1 returns self\n //\n // let longestPalindrome = \"\";\n // let leftIndex = 0;\n //\n //\n // //example: badbob popop abacbacba\n //\n //\n // while (leftIndex < str.length) {\n //\n // let rightIndex = str.length - 1;\n //\n // while (rightIndex > leftIndex) {\n //\n // while (str[leftIndex] !== str[rightIndex] && rightIndex > leftIndex) {\n // rightIndex--;\n // }\n //\n // let iterations = (rightIndex - leftIndex) / 2;\n // let count = 0;\n //\n // while (count < iterations) {\n // leftIndex++;\n // rightIndex--;\n //\n // if (str[leftIndex] !== str[rightIndex]) {\n // break;\n // }\n // count++;\n // }\n //\n // if (count === iterations) {\n // let palindrome = str.substring(leftIndex - iterations, rightIndex + iterations + 1);\n // if (palindrome.length > longestPalindrome.length) {\n // longestPalindrome = palindrome;\n // }\n // }\n // rightIndex--;\n // }\n // leftIndex++;\n // }\n //\n // return longestPalindrome;\n}", "function find(str1, str2) {\n //创建存放重复内容的数组\n var all = new Array();\n //字符串转字符数组\n var str_1 = str1.split(\"\");\n var str_2 = str2.split(\"\");\n for (var i = 0; i < str_1.length; i++) {\n for (var l = 0; l < str_2.length; l++) {\n //判断是否重复\n var lo = all.length;\n all[lo] = \"\";\n //判断之后的字符串是否相同\n for (var k = 0; str_1[i + k] == str_2[l + k]; k++) {\n all[lo] = all[lo] + str_1[i + k];\n //防止数组越界,提前停止循环\n if (i + k == str_1.length-1||i+k==str_2.length-1) {\n break;\n }\n }\n }\n }\n \n var most = 0;\n var fu = new Array();\n for (var j = 0; j < all.length; j++) {\n //去除空的内容\n if (all[j] != \"\") {\n //按照大小排序(删除部分小的)\n if (all[j].split(\"\").length >= most) {\n most = all[j].split(\"\").length;\n fu[fu.length] = all[j];\n }\n }\n }\n \n //将不重复内容写到新数组\n var wu=new Array();\n for(var i=0;i<fu.length;i++){\n var c=false;\n for(var l=0;l<wu.length;l++){\n if(fu[i]==wu[l]){\n c=true;\n }\n }\n if(!c){\n wu[wu.length]=fu[i];\n }\n }\n \n //将最长的内容写到新数组\n var ml=new Array();\n //获得最后一个字符串的长度(最长)\n var longest=wu[wu.length-1].split(\"\").length;\n //长度等于最长的内容放到新数组\n for(var i=wu.length-1;i>=0;i--){\n if(wu[i].split(\"\").length==longest){\n ml[ml.length]=wu[i];\n }else{\n //提前结束循环\n break;\n }\n }\n \n return ml\n }", "function SearchingChallenge1(str) {\n const array = [...str];\n const k = Number(array.shift());\n\n let substring = [];\n let n = 1;\n\n let index = 0;\n\n let res = [];\n\n while (index < array.length) {\n if (substring === [] || substring.includes(array[index])) {\n substring.push(array[index]);\n index++;\n console.log(\"substring\", substring);\n } else if (!substring.includes(array[index]) && n <= k) {\n substring.push(array[index]);\n n++;\n index++;\n console.log(\"substring\", substring);\n } else {\n res.push(substring.join(\"\"));\n console.log(\"res during\", res);\n substring = [];\n n = 1;\n index--;\n console.log(\"substring after []\", substring.length);\n }\n }\n\n res.push(substring.join(\"\"));\n\n console.log(\"res final\", res);\n\n const lengths = res.map((e) => e.length);\n\n return res[lengths.indexOf(Math.max(...lengths))];\n}", "function longestDigitsPrefix(inputString) {\n let digits = '0123456789';\n let prefix = '';\n inputString = inputString.split('');\n \n for(let i = 0; i < inputString.length; i++){\n if(!digits.includes(inputString[0]))\n return '';\n if(digits.includes(inputString[i]))\n prefix += inputString[i];\n else\n return prefix;\n }\n return prefix;\n}", "function smallestCommons(arr) {\n function multipleArr(num) {\n return Array.from(\n {\n length: 10000\n },\n (v, k) => k * num\n );\n }\n\n function divideLst(arr, step) {\n let start = Math.min(arr[0], arr[1]);\n let end = Math.max(arr[0], arr[1]);\n return Array.from(\n {\n length: (end - start) / step + 1\n },\n (_, i) => start + i * step\n );\n }\n var lst1 = multipleArr(arr[0]);\n var lst2 = multipleArr(arr[1]);\n var divider = divideLst(arr, 1);\n var multLst = [];\n for (let i = 0; i < lst1.length; i++) {\n if (lst2.indexOf(lst1[i]) > 0) {\n multLst.push(lst1[i]);\n }\n }\n for (let x = 0; x < multLst.length; x++) {\n for (let y = 0; y < divider.length; y++) {\n if (multLst[x] % divider[y] !== 0) {\n delete multLst[x];\n }\n }\n }\n return multLst.filter(Boolean)[0];\n}", "function findCommonPrefix(str) {\n lastChar = commonPrefix.length - 1;\n commonPrefix = commonPrefix.substring(0, lastChar);\n }", "function commonChars (a,b){\n let result = \"\";\n for(let i = 0; i < a.length; i++){\n\n if(b.indexOf(a.charAt(i)) !== -1){\n result = result + a.charAt(i);\n }\n\n }\n console.log(a.length, b.length);\n \n return result;\n}", "function returnLongestString(array){\n let newArray = array;\n\n let currentStr = newArray[0]; \n for(let i = 1; i <= newArray.length; i++){\n if( newArray[i].length > currentStr.length ) return currentStr = newArray[i] ;\n }\n return currentStr;\n}", "function longestString(strings) {\n\n}", "function morganAndString(a, b) {\n\n a += 'z';\n b += 'z';\n\n let final = '';\n let i = 0, j = 0;\n\n loop1: for (i = 0, j = 0; i < a.length || j < b.length; ) {\n if (a.charAt(i) === 'z') {\n i++;\n break loop1;\n }\n if (b.charAt(j) === 'z') {\n j++;\n break loop1;\n }\n if (a.charAt(i) < b.charAt(j)) {\n // a is lower\n final += a.charAt(i);\n i++;\n } else if (a.charAt(i) > b.charAt(j)) {\n // b is lower\n final += b.charAt(j);\n j++;\n } else {\n // charaters are equal\n if (a.charAt(i) === 'z' || b.charAt(j) === 'z') {\n i++;\n j++;\n }\n\n let startingI = i,\n startingJ = j,\n prev = '';\n\n loop2: while (a.charAt(i) === b.charAt(j)) {\n i++;\n j++;\n\n if (i >= a.length && j >= b.length) {\n i = startingI;\n j = startingJ;\n break loop2;\n } else if (i >= a.length) {\n prev = b.charAt(startingJ);\n while (b.charAt(startingJ) <= prev) {\n final += b.charAt(startingJ);\n startingI++;\n }\n i = startingI;\n j = startingJ;\n } else if (j > b.length) {\n prev = a.charAt(startingI);\n while (a.charAt(startingI) <= prev) {\n final += a.charAt(startingI);\n startingI++;\n }\n i = startingI;\n j = startingJ;\n }\n }\n\n if (a.charAt(i) <= b.charAt(j)) {\n prev = a.charAt(startingI);\n while (a.charAt(startingI) <= prev) {\n final += a.charAt(startingI);\n prev = a.charAt(startingI);\n startingI++;\n }\n i = startingI;\n j = startingJ;\n }\n\n if (a.charAt(i) > b.charAt(j)) {\n prev = b.charAt(startingJ);\n while (b.charAt(startingJ) <= prev) {\n final += b.charAt(startingJ);\n prev = b.charAt(startingJ);\n startingJ++;\n }\n i = startingI;\n j = startingJ;\n }\n }\n }\n // append remaining string to final answer\n if (i < a.length) {\n final += a.substring(i);\n }\n if (j < b.length) {\n final += b.substring(j);\n }\n\n return final=final.replace('z','');\n}", "function longest(s1, s2) {\n var str1 = s1.split('');\n var str2 = s2.split('');\n var newArray = [];\n for (var i = 0; i < str1.length; i++) {\n if (!newArray.includes(str1[i]))\n newArray.push(str1[i]);\n }\n for for (var i = 0; i < str2.length; i++) {\n if (!newArray.includes(str2[i]))\n newArray.push(str2[i]);\n }\n return newArray\n }", "function refactoredLongestStrings(array) {\n\n const maxLength = array.reduce((max, word) => \n { return word.length > max ? word.length : max}, 0)\n const isMaxLength = word => word.length === maxLength\n const longestWords = array => array.filter(isMaxLength)\n\nreturn longestWords(array)\n}", "function comp(string) {\n string = string.split('')\n let helper = []\n let count = 1\n for (let i = 0; i < string.length; i++) {\n if (string[i + 1] === string[i]) {\n count += 1\n } else {\n helper.push(string[i],count)\n count = 1 \n }\n }\n return helper.join('')\n}", "function longest_str_in_array(arra) {\n\n var max_str = arra[0].length;\n\n var ans = arra[0];\n\n for (var i = 1; i< arra.length; i++) {\n\n var maxi = arra[i].length;\n\n if(maxi > max_str) {\n\n ans = arra[i];\n\n max_str = maxi;\n }\n }\n \n return ans;\n }", "function solve2(s) {\n // Write your code here\n let ret_str = ''\n for (let i = 0; i < s.length; i++) {\n if (s[i] !== s[i+1] || i + 1 > s.length) ret_str += s[i]\n }\n // console.log(ret_str)\n return ret_str\n}", "function longestStr (array) {\n var longestWord = \"\";\n array.forEach(function(strings) { //.forEach(); - takes each element of an array once \n if(strings.length > longestWord.length) {\n longestWord = strings;\n }\n });\n return longestWord;\n}", "function findLongestString(strings) {\n var longestString = strings.reduce(function(longest, current){\n if (current.length > longest.length) {\n return current;\n }\n else {\n return longest;\n };\n });\n return longestString;\n}", "function KUniqueCharacters(str) { \nlet arr = [];\nlet longest = str[0];\n \nfor (let i=1; i<str.length; i++) {\n let table = {}\n let ans = \"\"\n let count = 0\n for (let j=i; j<str.length; j++) {\n if (table[str[j]] === undefined) { \n table[str[j]] = 1\n count++\n }\n if (count <= str[0]) {\n ans += str[j]\n }\n }\n if (ans.length > longest) {\n longest = ans.length\n arr.push(ans)\n }\n}\nreturn arr.sort(function(a,b) {return b.length-a.length})[0]\n}", "function longestString (a) {\n var p = a[0];\n var q;\n for (var i = 0; i < a.length; i++) {\n q = a[i];\n if (q.length > p.length) {\n p = q;\n }\n\n }\n return p;\n}", "function findMostFreqWord(array){\n var count=0;\n var longSequence=0;\n var maxElem =\"\";\n var result=\" \";\n for(var i=0; i<array.length; i++){\n for(var j=0; j<array.length; j++){\n if(array[i]===array[j]){\n count++; \n if(longSequence<=count){\n longSequence=count;\n maxElem=array[i]; \n }\n }\n }\n count=0;\n } \n \n if(longSequence==1){\n maxElem=array[0]; \n }\n\n result=maxElem+\" -> \"+longSequence+\" times\"; \n \n document.getElementById('content').innerHTML =result;\n }", "function longestInCommon(candidates, index) {\n var i, ch, memo;\n\n do {\n memo = null;\n for (i = 0; i < candidates.length; i++) {\n\t ch = candidates[i].charAt(index);\n\t if (!ch) { break };\n\t if (!memo) { memo = ch; }\n\t else if (ch != memo) { break; }\n }\n } while (i == candidates.length && ++index);\n\n return candidates[0].slice(0, index);\n }", "function longestString(array) {\r\n\r\n // Initialize highest character count variable to 0\r\n // Initialize longest string variable to empty string\r\n var longestChars = 0;\r\n var longestString = '';\r\n\r\n // Loop through array\r\n for (var i = 0; i<array.length; i++) {\r\n // Count each string in array\r\n charCount = array[i].length;\r\n\r\n // if string's character count is higher than highest character count variable, reset highest character count to the current string's length and reassign longest string variable to current string.\r\n if (charCount > longestChars) {\r\n longestChars = charCount;\r\n longestString = array[i];\r\n }\r\n }\r\n\r\n // Return longest string variable. \r\n return longestString;\r\n}", "function onlyDuplicates(str) {\n // your code here\n\n let res = [...str].reduce((acc, val, i, array) => {\n if (array.indexOf(val) !== array.lastIndexOf(val)) {\n return (acc += val);\n } else return acc;\n }, \"\");\n\n return res;\n}", "function longestName (arr)\n{ \n // debugger\n var output = arr.reduce ( (longest, x) => \n { var name = x.name[\"first\"]+\" \"+x.name[\"last\"];\n if (longest.length < (name).length)\n longest= name;\n return longest;\n } ,\"\")\n\n return output\n}", "function findShortestWordAmongMixedElements(arr) {\n // your code here\n if(!arr.length) {\n return \"\";\n }\n \n function hasString(arr) {\n return arr.some(element => typeof element === \"string\");\n }\n //var strings = arr.filter(element => typeof element === \"string\");\n //var shortestPos = Math.min(...strings.map(string => return string.length));\n if(!arr.length || !hasString(arr)) {\n return \"\";\n }\n var strings = arr.filter(element => typeof element === \"string\");\n var stringLengths = strings.map(string => string.length);\n console.log(stringLengths);\n var pos = Math.min(...stringLengths);\n var shortest = stringLengths.indexOf(pos);\n console.log(shortest);\n var ans = strings[shortest];\n return ans;\n}", "function getShortestUniqueSubstring(arr, str) {\n // check starting with shortest possible str length (arr.length)\n // move down index taking slices of min len starting with 0 (0-2, 1-3)\n // if no matches at min len, move to search for min len +1\n // else return the first match (this will be the shortest match)\n // continue until one if found\n // if not return ''\n\n let min=arr.length;\n let max=str.length;\n let substr=true;\n\n while(min<=max){\n //str\n for(let i=0; i<str.length; i++){\n substr=true;\n\n //arr\n for(let x=0; x<arr.length; x++ ){\n if(str.slice(i,i+min).indexOf(arr[x])<0){\n substr=false;\n break;\n }\n }\n\n if(substr){\n return str.slice(i,i+min);\n }\n }\n\n min++;\n }\n\n return '';\n}", "function longestSub(str){\n \n var substr = \"\";\n var lngsubstr = 0;\n var lng =\"\" ;\n \n for (var i=0; i<str.length; i++){\n \n substr = str.substring(i,i+1);\n \n var j = i+1;\n \n while( substr.indexOf(str[j]) === -1 && j<str.length ){\n substr = str.substring(i,j+1);\n j++;\n }\n \n if(lngsubstr < substr.length){\n lngsubstr = substr.length;\n lng = substr;\n } \n \n }\n \n// console.log(lng);\n// console.log(lngsubstr);\n}", "function commonBase(s1, s2){\n\n if(s2.indexOf(s1) === 0)return s1;\n\n var cnt = 0, len = Math.min(s1.length, s2.length)\n\n while(cnt < len && s1.charAt(cnt) == s2.charAt(cnt))cnt++;\n\n return s1.substr(0, cnt);\n}", "function longestConsec (strarr, k){\n var n = strarr.length;\n var longest=0;\n var targetIndex=0;\n var calcArr=[];\n var calc=0;\n var result;\n if(k>n || n===0 || k<=0){\n return \"\";\n } else{\n var arrLengths = [];\n for (var i=0;i<strarr.length;i++){\n arrLengths.push(strarr[i].length);\n }\n debugger;\n for (var j=0;j<arrLengths.length;j++){\n calcArr = arrLengths.slice(j,j+k);\n calc = calcArr.reduce(function(a,b){\n return a+b;\n },0);\n if (calc>longest){\n targetIndex = j;\n longest=calc;\n }\n }\n console.log (targetIndex+k-1);\n result = strarr.slice(targetIndex,targetIndex+k)\n result = result.join(\"\");\n return result;\n }\n}", "function most_common_letter(string) {\n\n\tvar list = {};\n\tvar array = string.split(\"\");\n\n\tarray.forEach(function(letter){\n\t\tif(list[letter]!==undefined){\n\t\t\tlist[letter]+=1;\n\t\t}else{\n\t\tlist[letter] = 1;\n\t\t}\n\t})\n\tconsole.log(list);\n\n\tvar higher = 0;\n\tvar higher_letter\n\n\tfor (var letter in list){\n\t\tif(list[letter]>higher){\n\t\t\thigher = list[letter];\n\t\t\thigher_letter = letter;\n\t\t}\n\t}\n\n\tconsole.log([String(higher_letter), higher]);\n\treturn [String(higher_letter), higher];\n}", "function lengthOfLongestSubstringB(s){\n let longest = 0;\n //let seen = {};\n let seen = new Map();\n let left = 0;\n\n if(s.length <=1){\n return s.length;\n }\n\n for (let right = 0; right < s.length; right++) {\n const currentChar = s[right];\n //const prevSeenChar = seen[currentChar];\n const prevSeenChar = seen.get(currentChar);\n if(prevSeenChar >= left){\n left = prevSeenChar + 1;\n }\n //seen[currentChar] = right;\n seen.set(currentChar, right);\n longest = Math.max(longest, right - left + 1);\n }\n\n console.log(longest);\n}", "function maxCharacter(str) {\r\n final = new Array\r\n for(i = 0; i< str.length; i++)\r\n {\r\n contained = false\r\n for(j=0; j<final.length && !contained; j++)\r\n {\r\n if(final[j][0] === str[i])\r\n {\r\n final[j][1]++;\r\n contained=true;\r\n } \r\n \r\n }\r\n if(!contained)\r\n {\r\n a = [str[i], 1]\r\n final.push(a)\r\n } \r\n }\r\n\r\n let highest=['z',0];\r\n console.log(final)\r\n for(i=0; i<final.length; i++)\r\n {\r\n if(final[i][1] > highest[1])\r\n {\r\n highest[0] = final[i][0]\r\n highest[1] = final[i][1]\r\n }\r\n }\r\n return highest;\r\n}", "function mix(s1, s2) {\n\n console.log(s1, \"string2: \" + s2)\n\n var finalStr = \"\";\n // remove all unnecessary characters in the string..\n s1 = s1.replace(/[^a-z]/gi, '');\n s2 = s2.replace(/[^a-z]/gi, '');\n\n var letterOccurrenceInSentences = {};\n\n // moves all the occurrence of every letter into a object with two properties\n\n\n countLetterOccurrence(s1, letterOccurrenceInSentences, 'first');\n countLetterOccurrence(s2, letterOccurrenceInSentences, 'second');\n\n // now need to check each value length if greater than 1, if it isn't remove it from the object\n\n // i dont think we need to actually check if it is bigger than one...\n\n // when doing the final check i can just only count it if is bigger than one...\n\n // console.log(\"first string \" + s1, \"second string \" + s2)\n // for (var key in letterOccurrenceInSentences) {\n // if (letterOccurrenceInSentences.hasOwnProperty(key)) {\n // console.log(letterOccurrenceInSentences)\n // }\n // }\n\n // starting to insert the maxium of letters into a string..\n\n console.log(letterOccurrenceInSentences);\n\n for (var key in letterOccurrenceInSentences) {\n if (\n letterOccurrenceInSentences[key].first > letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].second == undefined) {\n if (trueString(letterOccurrenceInSentences[key].first)) {\n finalStr += \"1:\"\n for (var i = 0; i < letterOccurrenceInSentences[key].first; i++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first < letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].first == undefined) {\n if (trueString(letterOccurrenceInSentences[key].second)) {\n finalStr += \"2:\"\n for (var j = 0; j < letterOccurrenceInSentences[key].second; j++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first == letterOccurrenceInSentences[key].second) {\n if (letterOccurrenceInSentences[key].first !== 1 && letterOccurrenceInSentences[key].second !== 1) {\n finalStr += \"=:\"\n for (var k = 0; k < letterOccurrenceInSentences[key].first; k++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } \n }\n\n finalStr = finalStr.split(\"/\").sort(function (a, b) {\n if (b.length === a.length) {\n return (a > b ? 1 : -1);\n } else {\n return b.length - a.length;\n }\n }).join(\"/\");\n\n // remove the last slash...\n finalStr = finalStr.slice(0, -1);\n console.log(finalStr);\n\n return console.log(finalStr);\n\n }", "function super_reduced_string(s){\n // Complete this function\n var arr = s.split(\"\");\n var changes = 0;\n \n do {\n changes = 0;\n for (i = 0; i < arr.length; i++) {\n if (arr[i] === arr[i+1]) {\n changes++;\n arr.splice(i, 2);\n }\n }\n } while (changes !== 0);\n \n return arr.length > 0 ? arr.join(\"\") : \"Empty String\";\n}", "function longestPalindrome(str) {\n\tstr = str.toLowerCase().replace(/[\\W_]/g, '');\n\tlet longest = '',\n\t\ti = 0;\n\n\twhile (i < str.length - 1) {\n\t\tlet lp = Math.floor(i - .5),\n\t\t\trp = Math.ceil(i + .5);\n\n\t\tif (!longest) longest = str[i];\n\n\t\twhile (str[lp] === str[rp] && lp >= 0 && rp < str.length) {\n\t\t\tlet pl = str.slice(lp, rp + 1);\n\t\t\tif (longest.length < pl.length) longest = pl;\n\t\t\t--lp;\n\t\t\t++rp;\n\t\t}\n\t\ti += 0.5;\n\n\t}\n\treturn longest;\n}", "function highestFreq (str) {\n\t// Create an object displaying the character count for each character.\n \tlet count = str.split('').reduce((a,b) => {\n \ta[b] ? a[b] ++ : a[b] = 1;\n \treturn a;\n \t},{});\n \t// Reduce the keys of our count object\n \treturn Object.keys(count).reduce((a,b,c) => {\n \t\t// If the array provided to reduce is empty. Push in the first element.\n \t\t// We need to start comparing elements.\n \tif(!a.length) {\n \t\ta.push(b); \n \t// If the first element in the array is appears less times than the current character.\n \t// Empty out the checker array and push in the new element.\n \t} else if(count[a[0]] < count[b]) {\n \t\twhile(a.length){\n \t\t\ta.pop();\n \t\t}\n \t\t a.push(b);\n \t// If the current element appears the same amount of times as the first element in the array.\n \t// Push it in the array as well.\n \t} else if(count[a[0]] === count[b]) {\n \t\ta.push(b);\n \t}\n \t// Return the array after each iteration. \n \treturn a;\n \t// Finally sort the array and join it into a string.\n \t}, []).sort().join('');\n}", "function longestRepetition(s) {\n //console.log(s)\n var i = 0,\n seq = 0,\n results = [];\n \n if ( s === ('')){\n return ['', 0]\n }\n \n for(let i=0; i<s.length; i++) {\n var current = s[i],\n next = s[i + 1];\n \n if (typeof results[seq] === 'undefined') {\n results[seq] = [current, 0];\n }\n \n results[seq][1]++;\n \n if (current !== next) {\n seq++;\n }\n }\n \n return results.sort((a, b) => b[1] - a[1])[0];\n }", "function longestString(array) {\n const sorted = array.sort(function (a, b) {\n return b.length - a.length;\n });\n const longestStr = sorted[0];\n return longestStr;\n}", "function organize_str() {\n\tfor (i = 0; i < array.length; i++) {\n\t\tif(filtered_str[i] === filtered_str[i+1]) {\n\t\t\tarr_small.push(filtered_str[i]);\n\t\t} else {\n\t\t\tarr_small.push(filtered_str[i]);\n\t\t\tarrNew.push(arr_small);\n\t\t\tarr_small = [];\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.81770235", "0.7536537", "0.7298831", "0.72766906", "0.7263027", "0.72377604", "0.7116802", "0.67260146", "0.6720174", "0.6601336", "0.65502846", "0.64597", "0.64029264", "0.6357975", "0.6325793", "0.62687784", "0.6240725", "0.6238666", "0.6204243", "0.61854887", "0.6171245", "0.6149999", "0.611856", "0.61024743", "0.6067336", "0.60306215", "0.6030121", "0.5976681", "0.5965848", "0.59656507", "0.59259623", "0.5923822", "0.5898803", "0.5891111", "0.5888221", "0.5867868", "0.5864857", "0.5852505", "0.58431923", "0.5837957", "0.5832259", "0.58176565", "0.5796492", "0.57913715", "0.5766356", "0.575986", "0.57523435", "0.57033324", "0.5680358", "0.5679397", "0.5675213", "0.567057", "0.56672657", "0.5658732", "0.5651607", "0.5647498", "0.5645181", "0.56303966", "0.562105", "0.5620685", "0.560293", "0.559309", "0.55924666", "0.55912596", "0.5588241", "0.5585314", "0.55844355", "0.5583936", "0.5572048", "0.55689275", "0.5567183", "0.5567148", "0.55668116", "0.5545493", "0.55389977", "0.55325794", "0.5508191", "0.550633", "0.55025357", "0.54969794", "0.5493807", "0.54930174", "0.5493", "0.5488339", "0.5487431", "0.54839605", "0.54586923", "0.5454955", "0.544374", "0.54412067", "0.54334813", "0.54289544", "0.5427501", "0.54243034", "0.5418141", "0.5404466", "0.53991336", "0.53989893", "0.53959185", "0.5395905" ]
0.7716853
1
Checks if a Discord member already has a Simbit shop account
function checkAcc(memberObj){ if(getShopUser(memberObj) != null){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSubscription ( spaceId )\n{ // checks if spaceId is currently subscribed\n if ( subscriptions.includes( spaceId ) )\n { return true; }\n else\n { return false; }\n}", "userExists(user) {\n // Temp variable for storing the user if found\n let temp = '';\n for (let i of this.users) {\n if (i === user) {\n console.log('user: ' + user + ' exists');\n temp = user;\n }\n }\n let exists = (temp !== '' && temp === user);\n if(temp === '') console.log('user: ' + user + ' does not exist');\n return exists;\n }", "function isNewMember(member, shouldBePushed) {\n var isNew = org.members.every(function(existingMember) {\n return existingMember.username !== member.login;\n });\n console.log(member.login,'is new?',isNew);\n isNew ? shouldBePushed(true) : shouldBePushed(false);\n }", "function isMember(accountMembers, member) {\n var index = accountMembers.indexOf(member);\n return index !== -1;\n }", "validateLootAccount() {\n let result = false;\n let account = this.lootView.accountID;\n let state = this.lootView.accountState;\n let accountExist = this.bank.players.some(p => p.id === account);\n\n if (accountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "function isExist(usersSession, tar) {\n for (one in usersSession) {\n if (usersSession[one].name == tar) return true\n }\n return false;\n }", "function checkRequiredUsers(member, command) {\n return command.requiredUsers.includes(member.id);\n}", "function checkPlayer() {\n return (gInfo.playerList[gInfo.currentPlayer].uid==currentUID);\n}", "function checkExistingAuth() {\n // const userRecord = configstore.get('user');\n // const tokens = configstore.get('tokens');\n // console.log({ tokens });\n //\n // if (userRecord && tokens) throw new Error('You are alread logged in!');\n\n return true;\n}", "checkAlreadyLoggedIn(props) {\n if (/\\/(amc-sign-up|appraiser-sign-up|login)/.test(this.props.location.pathname)) {\n return props.auth.get('user') && !props.auth.get('signingUp');\n }\n }", "function getShopUser(memberObj){\n return data.users.find(user => {\n return user.id === memberObj.user.id.toString();\n })\n}", "isPurchaseStatusAlreadyOwned() {\n const purchaseStatus = this.getPurchaseStatus();\n return purchaseStatus === PURCHASE_STATUS.ALREADY_OWNED;\n }", "static async isRegisteredUsername(username) {\n let res = await db.query('SELECT * FROM users WHERE username = $1', [username]);\n return res.rowCount > 0;\n }", "function doesMintCryptoPropertyExist() {\n\tlet mintAccounts = document.getElementsByClassName(\"accountName\");\n\tfor (let i = 0; i < mintAccounts.length; i++) {\n\t\tif (mintAccounts[i].innerText == \"Cryptocurrency\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function checkAuth(token) {\n // should be a salted hash...\n var tokenCheck = counters.findOne({ token: token}).then((key) => {\n if (!key) {\n return false\n } else {\n return true\n }\n });\n return tokenCheck;\n }", "requiresAccountId(stat) {\n const stackAccount = core_1.Stack.of(this).account;\n // if stat.account is undefined, it's by definition in the same account\n if (stat.account === undefined) {\n return false;\n }\n // Return true if they're different. The ACCOUNT_ID token is interned\n // so will always have the same string value (and even if we guess wrong\n // it will still work).\n return stackAccount !== stat.account;\n }", "function winnerAlreadyExists(winnerEmail) {\n var i;\n for (i = 0; i < $scope.winners.length; i++) {\n if ($scope.winners[i].email === winnerEmail) {\n return true;\n }\n }\n return false;\n }", "async function checkIfUserExist () {\n try {\n const user = await fetch('https://mern-finalproj-api.herokuapp.com/Help4U/user/check', {\n method: 'POST',\n headers: new Headers({\n 'Content-Type': 'application/json; charset=utf-8'\n }),\n mode: 'cors',\n body: JSON.stringify({ google_id: response.googleId })\n\n }).then(user => user.json());\n\n if (user.status === 200 && user.data !== null) {\n // update admin access token - only for admin API requests\n if (user.data.admin == true) {\n updateAdminAccessToken(response);\n }\n\n setSession(response, user.data);\n history.replace('/home');\n }\n\n // user not exist, signup with google account\n if (user.status === 200 && user.data === null) {\n history.replace('/signup');\n }\n if (user.status === 500) {\n history.replace('/error');\n }\n } catch (e) {\n history.replace('/error');\n }\n }", "function isTurnPlayer (guid) {\n return (guid === state.queue[0]);\n}", "function checkCartExistance(owner, prod) {\n return new Promise((reso, reject) => {\n db.collection(\"carts\").findOne({ userOwner: owner }, function(err, carts) {\n if (carts === null) {\n reso(false);\n } else if (carts.products.includes(prod)) {\n reject(`Prodcuts is already inside the cart.`);\n } else {\n reso(carts);\n }\n });\n });\n}", "userExists(user) {\n return this.users.indexOf(user)!==-1;\n }", "checkJoined() {\n for (let i = 0; i < this.props.myEvent.member.length; i++) {\n if (this.props.myEvent.member[i].id == Meteor.userId()) {\n return true;\n }\n }\n return false;\n\n //return this.props.myEvent.member.includes(Meteor.userId());\n }", "function callGuestOrAccCreationOrLogged() {\n\tif(intervalForServiceFee){\n\t\tclearIntervalApp(intervalForServiceFee);\n\t}\n\tdeActivateCheckoutPayButton(); \n var registerUser = parseBoolean(localStorage.getItem(\"registerUser\"));\n if (!registerUser) {\n if (!isGrtr) {\n updateUserProfileCheckout();\n } \n } else {\n \tif(isPromocodeJsonTypeAvailable()){\n \t\tif(!verifyPromocode()){\n \t \treturn;\n \t }\n \t}\n \tclearIntervalApp(timeIntevalOfAddCard);\n \tcallAddCardOrSubmitCard();\n }\n}", "userEnUso(nick)\n {\n const user = this.usuarios.find(usuario => usuario.nickName == nick)\n return user != undefined;\n }", "function checkUsrSubscription() {\n\tif (checkCookieCor(\"rcsSubscriptions\")){\n\t\tvar rcsSubscriptions = getCookieClient(\"rcsSubscriptions\");\n\t\tvar currentAppId = getCurrentAppId();\n\t\tvar ca = rcsSubscriptions.split('|');\n\t\tfor(var i=0;i < ca.length;i++) {\n\t\t\tvar appId = ca[i];\n\t\t\tif (appId == currentAppId)\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "async function checkStore() {\n if ((store.state.user.currentUser.first_name == '') && store.state.user.isAuthenticated) {\n await store.dispatch('initShared');\n } else if ((store.state.user.currentUser.first_name == '') && !store.state.user.isAuthenticated) {\n router.push('/login');\n }\n}", "async checkPermission(account){\n if(account !== \"\" && account !== undefined){ \n const check = await this.permissions.methods.havePermission(account)\n .call({from:this.state.account});\n return check;\n }\n return false;\n }", "function isProductAlreadyInCart() {\n if (!Storage.has('products')) {\n return false;\n } \n let products = Storage.get('products');\n if (products.includes(getProductId())) { \n return true;\n }\n return false;\n}", "static async usernameCheck(username) {\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE UPPER(username) = UPPER($1)`,\n [username]\n );\n // returns true if username is already in use\n return duplicateCheck.rows.length > 0;\n }", "function promptMemberExists() {\n inquirer.prompt([\n {\n type: 'input',\n message: \"Enter key:\",\n name: \"key\"\n },\n {\n type: 'input',\n message: \"Enter value:\",\n name: \"value\"\n }\n ]).then((answers) => {\n console.log(memberExists(answers.key, answers.value));\n mainPrompt();\n }).catch((error) => {\n if (error.isTtyError) {\n // Prompt couldn't be rendered in the current environment\n console.error(error);\n } else {\n // Something else went wrong\n console.error(error);\n }\n });\n}", "function sessionExists(sdk) {\n return sdk.session\n .get()\n .then(function (res) {\n if (res.status === \"ACTIVE\") {\n return true;\n }\n\n return false;\n })\n .catch(function () {\n return false;\n });\n }", "async isLogin() {\n let user = await this.session('userInfo') || {};\n return !think.isEmpty(user);\n }", "function isGuildMember(m){\n var ret = false\n config.memberRoles.forEach((memberRole) => {\n if (m.roles.has(memberRole)){\n ret = true\n }\n })\n return ret\n}", "function isExist(check, accessor, objJRole, objRoleManager) {\n\t//If role is new.\n\tif (check === true) {\n\t\tobjRoleManager.create(objJRole);\n\t\tremoveSpinner(\"modalSpinnerRole\");\n\t\treturn true;\n\t}\n\tvar existMessage = getUiProps().MSG0007;\n\tdocument.getElementById(\"popupRoleErrorMsg\").innerHTML = existMessage;\n\tremoveSpinner(\"modalSpinnerRole\");\n\treturn false;\n}", "async function hasmembership(email) {\r\n try {\r\n const membership = await getDataAsync(`${BASE_URL}/user/membership/${email}`);\r\n if (membership != null) {\r\n // returns true if user has membership\r\n return true;\r\n } else {\r\n // returns true if user don't have membership\r\n return false;\r\n }\r\n } // catch and log any errors\r\n catch (err) {\r\n console.log(err);\r\n }\r\n}", "async verifyUserLoggedIn() {\n if ((await browser.getCurrentUrl()).includes('inventory')) {\n return true;\n }\n else { return false; }\n }", "function isTaskMember(data) {\n var found = false;\n\n $.each(data.members, function(index, value) {\n if (divvy.currentUser == value.username) {\n found = true;\n }\n });\n\n return found;\n }", "function isTaskMember(data) {\n var found = false;\n\n $.each(data.members, function(index, value) {\n if (divvy.currentUser == value.username) {\n found = true;\n }\n });\n\n return found;\n }", "checkForPlayer (id) {\n return this.turns.indexOf(id) >= 0\n }", "function checkAuth(discordName, callback) {\r\n const collection = db.collection(account + '_users');\r\n collection.findOne({ _id: 1 }, function (err, doc) {\r\n gPlayerDB = doc.players;\r\n if (doc.gm === discordName) {\r\n callback(1);\r\n return;\r\n }\r\n\r\n for (var i = 0; i < doc.players.length; i++) {\r\n if (doc.players[i].discord === discordName) {\r\n gPlayer = i;\r\n callback(2);\r\n return;\r\n }\r\n }\r\n\r\n callback(0);\r\n return;\r\n });\r\n}", "function confirmMember(session, args, next) { // See if the user provided a user after the salute command\n\n var getMember = builder.EntityRecognizer.findEntity(args.entities, 'member'); // get the name if provided\n var nameExists = false;\n if (getMember) { // if a name is provided carry on to the next function\n\n for (i = 0; i < usersArray.length; i++) {\n if (getMember.entity == usersArray[i].toLowerCase()) {\n nameExists = true;\n }\n }\n\n if (true)//nameExists == true)\n {\n next(args, { response: getMember.entity });\n }\n else {\n session.send(usersArray[44].toLowerCase());\n session.send(getMember.entity);\n session.send(\"Sorry this person does not exist\");\n }\n\n }\n else {\n\n builder.Prompts.text(session, 'Who do you want to salute?'); // Ask the user for a user to salute and pass it to the next function\n\n }\n}", "function doesAccountExist() {\n const accToCheck = readline.question(\"Give ID number to see, if the account exists (or 'return' to go back)\\n>> \");\n\n const userArray = JSON.parse(fs.readFileSync(\"./accountDetails.json\", \"utf8\"));\n\n if (accToCheck === \"return\") {\n currentLoc = \"account\";\n } else {\n // Compare userArray:s id:s with accToCheck's ID and take true/false in checkBoolean\n const checkBoolean = userArray.some((x)=> x.id === accToCheck);\n\n if (checkBoolean) {\n console.log(\"User found by that ID. If you are xfering money, \" +\n \"contact user first to make sure it's correct ID\");\n } else {\n console.log(\"No user found by that ID.\");\n }\n doesAccountExist();\n }\n}", "function hasProfile() {\n if (!store.has('ui.profile.url') || !store.has('ui.profile.user') || !store.has('ui.profile.password')) {\n return false;\n }\n if (!store.get('ui.profile.url') || !store.get('ui.profile.user') || !store.get('ui.profile.password')) {\n return false;\n }\n return true;\n}", "function checkIfUserExists(name, redisClient) {\n return new Promise((resolve) => {\n redisClient.get(`${USER_PREFIX}${name}`, (err, res) => {\n resolve(Boolean(res));\n });\n });\n}", "function storeOwner() {\n var bitsUserName = localStorage.getItem(\"bits-user-name\");\n var sokoOwner = JSON.parse(localStorage.getItem('soko-store-id-' + localStorage.getItem('soko-active-store'))).owner;\n if (bitsUserName != sokoOwner) {\n $(\"#checkStoreOwner\").css('display', 'block')\n $(\"#storeSettings\").css(\"display\", \"none\");\n\n } else {\n $(\"#storeSettings\").css('display', 'block')\n $(\"#checkStoreOwner\").css('display', 'none')\n }\n}", "validateSaleBuyAcount() {\n let result = false;\n let acountID = this.saleAndBuy.acountID;\n let state = this.saleAndBuy.acountState;\n\n //Primero verifico que es una cuenta exsitente\n let acountExist = this.bank.players.some(p => p.id === acountID);\n\n if (acountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "function isInitialized(guildmember){\n\n //checks if user is in tendieMap\n \n //iterate over keys in tendieMap until found or not\n for(var key of tendieMap.keys()){\n if(key === guildmember.id){\n return true;\n }\n }\n console.log(\"not registered\");\n return false;\n\n}", "function checkBridgeUserExistance(ip, username) {\n var userExists = false;\n $.ajax({\n url: \"http://\" + ip + \"/api/\" + username + \"/\",\n async: false\n }).done(function(data) {\n if (data.config !== undefined) {\n userExists = true;\n } \n });\n return userExists;\n}", "function hasProfile() {\n if (!store.has('ui.profile.url') || !store.has('ui.profile.user') || !store.has('ui.profile.password')) {\n log.warn('Profile missing');\n return false;\n }\n if (!store.get('ui.profile.url') || !store.get('ui.profile.user') || !store.get('ui.profile.password')) {\n log.warn('Profile empty');\n return false;\n }\n log.debug('Profile found');\n return true;\n}", "function checkSessionID(req) {\n if(req.cookies.sessionId in playerlist) {\n return true;\n } else {\n return false;\n }\n\n }", "function checkTurn() {\n\n if (actingPlayer === turnOf && alreadyTakenTurn === true) {\n cycleTurn();\n } else if (actingPlayer === turnOf && alreadyTakenTurn === false) {\n alreadyTakenTurn = true;\n }\n}", "isConnected() { return this.accounts && this.accounts.length > 0; }", "function checkTransactionID() {\r\n\tvar tmp = GM_getValue(\"trans_id\",\"\");\r\n\tif (tmp\t== \"\") configTransactionId();\r\n}", "function checkIfUniqueSerNum(sn,cb){\n db.TicketModel.findOne({serial_number:sn},function(err,ticket){\n if(err){\n return cb(err);\n }\n if(typeof(ticket)!=='undefined' && ticket){\n return cb(null,false);\n }\n\n return cb(null,true);\n });\n}", "function isPlayer(socID) {\n var i;\n for (i = 1; i < user.length; i++) {\n if (user[i]) {\n if (socID === user[i].socketid) {\n return true;\n }\n }\n }\n return false;\n}", "async function CheckUserExistence(userID) {\n try {\n await client.query(\"BEGIN\");\n await client.query(`INSERT INTO ${userDb}(discord_id) VALUES ($1)`, [userID])\n await client.query(\"COMMIT\");\n } catch (e) {\n await client.query(\"ROLLBACK\");\n }\n}", "checkUser() {\n let doesExit = false\n this.state.admin.forEach(x => {\n if(x.email === this.state.email) {\n doesExit = true;\n }\n });\n return doesExit;\n }", "function checkAccount(URL){\n var requestPromise = browser.storage.sync.get();\n requestPromise.then(function(data){\n var cat = data.categories; var entries = data.entries;\n var accountFound = false; var username;\n for(e in entries){\n if(e === URL){\n accountFound = true;\n username = entries[e].username;\n }\n }\n //if there was no account found or there is an account for this page but a different username was saved\n if(accountFound){\n //TODO: how popup \"want to add this account?\"\n $('#hint').html(\"Found account for this website.\");\n }else{\n $('#hint').html(\"Add Entry for this website?\");\n\n\n\n }\n });\n\n}", "async function execGetUserInformation(msg, args) {\n let flag = false;\n let checkedUsers = [];\n await client.guilds.array().forEach(async g => {\n await g.members.array().forEach(m => {\n if (!checkedUsers.includes(m.user.tag) && m.user.tag == args) {\n msg.channel.send(\"Username : `\" + m.user.username + \"`\\n\\n\" +\n \"Created at : `\" + m.user.createdAt + \"`\\n\\n\" +\n \"Status : `\" + m.presence.status + \"`\\n\\n\" +\n \"Server : `\" + m.guild.name + \"`\\n\\n\" +\n \"Joined at : `\" + m.joinedAt + \"`\");\n if (m.user.verified) msg.channel.send(\"Account verified.\");\n else msg.channel.send(\"Account not verified.\");\n flag = true;\n checkedUsers.push(m.user.tag);\n return;\n }\n });\n });\n if (!flag) msg.channel.send(\"User not found please try again!\");\n }", "function usernameAlreadyExists(username){\n return false;\n }", "static async isRegisteredMail(mail) {\n let res = await db.query('SELECT * FROM users WHERE mail = $1', [mail])\n return res.rowCount > 0;\n }", "static async checkIsRegistered (selectedAddress) {\n if (registrations === undefined) {\n return\n }\n\n for (const x of registrations) {\n const { txid } = x\n const account = await this.getPendingIdentity(txid)\n if (account === undefined) {\n return false\n }\n\n const bchRegistration = account.information.payment[0].address\n if (bchRegistration === selectedAddress) {\n return true\n } else {\n return false\n }\n }\n }", "static async exists(email){\n let user = await User.findOne({where: {email: email}});\n return user !== null\n }", "function userCanFetchShoppingList(account, shoppingList) {\r\n var userHasRight = false;\r\n if (account.shoppingLists.indexOf(shoppingList._id) > -1 && shoppingList.isActive) {\r\n userHasRight = true;\r\n }\r\n else {\r\n userHasRight = false;\r\n }\r\n return userHasRight;\r\n}", "async function githubIsExist(githubAccount) {\r\n try {\r\n const user = await User.findOne({\r\n where: {\r\n githubAccount,\r\n },\r\n });\r\n if (user) {\r\n return user.toJSON();\r\n }\r\n return false;\r\n } catch (error) {\r\n console.error(error.message);\r\n return false;\r\n }\r\n}", "function verifyNotAlreadyMember(project, callback) {\n req.db.models.user.get(userId, function withProject(err, user) {\n if (err) {\n return callback(err);\n }\n\n // quirk: hasMembers returns false if the member does exist greater than 1 times.\n project.hasMembers(user, function rejectIfMemberExists(err, memberExists) {\n if (!err && memberExists) {\n err = new Error('You\\'re already a collaborator on this project.');\n err.status = httpStatus.BAD_REQUEST;\n }\n\n return callback(err, project, user);\n });\n });\n }", "function check_current_user() {\n\tfor (var i=0; i<members_db.length; i++) {\n\t\tif (members_db[i][7] == true) {\n\t\t\tlocalStorage.setItem(\"current_user_id\", i); \n\t\t}\n\t}\n}", "async function buyerDoesntExist(bEmail) {\n try {\n const result = await repository.getBuyerByEmail(bEmail);\n return result.rowCount === 0;\n } catch (error) {\n console.log(error);\n }\n}", "checkIfPlayersTurn (playerId) {\n return playerId === this.currentTurn\n }", "checkPlayerExist(user){\n let testPlayer = function(player){\n if(user.id === player.id){\n return true\n }\n return false\n }\n return this.players.find(testPlayer)\n }", "check() {\n let isLoggedIn = this.Storage.getFromStore('isLoggedIn');\n\n if(isLoggedIn) {\n return true;\n }\n\n return false;\n }", "function isRelayAddonInstalled() {\n const installationIndicator = document.querySelector(\"firefox-private-relay-addon\");\n\treturn (installationIndicator.dataset.addonInstalled === \"true\" || isAddonInstallInLocalStorage());\n}", "static accountIsValid(account) {\n return true;\n }", "async function buyMembership(id) {\r\n\r\n const userEmail = sessionStorage.getItem('email');\r\n const user = await getUserWithMail(userEmail);\r\n if (user) {\r\n const userDataObj = {\r\n membership: id,\r\n id: user.UserId,\r\n firstName: user.FirstName,\r\n lastName: user.LastName,\r\n dateOfBirth: user.DateOfBirth,\r\n phoneNumber: user.PhoneNumber,\r\n email: user.Email,\r\n role: user.Role,\r\n }\r\n\r\n await updateUser(userDataObj);\r\n handleRedirection();\r\n }\r\n}", "isUserLoggedIn() {\n //console.log(`User registered button should be present`);\n return this.userRegisteredButton.isExisting();\n }", "hasUser(msg) {\n let indexOfUser = this.list.findIndex(user => user.id === msg.author.id);\n return indexOfUser !== -1;\n }", "function checkAccount() {\n console.log(localStorage);\n if (localStorage.getItem(\"email\") === null) {\n\n } else {\n existingAccount = true;\n }\n}", "function playerClick(square){\n //Check if player's turn\n if (document.getElementById(\"game-turn\").innerHTML === \"Your\"){\n\n //Check if square is taken\n if (squareFree(square)) {\n\n //Set the square in the game\n setSquare(`${square}`,\"O\");\n\n } else {\n //Square already taken\n shakey();\n }\n } else {\n //It's not the player's turn!\n shakey();\n }\n}", "function hasStandup(who, cb) {\n \n var user = who.user;\n var channel = who.channel;\n controller.storage.teams.get('standupData', function(err, standupData) {\n if (!standupData || !standupData[channel] || !standupData[channel][user]) {\n cb(null, false);\n } else {\n cb(null, true);\n }\n });\n}", "function checkUser(potentialUserName) {\n Meteor.call('users.checkUsername', {potentialUserName}, (error, count) => {\n if (error) {\n Bert.alert(error.reason, 'danger');\n } else {\n console.log(count)\n if (count > 0) {\n setUsernameFalse(potentialUserName)\n return false\n } else {\n setUsernameTrue(potentialUserName)\n return true\n }\n }\n });\n }", "function CheckIfStatExists( results )\n{\n\tvar doesnt_exist = (results === \"gameplay stat not found\");\n\tif(doesnt_exist)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "async tokenExists(token) {\n\n // parameter token doesn't exist\n if (!this._parameterExists(token)) {\n return false;\n }\n\n try {\n // token exists\n if (await this._count('users', 'email', { token }) === 1) {\n return true;\n }\n\n // token doesn't exist\n return false;\n } catch (err) {\n this.logger.error(err);\n return false;\n }\n }", "validateTaxPayer() {\n let result = false;\n let taxPayerId = this.taxesView.accountID;\n let state = this.taxesView.accountState;\n let taxPayerExist = this.bank.players.some(p => p.id === taxPayerId);\n\n if (taxPayerExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "function checkIfPlayerWon(symbol) {\n if ($('.sq1').hasClass(symbol) && $('.sq2').hasClass(symbol) && $('.sq3').hasClass(symbol)) {\n return true;\n } else if ($('.sq4').hasClass(symbol) && $('.sq5').hasClass(symbol) && $('.sq6').hasClass(symbol)) {\n return true;\n } else if ($('.sq7').hasClass(symbol) && $('.sq8').hasClass(symbol) && $('.sq9').hasClass(symbol)) {\n return true;\n } else if ($('.sq1').hasClass(symbol) && $('.sq4').hasClass(symbol) && $('.sq7').hasClass(symbol)) {\n return true;\n } else if ($('.sq2').hasClass(symbol) && $('.sq5').hasClass(symbol) && $('.sq8').hasClass(symbol)) {\n return true;\n } else if ($('.sq3').hasClass(symbol) && $('.sq6').hasClass(symbol) && $('.sq9').hasClass(symbol)) {\n return true;\n } else if ($('.sq1').hasClass(symbol) && $('.sq5').hasClass(symbol) && $('.sq9').hasClass(symbol)) {\n return true;\n } else if ($('.sq3').hasClass(symbol) && $('.sq5').hasClass(symbol) && $('.sq7').hasClass(symbol)) {\n return true;\n } else {\n return false;\n }\n }", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n }\n }", "async function checkForRememberedUser() {\n console.debug(\"checkForRememberedUser\");\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n if (!token || !username) return false;\n\n // try to log in with these credentials (will be null if login failed)\n currentUser = await User.loginViaStoredCredentials(token, username);\n}", "function isMember(req, res, next) {\n req.user.isMember(req.params.house, (is) => {\n if (is) next();\n else res.send({ error: req.user.fname + ' is not a member of ' + req.params.house });\n });\n }", "async function checkForRememberedUser() {\n console.debug('checkForRememberedUser');\n const token = localStorage.getItem('token');\n const username = localStorage.getItem('username');\n if (!token || !username) return false;\n\n // try to log in with these credentials (will be null if login failed)\n currentUser = await User.loginViaStoredCredentials(token, username);\n}", "async function rpcCredIntegrityCheck(settings) {\n if (!Object.prototype.hasOwnProperty.call(settings.bitcoind, 'rpcUser')) {\n settings.bitcoind.rpcUser = UUID.create();\n }\n\n if (!Object.prototype.hasOwnProperty.call(settings.bitcoind, 'rpcPassword')) {\n settings.bitcoind.rpcPassword = UUID.create();\n }\n}", "function checkSession(callback) {\n\t authClient.session.exists().then(callback);\n\t }", "get isBuyer() {\n return parseInt(this.props.login['role'], 10) === ROLES.BUYER\n }", "async credentialsExist() {\n return { success: true, credentialsExist: this.authManager.accountsFileExists() }\n }", "userRegister(user) {\n if(false) {\n throw new Error('Action cannot be billed');\n }\n\n return true;\n }", "function check(){\n return $storage.profile !== null;\n }", "function check(){\n return $storage.profile !== null;\n }", "function checkLogin() {\n if (\"ActiveUser\" in localStorage) {\n return true\n } else {\n return false\n }\n}", "function checkForOpponent() {\n if (opponentToggle === \"not found\") {\n $.ajax({\n url: `/game/${gameID}/waiting/${userID}`,\n method: \"GET\",\n success: (data) => { opponentToggle = data; }\n });\n }\n stopOpponentCheckTimer();\n }", "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n currentUser = await User.getLoggedInUser(token, username);\n await generateStories();\n\n if (currentUser) {\n showNavForLoggedInUser();\n fillUserInfo();\n $userProfile.show();\n }\n else{\n $userProfile.hide();\n }\n }", "function checkIfPlayerWon(sign) {\n if ($('.sq1').hasClass(sign) && $('.sq2').hasClass(sign) && $('.sq3').hasClass(sign)) {\n return true;\n } else if (($('.sq4').hasClass(sign) && $('.sq5').hasClass(sign) && $('.sq6').hasClass(sign))) {\n return true;\n } else if (($('.sq7').hasClass(sign) && $('.sq8').hasClass(sign) && $('.sq9').hasClass(sign))) {\n return true;\n } else if (($('.sq1').hasClass(sign) && $('.sq4').hasClass(sign) && $('.sq7').hasClass(sign))) {\n return true;\n } else if (($('.sq2').hasClass(sign) && $('.sq5').hasClass(sign) && $('.sq8').hasClass(sign))) {\n return true;\n } else if (($('.sq3').hasClass(sign) && $('.sq6').hasClass(sign) && $('.sq9').hasClass(sign))) {\n return true;\n } else if (($('.sq1').hasClass(sign) && $('.sq5').hasClass(sign) && $('.sq9').hasClass(sign))) {\n return true;\n } else if (($('.sq3').hasClass(sign) && $('.sq5').hasClass(sign) && $('.sq7').hasClass(sign))) {\n return true;\n } else {\n return false;\n }\n }", "function userExists(username){\n\treturn username.toLowerCase() == 'admin';\n}" ]
[ "0.55734277", "0.5473422", "0.5449131", "0.5419826", "0.54182255", "0.5417166", "0.5397074", "0.5372543", "0.53500605", "0.5339697", "0.5327737", "0.5310359", "0.53093594", "0.53005874", "0.5296564", "0.52776945", "0.5259131", "0.52456725", "0.5239986", "0.52367795", "0.52335805", "0.52292466", "0.5225131", "0.5221633", "0.5220008", "0.52168196", "0.52163625", "0.52077866", "0.51937973", "0.5192535", "0.5186715", "0.51753175", "0.5171764", "0.5160963", "0.5159804", "0.5154377", "0.51533794", "0.51533794", "0.5152616", "0.51477623", "0.5131193", "0.5120041", "0.51172405", "0.5117058", "0.5101994", "0.5100124", "0.50981593", "0.50829256", "0.5071287", "0.50577474", "0.5047792", "0.50445396", "0.50425696", "0.5036298", "0.50350416", "0.5033109", "0.50297576", "0.50150144", "0.5010902", "0.5009923", "0.5001617", "0.5001406", "0.5000751", "0.49999315", "0.49939853", "0.49931026", "0.4982727", "0.49816176", "0.49806052", "0.49711135", "0.49678472", "0.49592042", "0.4953586", "0.49504563", "0.49457806", "0.494258", "0.49330324", "0.492922", "0.492768", "0.49212754", "0.4920109", "0.4919976", "0.49188784", "0.49186766", "0.4918554", "0.49168777", "0.49137664", "0.49113357", "0.49001718", "0.4893823", "0.48917383", "0.48806038", "0.48785752", "0.48741323", "0.48741323", "0.48684558", "0.48682362", "0.48676634", "0.48674744", "0.4867374" ]
0.65833217
0
Makes a Simbit shop account for a Discord member
function mkAcc(memberObj){ data["users"].push( { "id": memberObj.user.id.toString(), "name": memberObj.user.username, "balance": 0, "inventory" : [] } ) return fs.writeFileSync("./data/shop/data.json", JSON.stringify(data), (err) => console.log(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "becomeGameSponsor({ gameSponsorFee }) {\n this.CONTRACT\n .becomeGameSponsor\n .sendTransaction(\n {\n \"from\": MYWeb3.getAccount(),\n \"gas\": MYWeb3.toHex(400000),\n \"value\": MYWeb3.toWei(gameSponsorFee),\n },\n function (err, result) {}\n );\n }", "register({id, first_name, last_name, username, password}){\n return {\n name: \"createMember\",\n args: [{\n id: id,\n first_name: first_name,\n last_name: last_name,\n username: username,\n password: pgcrypto.crypt(password),\n }]\n }\n }", "sendMe() {\n this.sendData('me', {\n dance: 'Techno',\n group: this.id,\n heroSkin: false,\n playerId: this.id,\n skin: this.character,\n team: 'none',\n username: this.playerName,\n weapon: this.weapon,\n weaponSkins: {\n Scar: false,\n Shotgun: false,\n Sniper: false,\n 'Tec-9': false,\n },\n });\n }", "createAccount() {\n if (document.getElementById('newaccount-name').value == '')\n return;\n let options = {\n username: '',\n group: '',\n permission: 0\n };\n if (document.getElementById('newaccount-name').value != '') {\n options.username = document.getElementById('newaccount-name').value;\n }\n if (document.getElementById('newaccount-permission').value != '') {\n options.permission = document.getElementById('newaccount-permission').value;\n }\n if (document.getElementById('newaccount-group').value != '') {\n options.group = document.getElementById('newaccount-group').value;\n }\n\n window.Lemonade.Mirror.send('account-create', CookieManager.getCookie('loggedIn_user'), CookieManager.getCookie('loggedIn_session'), options);\n }", "async createMember(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 4) {\n throw new Error('Incorrect number of arguments. Expecting 4');\n }\n\n var member = {\n firstName: args[1],\n lastName: args[2],\n balance: args[3]\n };\n\n console.info(member);\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(member)));\n console.info('============= END : Create animal ===========');\n }", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "registerAccount(traderName, traderEmail, traderPassword) {\n var registration = new Registration(traderName, traderEmail, traderPassword);\n\n // Validate Credentials\n let obj = registration.validateCredentials(traderEmail, traderName, traderPassword);\n if (obj.Bool == false)\n return obj;\n\n // Complete Registration\n const words = Buffer.from(Registration.generateWords(), 'utf8').toString('hex'); // Store this, fuck aughttt\n let walletID = registration.createWalletID(words, traderPassword); // get the first hash (secret)\n console.log(\"Please keep this walletID secret \" + walletID + ' ' + words + ' ' + traderPassword);\n registration.storeCredentials(registration, words);\n const reg = (registration.createIdentity(traderName, \"50000\", walletID)) ? true : false;\n if (reg == true)\n return {\n Bool: true,\n Message: \"Registration Successful\"\n };\n\n return {\n Bool: false,\n Message: \"Registratiion Failed\"\n };\n }", "async function buyMembership(id) {\r\n\r\n const userEmail = sessionStorage.getItem('email');\r\n const user = await getUserWithMail(userEmail);\r\n if (user) {\r\n const userDataObj = {\r\n membership: id,\r\n id: user.UserId,\r\n firstName: user.FirstName,\r\n lastName: user.LastName,\r\n dateOfBirth: user.DateOfBirth,\r\n phoneNumber: user.PhoneNumber,\r\n email: user.Email,\r\n role: user.Role,\r\n }\r\n\r\n await updateUser(userDataObj);\r\n handleRedirection();\r\n }\r\n}", "function setupDirectFromUser() {\n return __awaiter(this, void 0, void 0, function* () {\n yield api_1.login({ username: config_1.mockUser.username, password: config_1.mockUser.password });\n return api_1.post('im.create', { username: config_1.botUser.username }, true);\n });\n}", "async function createAnAccount() {\n let userService = new UserService(process.env.MICRO_API_TOKEN);\n let rsp = await userService.create({\n email: \"[email protected]\",\n id: \"usrid-1\",\n password: \"mySecretPass123\",\n username: \"usrname-1\",\n });\n console.log(rsp);\n}", "function create_account(sender_worker, username, password) {\n var new_guid = generate_random_id();\n var wr = { \n\t'guid': new_guid, \n\t'username': CryptoJS.SHA1(username).toString(), \n\t'password' : CryptoJS.SHA1(password).toString(),\n\t'version' : pii_vault.config.current_version \n }\n\n var r = request({\n\t url: \"http://woodland.gtnoise.net:5005/create_new_account\",\n\t content: JSON.stringify(wr),\n\t onComplete: function(response) {\n\t\tmy_log(\"Here here: Comepleted create-account response\", new Error);\n\t\tmy_log(\"Here here: Response status: \" + response.status, new Error);\n\t\tmy_log(\"Here here: Response status txt: \" + response.statusText, new Error);\n\t\tmy_log(\"Here here: Response text: \" + response.text, new Error);\n\t\tmy_log(\"Here here: Response json: \" + response.json, new Error);\n\t\tmy_log(\"Here here: Response headers: \" + response.headers, new Error);\n\n\t\tif (response.status == 200) {\n\t\t var data = response.text;\n\t\t if (data == 'Success') {\n\t\t\tsender_worker.port.emit(\"account-success\", {\n\t\t\t\ttype: \"account-success\", \n\t\t\t\t desc: \"Account was created successfully. You are now logged-in\"\n\t\t\t\t });\n\n\t\t\t//Reset pii_vault.\n\t\t\tpii_vault = { \"options\" : {}, \"config\": {}};\n\t\t\tpii_vault.guid = new_guid;\n\t\t\tmy_log(\"create_account(): Updated GUID in vault: \" + pii_vault.guid, new Error);\n\t\t\tvault_write(\"guid\", pii_vault.guid);\n\t\t\t\n\t\t\tcurrent_user = username;\n\t\t\tpii_vault.current_user = username;\n\t\t\tvault_write(\"current_user\", pii_vault.current_user);\n\t\t\t\n\t\t\tsign_in_status = 'signed-in';\n\t\t\tpii_vault.sign_in_status = 'signed-in';\n\t\t\tvault_write(\"sign_in_status\", pii_vault.sign_in_status);\n\t\t\t//GUID has changed, call init() to create new fields. Otherwise it\n\t\t\t//will not do anything.\n\t\t\tvault_init();\n\t\t\tmy_log(\"APPU DEBUG: Account creation was success\", new Error);\n\t\t\t//Just to report our status\n\t\t\tpii_check_if_stats_server_up();\n\t\t }\n\t\t else if (data.split(' ')[0] == 'Failed') {\n\t\t\tvar temp = data.split(' ');\n\t\t\ttemp.shift();\n\t\t\tvar reason = temp.join(' ');\n\n\t\t\tsender_worker.port.emit(\"account-failure\", {\n\t\t\t\ttype: \"account-failure\", \n\t\t\t\t desc: reason\n\t\t\t\t });\n\t\t\tmy_log(\"APPU DEBUG: Account creation was failure: \" + reason, new Error);\n\t\t }\n\t\t else {\n\t\t\tsender_worker.port.emit(\"account-failure\", {\n\t\t\t\ttype: \"account-failure\", \n\t\t\t\t desc: \"Account creation failed for unknown reasons\"\n\t\t\t\t });\n\t\t\tmy_log(\"APPU DEBUG: Account creation was failure: Unknown Reason\", new Error);\n\t\t }\n\t\t}\n\t\telse {\n\t\t //This means that HTTP response is other than 200 or OK\n\t\t print_appu_error(\"Appu Error: Account creation failed at the server: \" \n\t\t\t\t + response.toString() + \" @ \" + (new Date()));\n\n\t\t sender_worker.port.emit(\"account-failure\", {\n\t\t\t type: \"account-failure\", \n\t\t\t\tdesc: \"Account creation failed, service possibly down\"\n\t\t\t\t});\n\t\t my_log(\"APPU DEBUG: Account creation was failure: Unknown Reason\", new Error);\n\t\t}\n\t }\n\t});\n\n r.post();\n}", "async addMember(stub, args) {\n let cid = new ClientIdentity(stub);\n\n console.info('addMember invoked');\n\n //check args length should be 10\n if (args.length != 10) {\n console.info(`Argument length should be 10 with the order example: \n {\n user_id: \"abc\",\n organization: \"Seller\",\n user_name: \"MCB Bank\",\n address: \"Street 1, F-10 Markaz\",\n memberType: \"seller\",\n seller: \"none\",\n traders : [{\n name: \"Afghan Traders\",\n mobile: 021**********,\n address: \"Peshawar Road\",\n }],\n buyers: \"none\"\n bankers : [{\n name: \"MCB Bank\",\n mobile: 021**********,\n address: \"F-10 Markaz\",\n }],\n shippers : [{\n name: \"Razzaq Shipping\",\n mobile: 021**********,\n address: \"New Town, Karachi\",\n }]\n }`);\n\n throw new Error(`Argument length should be 10 with the order example: \n {\n user_id: \"abc\",\n organization: \"Seller\",\n user_name: \"MCB Bank\",\n address: \"Street 1, F-10 Markaz\",\n memberType: \"seller\",\n traders : [{\n name: \"Afghan Traders\",\n mobile: 021**********,\n address: \"Peshawar Road\",\n }],\n bankers : [{\n name: \"MCB Bank\",\n mobile: 021**********,\n address: \"F-10 Markaz\",\n }],\n shippers : [{\n name: \"Razzaq Shipping\",\n mobile: 021**********,\n address: \"New Town, Karachi\",\n }]\n }`);\n }\n\n //create object to hold details of our new member\n if (args[1] !== 'Seller' && args[1] !== 'Trader' && args[1] !== 'Buyer' && args[1] !== 'Banker' && args[1] !== 'Shipper') {\n console.info('Organization not exist');\n throw new Error('Invalid Organiztion, please check the name of organization');\n }\n\n if (args[4] !== 'seller' && args[4] !== 'trader' && args[4] !== 'buyer' && args[4] !== 'banker' && args[4] !== 'shipper') {\n console.info('member should be one of these seller, trader, buyer, banker or a shipper');\n throw new Error('member should be one of these seller, trader, buyer, banker or a shipper');\n }\n let newMember = {};\n\n newMember.user_id = args[0];\n newMember.organization = args[1];\n newMember.user_name = args[2];\n newMember.address = args[3];\n newMember.memberType = args[4];\n // newMember.checkId = cid.assertAttributeValue('name', 'aman1212');\n\n if (args[4] === 'seller') {\n // if(!Array.isArray(args[6]) && !Array.isArray(args[8]) && !Array.isArray(args[9])) {\n // console.info('Value should be of type Array');\n // throw new Error('Value should be of type Array');\n // }\n newMember.traders = args[6];\n newMember.bankers = args[8];\n newMember.shippers = args[9];\n }\n else if (args[4] === 'trader') {\n // if(!Array.isArray(args[5]) && !Array.isArray(args[7]) && !Array.isArray(args[8]) && !Array.isArray(args[9])) {\n // console.info('Value should be of type Array');\n // throw new Error('Value should be of type Array');\n // }\n newMember.sellers = args[5];\n newMember.buyers = args[7];\n newMember.bankers = args[8];\n newMember.shippers = args[9];\n }\n else if (args[4] === 'buyer') {\n // if(!Array.isArray(args[6]) && !Array.isArray(args[8]) && !Array.isArray(args[9])) {\n // console.info('Value should be of type Array');\n // throw new Error('Value should be of type Array');\n // }\n newMember.traders = args[6];\n newMember.bankers = args[8];\n newMember.shippers = args[9];\n }\n\n // await stub.putPrivateData(args[4]+'_users',args[0], Buffer.from(JSON.stringify(newMember)));\n await stub.putState(args[0], Buffer.from(JSON.stringify(newMember)));\n }", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say(\"Hi there, I'm Taylor. I'm a bot that has just joined your team.\");\n convo.say('You can now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function money() {\n let commands = {\n atm: 'wallet',\n purse: 'wallet',\n wallet(target, room, user) {\n if (!this.canBroadcast()) return;\n Economy.get((target || user.userid), function(amount) {\n let currency = Wulu.Economy.currency_name;\n if (amount !== 1) currency += 's';\n this.sendReplyBox(`${target || user.name} has ${amount} ${currency}.`);\n room.update();\n }.bind(this));\n },\n\n 'generatemoney': 'givemoney',\n givemoney(target, room, user) {\n if (!user.can('givemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/givemoney [user], [amount] - Give a user a certain amount of money.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.give(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was given ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has given you ${amount} ${currency}. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n takemoney(target, room, user) {\n if (!user.can('takemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/takemoney [user], [amount] - Take a certain amount of money from a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.take(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was losted ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has taken ${amount} ${currency} from you. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n transfer: 'transfermoney',\n transfermoney(target, room, user) {\n if (!target || target.indexOf(',') < 0) return this.sendReply('/transfer [user], [amount] - Transfer a certain amount of money to a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let targetName = this.targetUsername;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${targetName} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n let self = this;\n Economy.get(user.userid, function(userAmount) {\n if (amount > userAmount) return self.sendReply('You cannot transfer more money than what you have.');\n Economy.give(targetName, amount, function(targetTotal) {\n Economy.take(user.userid, amount, function(userTotal) {\n let targetCash = targetTotal !== 1 ? currency_name + 's' : currency_name;\n let userCash = userTotal !== 1 ? currency_name + 's' : currency_name;\n self.sendReply(`You have successfully transferred ${amount} ${currency} to ${targetName}. You now have ${userTotal} ${userCash}.`);\n self.sendReply(`${user.name} has transferred ${amount} ${currency} to you. You now have ${targetTotal} ${targetCash}.`);\n });\n });\n });\n },\n\n moneyladder: 'richestuser',\n richladder: 'richestuser',\n richestusers: 'richestuser',\n richestuser(target, room) {\n if (!this.canBroadcast()) return;\n let self = this;\n let display = `<center><u><b>Richest Users</b></u></center><br>\n <table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n <tbody>\n <tr>\n <th>Rank</th>\n <th>Username</th>\n <th>Money</th>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n User.find().sort({money: -1}).limit(10).exec(function(err, users) {\n if (err) return;\n users.forEach((user, index) => {\n display += `<tr>\n <td>${index + 1}</td>\n <td>${user.name}</td>\n <td>${user.money}</td>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n });\n display += '</tbody></table>';\n self.sendReply('|raw|' + display);\n room.update();\n });\n }\n };\n\n Object.merge(CommandParser.commands, commands);\n}", "async grantMeChannel () {\n\t\t// subscription cheat must be provided by test script\n\t\tif (!this.subscriptionCheat) {\n\t\t\treturn;\n\t\t}\n\t\t// allow unregistered users to subscribe to me-channel, needed for mock email testing\n\t\tthis.api.warn(`NOTE - granting subscription permission to me channel for unregistered user ${this.model.id}, this had better be a test!`);\n\t\tawait this.api.services.broadcaster.grant(\n\t\t\t[this.model.id],\n\t\t\t`user-${this.model.id}`,\n\t\t\t() => {},\n\t\t\t{ request: this.request }\n\t\t);\n\t}", "async function logindiscord() {\r\n const discordToken = await kvclient.getSecret(secretName);\r\n client.login(discordToken.value);\r\n }", "greetUser() {\n Channel.botMessage(`\\nHello, ${this.user}!\\n\\n`)\n }", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.error(err)\n } else {\n convo.say('I am a bot that has just joined your team')\n convo.say('You must now /invite me to a channel so that I can be of use!')\n }\n })\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "async function handleBot( xmpp, redis, origin ) {\n const msg = ( text ) => newMessage( text, origin.from, origin.to )\n const user = getUserState( redis, origin.from )\n const text = origin.text\n\n const helpString = `Commands:\n register : Set up twilio account and number\n cancel : Return to this help text\n status : Show user config status\n clear : Clear your user config`\n\n let userStatus = await user.botStatus.get()\n let finalStatus = userStatus\n \n const commands = new Set([ \"register\", \"status\", \"help\", \"cancel\", \"clear\" ])\n\n if ( ! userStatus ) {\n await user.botStatus.set( \"help\" )\n userStatus = \"help\"\n } \n \n console.log( text.toLowerCase().trim() )\n if ( commands.has( text.toLowerCase().trim() ) ) {\n switch ( text.toLowerCase().trim() ) {\n case \"register\":\n finalStatus = \"register_account_sid\"\n break;\n case \"status\":\n finalStatus = \"status\"\n break;\n case \"clear\":\n const phoneNumber = await user.phoneNumber.get()\n await redis.del( phoneNumber )\n await user.clear( [ 'accountSid', 'authToken', 'phoneNumber' ] )\n finalStatus = \"status\"\n case \"help\":\n case \"cancel\":\n finalStatus = \"help\"\n break;\n }\n\n } else {\n switch ( userStatus ) {\n case \"register_account_sid\":\n await user.accountSid.set( origin.text )\n finalStatus = \"register_auth_token\"\n break;\n case \"register_auth_token\":\n await user.authToken.set( origin.text )\n finalStatus = \"register_number\"\n break;\n case \"register_number\":\n const number = origin.text.trim()\n if ( ! /^\\+\\d+$/.test( number ) ) {\n await xmpp.send( msg( \"Invalid Phone Number\" ) )\n return\n }\n await user.phoneNumber.set( number )\n try {\n await testUserCredentials( user )\n const jid = await redis.getAsync( number )\n if ( jid ) throw new Error( \"Number already in use by \", jid )\n await redis.setAsync( number, origin.from )\n finalStatus = \"register_end\"\n } catch ( err ) {\n await xmpp.send( msg( \"Error signing up: \" + err ) )\n await user.clear( [ 'accountSid', 'authToken', 'phoneNumber' ] )\n finalStatus = \"help\"\n }\n break;\n case \"help\":\n break\n default:\n await xmpp.send( msg( `unknown status: '${userStatus}'` ) )\n }\n } \n await user.botStatus.set( finalStatus )\n \n if ( userStatus != \"help\" && userStatus == finalStatus ) {\n await xmpp.send( msg( \"Try Again\" ) )\n return\n }\n\n switch ( finalStatus ) {\n case \"help\":\n await xmpp.send( msg( helpString ) )\n break;\n case \"register_account_sid\":\n await xmpp.send( msg( \"Enter Account SID\" ) )\n break;\n case \"register_auth_token\":\n await xmpp.send( msg( \"Enter Auth Token\" ) )\n break;\n case \"register_number\":\n await xmpp.send( msg( \"Enter Phone Number ( in E.164 format: + country_code phone_number )\" ) )\n break;\n case \"register_end\":\n await xmpp.send( msg( \"Successfully Registered\" ) )\n case \"status\":\n testUserCredentials( user )\n userAccountSid = await user.accountSid.get()\n userAuthToken = await user.authToken.get()\n userNumber = await user.phoneNumber.get()\n await xmpp.send( msg( `Status: ${userAccountSid}, ${userAuthToken}, ${userNumber}`) )\n await user.botStatus.set( \"help\" )\n break\n }\n\n}", "function addMember(board,member) {\n var url = 'https://api.trello.com/1/boards/'\n + board\n + '/members/' \n + member\n + '?allowBillableGuest=false&type=normal&key=[YOUR KEY]&token=[YOUR TOKEN]';\n \n var options =\n {\n \"method\" : \"PUT\", \n \"followRedirects\" : true,\n \"muteHttpExceptions\": true\n };\n \n var response = UrlFetchApp.fetch(url, options);\n return 1;\n}", "function main() {\r\n // user.userLogin(\"[email protected]\", \"sporks\");\r\n}", "function claimButtonClicked() {\n const starName = document.getElementById('star-name-input').value;\n const starStory = document.getElementById('star-story-input').value;\n const starRa = document.getElementById('star-ra-input').value;\n const starDec = document.getElementById('star-dec-input').value;\n const starMag = document.getElementById('star-mag-input').value;\n const starCent = document.getElementById('star-cent-input').value;\n const tokenId = document.getElementById('token-id-input').value;\n web3.eth.getAccounts((error, accounts) => {\n starNotary.createStar(starName, starStory, starRa, starDec, starMag, starCent, tokenId, { from: accounts[0] }, (errors) => {\n\n if (!error) {\n location.reload();\n } else {\n console.log(\"ERROR\", error);\n }\n })\n })\n}", "function createNewUser(data){\n let msg = {\n jsonrpc: '2.0',\n id: '0',\n method: 'setUser',\n params: data,\n };\n console.log(\"Making new user request\" )\n doSend(msg); \n}", "async createAccount(caller, amount = 0) {\n const iTx = invokeScript({\n dApp: address(this.dapp_account),\n call: {\n function: \"createAccount\",\n },\n payment: [{ assetId: this.asset_id, amount: amount }]\n }, caller);\n\n await broadcast(iTx)\n await waitForTx(iTx.id);\n this.dd('Account ' + caller + ' (' + address(caller) + ') has been created in dApp (' + address(this.dapp_account) + ') | tx_id: ' + iTx.id)\n }", "async run(message, args) {\n var services = sixMansService.GetAllServicesForInstance(message.channel.id);\n if(services == null)\n {\n return;\n }\n var [databaseService, gameService, queue, channels] = services;\n\n if(message.channel.id == channels.queue) {\n // Try add user to the queue\n var[success, error] = queue.TryAddToQueue(message.author, message.channel);\n if(!success) {\n message.reply(error);\n return;\n }\n\n // Add user to the database if they are not already there.\n var user = await databaseService.GetUser(message.author.id);\n if(user == null) {\n await databaseService.AddNewUser(message.author.id, message.author.username)\n }\n\n var queueString = queue.toDiscordString();\n\n var queueReply = new Discord.RichEmbed()\n .addField(\"Player joined the queue\", message.author + \" has joined the queue.\")\n .addField(\"Players in queue: \" + queue.length, queueString)\n .setColor(embedColor2)\n .setFooter(footer, footerImage)\n\n await message.channel.send(queueReply);\n\n if (queue.length == 6) {\n queue.BeginVoting();\n await message.channel.send(\"**THE QUEUE IS FULL! VOTING STARTING!**\\n\\nPlayers: \" + queueString + \"\\n\\nUse **!r** to pick random teams\\nUse **!b** to pick balanced teams\\nUse **!c** to pick captains\");\n }\n }\n }", "function sendWelcomeMessageTo(guildMember){\r\n guildMember.send(\"Hello and Welcome to the **FAF Discord Server**. We are quite active and are happy to help with any problems you may have. \\n\\n__**Useful Links**__\\nForums: http://forums.faforever.com/index.php \\nWiki: https://wiki.faforever.com/index.php?title=Main_Page \\nClient Download: https://faforever.com/client\")\r\n .catch(e => {\r\n utils.log(\"Could not send welcome message to \"+guildMember.user.username+\"\");\r\n });\r\n}", "function sendWelcomeMessageTo(guildMember){\r\n guildMember.send(\"Hello and Welcome to the **FAF Discord Server**. We are quite active and are happy to help with any problems you may have. \\n\\n__**Useful Links**__\\nForums: http://forums.faforever.com/index.php \\nWiki: https://wiki.faforever.com/index.php?title=Main_Page \\nClient Download: https://faforever.com/client\")\r\n .catch(e => {\r\n utils.log(\"Could not send welcome message to \"+guildMember.user.username+\"\");\r\n });\r\n}", "function createHackableUser(username) {\n var password = \"Portal123\";\n var newUser = new GlideRecord('sys_user');\n newUser.initialize();\n newUser.user_password.setDisplayValue(password);\n newUser.first_name = \"Admin (\" + username + \")\";\n newUser.last_name = \"User\";\n newUser.user_name = \"admin_user_\" + username;\n return newUser.insert();\n}", "function testMembers(){\n var members = new Members();\n members.find(\"---Name of test member (guinne pig)--\").sendSlack(\"howdy, in case you wanted to know this function is working\");\n}", "function autoForkTopic(member) {\n const topic = member.voiceChannel.name;\n const parentID = member.voiceChannel.parent.id;\n member.guild.createChannel(topic, { type: 'voice', parent: parentID }).then(\n response => {\n response.createInvite()\n .then(invite => member.send(`This room is looking a bit crowded, I made a new one :) https://discord.gg/${invite.code}`))\n .catch(console.error);\n }\n ).catch(e => { console.error(e); });\n}", "function BotAccount(accountDetails) {\n // Ensure account values are valid\n var self = this;\n // Init all required variables\n self.tempSettings = {};\n self.community = new SteamCommunity();\n self.client = new SteamUser();\n self.trade = new TradeOfferManager({\n \"steam\": self.client,\n \"community\": self.community,\n \"cancelTime\": 1000 * 60 * 60 * 24 * 10, // Keep offers upto 1 hour, and then just cancel them.\n \"pendingCancelTime\": 1000 * 60 * 30, // Keep offers upto 30 mins, and then cancel them if they still need confirmation\n \"cancelOfferCount\": 30,// Cancel offers once we hit 7 day threshold\n \"cancelOfferCountMinAge\": 1000 * 60 * 60 * 24 * 7,// Keep offers until 7 days old\n \"language\": \"en\", // We want English item descriptions\n \"pollInterval\": 5000 // We want to poll every 5 seconds since we don't have Steam notifying us of offers\n });\n self.store = new SteamStore();\n self.accountDetails = accountDetails;\n\n\n self.client.on('loggedOn', function (details) {\n self.client.setPersona(SteamUser.Steam.EPersonaState.Online);\n self.emit('loggedOn', details);\n if (self.getTempSetting('displayBotMenu') != null) {\n self.emit('displayBotMenu');\n self.deleteTempSetting('displayBotMenu');\n }\n });\n\n self.client.on('webSession', function (sessionID, cookies) {\n if (self.accountDetails.sessionID != sessionID || self.accountDetails.cookies != cookies) {\n self.accountDetails.sessionID = sessionID;\n self.accountDetails.cookies = cookies;\n delete self.accountDetails.twoFactorCode;\n /**\n * Updated an account's details (such as: username, password, sessionid, cookies...)\n *\n * @event BotAccount#updatedAccountDetails\n */\n self.emit('updatedAccountDetails');\n }\n\n if (self.accountDetails.cookies) {\n self.community.setCookies(cookies);\n self.store.setCookies(cookies);\n self.trade.setCookies(cookies);\n }\n\n self.client.on('friendOrChatMessage', function (senderID, message, room) {\n if (self.currentChatting != null && senderID == self.currentChatting.sid) {\n console.log((\"\\n\" + self.currentChatting.accountName + \": \" + message).green);\n }\n /**\n * Emitted when a friend message or chat room message is received.\n *\n * @event BotAccount#friendOrChatMessage\n * @type {object}\n * @property {SteamID} senderID - The message sender, as a SteamID object\n * @property {String} message - The message text\n * @property {SteamID} room - The room to which the message was sent. This is the user's SteamID if it was a friend message\n */\n self.emit('friendOrChatMessage', senderID, message, room);\n });\n\n self.trade.on('sentOfferChanged', function (offer, oldState) {\n /**\n * Emitted when a trade offer changes state (Ex. accepted, pending, escrow, etc...)\n *\n * @event BotAccount#offerChanged\n * @type {object}\n * @property {TradeOffer} offer - The new offer's details\n * @property {TradeOffer} oldState - The old offer's details\n */\n self.emit('offerChanged', offer, oldState);\n });\n\n self.trade.on('receivedOfferChanged', function (offer, oldState) {\n self.emit('offerChanged', offer, oldState);\n });\n\n // Useless right now\n //self.client.on('friendsList', function () {\n // self.emit('friendsList');\n //});\n\n self.trade.on('newOffer', function (offer) {\n /**\n * Emitted when we receive a new trade offer\n *\n * @event BotAccount#newOffer\n * @type {object}\n * @property {TradeOffer} offer - The offer's details\n */\n self.emit('newOffer', offer);\n });\n\n\n // Really glitchy trade system... So just ignore it for now.\n //self.client.on('tradeResponse', function (steamid, response, restrictions) {\n // self.emit('tradeResponse', steamid, response, restrictions);\n //});\n\n // Really glitchy trade system... So just ignore it for now.\n //self.client.on('tradeRequest', function (steamID, respond) {\n // respond(false);\n //});\n\n self.client.on('tradeOffers', function (count) {\n /**\n * Emitted when we receive a new trade offer notification (only provides amount of offers and no other details)\n *\n * @event BotAccount#tradeOffers\n * @type {object}\n * @property {Integer} count - The amount of active trade offers (can be 0).\n */\n self.emit('tradeOffers', count);\n self.setTempSetting('tradeOffers', count);\n });\n\n self.client.on('steamGuard', function (domain, callback, lastCodeWrong) {\n /**\n * Emitted when Steam requests a Steam Guard code from us. You should collect the code from the user somehow and then call the callback with the code as the sole argument.\n *\n * @event BotAccount#steamGuard\n * @type {object}\n * @property {String} domain - If an email code is needed, the domain name of the address where the email was sent. null if an app code is needed.\n * @property {callbackSteamGuard} callbackSteamGuard - Should be called when the code is available.\n * @property {Boolean} lastCodeWrong - true if you're using 2FA and the last code you provided was wrong, false otherwise\n */\n self.emit('steamGuard', domain, callback, lastCodeWrong);\n });\n /**\n * Emitted when we fully sign into Steam and all functions are usable.\n *\n * @event BotAccount#loggedIn\n */\n self.emit('loggedIn');\n });\n\n\n self.client.on('error', function (e) {\n // Some error occurred during logon\n console.log(e);\n switch (e.eresult) {\n case 5:\n self.emit('incorrectCredentials', self.accountDetails);\n var tempAccountDetails = {\n accountName: self.accountDetails.accountName,\n password: self.accountDetails.password\n };\n delete self.accountDetails;// Clearing any non-auth details we may have had saved.\n self.accountDetails = tempAccountDetails;\n self.emit('updatedAccountDetails');\n break;\n default:\n self.emit('debug', e);\n }\n self.emit('displayBotMenu');\n });\n\n}", "function addMember() {\n inquirer.prompt([\n {\n type: 'list',\n name: 'addMember',\n message: 'What type of member would you like to add?',\n choices: [\"Intern\", \"Engineer\", \"Done, build my team\"]\n },\n\n // switch cases based on what user chooses from list. \n // 'Engineer' returns addEngineer function, 'Intern' returns addIntern function, 'Done' finishes prompt and builds team html page.\n ]).then(res => {\n switch (res.addMember) {\n case 'Engineer':\n return addEngineer();\n\n case 'Intern':\n return addIntern();\n\n case 'Done, build my team':\n return buildTeam();\n\n }\n })\n}", "function confirmMember(session, args, next) { // See if the user provided a user after the salute command\n\n var getMember = builder.EntityRecognizer.findEntity(args.entities, 'member'); // get the name if provided\n var nameExists = false;\n if (getMember) { // if a name is provided carry on to the next function\n\n for (i = 0; i < usersArray.length; i++) {\n if (getMember.entity == usersArray[i].toLowerCase()) {\n nameExists = true;\n }\n }\n\n if (true)//nameExists == true)\n {\n next(args, { response: getMember.entity });\n }\n else {\n session.send(usersArray[44].toLowerCase());\n session.send(getMember.entity);\n session.send(\"Sorry this person does not exist\");\n }\n\n }\n else {\n\n builder.Prompts.text(session, 'Who do you want to salute?'); // Ask the user for a user to salute and pass it to the next function\n\n }\n}", "async function createUser(username='mateo', password='aaa', email='[email protected]', status='active') {\n /* eslint-disable prefer-const */\n let myUser = await getAccount();\n\n let config = {\n headers: {\n 'x-access-token': myUser.token,\n },\n };\n\n let payload = {\n 'accountId': myUser.id,\n 'username': username,\n 'password': password,\n 'email': email,\n 'status': status,\n 'permissions': [\n {\n 'accountId': myUser.id,\n 'roles': [\n 'user',\n ],\n },\n ],\n };\n\n axios.post(api+'/users', payload, config).then((data)=>{\n return data;\n }).catch((e)=>{\n return e.message;\n });\n}", "async function discordSetup() {\n\t// Discord Setup Prompts\n\tconsole.clear();\n\tprogressLog(\"Now Setting Up Discord Portion\");\n\tenvConfig.DISCORD_TOKEN = await ask({\n\t\tmessage: \"Enter In Your Discord Bot Token (You can find this in the Discord Developer Portal): \",\n\t\tvalidate: DiscordSetup.testToken\n\t});\n\tprogressLog(\"Discord Bot Token Valid\");\n\tawait anyKey(\"Add The Discord Bot To The Logging Server/Guild And Press Enter To Continue\");\n\tprogressLog(`The Bot Is In ${DiscordSetup.client.guilds.cache.size} Servers`);\n\tenvConfig.DISCORD_GUILD_ID = await ask({\n\t\ttype: \"select\",\n\t\tmessage: \"Logging Server/Guild ID: \",\n\t\thint: \"Use the arrows to select the target server from this list. Enter once if they do not work.\",\n\t\tinitial: 0,\n\t\tchoices: DiscordSetup.client.guilds.cache.map(guild => {\n\t\t\treturn {\n\t\t\t\ttitle: `[${guild.id}] ${guild.name}`,\n\t\t\t\tvalue: guild.id\n\t\t\t};\n\t\t})\n\t});\n\tDiscordSetup.setLoggingGuild(envConfig.DISCORD_GUILD_ID);\n\tprogressLog(`Selected [${DiscordSetup.getLoggingGuild().name}] As The Logging Server`);\n\tprogressLog(\"Testing Permissions on Server\");\n\tif(!DiscordSetup.getGuildMe().hasPermission(\"ADMINISTRATOR\")) warningLog(\"The Bot Does Not Have ADMINISTRATOR Permissions.\\nGrant The Bot ADMINISTRATOR Permissions Before The Next Step For An Easier Setup\");\n\tawait anyKey(\"Press Enter To Check Permissions\", DiscordSetup.testPerms);\n\tprogressLog(\"Discord Bot Has Been Successfully Set Up\");\n}", "async addMember(ctx, email, name, address, phoneNumber) {\n let member = {\n name: name,\n address: address,\n number: phoneNumber,\n email: email\n };\n await ctx.stub.putState(email, Buffer.from(JSON.stringify(member)));\n return JSON.stringify(member);\n }", "async function sendToStaff (user) {\n try {\n // prepare message\n let markdown = `${user.email} (${user.id}) has finished provisioning in the Webex CC v4 instant demo.`\n const url = 'https://webexapis.com/v1/messages'\n const token = globals.get('toolbotToken')\n const options = {\n method: 'POST',\n headers: {\n Authorization: 'Bearer ' + token\n },\n body: {\n roomId: globals.get('webexV4ProvisionRoomId'),\n markdown\n }\n }\n // send message\n await fetch(url, options)\n } catch (e) {\n console.log(`failed to notify staff of provision on Webex:`, e.message)\n }\n}", "function run() {\r\n var account = {\r\n clientId: \"#####\", // You can get when you registered an app to Netatmo.\r\n clientSecret: \"#####\", // You can get when you registered an app to Netatmo.\r\n userName: \"#####\", // Account for logging in to Netatmo.\r\n password: \"#####\", // Account for logging in to Netatmo.\r\n diffTime: 900, // When the data is not updated from the time that the script was run to before diffTime, it can confirm that Netatmo is down.\r\n batteryPercent: 10, // When the battery charge is less than batteryPercent, this script sends an email as the notification.\r\n mail: \"#####\", // This is used for sending the email.\r\n };\r\n checkNetatmo(account);\r\n}", "createAccount(){\n\n console.log('ACCOUNT CREATED')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n var web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n\n let newAccount = web3js.eth.accounts.create();\n let newAccount_public = newAccount.address\n let newAccount_private = newAccount.privateKey\n\n\n //JSON that is supporting all chains. \n let newJSON = {\n eth : [\n {\n privateKey : newAccount_private,\n publicKey : newAccount_public, \n }\n ],\n eos : [] \n }\n // 0xf65edc67222a17bdb9979e9560f75ac34fae6dc30e6d2145458295bf11739390\n\n //Turn array to string to store in keychain. \n let stored_string = JSON.stringify(newJSON);\n\n\n //Store array with keys in keychain. \n (async function() {\n\n // Store the credentials\n await Keychain.setGenericPassword('null', stored_string);\n \n })();\n\n this.props.navigator.push({\n id : 'AccountCreated',\n passProps : {\n privateKey : newAccount_private,\n publicKey : newAccount_public\n }\n })\n \n }", "static identity(args, options = {}) {\n let permission = {\n actor: args.account || PlaceholderName,\n permission: args.permission || PlaceholderPermission,\n };\n if (permission.actor === PlaceholderName &&\n permission.permission === PlaceholderPermission) {\n permission = null;\n }\n return this.create({\n identity: {\n permission,\n },\n broadcast: false,\n callback: args.callback,\n info: args.info,\n }, options);\n }", "async function giveBal(guild, client, message, args)\n{\n\tcmd = args.shift();\n\n\t//Start to check whether or not the next arg is a valid Discord user\n\tnextArg = cmd;\n\tnextArg = nextArg.substring(2, nextArg.length - 1);\n\n\tif(nextArg.charAt(0) == \"!\")\n\t\tnextArg = nextArg.substring(1, nextArg.length);\n\n\t\t//\n\ttaggedUser = await client.fetchUser(nextArg).catch(err =>{});\n\n\t//Main body\n\tamount = args.shift();\n\tif((taggedUser != undefined) && (amount * 0 == 0) && (amount > 0))\n\t{\n\t\tvar memberInfo = await sqlHand.getData(client, `./SQL/guild_data/${guild.id}/members/member_data.sqlite`, \"data\", \"id\", message.author.id);\n\n\t\tmemberInfo.bal += Math.floor(amount * 1);\n\t\tmemberInfo.totalBal += Math.floor(amount * 1);\n\n\t\tmessage.channel.send(message.author + \" has successfully given <@\" + nextArg + \">, **\" + Math.floor(amount * 1) + \" Quarters!**\");\n\t\tfor(_n = 0; _n < notifier.length; _n++)\n\t\t{\n\t\t\tlet adminProf = message.guild.members.find(member => member.id == notifier[_n]);\n\t\t\tif(adminProf == null || adminProf == undefined) continue;\n\t\t\tadminProf.send(\"========================\\n\" + message.author.username + \"#\" + message.author.discriminator + \" has successfully given \" + taggedUser.username + \"#\" + taggedUser.discriminator + \", **\" + Math.floor(amount * 1) + \" Quarters!**\\n\\n**Guild Name:** \" + message.guild.name + \"\\n**Guild ID:** \" + message.guild.id + \"\\n========================\");\n\t\t}\n\n\t\tawait sqlHand.setData(client, `./SQL/guild_data/${guild.id}/members/member_data.sqlite`, config.usersSQLSetter, memberInfo);\n\t}\n\n\tif(amount < 0)\n\t\tmessage.channel.send(message.author + \", you can't give negative quarters.\");\n\n\tif(taggedUser == undefined)\n\t\tmessage.channel.send(message.author + \", you've tagged an invalid user, please try again.\");\n\tmessage.channel.stopTyping();\n}", "function signAndSend (signer, { nonce }, status) {\n const { type, args } = this\n status({ events: [], status: { isInBlock:1 } })\n\n const user = _newUser(signer, { nonce }, status)\n if (!user) return console.error('NO USER', user)\n\n if (type === 'publishFeedAndPlan') _publishFeedAndPlan(user, { nonce }, status, args)\n else if (type === 'registerEncoder') _registerEncoder(user, { nonce }, status, args)\n else if (type === 'registerAttestor') _registerAttestor(user, { nonce }, status, args)\n else if (type === 'registerHoster') _registerHoster(user, { nonce }, status, args)\n else if (type === 'encodingDone') _encodingDone(user, { nonce }, status, args)\n else if (type === 'hostingStarts') _hostingStarts(user, { nonce }, status, args)\n else if (type === 'requestProofOfStorageChallenge') _requestProofOfStorageChallenge(user, { nonce }, status, args)\n else if (type === 'requestAttestation') _requestAttestation(user, { nonce }, status, args)\n else if (type === 'submitProofOfStorage') _submitProofOfStorage(user, { nonce }, status, args)\n else if (type === 'submitAttestationReport') _submitAttestationReport(user, { nonce }, status, args)\n // else if ...\n}", "async run(client, message, args){ //pokrece modul\n let member = message.mentions.members.first() || message.author || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(x => x.user.username === args.slice(0).join(\" \") || x.user.username === args[0])//ovo omogucava da tagujemo ljude kad koristimo komandu\n\n let gay = [//ovo nam definise odgovore\n '0',\n '1%',\n '5%',\n '10%',\n '15%',\n '20%',\n '23%',\n '100%',\n '50%',\n '60%',\n '70%',\n '11%',\n '44%',\n '68%',\n '34%',\n '35%',\n '99%',\n '79%',\n '54%',\n '51%',\n '99%',\n '84%',\n ];\n let odgovor = gay[Math.floor(Math.random() * gay.length - 1)];//linija koda koja omogucava random slanje nekog od gore navedegih postotaka\n const gaypostotak = new Discord.MessageEmbed()//pravi discord message embed\n .setTitle('GAY MASINA')//naziv embeda\n .setDescription(`${member} je ${odgovor} gay :rainbow_flag: `)//opis embeda\n .setColor('RANDOM')//postavlja random boju za svaki embed\n\n message.channel.send(gaypostotak)//salje embed u kanal u koji je napisana komanda\n }", "async quote (params) {\n await this.factory.connect()\n\n // save a webfinger call if it's on the same domain\n const receiver = this.utils.resolveSpspIdentifier(params.destination)\n debug('making SPSP quote to', receiver)\n\n return ILP.SPSP.quote(\n await this.factory.create({ username: params.user.username }),\n {\n receiver,\n sourceAmount: params.sourceAmount,\n destinationAmount: params.destinationAmount\n }\n )\n }", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\nhdPrivateKey.network = bitcore.Networks.get(\"openchain\");\nvar derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\nconsole.log(\"Passphrase is: \" + code.toString() + \"\\nWalletID: \" + derivedKey.privateKey.toAddress().toString());\n\n}", "execute(message, args) {\n const taggedUser = message.mentions.users.first();\n message.channel.send(`Jo ${taggedUser.username}, iemand probeert je de ober uit te trappen`);\n }", "async onRegisterCommand(player) {\n if (!this.settings_().getValue('playground/enable_beta_features')) {\n if (!this.registrationDialogCache_)\n this.registrationDialogCache_ = JSON.parse(readFile(kRegistrationFile));\n\n const message = this.registrationDialogCache_.join('\\r\\n');\n return alert(player, { message });\n }\n\n // Don't let players re-register their own account.\n if (player.account.isRegistered() || player.account.isIdentified()) {\n return await alert(player, {\n title: 'Register your account',\n message: `You are already logged in to an account. Join as a new user first.`,\n });\n }\n\n // Don't let the |player| register the account if an account with that name already exists.\n // This shouldn't ever happen unless the database connection was busted when they connected\n // to the server, but better to guard against it to make sure stuff doesn't mess up.\n const summary = await this.database_.getPlayerSummaryInfo(player.name);\n if (summary !== null) {\n return await alert(player, {\n title: 'Register your account',\n message: `An account named \"${player.name}\" already exists.`,\n });\n }\n\n // Give the |player| multiple attempts to pick a reasonably secure password. We don't set\n // high requirements, but we do need them to be a little bit sensible with their security.\n const password = await Question.ask(player, {\n question: 'Register your account',\n message: 'Enter the password to use for your account',\n isPrivate: true, // display this as a password field\n constraints: {\n validation: AccountCommands.prototype.isSufficientlySecurePassword.bind(this),\n explanation: 'The password must be at least 8 characters long, and contain at ' +\n 'least one number, symbol or a character of different casing.',\n abort: 'Sorry, you need to have a reasonably secure password!'\n }\n });\n\n if (!password)\n return; // the user aborted out of the flow\n\n // The |player| must confirm that they indeed picked the right password, so we ask again.\n const confirmPassword = await Question.ask(player, {\n question: 'Register your account',\n message: 'Please enter your password again to verify.',\n isPrivate: true, // display this as a password field\n constraints: {\n validation: input => input === password,\n explanation: 'You must enter exactly the same password again to make sure that ' +\n 'you didn\\'t accidentally misspell it.',\n abort: 'Sorry, you need to confirm your password!'\n }\n });\n\n if (!confirmPassword)\n return; // the user aborted out of the flow\n\n await this.database_.createAccount(player.name, password);\n\n // Tell other administrators about the new account, giving everyone some opportunity to know\n // what's going on. Not least of all the people watching through Nuwani.\n this.announce_().announceToAdministrators(\n Message.ACCOUNT_ADMIN_CREATED, player.name, player.id);\n\n await alert(player, {\n title: 'Register your account',\n message: `Your account for \"${player.name} has been created. You will be forced to ` +\n `reconnect after dismissing this dialog.`,\n });\n\n player.kick();\n }", "function createChannel() {\n asdb.create.channel({\n // UNCOMMENT THESE IN ORDER TO SAVE AGAIN\n //title: \"Bounty\",\n //type: \"Farmers Market\",\n //aka: \"Dallas\"\n }).then(function success(s) {\n console.log('SUCCESS:');\n console.log(s);\n }).catch(function error(e) {\n console.log('ERROR:');\n console.log(e);\n });\n}", "static setup({settings, user: {email, password, username}}) {\n\n // Validate the settings first.\n return SetupService\n .validate({settings, user: {email, password, username}})\n .then(() => {\n return SettingsService.update(settings);\n })\n .then((settings) => {\n\n // Settings are created! Create the user.\n\n // Create the user.\n return UsersService\n .createLocalUser(email, password, username)\n\n // Grant them administrative privileges and confirm the email account.\n .then((user) => {\n\n return Promise.all([\n UsersService.addRoleToUser(user.id, 'ADMIN'),\n UsersService.confirmEmail(user.id, email)\n ])\n .then(() => ({\n settings,\n user\n }));\n });\n });\n }", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, '[email protected]','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', '[email protected]', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', '[email protected]', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "async function createGuest(guestInfo){\n await guest.create(guestInfo)\n}", "_sendInvitation(user, password) {\n return this.mailer.invite({email: user.email, password: password})\n }", "function createThisPlayer(userName){\n // Create a ship for this browser\n makePlayer(false, { userName: userName });\n // Tell the other players that this browser just connected\n socket.emit('newPlayer' , { userName: userName, x: 40, y: 40, radian: 0 });\n }", "function createUser() {}", "function sendNutriMessage(recipientID,name){\n getNutri('https://tsechatbot.myshopify.com/admin/products/'+name+'/metafields.json',recipientID,name);\n}", "function invitePlayers(guild, host) {\n\tconsole.log(\"Inviting Players\");\n\tisActiveGame = true;\n\t\n\tconst hostRole = guild.roles.find(role => role.name === \"Host\");\n\tconst everyoneRole = guild.roles.find(role => role.name === \"@everyone\");\t\n\t\n\thost.addRole(hostRole).catch(console.error);\t\t\t\n\tfillRoleArray(guild);\n\t\n guild.createChannel('join-game','text').then(channel => {\n channel.send(\"@here, \" + host.toString() + \" wants to start a game, please message !play if you want to join\")}).catch(console.error);\n\t\t\n guild.createChannel('host','text').then(channel => {\n channel.send(\"This channel is for hosts to mesage the bot privatly\");\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions(hostRole, { VIEW_CHANNEL: true });\n });\n}", "async sign() {\n const { room, storage } = this.swap\n\n this.storage.update({\n isSignFetching: true,\n })\n\n await this.ethSwap.sign(\n {\n myAddress: storage.data.me.ethData.address,\n participantAddress: storage.data.participant.eth.address,\n },\n (signTransactionUrl) => {\n this.storage.update({\n signTransactionUrl,\n })\n }\n )\n\n this.storage.update({\n isSignFetching: false,\n isMeSigned: true,\n })\n\n room.sendMessage(storage.data.participant.peer, [\n {\n event: 'swap:signed',\n data: {\n orderId: storage.data.id,\n },\n },\n ])\n\n const { isMeSigned, isParticipantSigned } = this.storage.data\n\n if (isMeSigned && isParticipantSigned) {\n this.finishStep()\n }\n }", "async addMembersToTalk(parent, args, ctx, info) {\n // check login\n if (!ctx.request.userId) {\n throw new Error('You must be logged in to do that!');\n }\n // check that the user is the member of the talk\n // TODO\n\n // add new members\n // transform array of members\n const members = args.members.map(member => ({ id: member }));\n return ctx.db.mutation.updateTalk(\n {\n data: {\n members: {\n connect: members,\n },\n },\n where: {\n id: args.id,\n },\n },\n info\n );\n }", "function claimButtonClicked() { \n console.log(\"ejecución 1\")\n web3.eth.getAccounts(function(error, accounts) { \n if (error) { \n console.log(error)\n return\n }\n //console.log(\"ejecución 2\")\n var account = web3.eth.defaultAccount;\n\n var starName = document.getElementById(\"star-name-input\").value;\n var starStory = document.getElementById(\"star-story-input\").value;\n var star_dec = document.getElementById(\"star-dec-input\").value;\n var star_mag = document.getElementById(\"star-mag-input\").value;\n var star_cent = document.getElementById(\"star-cent-input\").value;\n var star_token = document.getElementById(\"star-token-input\").value;\n\n\n\n starNotary.createStar(starName, starStory, star_dec, star_mag, star_cent, star_token, {from: account, gasLimit:\"5000000\"}, function (error, result) {\n if (!error) {\n document.getElementById(\"result\").innerHTML = \"Transaction: <a href='https://rinkeby.etherscan.io/tx/\"+result+\"' target='_blank'>\"+result+\"</a>\";\n document.getElementById(\"star-tx-input\").value = star_token = document.getElementById(\"star-token-input\").value;\n } else { \n console.log(error);\n console.log(\"errorrrr\");\n }\n });\n \n });\n \n}", "function createAccount() {\n try {\n const tronWeb = new TronWeb(fullNode, solidityNode, eventServer);\n return tronWeb.createAccount();\n\n } catch (error) {\n console.log(error);\n throw error;\n }\n}", "async send (recipient, amount, denom = 'uscrt', memo = \"\") {\n if (typeof amount === 'number') amount = String(amount)\n return await this.API.sendTokens(recipient, [{denom, amount}], memo)\n }", "index({ params }, res) {\n\t\tvar password = Math.random().toString(36).slice(-8);\n\n\t\tweb3.eth.personal.newAccount(password).then((address) => {\n\t\t\tres.json({\n\t\t\t\tpassword, address\n\t\t\t});\n\t\t}).catch((ex) => {\n\t\t\tconsole.error(ex);\n\t\t\tres.json({ error: true });\n\t\t})\n\n\t}", "async function ClaimConfirm(userID, guildID, cardID) {\n try {\n await client.query(\"BEGIN\");\n await client.query(`UPDATE ${spawnDb} SET card_id = null, card_name = null WHERE guild_id = $1`, [guildID]);\n await client.query(`INSERT INTO ${userInv}(user_id, card_id) VALUES ($1, $2)`, [userID, cardID]);\n client.query(\"COMMIT\");\n } catch (e) {\n client.query(\"ROLLBACK\");\n console.log(e);\n }\n}", "async function signup ({ message, reply }) {\n const data = validate(message.payload, schema)\n\n const user = {\n _id: Shortid.generate(),\n email: data.email\n }\n\n const session = {\n userId: user._id,\n email: user.email\n }\n\n const accessToken = Auth.createToken(session)\n\n reply({ topic: 'signup', payload: { user, accessToken }, session })\n}", "function sendAllTourAuth(message) {\r\n for (var x in sys.playersOfChannel(tourschan)) {\r\n var arr = sys.playersOfChannel(tourschan);\r\n if (isMegaUser(arr[x])) {\r\n sys.sendMessage(arr[x], message, tourschan);\r\n }\r\n }\r\n}", "function signup(username, password) {\n // TODO: create new user\n}", "function toAdd(){\n let date = new Date\n let year = date.getFullYear()\n const conn = new Client();\n conn.on('ready', function(user) {\n console.log('Client :: ready');\n\n users[year].forEach(e=>{\n conn.exec(`ppp secret add name=${e.username} password=${e.password} service=\"pppoe\" profile=${e.type} comment= \"${e.name} ${e.number}\"`, data=> console.log(\"added\"))\n //set\n conn.exec(`ppp secret set [find name=\"${e.username}\"] password=\"${e.password}\" profile=\"${e.type}\" comment=\"${e.name} ${e.number}\"`, data=>console.log(\"done\"))\n })\n }).connect({\n host: '192.168.93.93',\n port: 22,\n username: 'admin',\n password : \"\",\n privateKey: require('fs').readFileSync('./key.ppk')\n });\n }", "function register(name, pwd) {\n send(json_get_register_message(name, pwd));\n}", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "function createanonuser(ctx, passwordkey, invitecode, invitename, uh) {\n ctx.callback = createanonuser2;\n ctx.passwordkey = passwordkey;\n api_createuser(ctx, invitecode, invitename, uh);\n}", "async function createNewUser(username, password) {\n const newClient = this.create({\n username: username,\n password: password,\n stats: { XP: 0, correct: 0, incorrect: 0 },\n });\n return newClient;\n}", "function anotherMember() {\n inquirer\n .prompt([\n {\n type: 'list',\n message: 'Would you like to add another team member?',\n choices: ['Manager', 'Engineer', 'Intern', 'None'],\n name: 'type',\n },\n ])\n .then((response) => {\n switch (response.type) {\n case 'Manager':\n managerQs();\n break;\n case 'Engineer':\n engineerQs();\n break;\n case 'Intern':\n internQs();\n break;\n default:\n generateHTML();\n break;\n }\n });\n}", "sendInvite(address) {\n console.log('SEND INVITE');\n this\n .setOtherAddress(address)\n .contractInstance\n .init(this.otherAddress, this.gx, {from: this.accountAddress});\n }", "register({ username, email, firstName, lastName, password }) {\n return apiClientEmail.post('/user', {\n username,\n email,\n firstName,\n lastName,\n password,\n })\n }", "async function sign() {\n const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });\n const account = accounts[0];\n const name = document.getElementById(\"name\").value;\n const guess = document.getElementById(\"guess\").value;\n const bounty = await Riddle.methods.bounty().call();\n bid = parseInt(bounty) + 10;\n const transactionParameters = {\n from: account,\n gasPrice: 0x1D91CA3600,\n value: bid\n };\n await Riddle.methods.riddle_guess(name, guess).send(transactionParameters);\n}", "function callGuestOrAccCreationOrLogged() {\n\tif(intervalForServiceFee){\n\t\tclearIntervalApp(intervalForServiceFee);\n\t}\n\tdeActivateCheckoutPayButton(); \n var registerUser = parseBoolean(localStorage.getItem(\"registerUser\"));\n if (!registerUser) {\n if (!isGrtr) {\n updateUserProfileCheckout();\n } \n } else {\n \tif(isPromocodeJsonTypeAvailable()){\n \t\tif(!verifyPromocode()){\n \t \treturn;\n \t }\n \t}\n \tclearIntervalApp(timeIntevalOfAddCard);\n \tcallAddCardOrSubmitCard();\n }\n}", "async function createNewAccountNode(){\n const password = 'Password'\n const newAccount = await web3.eth.personal.newAccount(password);\n console.log(chalk.cyan(newAccount));\n console.log(chalk.white(\"###### Unlocking the newly created account ########\"));\n let status = await web3.eth.personal.unlockAccount(newAccount, password, 600);\n console.log(chalk.green('Account unlock status: ' + status));\n}", "function createRequestedPlayer() {\n\tvar col = playerColors[Math.floor(Math.random() * playerColors.length)];\n\tsend({\n\t\ttype: \"createInstance\", \n\t\tcollection: \"entities\", \n\t\tdata: {\n\t\t\tid: uniqueID(), \n\t\t\tdiagramID: \"1\", \n\t\t\tclass: \"actor\", \n\t\t\tdrawType: \"actor\", \n\t\t\tname: document.getElementById(\"name\").value, \n\t\t\tcolor: col, \n\t\t\tcolor2: \"dark\" + col, \n\t\t\tposX: 4, \n\t\t\tposY: -1.5, \n\t\t\tsize: 0.75, \n\t\t\tangle: 0\n\t\t}\n\t}, function(data){\n\t\tconsole.log(\"a player has been added!\");\n\t});\n}", "async run(msg, args) {\n util.trackAction(msg, \"vainsocial-guild-create\");\n const guildCreateView = new GuildCreateView(msg, msg.author.id);\n if (msg.guild.id != 283790513998659585)\n return await guildCreateView.error(oneLine`\nGuilds creation is currently running in closed beta.\nIf you want to participate, join our development Discord: https://discord.gg/txTchJY\n`);\n try {\n await api.post(\"/guild\", {\n shard_id: args.region,\n name: args.name,\n identifier: args.tag,\n user_token: msg.author.id\n });\n } catch (err) {\n console.error(err);\n return await guildCreateView.error(err.error.err);\n }\n await guildCreateView.respond();\n }", "async connect() {\n Channel.botMessage('Welcome to Routefusion Chat!\\n\\n');\n this.user = await this.setUser();\n this.greetUser();\n }", "async capturePrice(step) {\n const user = await this.userProfile.get(step.context, {});\n\n const { ActionTypes, ActivityTypes, CardFactory } = require('botbuilder');\n\n const reply = { type: ActivityTypes.Message };\n\n // // build buttons to display.\n const buttons = [\n { type: ActionTypes.ImBack, title: '1. 💰', value: '1' },\n { type: ActionTypes.ImBack, title: '2. 💰💰', value: '2' },\n { type: ActionTypes.ImBack, title: '3. I do not care', value: '3' }\n ];\n\n // // construct hero card.\n const card = CardFactory.heroCard('', undefined,\n buttons, { text: 'For how much do you want to eat ?' });\n\n // // add card to Activity.\n reply.attachments = [card];\n\n // // Send hero card to the user.\n await step.context.sendActivity(reply);\n}", "async createAccount(ctx, name) {\n const userId = ctx.clientIdentity.getID();\n const newAccount = {\n ID: userId,\n Name: name,\n Balance: 0,\n AuthedParties: {},\n };\n ctx.stub.putState(userId, Buffer.from(JSON.stringify(newAccount)));\n return JSON.stringify(newAccount);\n }", "function startGame(guild,data) {\n\tconsole.log(\"Starting Game\");\n\t\n\tconst villagerRole = guild.roles.find(role => role.name === \"Town\");\n const everyoneRole = guild.roles.find(role => role.name === \"@everyone\");\n\tconst ghostRole = guild.roles.find(role => role.name === \"Dead\");\n const hostRole = guild.roles.find(role => role.name === \"Host\");\n\n\tnumAlive = numPlayer;\n\t\n\tisGameStarted = true;\n\tisDay = true;\n selectRoles(guild,data);\n guild.fetchMembers().then(r => {\n\t\tr.members.array().forEach(user => createUserChannels(user,guild))});\n\t\t\n guild.createChannel('day','text').then(channel => {\n channel.send(\"Welcome \" + villagerRole.toString() + \" to your first day!\");\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n \tchannel.overwritePermissions( \n\t\t villagerRole, \n\t\t { VIEW_CHANNEL: true });\n channel.overwritePermissions( \n\t\tghostRole, \n\t\t{\tVIEW_CHANNEL: true,\n\t\t\tSEND_MESSAGES: false,\n ADD_REACTIONS: true});\n outputGroups(channel);\n });\n guild.createChannel('dead','text').then(channel => {\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions( \n\t\tghostRole, \n\t\t{\tVIEW_CHANNEL: true,\n\t\t\tSEND_MESSAGES: true,\n ADD_REACTIONS: true});\n });\n \n guild.createChannel('night-werewolf','text').then(channel => {\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions(hostRole, { VIEW_CHANNEL: true });\n channel.overwritePermissions(ghostRole, { SEND_MESSAGES: false, ADD_REACTIONS: false });\n });\n \n guild.createChannel('day-voice','voice').then(channel => {\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions( \n\t\t villagerRole, \n\t\t { VIEW_CHANNEL: true });\n\n\t channel.overwritePermissions( \n\t\t ghostRole, \n\t\t {\tVIEW_CHANNEL: true,\n\t\t\tSPEAK: false});\n \n everyoneGetInHere(guild,channel);\n });\n\t\n guild.channels.find(channel => channel.name === \"join-game\").delete();\n}", "function _inviteUserToChat(theirId, senderName, chatId) {\r\n let insert = `INSERT INTO chatmembers(memberid, chatid) VALUES ($1,$2)`\r\n\r\n return db.none(insert, [theirId, chatId])\r\n .then(() => {\r\n return db.oneOrNone('SELECT * FROM FCM_Token WHERE memberid=$1', [theirId])\r\n }).then(rows => {\r\n fcm_functions.notifyChatRequest(rows['token'], senderName, chatId);\r\n }).catch(err => _handleDbError(err));\r\n}", "onSendToken() {\n const {activity} = this.state;\n if (activity === \"registerNewEmail\") {\n const {contactAddress, contactType} = this.state;\n this.doTokenRequest(\"POST\", \"/auth/newContact/sendVerify\", \"sendCode\",\n {contactAddress, contactType});\n } else {\n const {username} = this.state;\n this.doTokenRequest(\"POST\", \"/auth/user/sendVerify\",\n \"sendCode\", {username});\n }\n\n }", "async function createAccount() {\n // now there are 2 ways to generate account\n // 1. input private key and added to wallet\n // 2. input seedphrase and added to wallet\n\n // for better end-user experience, like meta-mask does, the working flow like this:\n // 1. give account a name, it should be done by app as shown to user, not sdk.\n // perhaps store it in localstorage or some front-end database\n\n const accountName = 'My First Account'\n\n // 2. ask user to input password and confirm again\n // if we pass the 2-times-validator\n // we then use the password later\n\n let password\n\n const passwordFirst = 'MyVeryStrongPassword'\n logOutPut('input password first time', passwordFirst)\n\n const passwordConfirmed = 'MyVeryStrongPassword'\n logOutPut('input password second time', passwordConfirmed)\n\n if (passwordFirst !== passwordConfirmed) {\n throw new Error('password is not correct')\n }\n\n password = passwordConfirmed\n\n logOutPut('Your password is', password)\n\n // 3. generate seed phrase, according to BIP-44, and ask user to write it down\n const seed = Wallet.generateMnemonic()\n\n // see log here:\n logOutPut('seed phrase created', seed)\n\n // 2. then add the seed phrase to wallet, each phrase can generate multiple accounts using index.\n // that actually create different private keys, however user don't want to remember them all.\n // we use 0 to use the first index according to BIP-39\n // please note that same seed and same index, generate same privateKey, which is constant.\n // just for example , we add one account each time.\n // note that the first account will be the signer of wallet\n\n const signer = harmony.wallet.addByMnemonic(seed, 0)\n\n // 3. now the account is created, but it is not encrypted yet, we use the password that user confirmed earlier.\n // how ever the encrypt process is async, because it may cause your app runs encryption.\n // we use `Wallet.encryptAccont(address:string, password:string)` to encrypt the account\n\n await harmony.wallet.encryptAccount(signer.address, password)\n\n // 4. now the private key is encrypted to keystore format.\n\n logOutPut('your private key is encrypted to KeyStore', signer.privateKey)\n\n logOutPut(\n 'Account.encrypted also show encryption state is:',\n signer.encrypted\n )\n\n // 5. you can print out Account address.\n\n logOutPut('Account address is:', signer.address)\n\n // 6. but to user, you had better show them checksumAddress\n\n logOutPut('Account checksumAddress is:', signer.checksumAddress)\n\n // 7. now you can save account name, account address to local storage.\n // note: NEVER store privatekey to local storage\n\n const accountInfo = {\n accountName,\n address: signer.checksumAddress\n }\n\n logOutPut('Account is to be saved:', accountInfo)\n\n // now if you want to get account instance from wallet\n // use Wallet.getAccount(address:string)\n // we just use accountInfo object above as query\n\n const foundAccount = harmony.wallet.getAccount(accountInfo.address)\n\n logOutPut('Account is found:', foundAccount)\n\n // whenever you want to encrypt an acount\n // use Wallet.decryptAccount(address:string,password:string)\n\n logOutPut('Signer is to encrypted:', harmony.wallet.signer.privateKey)\n\n await harmony.wallet.decryptAccount(\n harmony.wallet.signer.address,\n 'MyVeryStrongPassword'\n )\n\n logOutPut(\n 'Account is now decrypted, you got the private key:',\n harmony.wallet.signer.privateKey\n )\n\n // you can remove account from Wallet\n // but remember to delete localstorage as well\n // use Wallet.removeAccount(address:string)\n\n harmony.wallet.removeAccount(harmony.wallet.signer.address)\n\n logOutPut('wallet is cleaned up', harmony.wallet.accounts)\n}", "async onAccountCommand(currentPlayer, targetPlayer) {\n const player = targetPlayer || currentPlayer;\n\n if (!player.account.isRegistered()) {\n currentPlayer.sendMessage(Message.ACCOUNT_NOT_REGISTERED, player.name);\n return;\n }\n\n const features = {\n aliases: player.isVip() && this.getSettingValue('vip_alias_control'),\n changename: this.getSettingValue('nickname_control'),\n changepass: this.database_.canUpdatePasswords() &&\n this.getSettingValue('password_control'),\n information: this.getSettingValue('info_visibility'),\n record: this.getSettingValue('record_visibility'),\n sessions: this.getSettingValue('session_visibility'),\n\n // Special case: Beta-server features for amending otherwise immutable settings.\n beta: this.settings_().getValue('playground/enable_beta_features'),\n };\n\n const dialog = new Menu('Account management');\n\n // Enables the |player| to change their nickname. This can only be done a limited number of\n // times in a specific time period. Changing their nickname will immediately apply. This\n // option may only be used when the |player| is the current player.\n if (features.changename && player === currentPlayer) {\n dialog.addItem(\n 'Change your nickname',\n AccountCommands.prototype.changeNickname.bind(this, currentPlayer));\n }\n\n // Enables the |player| to change their password. The new password needs to be reasonably\n // secure, and match the password guidelines on the website. This option may only be used\n // when the |player| is the current player.\n if (features.changepass && player === currentPlayer) {\n dialog.addItem(\n 'Change your password',\n AccountCommands.prototype.changePassword.bind(this, currentPlayer));\n }\n\n // Enables the |player| to manage their aliases. VIPs are allowed a certain number of custom\n // names on top of their username, which they are able to control themselves.\n if (features.aliases) {\n dialog.addItem(\n 'Manage nickname aliases',\n AccountCommands.prototype.manageAliases.bind(this, currentPlayer, targetPlayer));\n }\n\n // Enables the |player| to see information about their account.\n if (features.information) {\n dialog.addItem(\n 'View account information',\n AccountCommands.prototype.displayInfo.bind(this, currentPlayer, targetPlayer));\n }\n\n // Enables the |player| to view their record, with the exception of notes as they are only\n // accessible to administrators and Management members.\n if (features.record) {\n dialog.addItem(\n 'View player record',\n AccountCommands.prototype.displayRecord.bind(this, currentPlayer, targetPlayer));\n }\n\n // Enables the |player| to view their recent playing sessions, together with some basic\n // information that can be shown about the session.\n if (features.sessions) {\n dialog.addItem(\n 'View recent sessions',\n AccountCommands.prototype.displaySessions.bind(this, currentPlayer, targetPlayer));\n }\n\n // Enables the |player| to change their own settings, otherwise restricted to Management\n // members. They can give themselves VIP rights, and change their own level.\n if (features.beta) {\n dialog.addItem(\n '{90CAF9}[Beta] Manage your account',\n AccountCommands.prototype.displayManage.bind(this, currentPlayer, targetPlayer));\n }\n\n if (!dialog.hasItems()) {\n currentPlayer.sendMessage(Message.ACCOUNT_NOT_AVAILABLE);\n return;\n }\n\n return dialog.displayForPlayer(currentPlayer);\n }", "function sendInvite(user, options, sphere, isNew, accessTokenId) {\n let baseUrl = app.__baseUrl;\n if (isNew) {\n let acceptUrl = baseUrl + '/profile-setup';\n let declineUrl = baseUrl + '/decline-invite-new';\n\n let userIdFromContext = options && options.accessToken && options.accessToken.userId || undefined;\n const User = loopback.findModel('user');\n User.findById(userIdFromContext)\n .then((currentUser) => {\n emailUtil.sendNewUserInviteEmail(user, currentUser, sphere, acceptUrl, declineUrl, accessTokenId);\n })\n .catch((err) => {\n console.log(\"ERROR DURING sendInvite\", err);\n })\n }\n else {\n let acceptUrl = baseUrl + '/accept-invite';\n let declineUrl = baseUrl + '/decline-invite';\n\n let userIdFromContext = options && options.accessToken && options.accessToken.userId || undefined;\n const User = loopback.findModel('user');\n User.findById(userIdFromContext)\n .then((currentUser) => {\n emailUtil.sendExistingUserInviteEmail(user, currentUser, sphere, acceptUrl, declineUrl);\n })\n .catch((err) => {\n console.log(\"ERROR DURING sendInvite\", err);\n })\n }\n }", "async function SetSpawningChannel(guildID, channelID, settingChannel) {\n try {\n await client.query(\"BEGIN\");\n await client.query(`INSERT INTO ${spawnDb}(guild_id, channel_id, last_spawn) VALUES ($1, $2, 0)`, [guildID, channelID]);\n client.query(\"COMMIT\");\n } catch (e) {\n await client.query(\"ROLLBACK\");\n if (settingChannel) {\n client.query(`UPDATE ${spawnDb} SET channel_id = $1 WHERE guild_id = $2`, [channelID, guildID]);\n console.log(`Guild spawn set to ${channelID}`);\n }\n }\n}", "function register(){\n\t\tif(websocket){\n\t\t\twebsocket.send(\"game.inbound.GameRegistrationMessage\",{\n\t\t\t\t\t\ttransactionId:new Date().getTime(),\n\t\t\t\t\t\tuserSessionId:SESSION_ID,\n\t\t\t\t\t\tuserType:\"USER_TYPE_PLAYER\"\n\t\t\t\t\t});\n\t\t}\n\t}", "async function updateNickname(guild, coin) {\n const testdata = await fetch(`https://api.pancakeswap.info/api/tokens/${pancake}`).then(response => response.text()); // get data as raw\n let realdata = JSON.parse(testdata) // convert data to json\n mprice = (realdata['data']['price'] * multiplier).toFixed(5);\n return guild.me.setNickname(`$${mprice}`);\n}", "register (credentials) {\n return Api().post('register', credentials)\n }", "function registerCreator(transaction, done, injectToken = false) {\n console.log('registering creator')\n var uri = transaction.protocol + '//' + transaction.host + '/agitator/users/'\n rp({\n method: 'POST',\n uri: uri,\n body: {\n email: creatorEmail,\n password: creatorPassword,\n first_name: creatorFirstName,\n last_name: creatorLastName\n },\n json: true // Automatically stringifies the body to JSON)\n })\n .then(function (parsedBody) {\n var token = parsedBody.token.string\n saveToken(token, 'creator')\n if (injectToken) {\n transaction.request.headers.Authorization = 'Bearer ' + token\n }\n done()\n\n })\n .catch(function (err) {\n console.log('could not register user: ' + err)\n done()\n })\n}", "function create_user(userobject){\n\n}", "function createUserObj(name)\n {\n var userObj = {userName:name};\n sendRequest(userObj, \"channels\", setChannelInfo);\n }", "register(credentials){\n return Api().post('register', credentials); \n }" ]
[ "0.6132298", "0.5986284", "0.58800316", "0.5826678", "0.5746144", "0.5742082", "0.56690496", "0.56596005", "0.5641064", "0.56408376", "0.56162", "0.55959916", "0.55750436", "0.5573975", "0.55138916", "0.55117965", "0.55003226", "0.5472459", "0.54669696", "0.54669696", "0.54669696", "0.54669696", "0.54669696", "0.545303", "0.54440695", "0.5420308", "0.54139245", "0.5407711", "0.53756475", "0.53742033", "0.53734255", "0.53734255", "0.5364024", "0.53427494", "0.53167385", "0.5315928", "0.5313296", "0.5304618", "0.53024215", "0.53021884", "0.5280886", "0.5274641", "0.5273825", "0.5271238", "0.5260308", "0.5258218", "0.5252801", "0.5246607", "0.52385044", "0.52334374", "0.5232725", "0.5225562", "0.52183276", "0.5212038", "0.5211214", "0.520616", "0.5205816", "0.52042675", "0.5202938", "0.5202464", "0.52012527", "0.5195522", "0.5192961", "0.51911575", "0.51907426", "0.5189099", "0.5187697", "0.5184368", "0.51782525", "0.51744866", "0.5173884", "0.51703626", "0.5169127", "0.5165721", "0.5163883", "0.515422", "0.5150489", "0.51491606", "0.5144761", "0.5143705", "0.51413554", "0.5140309", "0.51355875", "0.51168764", "0.5114849", "0.5104541", "0.5102678", "0.51026094", "0.51005673", "0.5097729", "0.50966865", "0.5095019", "0.50910825", "0.5090419", "0.50899166", "0.50894994", "0.5084907", "0.5081741", "0.5079198", "0.507757", "0.5075628" ]
0.0
-1
Gets the Simbit account
function getShopUser(memberObj){ return data.users.find(user => { return user.id === memberObj.user.id.toString(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAccount() {\n const config = zxeth.getConf();\n\n return config.accounts[0];\n}", "async function getAccount() {\n return (await web3.eth.personal.getAccounts())[0];\n}", "get account () { return this.API.getAccount(this.address) }", "async function getAccount() {\n let account = \"No account\";\n if (web3.currentProvider) {\n account = await web3.eth.getAccounts();\n }\n return account\n}", "async getAccount() {\n // need to call getAccount here?\n const cache = this.clientApplication.getTokenCache();\n const currentAccounts = await cache.getAllAccounts();\n\n if (currentAccounts === null) {\n console.log('No accounts detected');\n return null;\n }\n\n if (currentAccounts.length > 1) {\n // Add choose account code here\n console.log('Multiple accounts detected, need to add choose account code.');\n return currentAccounts[0];\n } else if (currentAccounts.length === 1) {\n return currentAccounts[0];\n } else {\n return null;\n }\n }", "getAccount() {\n return super.getAsNullableString(\"account\");\n }", "get account() {\n\t\treturn this.__account;\n\t}", "async getAccount() {\n if (this.accountP) {\n return this.accountP;\n }\n const account = new Account(this.accountFilePath);\n await account.restore();\n return account;\n }", "function getAccount() {\n var result;\n UserAccount.findOne({ username: req.body.username }).exec();\n return result;\n }", "async function getAccount() {\n /* eslint-disable prefer-const */\n let payload = {\n 'username': 'mateo.randulfe',\n 'password': 'efludnar.oetam',\n };\n\n try {\n let data = await axios.post(api+'/auth/token', payload);\n let account = {\n token: data.data.token,\n id: data.data.user.permissions[0].accountId,\n };\n return account;\n } catch (e) {\n return e.message;\n }\n}", "account() {\n return new Account(this.getSDK(), this.getToken());\n }", "static async getAccount(accountId){\n try{\n const account = await this.server.accounts()\n .accountId(accountId).call()\n return account\n } catch (error) {\n console.log(\"An error ocurred trying to load account.\")\n console.log(error) \n throw error \n }\n }", "loadAccounts() {\n return this.web3.eth.getAccounts()\n .then((accounts) => {\n this.account = (accounts[0]);\n return this.account;\n }).catch((e) => {\n console.log(\"Error in getting account\", e);\n });\n }", "getAccount(accountId: string): Promise<Account> {\n return this._member.getAccount(accountId);\n }", "function retrieveMyAccount() {\n return function ( dispatch, getState ) {\n const { authenticationToken } = getState();\n const headers = isServer ? { internal: 'TRUE', 'Access-Token': authenticationToken } : { };\n return fetch(`${BACKEND_URL}/i/user?query={username,name,avatar}`, {\n method : 'get',\n credentials : 'include',\n headers,\n })\n .then(res => res.json())\n .then(res => (res.error ? Promise.reject(res.error) : res))\n .then(\n res => {\n const { data: {\n name: fullname = defaults.fullname,\n username = defaults.username,\n avatar = defaults.avatar,\n } = { } } = res;\n dispatch({ type: actions.SetAccountUsername, username });\n dispatch({ type: actions.SetAccountFullname, fullname });\n dispatch({ type: actions.SetAccountAvatar, avatar });\n return false;\n },\n err => err,\n )\n }\n}", "async function getAccount() {\n if (!window.ethereum) {\n console.log(\"MetaMask not installed\")\n return false;\n }\n\n let status = false;\n await window.ethereum.request({ method: 'eth_accounts' })\n .then((accounts) => {\n if (accounts.length) {\n acc = accounts[0];\n status = true;\n }\n })\n .catch((err) => {\n // Some unexpected error.\n // For backwards compatibility reasons, if no accounts are available,\n // eth_accounts will return an empty array.\n console.error(err);\n });\n return status;\n}", "getUserWallet() {\n return Api.get(\"/client/user-wallet\");\n }", "function getAccount() {\r\n let adr = address.value;\r\n let sanitizedAdr = adr.toUpperCase().replace(/-|\\s/g, \"\");\r\n if (adr == \"\") {\r\n address.focus();\r\n return false;\r\n }\r\n _doGet('/account/get?address=' + sanitizedAdr);\r\n }", "getAccount(accountKey) {\n const account = this.getItem(accountKey);\n if (msalCommon.AccountEntity.isAccountEntity(account)) {\n return account;\n }\n return null;\n }", "function _getAccountToken() {\n let accountToken = localStorageModule.getItem(_accountTokenLocalstorageKey);\n if (accountToken === null || accountToken === undefined || accountToken === \"undefined\") {\n accountToken = _uuidv4();\n _storeValueInLocalStorage(_accountTokenLocalstorageKey, accountToken); \n }\n \n return accountToken;\n}", "function returnUseraccount(){\n\n return user_account;\n\n}", "getAccountInfo() {\n return request(`${this.locationPrefix}/account/info`, 'GET', this.config);\n }", "getApiAccount(account) {\n return __awaiter(this, void 0, void 0, function* () {\n const formattedBattleTag = yield utils_1.formatBattleTag(account);\n return yield this._handleApiCall(`/d3/profile/${formattedBattleTag}/`, 'Error fetching profile information.');\n });\n }", "async function readAccount() {\n const key = JSON.parse(process.env.KEY);\n\n const address = await arweave.wallets.jwkToAddress(key);\n console.log(\"address\", address);\n\n const lastTransactionId = await arweave.wallets.getLastTransactionID(address);\n console.log(\"lastTransactionId\", lastTransactionId);\n}", "async getActiveAccount() {\n var _a, _b, _c;\n if (this.account) {\n return this.account;\n }\n const cache = (_b = (_a = this.confidentialApp) === null || _a === void 0 ? void 0 : _a.getTokenCache()) !== null && _b !== void 0 ? _b : (_c = this.publicApp) === null || _c === void 0 ? void 0 : _c.getTokenCache();\n const accountsByTenant = await (cache === null || cache === void 0 ? void 0 : cache.getAllAccounts());\n if (!accountsByTenant) {\n return;\n }\n if (accountsByTenant.length === 1) {\n this.account = msalToPublic(this.clientId, accountsByTenant[0]);\n }\n else {\n this.logger\n .info(`More than one account was found authenticated for this Client ID and Tenant ID.\nHowever, no \"authenticationRecord\" has been provided for this credential,\ntherefore we're unable to pick between these accounts.\nA new login attempt will be requested, to ensure the correct account is picked.\nTo work with multiple accounts for the same Client ID and Tenant ID, please provide an \"authenticationRecord\" when initializing a credential to prevent this from happening.`);\n return;\n }\n return this.account;\n }", "async getWeb3Account() { return getDefaultAccount(this._web3) }", "getAccount() {\n return this.props.account;\n }", "getAccount() {\n return this.props.account;\n }", "static async getIdentity (txid) {\n const parsed = await cashaccount.accountLookupViaTxid(txid)\n if (parsed === undefined) {\n return\n }\n const account = await cashaccount.parseBitdbObject(parsed)\n return account\n }", "function getCurrentLoggedInUserAccount() {\n\t//access to the db\n\t//confirm they have proper credentials\n\treturn \"Kimberly\";\n}", "function fetchAccount(token, callback) {\n\taccess_token = \"Bearer \" + token;\n\taxios({\n\t\tmethod: 'get',\n\t\turl: ACCOUNTS_URL,\n\t\theaders: {\n\t\t\t\"Authorization\": access_token,\n\t\t\t\"uuid\": SAMPLE_UUID,\n\t\t\t\"Accept\": ACCEPT,\n\t\t\t\"client_id\": CLIENT_ID\n\t\t}\n\t}).then(function(response){\n\t\tvar successfulAccount = JSON.stringify(response.data, undefined, 2);\n\t\tcallback(null, successfulAccount);\n\t\t}).catch(function(error){\n\t\t\tcallback(error, null);\n\t\t});\n}", "function getAnalyticsAccount(){\n for (var toolid in _satellite.tools){\n if (_satellite.tools[toolid].settings.engine == \"sc\"){\n return _satellite.tools[toolid].settings.account;\n }\n }\n}", "function GetAccount(name) {\n return client.database.getAccounts([name]);\n }", "async function getAccount(address) {\n if (address == null) {\n return null;\n }\n var response = await restGet(`/auth/accounts/${address}`);\n var account;\n try {\n account = response.data.result.value;\n } catch (e) {\n return null;\n }\n\n if (account.address == \"\") {\n return null;\n }\n return account;\n}", "getAccount(peerAddr) {\n let accts = globalState.get('000-reputation-accounts');\n for (let pa of Object.keys(accts)) {\n if (pa === peerAddr) {\n return accts[peerAddr];\n }\n }\n return null;\n }", "async getAccount(id){\n // console.log('Getting account...');\n data = {\n URI: `${ACCOUNTS}/${id}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "getAccounts() {\n this.props.web3Client.eth.getAccounts((err, result) => {\n console.log(result);\n });\n }", "get accountSid() {\n return this.callInfo.accountSid;\n }", "getAccount(id)\n {\n if (typeof(id) == \"object\")\n id = id.id\n\n return this.accounts.find(x => x.id == id) || null\n }", "get(key) {\n let account = this.lookup(key);\n if (!account) {\n account = new ethereumjs_account_1.default();\n }\n return account;\n }", "fetchUserAccount() {\n if ( !this._apikey || !this._ajax ) return;\n\n this._ajax.get( this.getSignedUrl( '/v3/account' ), {\n type: 'json',\n headers: { 'X-MBX-APIKEY': this._apikey },\n\n success: ( xhr, status, response ) => {\n let balances = this.parseUserBalances( response );\n this.emit( 'user_balances', balances );\n this.emit( 'user_data', true );\n },\n error: ( xhr, status, error ) => {\n this.emit( 'user_fail', error );\n this.stopUserStream();\n }\n });\n }", "async getAccount(searchAddress) {\n const account = await this.queryClient.auth.account(searchAddress);\n return account ? accountFromProto(account) : null;\n }", "async function getMetamaskAccount() {\r\n\tvar map = {};\r\n\tmap[\"id\"] = \"getWalletAddress\";\r\n\tmap[\"address\"]=\"0\";\r\n\r\n\ttry {\r\n\t const accounts = await ethereum.request({ method: 'eth_requestAccounts' });\r\n\t\tmap[\"address\"] = accounts[0];\r\n\t\tweb3 = new Web3(window.ethereum);\r\n\t\tconsole.log(web3);\r\n\t\tconsole.log(map[\"address\"]);\r\n\r\n\t} catch(error) {\r\n\t\tconsole.log(\"User rejected request\");\r\n\t}\r\n\tGMS_API.send_async_event_social(map);\r\n}", "get defaultAccount() {\r\n if (this.accounts.length === 0) {\r\n throw new Error(\"No accounts available in this Wallet!\");\r\n }\r\n for (const acct of this.accounts) {\r\n if (acct.isDefault) {\r\n return acct;\r\n }\r\n }\r\n for (const acct of this.accounts) {\r\n if (acct.tryGet(\"privateKey\") || acct.tryGet(\"WIF\")) {\r\n return acct;\r\n }\r\n }\r\n for (const acct of this.accounts) {\r\n if (acct.encrypted) {\r\n return acct;\r\n }\r\n }\r\n return this.accounts[0];\r\n }", "returnAccount(accountName) {\r\n const accountIndex = this.findAccountIndex(accountName);\r\n if (accountIndex > -1) {\r\n return this._accountList[accountIndex]; // return the account object ref\r\n } else {\r\n return 'Account not found'; // return a failure message\r\n }\r\n }", "loadWeb3Account() {\n const privateKey = wif.decode(this.pvtKey.toWIF()).privateKey\n const privateKeyEth = `${\"0x\"}${privateKey.toString(\"hex\")}`\n // this.logPrivateKeys({ privateKey, privateKeyEth })\n const account = this.web3Accounts.privateKeyToAccount(privateKey)\n this.pvtKeyEth = account.privateKey\n // this.logAccount({ account })\n return account\n }", "static getActive() {\n\t\t\t\treturn _activeAccount;\n\t\t\t}", "getAccountId() {\n return this._authData.accountId || '';\n }", "getUserBanks() {\n return this.api.send('GET', 'user/bank_account');\n }", "static async getPendingIdentity (txid) {\n const parsed = await cashaccount.registrationLookupViaTxid(txid)\n if (parsed === undefined) {\n return\n }\n\n const account = await cashaccount.parseBitdbObject(parsed)\n return account\n }", "getUserDetails(id) {\n return apiClient.get(\n `/account?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3&session_id=${id}`\n )\n }", "static async getOneAccount(req, res) {\n try {\n if (typeof req.params.accountnumber !== 'number' && isNaN(req.params.accountnumber)) {\n return res.status(400).json({ status: 400, error: 'Account number must be number' });\n }\n\n const result = await db.fetchOneAccDetails(parseInt(req.params.accountnumber));\n if (!result.rows[0]) return res.status(404).json({ status: 404, error: 'Account not found' });\n\n if (req.user.id !== result.rows[0].owner) {\n return res.status(403).json({\n status: 403,\n error: 'You are not the owner of the account',\n });\n }\n return res.status(200).json({\n status: 200,\n data: {\n createdOn: result.rows[0].createdon,\n accountNumber: result.rows[0].accountnumber,\n ownerEmail: req.user.email,\n type: result.rows[0].type,\n status: result.rows[0].status,\n balance: result.rows[0].balance,\n },\n });\n } catch (error) {\n res.status(500).json({ status: 500, error: 'Server Error' });\n }\n }", "function initAccountWithCurrentAccount() {\n\n var token = getOauthTokenFromStorage();\n var account = null;\n\n if (token) {\n var req = {\n method: 'GET',\n url: 'accounts/current',\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n }\n $http(req)\n .then(function successCallback(response) {\n account = response.data;\n AccountService.initAccount(account);\n }, function errorCallback(response) {\n removeOauthTokenFromStorage();\n });\n\n }\n return account;\n }", "getUserWallet(uid) {\n return Request.get({\n url: `${URLS.WALLET_USER}/${uid}`,\n });\n }", "function getAmtUuid() {\r\n if (settings.hostname == null) {\r\n var amtMeiModule, amtMei;\r\n try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { console.log(ex); exit(1); return; }\r\n amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; });\r\n amtMei.getUuid(function (result) { if ((result == null) || (result.uuid == null)) { console.log('Failed.'); } else { console.log(result.uuid); } exit(1); });\r\n } else {\r\n if ((settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) { settings.noconsole = true; startLms(getAmtUuidEx); return; } else { getAmtUuidEx(); }\r\n }\r\n}", "async function requestAccount() {\n await window.ethereum.request({ method: 'eth_requestAccounts' });\n }", "async function requestAccount() {\n await window.ethereum.request({ method: \"eth_requestAccounts\" });\n }", "async function requestAccount() {\n await window.ethereum.request({ method: \"eth_requestAccounts\" });\n }", "async function getAccount(user) {\n return sendRequest(baseUrl + \"/api/accounts/\" + encodeURIComponent(user), \"GET\");\n}", "function loadAccount(){\n\n if (window.ethereum && window.ethereum.isMetaMask) {\n console.log('MetaMask detected');\n window.web3 = new Web3(window.ethereum);\n window.ethereum.send('eth_requestAccounts')\n .then(function(result){\n console.log(result.result[0]);\n setDefaultAccount(result.result[0]);\n\n // connection successful, connect wallet button will now display \"Connected\"\n setConnectionInd(\"Connected\");\n\n window.web3.eth.getBalance(contractAddress)\n .then(function(result){\n setContractBalance(window.web3.utils.fromWei(result));\n });\n\n setRPSContract(new window.web3.eth.Contract(contractABI, contractAddress));\n\n })\n } else {\n alert(\"You need to install MetaMask to interact with this app\");\n }\n }", "function getAccountFromPK() {\r\n let pk = publickey.value;\r\n if (pk == \"\") {\r\n pk.focus();\r\n return false;\r\n }\r\n _doGet('/account/get/from-public-key?publicKey=' + pk);\r\n }", "getDefaultAccount()\n {\n if (this.meta[\"settings.default-account\"] == null)\n return null\n\n return this.getAccount(this.meta[\"settings.default-account\"])\n }", "async show({ auth }) {\n return auth.user.account().fetch()\n }", "account(profile, args, context, info) {\n return { __typename: \"Account\", id: profile.accountId };\n }", "function getAccount(username){\n\tvar user;\n\taccounts.forEach(function (account){\n\t\tif(username === account.userName){\n\t\t\tuser = account;\n\t\t\t\n\t\t}\n\t\t\n\t})\n\treturn user;\n}", "async function getAccountBalance() {\n return web3.eth.getBalance(getAccount());\n}", "async function requestAccount() {\n\t\tawait window.ethereum.request({method: 'eth_requestAccounts'});\n\t}", "function getAccountInfo() {\n\n // Command to be sent to the IOTA API\n // Gets the latest transfers for the specified seed\n iota.api.getAccountData(seed, function(e, accountData) {\n\n console.log(\"Account data\", accountData);\n\n // Update address\n if (!address && accountData.addresses[0]) {\n\n address = iota.utils.addChecksum(accountData.addresses[accountData.addresses.length - 1]);\n\n updateAddressHTML(address);\n }\n\n balance = accountData.balance;\n\n // Update total balance\n updateBalanceHTML(balance);\n })\n }", "async requestMetaMaskAccount() {\r\n if (!window.ethereum) throw new Error(\"Not supported.\");\r\n\r\n try {\r\n let method = 'eth_requestAccounts';\r\n this.accounts = await window.ethereum.request({ method });\r\n this.web3 = new Web3(window.ethereum);\r\n window.ethereum.enable();\r\n } catch (error) {\r\n console.error(error);\r\n throw new Error('Error getting account info');\r\n }\r\n }", "getAccountDetails() {\n return this.OvhApiMe.v6().get().$promise;\n }", "function getAccount(username, password) {\r\n return db.query(\"Select * from accounts WHERE username ='\"+ username+\"'AND password ='\"+password + \"'\");\r\n}", "async function requestAccount() {\n await window.ethereum.request({ method: 'eth_requestAccounts' });\n }", "exportAccount (address) {\n return null // disabled\n // const wallet = this._getWalletForAccount(address)\n // return Promise.resolve(wallet.getPrivateKey().toString('hex'))\n }", "async function requestAccount() {\n\t\tawait window.ethereum.request({ method: 'eth_requestAccounts' });\n\t}", "function GetCredentials(node) {\n return JSON.parse(RED.nodes.getCredentials(node).account);\n }", "getAccounts() {\n return privates.get(this).keyring.getAccounts();\n }", "async function requestAccount(){\n //request metamask accounts\n await window.ethereum.request({method: 'eth_requestAccounts'});\n }", "authenticatedUser(account) {\n return account;\n }", "get accountId() {\n return this.getStringAttribute('account_id');\n }", "get_AccountNumber() { \n\t\treturn (this.accountNumber.getAttribute('value')).then(function(returnValue) {\n\t\t\tconsole.log(\"My Account Number\"+returnValue);\n\t\t\tlogger.info('Retrive AccountNumber from UI'+returnValue)\n\t\t\treturn returnValue;\n\t\t});\n\t}", "function getUser () {return user;}", "function randomAccount() {\n var account = {\n 'address': '',\n 'publicKey': '',\n 'password': '',\n 'secondPassword': '',\n 'username': '',\n 'balance': 0\n };\n\n account.password = randomPassword();\n account.secondPassword = randomPassword();\n account.username = randomDelegateName();\n\n return account;\n}", "get accounts() {\n return this._accounts;\n }", "accounts () {\n var p = this.withLedgerFile(this.cli).exec(['accounts'])\n return p.then(pro => {\n return pro.invoke('toString', []).split().compact()\n })\n }", "function getMyAddr () {\n var serializedAccount = localStorage.getItem('account')\n var msg = \"s\"\n var ret\n if (serializedAccount !== null) {\n var acc = ethClient.Account.deserialize(serializedAccount)\n console.log(acc)\n console.log(acc.getAddress())\n msg = acc.getAddress()\n ret = true\n } else {\n msg = \"You don't have an address.\"\n ret = false\n }\n document.getElementById(\"myaddress\").innerText = \"Your address is \" + msg\n return ret\n}", "function getAccount(role) {\n return global.accounts.find(account => account.role === role);\n}", "getAccountDetails(accountId) {\n if (lock.isBusy(accountId)) throwError('Service Unavailable', 503);\n this.logger.info('Getting account details...', accountId);\n return { ...accountDatabase[accountId] };\n }", "function getAccountId() {\n var url = 'https://' + getInfo('region') + '.api.riotgames.com/lol/summoner/v3/summoners/by-name/' + encodeURIComponent(getInfo('summoner_name')) + '?api_key=' + getInfo('api_key');\n var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true});\n var status = checkStatusError(response);\n if(!status) {\n var json = response.getContentText();\n var data = JSON.parse(json); \n return data['accountId'];\n }\n else if(status == 'exit') {\n return 'exit';\n }\n else if(typeof(status) == 'number') {\n Utilities.sleep(status);\n return getSummonerId();\n }\n else { // default wait 10 seconds if we fail but don't know why\n Utilities.sleep(10000);\n return getSummonerId();\n }\n}", "defaultAccount() {\n return functions_1.cached(this, CACHED_ACCOUNT, async () => {\n try {\n const creds = await this.defaultCredentials();\n const accessKeyId = creds.accessKeyId;\n if (!accessKeyId) {\n throw new Error('Unable to resolve AWS credentials (setup with \"aws configure\")');\n }\n return await new sdk_1.SDK(creds, this.defaultRegion, this.sdkOptions).currentAccount();\n }\n catch (e) {\n logging_1.debug('Unable to determine the default AWS account:', e);\n return undefined;\n }\n });\n }", "queryAccount(address) {\n return this.client.rpcClient.abciQuery('custom/acc/account', {\n Address: address,\n });\n }", "getAccounts() {\n web3.eth.getAccounts((error, result) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ userAddress: result[0] });\n }\n });\n }", "static async getTransForAcc(req, res) {\n try {\n if (req.user.type !== 'user') {\n return res.status(401).json({ status: 401, error: 'Only User can view transactions' });\n }\n\n if (!parseInt(req.params.accountnumber)) {\n return res.status(404).json({ status: 404, error: 'Enter account number please' });\n }\n\n const accForUser = await db.fetchAccountsByIdForUser(parseInt(req.params.accountnumber), req.user.id);\n if (!accForUser.rows[0]) {\n return res.status(404).json({ status: 404, error: 'Account not found, make sure you are the owner of the account' });\n }\n\n const result = await db.fetchTransForAcc(accForUser.rows[0].accountnumber);\n if (!result.rows[0]) return res.status(404).json({ status: 404, error: 'There is no transaction on this accounts' });\n\n return res.status(200).json({ status: 200, data: result.rows });\n } catch (error) {\n res.status(500).json({ status: 500, error: 'Server error' });\n }\n }", "function existingAccountQuery(passphrase, asset) {\n var client = new openchain.ApiClient(\"http://0.0.0.0:8080/\");\n\n //Calculate Private Key and wallet path from passphrase.\n var tmpMnenoic = new Mnemonic(passphrase);\n var privateKey = tmpMnenoic.toHDPrivateKey();\n var hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\n hdPrivateKey.network = bitcore.Networks.get(\"openchain\");\n \n var derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\n var walletId = \"/p2pkh/\" + derivedKey.privateKey.toAddress().toString() + \"/\";\n\n client.getAccountRecord(walletId, asset)\n .then(function (result) {\n console.log(\"Account Balance: \" + result.balance.toString());\n });\n}", "static getAccounts() {\n\t\t\t\treturn _accounts;\n\t\t\t}", "function getBalance(account){\n\treturn account.balance;\n}", "function getAccountDetails() {\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar count = retrieveAccountRecordCount();\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\" + count;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "async getUser() {\n let user = await this.getUserByCert();\n\n if(user == null)\n return null;\n\n return {\n name: this.CommonName,\n type: this.UserType,\n publicKey: user.publicKey\n }\n }", "static async read(token) {\n return await sendRequest(\"GET\", \"/users/self\", token);\n }", "function checkAccount() {\n try {\n const ethereum = checkConnection();\n return ethereum.selectedAddress;\n } catch (error) {\n return 0;\n }\n}", "async function requestAccount() {\n if (!window.ethereum) {\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n await Swal.fire({\n icon: 'error',\n title: 'MetaMask not installed!',\n html: `You can install it <a href=\"${isFirefox?\n \"https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/\":\n \"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn\"}\">here</a>!`,\n })\n return false;\n }\n\n let err = false;\n await window.ethereum.request({ method: \"eth_requestAccounts\"}) // ethereum.enable() is deprecated\n .then((accounts) => {\n acc = accounts[0];\n })\n .catch((e) => {\n if (e.code === 4001) {\n // EIP-1193 userRejectedRequest error\n console.log('Please connect to MetaMask!');\n Swal.fire({\n icon: 'error',\n title: 'Oops...',\n text: 'You rejected the connection!',\n })\n } else {\n console.error(e);\n Swal.fire({\n icon: 'error',\n title: 'Oops...',\n text: 'Connection failed!',\n })\n }\n err = true;\n })\n if (err) return false;\n \n checkNetwork();\n\n return true;\n}", "async updateAccount() {\n const accounts = await web3.eth.getAccounts();\n const account = accounts[0];\n console.log('account', account)\n this.currentAccount = account;\n }" ]
[ "0.78236365", "0.77858245", "0.76284635", "0.7244754", "0.7130035", "0.702045", "0.6929867", "0.690045", "0.6829834", "0.68227273", "0.6687283", "0.66637695", "0.6632414", "0.66189754", "0.65984136", "0.6561963", "0.6561452", "0.6543035", "0.64462125", "0.642186", "0.6402867", "0.6394796", "0.63907635", "0.6381212", "0.63623893", "0.635625", "0.634412", "0.634412", "0.6341627", "0.62874925", "0.6271148", "0.62124753", "0.61864114", "0.61592656", "0.6140138", "0.6111387", "0.6088509", "0.60795647", "0.607715", "0.60649693", "0.60588104", "0.6041004", "0.6030678", "0.6017949", "0.59842855", "0.5976022", "0.59641474", "0.59628195", "0.5953934", "0.59496766", "0.5926435", "0.59242624", "0.59057796", "0.5898063", "0.5886512", "0.5885413", "0.58824146", "0.58824146", "0.58809924", "0.58741677", "0.5871157", "0.5866177", "0.58607185", "0.5859289", "0.5853212", "0.58503014", "0.5849796", "0.5841662", "0.5841637", "0.5827773", "0.5819296", "0.58189696", "0.58176035", "0.5808289", "0.5804341", "0.58031243", "0.5784117", "0.5776092", "0.5768029", "0.57672685", "0.5755165", "0.57486486", "0.57474154", "0.5734423", "0.5732163", "0.5728981", "0.571087", "0.57051194", "0.5699466", "0.5699006", "0.5687476", "0.5681687", "0.5675338", "0.5674727", "0.56680894", "0.5660438", "0.56601584", "0.56587344", "0.5658289", "0.56558603", "0.565178" ]
0.0
-1
Awards a Shop User an amount of Simbits. There's no limit to how many Simbits
function award(memberObj, amount){ let shopUser = getShopUser(memberObj); shopUser.balance += amount; data.budget -= amount; fs.writeFileSync("./data/shop/data.json", JSON.stringify(data), (err) => console.log(err)); return `:confetti_ball: ${memberObj} has earned ${amount} Simbits! :confetti_ball: ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buy5() {\n const credit = 500;\n addCredit(credit);\n return credit;\n}", "function purchaseAutoUpgrades(autoUpgradeChoice) {\n let purchSing = automaticUpgrades[autoUpgradeChoice]\n let buySing = purchSing + automaticUpgrades[autoUpgradeChoice].quantity\n if (cheese >= automaticUpgrades[autoUpgradeChoice].price) {\n automaticUpgrades[autoUpgradeChoice].quantity ++\n cheese -= automaticUpgrades[autoUpgradeChoice].price\n automaticUpgrades[autoUpgradeChoice].price += 200\n console.log(automaticUpgrades[autoUpgradeChoice].quantity);\n}\ndrawAutomaticUpgrades()\n}", "function shop() {\n // Wenn der Nutzer mind. so viele Punkte hat, wie das naechste Upgrade kostet:\n if (points >= shopCount) {\n // Anzahl Punkte pro Klick erhoehen\n increment *= 2;\n // \"bezahlen\"\n points -= shopCount;\n // Preis erhoehen x4\n shopCount *= 4;\n //Inhalte auf Seite updaten\n counterEle.innerHTML = points;\n shopCountEle.innerHTML = shopCount;\n //Nutzer mit alert informieren\n alert('Super! Nun erhältst du ' + increment + ' Punkte pro Klick.');\n } else {\n // Der Nutzer hat noch nicht genug Punkte\n alert('Du hast noch nicht genug Punkte!');\n }\n}", "function buy50() {\n const credit = 6000;\n addCredit(credit);\n return credit;\n}", "increaseComicsNumber(){\n this.limit += 6;\n }", "function purchaseSingleUpgrades(upgradeChoice){\n let purchSing = clickUpgrades[upgradeChoice]\n let buySing = purchSing + clickUpgrades[upgradeChoice].quantity\n if (cheese >= clickUpgrades[upgradeChoice].price) {\n clickUpgrades[upgradeChoice].quantity ++\n cheese -= clickUpgrades[upgradeChoice].price\n clickUpgrades[upgradeChoice].price += 50\n console.log(clickUpgrades[upgradeChoice].quantity);\n }\n\n drawClickUpgrades()\n\n}", "function buyLotsofPhones() {\n\tfor (i = 0; i < (Math.floor((bankAccount - SPENDING_THRESHOLD) / pricePerPhoneAndAccessory)); i++) {\n\t\tnumPhones++;\n\t}\n}", "buyItems(item){\n let shopSells = new Shop('magic shop', 'sells magic things')\n this.items.push(item);\n shopSells.sellItems(item);\n }", "function buyBeerPerClick() {\n if (gameData.money >= gameData.beerPerClickCost) {\n gameData.money -= gameData.beerPerClickCost;\n gameData.beerPerClick += 1;\n gameData.beerPerClickCost = Math.round(gameData.beerPerClickCost * (Math.pow(1.09, gameData.beerPerClick)));\n showGameData();\n }\n}", "async function giveBal(guild, client, message, args)\n{\n\tcmd = args.shift();\n\n\t//Start to check whether or not the next arg is a valid Discord user\n\tnextArg = cmd;\n\tnextArg = nextArg.substring(2, nextArg.length - 1);\n\n\tif(nextArg.charAt(0) == \"!\")\n\t\tnextArg = nextArg.substring(1, nextArg.length);\n\n\t\t//\n\ttaggedUser = await client.fetchUser(nextArg).catch(err =>{});\n\n\t//Main body\n\tamount = args.shift();\n\tif((taggedUser != undefined) && (amount * 0 == 0) && (amount > 0))\n\t{\n\t\tvar memberInfo = await sqlHand.getData(client, `./SQL/guild_data/${guild.id}/members/member_data.sqlite`, \"data\", \"id\", message.author.id);\n\n\t\tmemberInfo.bal += Math.floor(amount * 1);\n\t\tmemberInfo.totalBal += Math.floor(amount * 1);\n\n\t\tmessage.channel.send(message.author + \" has successfully given <@\" + nextArg + \">, **\" + Math.floor(amount * 1) + \" Quarters!**\");\n\t\tfor(_n = 0; _n < notifier.length; _n++)\n\t\t{\n\t\t\tlet adminProf = message.guild.members.find(member => member.id == notifier[_n]);\n\t\t\tif(adminProf == null || adminProf == undefined) continue;\n\t\t\tadminProf.send(\"========================\\n\" + message.author.username + \"#\" + message.author.discriminator + \" has successfully given \" + taggedUser.username + \"#\" + taggedUser.discriminator + \", **\" + Math.floor(amount * 1) + \" Quarters!**\\n\\n**Guild Name:** \" + message.guild.name + \"\\n**Guild ID:** \" + message.guild.id + \"\\n========================\");\n\t\t}\n\n\t\tawait sqlHand.setData(client, `./SQL/guild_data/${guild.id}/members/member_data.sqlite`, config.usersSQLSetter, memberInfo);\n\t}\n\n\tif(amount < 0)\n\t\tmessage.channel.send(message.author + \", you can't give negative quarters.\");\n\n\tif(taggedUser == undefined)\n\t\tmessage.channel.send(message.author + \", you've tagged an invalid user, please try again.\");\n\tmessage.channel.stopTyping();\n}", "function buy_potions() {\n if (empty_slots() > 0) {\n for (type_id in potion_types) {\n var type = potion_types[type_id];\n\n var item_def = parent.G.items[type];\n\n if (item_def != null) {\n var cost = item_def.g * purchase_amount;\n\n if (character.gold >= cost) {\n var num_potions = num_items(type);\n\n if (num_potions < min_potions) {\n buy(type, purchase_amount);\n }\n } else {\n game_log(\"Not Enough Gold!\");\n }\n }\n }\n } else {\n game_log(\"Inventory Full!\");\n }\n}", "function sockMerchant(n, ar) {\n // Complete this function\n\n var types = {};\n\n for (var i = 0; i < n; i++) {\n if (types[ar[i]]) {\n types[ar[i]]++;\n } else {\n types[ar[i]] = 1;\n }\n }\n\n var keys = Object.keys(types);\n //console.log(keys.join(\" \"));\n var numSold = 0;\n\n for (var keyId = 0; keyId < keys.length; keyId++) {\n //console.log(types[sockName], sockName);\n numSold += Math.floor(types[keys[keyId]] / 2);\n }\n\n console.log(numSold);\n}", "function buyShovel(){\nif (cash >= clickUpgrades.shovel.price){ \n cash = cash - clickUpgrades.shovel.price,\n clickUpgrades.shovel.quantity+=1,\n clickUpgrades.shovel.price+=1,\n cashPC = cashPC + clickUpgrades.shovel.multiplier\n} else {\n alert('not enough cash')\n}\nupdate()\n}", "function enemyBuyOptionu() {\n if(enemyCash>300){\n enemyBuyU();\n }\n}", "becomeGameSponsor({ gameSponsorFee }) {\n this.CONTRACT\n .becomeGameSponsor\n .sendTransaction(\n {\n \"from\": MYWeb3.getAccount(),\n \"gas\": MYWeb3.toHex(400000),\n \"value\": MYWeb3.toWei(gameSponsorFee),\n },\n function (err, result) {}\n );\n }", "function buy20() {\n const credit = 2300;\n addCredit(credit);\n return credit;\n}", "function buySloop() {\r\n if(player.gold.num >= player.sloop.price) {\r\n player.sloop.num++;\r\n player.gold.num -= player.sloop.price;\r\n player.influence += player.sloop.influence;\r\n player.sloop.income = player.sloop.num * player.sloop.gain;\r\n gameLog('Ye bought yerself a Sloop!');\r\n } else {\r\n gameLog('Ye \\'aven\\'t enough gold fer that, Cap\\'n.');\r\n };\r\n player.sloop.price = Math.floor(7 * Math.pow(1.33, player.sloop.num));\r\n document.getElementById('sloopCost').innerHTML = player.sloop.price;\r\n document.getElementById('sloopNum').innerHTML = player.sloop.num;\r\n document.getElementById('sloopGain').innerHTML = player.sloop.income;\r\n document.getElementById('sloopInf').innerHTML = player.sloop.influence; \r\n document.getElementById('gold').innerHTML = player.gold.num;\r\n document.getElementById('influence').innerHTML = player.influence;\r\n \r\n}", "function buyHandWeapon(weap){\n let weapon= handWeapons[weap]\n if(weapon.cost.length == 0){\n return '';\n }\n if(canPurchase(weapon.cost[0])){\n weapon.quantity += 1\n player.heldWeapon = weap\n weapon.cost.splice(0,1)\n\n }\n}", "reachedShop () {\n this.gifts += 1;\n\n if (this.gifts % 3 === 0) {\n this.cars += 1;\n setTimeout(this.createEnemies.bind(this), 500, 1);\n this.speed += 0.3; \n audio.src = 'sounds/smw_1-up.wav';\n audio.play(); \n } else {\n audio.src = 'sounds/smw_coin.wav';\n audio.play();\n }\n\n setTimeout(this.resetPlayerPos.bind(gameVar), 500);\n }", "function checkForAdmiralBonus() {\n\n if (board.length >= 5) {\n\n if('Admiral' in getPlayerCards()) {\n\n if (playerMoves > 0 && !admiralBonusGiven) {\n \n admiralBonus = getPlayerCards().Admiral * 2;\n \n for (let i = 0; i < admiralBonus; i++) {\n players[actingPlayer].coins.push(deck.pop());\n }\n displayBoards();\n admiralBonusGiven = true;\n showModal('admiral bonus');\n }\n }\n } \n}", "dealCardAmountToPlayer(playerId, amount) {\n //get the player index from the player Array\n let playerIndex = this.Players.findIndex(obj => obj.id === playerId);\n\n let player = this.Players[playerIndex];\n //deal 7 cards to each player\n for (let i = 0; i < amount; i++) {\n let card = this.takeCardFromStock();\n player.cards.push(card);\n }\n }", "buy(number) {\n if (ThievesGuild.gold >= this.cost) {\n this.incOwned(number);\n ThievesGuild.gold = ThievesGuild.gold - this.cost;\n document.getElementById(\"gold\").innerHTML = ThievesGuild.gold;\n this.cost = Math.floor(this.basecost * Math.pow(1.08, this.owned));\n ThievesGuild.drawn = 0;\n }\n }", "function GrantItem(name) {\r\n for (var i = 0; i < GameState.Items.length; i++) {\r\n if (GameState.Items[i][0] == name) {GameState.Items[i][1]++;return;}\r\n }\r\n GameState.Items.push([name,1]);\r\n}", "gainThreeCoins() {\n this.coins += 3;\n }", "function SWorkerBuy(number){\r\n\t\tvar SWorkerCost = Math.floor(Math.pow(SWorkersBought, SWorkersExponent) + 1250000000000000);\r\n\t\tif(money >= SWorkerCost){\r\n\t\t\tmoney = money - SWorkerCost;\r\n\t\t\tSWorkers = SWorkers + 1;\r\n\t\t\tSWorkersBought = SWorkersBought + 1;\r\n\t\t\tdocument.getElementById('money').innerHTML = money;\r\n\t\t\tdocument.getElementById('SWorkers').innerHTML = SWorkers;\r\n\t\t}; //end of buying\r\n\t\tvar SWorkerNextCost = Math.floor(Math.pow(SWorkersBought, SWorkersExponent) + 1250000000000000);\r\n\t\tdocument.getElementById(\"SWorkerCost\").innerHTML = SWorkerCost;\r\n\t}", "async function buyItem(id, guildId, cost ){\n try {\n const user = await Users.findOne({ where: {user_id: id, guild_id: guildId }});\n if(user){\n if(user.balance >=cost){\n user.balance = user.balance - Number(cost);\n user.save();\n }else{\n return 0 ;\n }\n }else{\n return 0 ;\n }\n } catch (e) {\n console.log(e);\n }\n }", "function buy_potions() {\r\n\tif (empty_slots() >= 0) {\r\n\t\tfor (type_id in potion_types) {\r\n\t\t\tvar type = potion_types[type_id];\r\n\t\t\tvar item_def = parent.G.items[type];\r\n\r\n\t\t\tif (item_def != null) {\r\n\t\t\t\tvar cost = item_def.g * purchase_amount;\r\n\r\n\t\t\t\tif (character.gold >= cost) {\r\n\t\t\t\t\tvar num_potions = num_items(type);\r\n\r\n\t\t\t\t\tif (num_potions < min_potions) buy(type, purchase_amount);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tgame_log(\"Not Enough Gold!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tgame_log(\"Inventory Full!\");\r\n\t}\r\n}", "function adjustCount(amount){\n\t\t\titemCount = itemCount + amount;\n\t\t}", "function sockMerchant(n, ar) {\n let counts = {};\n let count = [];\n let sum = 0;\n\nfor(let i = 0; i < ar.length; i++){\nlet item = ar[i]\n counts[item] = counts[item] >= 1 ? counts[item] + 1 : 1;\n}\ncount = Object.values(counts);\nfor(let i = 0; i < count.length; i++){\nif(count[i] >= 2){\n sum += Math.floor(count[i]/2)\n}\n}\nreturn sum;\n}", "function buyMore(){\n\tinquirer.prompt([\n\t\t{\n\t\t\tname:\"confirm\",\n\t\t\tmessage:\"Would you like to buy more items?\",\n\t\t\ttype:\"confirm\"\n\t\t}\n\n\t]).then(function(user){\n\t\tif(user.confirm){\n\t\t\t//invoking function to display items and clearing table \n\t\t\tdisplayItems();\n\t\t\ttable.splice(0,table.length);\n\t\t}else{\n\n\t\t\tconsole.log(\"Thank you for shopping at Bamazon\");\n\t\t\tprocess.exit(0);\n\t\t}\n\t});\n}", "function increaseValue(brand, totalPrice, price, sign, OneOrHalf) {\n if (getFromStorage('userID')) {\n let quantity1 = 'quantity_'+brand+'_'+(OneOrHalf?'1kg':'halfkg');\n var value = parseInt(document.getElementById(quantity1).value, 10);\n value = isNaN(value) ? 0 : value;\n value++;\n document.getElementById(quantity1).value = value;\n updateTotalPrice(totalPrice, price, sign);\n updateCartItems(brand, value, OneOrHalf);\n\n } else {\n alert('you need to login first');\n }\n\n}", "function buyManager(index) {\n if (money < managers[index-1].price || managersOwned[index-1]) // cannot afford or owned\n return;\n money -= managers[index-1].price;\n managersOwned[index-1] = true;\n $(\"#clickme\"+index).css(\"display\",\"none\"); // no more need for manual clicking\n $(\"#managerBought\"+index).css(\"display\",\"initial\");\n}", "function buyLargeMeat(){\n if(g_karma >= 450){\n if(g_sounds == 1) g_btnsound.play();\n i_meatLarge +=1;\n localStorage.setItem('meatlarge', i_meatLarge);\n g_karma -= 450;\n localStorage.setItem('karma', g_karma);\n g_ApplicationManager.inventory.update();\n }else{if(g_sounds == 1) g_rejectedSound.play();}\n}", "payWinnings(player, rate){\n let winnings = this.player.bet * rate;\n this.player.wallet += winnings;\n this.player.bet = 0;\n return winnings;\n }", "function activateFreezePowerUp(unit, value, total){\n if(total % 10 === 0){\n freezeRandomCard();\n }\n}", "function buyManager(index) {\n\tif (money < managers[index-1].price || managersOwned[index-1]) // cannot afford or owned\n\t\treturn;\n\tmoney -= managers[index-1].price;\n\tmanagersOwned[index-1] = true;\n\t$(\"#clickme\"+index).css(\"display\",\"none\"); // no more need for manual clicking\n\t$(\"#managerBought\"+index).css(\"display\",\"initial\");\n}", "function numberItems(itemNames) {\n\n var item = itemNames.shift();\n var itemStock;\n\n connection.query('SELECT stock_quantity, price FROM products WHERE ?', {\n product_name: item\n }, function(err, res) {\n if (err) throw err;\n\n itemStock = res[0].stock_quantity;\n itemCost = res[0].price;\n });\n\n inquirer.prompt([{\n name: 'amount',\n type: 'text',\n message: 'How many ' + item + ' do you want?',\n\n validate: function(str) {\n if (parseInt(str) <= itemStock) {\n return true\n } else {\n\n console.log('\\nOh No! We only have ' + itemStock + ' in stock.'); //Alerts in case stock_quantity is not available\n return false;\n }\n }\n }]).then(function(user) {\n var amount = user.amount;\n\n cart.push({\n item: item,\n amount: amount,\n itemCost: itemCost,\n itemStock: itemStock,\n total: itemCost * amount\n });\n\n if (itemNames.length != 0) {\n numberItems(itemNames);\n } else {\n\n checkout();\n }\n });\n}", "function addToInventory(determine) {\n App[App.myRole].inventory[determine-1].quantity++;\n }", "function buyPart(item) {\n let protoBotCopy = protoBot\n let shopCopy = shop\n \n if(item.purchased == false){\n \n\n for (let i=0; i < shopCopy.length; i++){\n if(i == item.id - 1){\n \n shopCopy[i].purchased = true\n \n setShop(shopCopy)\n \n } \n }\n \n protoBotCopy.items.push(item)\n if(item.cost < balance){\n let cost = item.cost\n\n setBalance(balance - cost)\n setProtoBot(protoBotCopy)\n \n } else return alert('you do not have enough money')\n } else return alert('Item is already purchased')\n \n}", "gainTwoCoins() {\n this.coins += 2;\n }", "function billsTotal(){\n totally = totalCall + totalSms;\n }", "function sockMerchant(n, ar) {\n // Complete this function\n let obj = {}, count = 0\n for(let i = 0; i < n; i++) {\n if (obj[ar[i]] === undefined) obj[ar[i]] = 0\n obj[ar[i]]++\n }\n for (let key in obj) {\n if (obj[key] !== 1 && obj[key]%2 === 0) count += Math.floor(obj[key]/2)\n else if (obj[key] !== 1 && obj[key]%2 === 1) count += Math.floor(obj[key]/2)\n }\n return count\n}", "function showAllShopItems() {\n\tshowShopItemWhenAvailable(healthKitShopItemEl, healingCost, totalCoins, core.totalLife <= 50);\n\tshowShopItemWhenAvailable(improveMagazineShopItemEl, magazineIncreaseCost, totalCoins);\n\tshowShopItemWhenAvailable(fasterReloadShopItemEl, decreaseReloadingTimeCost, totalCoins);\n\tshowShopItemWhenAvailable(increasePowerUpDurationShopItemEl, powerUpDurationIncreaseCost, totalCoins);\n}", "userClick(closeShop){\n if (!this.state.gameRunning || this.state.gameOver){\n return;\n }\n\n // Check for script that is clicking over 45 times per second on average\n let timer = document.getElementById('timer') ? document.getElementById('timer').innerText : null;\n timer = timer ? Math.ceil(timer.replace(/s/, '')) : timer;\n if (timer && this.state.clicks / timer > 45){\n alert('Cheater! No scripts allowed');\n return this.endGame();\n }\n\n let newMoney = this.state.money + (this.state.autoInfectorIncrementer * this.state.moneyMultiplier);\n let newNumInfected = this.state.numInfected + this.state.autoInfectorIncrementer;\n this.setState({\n money: newMoney,\n numInfected: newNumInfected,\n clicks: this.state.clicks + 1,\n })\n\n if (closeShop){\n this.setState({\n showShop: false,\n showRiskShop: false,\n showRules: false,\n })\n }\n\n this.handletimers(newNumInfected);\n }", "function buySchooner() {\r\n if(player.gold.num >= player.schooner.price && player.influence >= player.schooner.infMin) {\r\n player.schooner.num++;\r\n player.gold.num -= player.schooner.price;\r\n player.influence += player.schooner.influence;\r\n player.schooner.income = player.schooner.num * player.schooner.gain;\r\n gameLog('A Schooner? What are ye going to do with that?');\r\n } else {\r\n gameLog('Ye \\'aven\\'t the resources to do that!');\r\n };\r\n player.schooner.price = Math.floor(2750 * Math.pow(1.23, player.schooner.num));\r\n document.getElementById('schoCost').innerHTML = player.schooner.price;\r\n document.getElementById('schoNum').innerHTML = player.schooner.num;\r\n document.getElementById('schoGain').innerHTML = player.schooner.income;\r\n document.getElementById('schoInf').innerHTML = player.schooner.influence;\r\n document.getElementById('gold').innerHTML = player.gold.num;\r\n document.getElementById('influence').innerHTML = player.influence;\r\n}", "function roboteggCollectorOn () {\n if (gameData.roboteggcollectorNum >= 0 && gameData.cash >= gameData.roboteggcollectorCost) {\n gameData.roboteggcollectorNum++;\n gameData.cash -= gameData.roboteggcollectorCost;\n gameData.roboteggcollectorCost = 10 * Math.pow(1.2, gameData.roboteggcollectorNum + 1); \n duckUpdate();\n }\n}", "function buyCharm() {\n if(charm.quantity < charm.maxQuantity) {\n if(zenny >= charm.price) {\n zenny -= charm.price;\n charm.quantity++;\n }\n }\n}", "function clickEarn(amount) {\n for (i = 0; i < amount; i++) {\n money+=1;\n}\n\t\n update()\n}", "function increaseSupply() {\n shiftSupply([1, -1]);\n }", "function Prize()\n{\n\tif(pm.health >= 2)\n\t{\t\n\t\tgm.GetComponent(PointsText).DisplayText(transform.position, \"\" + 500, 5.0);\n\t\tpm.AddPoints(500);\n\t\treturn;\n\t}\n\t\n\t// Spawn coin and float it up\n\tGameObject.Find(\"GameManager\").GetComponent(ItemFactory).SpawnItemAndFloat(prize, giftPos.position, 0, 0, 0, 0.05, 1, false);\n\t\n\t// play sound\n\tAudioSource.PlayClipAtPoint(giftSound, transform.position);\n}", "function incrementNumBags() {\n\n\tvar current = document.getElementById(\"bagInputField\");\n\tvar value = parseInt(current.value);\n\tvalue += 1;\n\n\ttry {\n\t\tvar geese = parseInt(document.getElementById(\"geeseInputField\").value);\n\t\tvar result = calculateTransportCost(value, geese);\n\t\tupdateElement(result);\n\t\tcurrent.value = value;\n\t} catch (err) {\n\n\t}\n\n\t// if (value + 1 <= MAXIMUM_BAGS_OF_CORN) {\n\t// \tcurrent.value = value + 1;\n\t// \tupdateCost(value + 1);\n\t// }\n\n}", "function performAmtPowerAction() {\r\n var transport = require('amt-wsman-duk');\r\n var wsman = require('amt-wsman');\r\n var amt = require('amt');\r\n wsstack = new wsman(transport, settings.hostname, settings.tls ? 16993 : 16992, settings.username, settings.password, settings.tls);\r\n amtstack = new amt(wsstack);\r\n if (settings.poweraction != 0) {\r\n // Set the power state\r\n amtstack.RequestPowerStateChange(settings.poweraction, performAmtPowerActionEx);\r\n } else {\r\n // Get the power state\r\n amtstack.Get('CIM_AssociatedPowerManagementService', performAmtPowerActionEx2, 0, 1);\r\n }\r\n}", "function moneyProducers() {\n\tmoneyClicks += workers;\n\tmoneyClicks += teamLeader * teamLeaderMPS;\n\tmoneyClicks += manager * managerMPS;\n\n}", "function howManyToBuy() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"quantityToBuy\",\n message: \"How many would you like to purchase?\",\n validate: function (input) {\n if (isNaN(input)) {\n return false;\n } else {\n return true;\n }\n }\n }\n ]).then(function (user) {\n quantityToBuy = parseInt(user.quantityToBuy);\n // after user input is entered, call checkIfAvailable function\n checkIfAvailable();\n });\n}", "function setChainSize(){\n\t\n\tvar limit = 'limit' + Alloy.Globals.angle,\n\t\tdb = Titanium.Database.open('SlingDB');\n\t\t\n\tif( Alloy.Globals.sling === 'Chain' ){\n\t\t\n\t\tif( Alloy.Globals.grade == 80 ){\n\t\t\n\t\t\tif( Alloy.Globals.angle == 45 || Alloy.Globals.angle == 0 ){\n\t\t\t\t\t\t\t\t\n\t\t\t\tvar returnedRow = db.execute('SELECT * FROM WorkingLoadLimits WHERE grade = 80 AND legs = ? AND limit45 >= ?', Alloy.Globals.legs, Alloy.Globals.load );\n\t\t\t\t\n\t\t\t\tvar lastNum = 10000;\n\t\t\t\n\t\t\t\twhile( returnedRow.isValidRow() ){\n\t\t\t\t\t\n\t\t\t\t\tif( returnedRow.fieldByName('limit45') < lastNum ){\n\t\t\t\t\t\n\t\t\t\t\t\tlastNum = returnedRow.fieldByName('limit45');\n\t\t\t\t\t\t\n\t\t\t\t\t\tAlloy.Globals.chainSize = parseInt( returnedRow.fieldByName('size') );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturnedRow.next();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}else if( Alloy.Globals.angle == 60){\n\t\n\t\t\t\tvar returnedRow = db.execute('SELECT * FROM WorkingLoadLimits WHERE grade = 80 AND legs = ? AND limit60 >= ?', Alloy.Globals.legs, Alloy.Globals.load );\n\t\t\t\t\n\t\t\t\tvar lastNum = 10000;\n\t\n\t\t\t\twhile( returnedRow.isValidRow() ){\n\t\n\t\t\t\t\tif( returnedRow.fieldByName('limit60') < lastNum ){\n\t\n\t\t\t\t\t\tlastNum = returnedRow.fieldByName('limit60');\n\t\n\t\t\t\t\t\tAlloy.Globals.chainSize = parseInt( returnedRow.fieldByName('size') );\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturnedRow.next();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//alert('Chain Size: ' + Alloy.Globals.chainSize );\n\t\t\t}\n\t\t\t\n\t\t}else if( Alloy.Globals.grade == 100 ){\n\t\t\n\t\t\tif( Alloy.Globals.angle == 45 || Alloy.Globals.angle == 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tvar returnedRow = db.execute('SELECT * FROM WorkingLoadLimits WHERE grade = 100 AND legs = ? AND limit45 >= ?', Alloy.Globals.legs, Alloy.Globals.load );\n\t\n\t\t\t\tvar lastNum = 10000;\n\t\n\t\t\t\twhile( returnedRow.isValidRow() ){\n\t\n\t\t\t\t\tif( returnedRow.fieldByName('limit45') < lastNum ){\n\t\n\t\t\t\t\t\tlastNum = returnedRow.fieldByName('limit45');\n\t\n\t\t\t\t\t\t Alloy.Globals.chainSize = parseInt( returnedRow.fieldByName('size') );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturnedRow.next();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//alert('Chain Size: ' + Alloy.Globals.chainSize );\n\t\n\t\t\t}else if( Alloy.Globals.angle == 60){\n\t\t\t\n\t\t\t\tvar returnedRow = db.execute('SELECT * FROM WorkingLoadLimits WHERE grade = 100 AND legs = ? AND limit60 >= ?', Alloy.Globals.legs, Alloy.Globals.load );\n\t\n\t\t\t\tvar lastNum = 10000;\n\t\n\t\t\t\twhile( returnedRow.isValidRow() ){\n\t\n\t\t\t\t\tif( returnedRow.fieldByName('limit60') < lastNum ){\n\t\n\t\t\t\t\t\tlastNum = returnedRow.fieldByName('limit60');\n\t\n\t\t\t\t\t\tAlloy.Globals.chainSize = parseInt( returnedRow.fieldByName('size') );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturnedRow.next();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//alert('Chain Size: ' + Alloy.Globals.chainSize );\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}else if( Alloy.Globals.sling === 'Wire Rope'){\n\t\t\n\t\tif( Alloy.Globals.angle == 45 || Alloy.Globals.angle == 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tvar returnedRow = db.execute('SELECT * FROM WorkingLoadLimits WHERE type = \"r\" AND legs = ? AND limit45 >= ?', Alloy.Globals.legs, Alloy.Globals.load );\n\t\n\t\t\tvar lastNum = 10000;\n\t\n\t\t\twhile( returnedRow.isValidRow() ){\n\t\n\t\t\t\tif( returnedRow.fieldByName('limit45') < lastNum ){\n\t\n\t\t\t\t\tlastNum = returnedRow.fieldByName('limit45');\n\t\n\t\t\t\t\t Alloy.Globals.ropeSize = parseInt( returnedRow.fieldByName('size') );\n\t\t\t\t\t\n\t\t\t\t}\n\t\n\t\t\t\treturnedRow.next();\n\t\t\t}\n\t\t\t\n\t\t\t//alert('Chain Size: ' + Alloy.Globals.chainSize );\n\t\n\t\t}else if( Alloy.Globals.angle == 60){\n\t\t\n\t\t\tvar returnedRow = db.execute('SELECT * FROM WorkingLoadLimits WHERE type = \"r\" AND legs = ? AND limit60 >= ?', Alloy.Globals.legs, Alloy.Globals.load );\n\t\n\t\t\tvar lastNum = 10000;\n\t\n\t\t\twhile( returnedRow.isValidRow() ){\n\t\n\t\t\t\tif( returnedRow.fieldByName('limit60') < lastNum ){\n\t\n\t\t\t\t\tlastNum = returnedRow.fieldByName('limit60');\n\t\n\t\t\t\t\tAlloy.Globals.ropeSize = parseInt( returnedRow.fieldByName('size') );\n\t\t\t\t\t\n\t\t\t\t}\n\t\n\t\t\t\treturnedRow.next();\n\t\t\t}\t\n\t\t}\t\n\t}\n\n}", "function buy10() {\n const credit = 1100;\n addCredit(credit);\n return credit;\n}", "function buyInvestment(index) {\n var amount = buyAmounts[buyAmount] // how many to buy, -1 for max\n if (amount > 0)\n for (var i = 0; i < amount; i++)\n buyInvestmentOnce(index);\n else\n while (money >= getPrice(index-1))\n buyInvestmentOnce(index);\n updateInvestments();\n}", "function Coin()\n{\n\t// Spawn coin and float it up\n\tgm.GetComponent(ItemFactory).SpawnItemAndFloat(prize, giftPos.position, 0, 180, 0, 0.05, 1.5, true);\n\t\n\t// Update coin balance with this new coin\n\tpm.AddCoins(1);\n\tpm.AddPoints(50);\n\t\n\t// play sound\n\tAudioSource.PlayClipAtPoint(coinSound, transform.position);\n}", "function theSeller (currentValue){\n//asking if currentvalue.who_made is equal to i_did and if so then seller should increa\n\tif(currentValue.who_made === 'i_did'){\n\t\tseller++;\n\t} \n}", "async showQuantities() {\n const character = this.character;\n const item = this.info.item;\n const buyItem = Items.new(item);\n let actions = new Actions();\n\n let style = buyItem.canBePurchasedBy(character, 1) ? 'default' : 'danger';\n actions.addButton(\"Buy 1\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 1 }, style });\n\n style = buyItem.canBePurchasedBy(character, 5) ? 'default' : 'danger';\n actions.addButton(\"Buy 5\", COMMAND_NAME, {params: { action: ACTION_BUY, item, quantity: 5 }, style });\n\n style = buyItem.canBePurchasedBy(character, 10) ? 'default' : 'danger';\n actions.addButton(\"Buy 10\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 10 }, style });\n\n style = buyItem.canBePurchasedBy(character, 25) ? 'default' : 'danger';\n actions.addButton(\"Buy 25\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 25 }, style });\n\n actions.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({\n attachments: Attachments.one({\n title: \"How many do you want to buy?\",\n fields: this.character.getFields(),\n actions\n })\n });\n }", "function buyMans() {\r\n if(player.gold.num >= player.mansion.price && player.influence >= player.mansion.infMin) {\r\n player.mansion.num++;\r\n player.gold.num -= player.mansion.price;\r\n player.influence += player.mansion.influence;\r\n player.mansion.income = player.mansion.num * player.mansion.gain;\r\n gameLog('Are ye looking to settle down now, Cap\\'n?');\r\n } else {\r\n gameLog('It be a sign, Cap\\'n.');\r\n };\r\n player.mansion.price = Math.floor(25525 * Math.pow(1.09, player.mansion.num));\r\n document.getElementById('mansCost').innerHTML = player.mansion.price;\r\n document.getElementById('mansNum').innerHTML = player.mansion.num;\r\n document.getElementById('mansGain').innerHTML = player.mansion.income;\r\n document.getElementById('mansInf').innerHTML = player.mansion.influence;\r\n document.getElementById('gold').innerHTML = player.gold.num;\r\n document.getElementById('influence').innerHTML = player.influence;\r\n}", "function money() {\n let commands = {\n atm: 'wallet',\n purse: 'wallet',\n wallet(target, room, user) {\n if (!this.canBroadcast()) return;\n Economy.get((target || user.userid), function(amount) {\n let currency = Wulu.Economy.currency_name;\n if (amount !== 1) currency += 's';\n this.sendReplyBox(`${target || user.name} has ${amount} ${currency}.`);\n room.update();\n }.bind(this));\n },\n\n 'generatemoney': 'givemoney',\n givemoney(target, room, user) {\n if (!user.can('givemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/givemoney [user], [amount] - Give a user a certain amount of money.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.give(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was given ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has given you ${amount} ${currency}. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n takemoney(target, room, user) {\n if (!user.can('takemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/takemoney [user], [amount] - Take a certain amount of money from a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.take(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was losted ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has taken ${amount} ${currency} from you. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n transfer: 'transfermoney',\n transfermoney(target, room, user) {\n if (!target || target.indexOf(',') < 0) return this.sendReply('/transfer [user], [amount] - Transfer a certain amount of money to a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let targetName = this.targetUsername;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${targetName} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n let self = this;\n Economy.get(user.userid, function(userAmount) {\n if (amount > userAmount) return self.sendReply('You cannot transfer more money than what you have.');\n Economy.give(targetName, amount, function(targetTotal) {\n Economy.take(user.userid, amount, function(userTotal) {\n let targetCash = targetTotal !== 1 ? currency_name + 's' : currency_name;\n let userCash = userTotal !== 1 ? currency_name + 's' : currency_name;\n self.sendReply(`You have successfully transferred ${amount} ${currency} to ${targetName}. You now have ${userTotal} ${userCash}.`);\n self.sendReply(`${user.name} has transferred ${amount} ${currency} to you. You now have ${targetTotal} ${targetCash}.`);\n });\n });\n });\n },\n\n moneyladder: 'richestuser',\n richladder: 'richestuser',\n richestusers: 'richestuser',\n richestuser(target, room) {\n if (!this.canBroadcast()) return;\n let self = this;\n let display = `<center><u><b>Richest Users</b></u></center><br>\n <table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n <tbody>\n <tr>\n <th>Rank</th>\n <th>Username</th>\n <th>Money</th>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n User.find().sort({money: -1}).limit(10).exec(function(err, users) {\n if (err) return;\n users.forEach((user, index) => {\n display += `<tr>\n <td>${index + 1}</td>\n <td>${user.name}</td>\n <td>${user.money}</td>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n });\n display += '</tbody></table>';\n self.sendReply('|raw|' + display);\n room.update();\n });\n }\n };\n\n Object.merge(CommandParser.commands, commands);\n}", "function Merchant() {\n\tEquipBest(); // ensure the best gear is equiped before stating\n\tfeedback = OPC.name + \" visits the merchant:<br>\";\n// sell the items in the backpack\n\tmerchNoBuyList = [torch,5,rations,5,lantern,1,oil,4]; // these things will not be sold from the backpack\n\tbackpackTally = [lantern,0,oil,0,rations,0,torch,0]; // track how many of each item are in the backpack\n\tfor(iMS = 0; iMS < OPC.backpack.length; iMS ++) {\n\t\tif(merchNoBuyList.includes(OPC.backpack[iMS])) { // check if current item is on the No Buy List\n\t\t\tbackpackTally[backpackTally.indexOf(OPC.backpack[iMS]) + 1] ++;\n\t\t\tif(backpackTally[backpackTally.indexOf(OPC.backpack[iMS]) + 1] <= merchNoBuyList[merchNoBuyList.indexOf(OPC.backpack[iMS]) + 1]) { // count is less than the sell point\n\t\t\t\tcontinue; // move on\n\t\t\t}\n\t\t}\n\t\t// give half the cash value\n\t\tfeedback += \"<br>\";\n\t\tswitch (OPC.backpack[iMS][0]) { // get the purchase value from the item array\n\t\t\tcase \"a\": // 7 - armour\n\t\t\t\tcopperValue = OPC.backpack[iMS][7];\n\t\t\t\tbreak;\n\t\t\tcase \"l\": // 4 - light sources\n\t\t\tcase \"s\": // 4 - shields\n\t\t\t\tcopperValue = OPC.backpack[iMS][4];\n\t\t\t\tbreak;\n\t\t\tcase \"m\": // 3 - misc.\n\t\t\t\tcopperValue = OPC.backpack[iMS][3];\n\t\t\t\tbreak;\n\t\t\tcase \"w\": // 5 - weapons\n\t\t\t\tcopperValue = OPC.backpack[iMS][6];\n\t\t\t\tbreak;\n\t\t}\n\t\tcopperValue = Math.ceil(copperValue / 2); // sell value is half purchase value \n\t\tOPC.copper += copperValue; // add half the copper to the OPC stock\n\t\tfeedback += OPC.backpack[iMS][1] + \" sold for \" + copperValue + \" cp.\";\n\t\tcopperValue = 0; // reset the copperValue\n\t\tOPC.backpack.splice(iMS, 1); // remove the item\n\t\tiMS --; // cycle the tracker back to account for the removed item\n\t}\n\tfeedback += \"<br>\";\n// restock items in the backpack\n\tmerchRestockItem = [torch,5,oil,4,rations,5]; // these things will be restocked to a set amount\n\tOPC.backpack.sort(); // sort the backpack alphabetically to group like things together\n\tfor(iMR = 0; iMR < merchRestockItem.length; iMR += 2) {\n\t\tif(OPC.backpack.includes(merchRestockItem[iMR])) {\n\t\t\titemAmount = (OPC.backpack.lastIndexOf(merchRestockItem[iMR]) - OPC.backpack.indexOf(merchRestockItem[iMR])) + 1; // calculate the number of an item\n\t\t}\n\t\telse {\n\t\t\titemAmount = 0;\n\t\t}\n\t\tif(itemAmount < merchRestockItem[iMR + 1]) { // if there are not enough\n\t\t\tfor(itemAmount; itemAmount < merchRestockItem[iMR + 1]; itemAmount ++) { // for loop to buy items while there is enough money\n\t\t\t\tfeedback += \"<br>\";\n\t\t\t\tswitch (merchRestockItem[iMR][0]) {\n\t\t\t\t\tcase \"a\": // 7 - armour\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][7];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"l\": // 4 - light sources\n\t\t\t\t\tcase \"s\": // 4 - shields\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][4];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"m\": // 3 - misc.\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][3];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"w\": // 5 - weapons\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][6];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(OPC.copper >= itemCost) { // is there enough money? (set up for torches)\n\t\t\t\t\tOPC.copper -= itemCost; // remove copper\n\t\t\t\t\tOPC.backpack.push(merchRestockItem[iMR]); // add item to backpack\n\t\t\t\t\tfeedback += merchRestockItem[iMR][1] + \" purchased for \" + itemCost + \" cp.\";\n\t\t\t\t}\n\t\t\t\telse { // if there is not enough money\n\t\t\t\t\tbreak; // end to purchasing loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfeedback += \"<br>\" + OPC.name + \" leaves the merchant.\";\n\tdocument.getElementById(\"opc-feedback\").innerHTML=feedback;\n\tEquipBest();\n//\tOPC.goal = \"travel\";\n\tOPC.encounter = \"\";\n\tWriteOPC();\n\t/*\n\t- equiup best just in case\n\t- sell things in the backpack that are not on a keep list\n\t- purchase things from the store to restock supplies; this will be based on what light source is available\n\t- create a list of items that are in stock\n\t- add some way to track currency (cp) which should be reflected in carry capacity\n\t*/\n}", "function getBuyCount(simData, generator) {\n let buyCounts = generator.Cost.map(cost => Math.floor(simData.Counts[cost.Resource] / cost.Qty));\n return Math.min(...buyCounts); \n}", "async capturePrice(step) {\n const user = await this.userProfile.get(step.context, {});\n\n const { ActionTypes, ActivityTypes, CardFactory } = require('botbuilder');\n\n const reply = { type: ActivityTypes.Message };\n\n // // build buttons to display.\n const buttons = [\n { type: ActionTypes.ImBack, title: '1. 💰', value: '1' },\n { type: ActionTypes.ImBack, title: '2. 💰💰', value: '2' },\n { type: ActionTypes.ImBack, title: '3. I do not care', value: '3' }\n ];\n\n // // construct hero card.\n const card = CardFactory.heroCard('', undefined,\n buttons, { text: 'For how much do you want to eat ?' });\n\n // // add card to Activity.\n reply.attachments = [card];\n\n // // Send hero card to the user.\n await step.context.sendActivity(reply);\n}", "regenerateStamina(amountToRegenerate){\n\n //Determine maximum\n let maxToRegen = this.props.stats_current.stamina - this.props.stamina_points;\n\n //If trying to regenerate more than maximum, only regen up to maximum\n let appliedAmountToRegenerate = ((amountToRegenerate > maxToRegen) ? maxToRegen : amountToRegenerate);\n\n this.incrementProperty('stamina_points', appliedAmountToRegenerate)\n }", "function onAddFiveClicked(){\n\t\tif (poker._bet < +50 && poker._cash >= +5){\n\t\t\tif(!cardsFliped)\n\t\t\t\tflipCards();\n\t\t\tresetHeld();\n\t\t\tpoker._bet += +5;\n\t\t\tpoker._cash -= +5;\n\t\t}\n\t\tbet.html(poker._bet);\n\t\tcash.html(poker._cash);\n\t}", "function buyItem(itemName) {\n let upgrade = items.find((item) => item.name == itemName);\n if(zenny >= upgrade.price) {\n zenny -= upgrade.price;\n upgrade.quantity++;\n upgrade.price = Math.floor(upgrade.price * 1.08);\n console.log(upgrade.price)\n update();\n showButtons();\n }\n}", "function buyGrain() {\n if (gameData.money >= gameData.grainCost) {\n gameData.grain += 1;\n gameData.money = (gameData.money - gameData.grainCost);\n showGameData();\n }\n}", "function Buy(i) {\n //checking if there is enough gold to buy resource\n if (goldAmount >= prices[i]) {\n //increasing amount of resource\n amounts[i]++;\n //decreasing amount of gold by price\n goldAmount -= prices[i];\n }\n else\n {\n //no money alert\n alert(\"You don't have money\");\n }\n}", "function purchaseMore() {\n inquirer.prompt({\n name: \"purchaseMore\",\n type: \"confirm\",\n message: \"Would you like to make another purchase?\"\n })\n .then(function (answer) {\n //If yes, then call the purchaseItem function again\n console.log()\n if (answer.purchaseMore === true) {\n 10\n itemDisplay();\n //Otherwise, call the endConnection function\n } else if (answer.purchaseMore === false) {\n endConnection();\n }\n })\n}", "buy() {\n this.amount --;\n this.price ++;\n }", "buy(amount, bank) {\n if (bank.withdraw(amount * this.cost)) {\n this.totSharesBought += amount;\n this.shares += amount;\n }\n }", "function sumBonus() {\n let sum = 0; // prøv let\n if (inputs[0].locked == true && inputs[1].locked == true && inputs[2].locked == true && inputs[3].locked == true && inputs[4].locked == true && inputs[5].locked == true) {\n for (let i = 0; i < 6; i++) {\n let num = inputs[i].value;\n sum += num;\n }\n }\n document.getElementById(\"sum\").value = sum;\n\n if (sum >= 63) {\n document.getElementById(\"bonus\").value = 50;\n } else {\n document.getElementById(\"bonus\").value = 0;\n\n }\n}", "function pushBonuses(bonuses, userId) {\n\n let totalBonuses = parseInt(bonuses);\n let actualBonuses = parseInt(localStorage.getItem(\"user-bonusCode\"));\n totalBonuses = totalBonuses + actualBonuses;\n localStorage.setItem(\"user-bonusCode\", totalBonuses);\n const payLoad = {\n bonusCode: totalBonuses\n };\n\n const postData = JSON.stringify(payLoad);\n fetch(`https://5bdffe29f2ef840013994a15.mockapi.io/users/${userId}`, {\n method: \"put\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n body: postData\n })\n .then(res => res.json())\n .then(d => {\n\n });\n document.querySelector(\".myAlert\").style.display = \"block\";\n document.querySelector(\"#donate-form\").reset();\n setTimeout(function () {\n document.querySelector(\".myAlert\").style.display = \"none\";\n }, 5000);\n}", "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}", "buy() {\n player.points = player.points.sub(this.cost())\n setBuyableAmount(this.layer, this.id, getBuyableAmount(this.layer, this.id).add(1))\n }", "function UWorkerBuy(number){\r\n\t\tvar UWorkerCost = Math.floor(Math.pow(UWorkersBought, UWorkersExponent) + 182500000000);;\r\n\t\tif(money >= UWorkerCost){\r\n\t\t\tmoney = money - UWorkerCost;\r\n\t\t\tUWorkers = UWorkers + 1;\r\n\t\t\tUWorkersBought = UWorkersBought + 1;\r\n\t\t\tdocument.getElementById('money').innerHTML = money;\r\n\t\t\tdocument.getElementById('UWorkers').innerHTML = UWorkers;\r\n\t\t}; //end of buying\r\n\t\tvar UWorkerNextCost = Math.floor(Math.pow(UWorkersBought, UWorkersExponent) + 182500000000);\r\n\t\tdocument.getElementById(\"UWorkerCost\").innerHTML = UWorkerCost;\r\n\t}", "function increase_bet(){\n\tif(cash >= bet_amount + bet && bet < max_bet){\n if(audio_on && sound_enabled){\n bet_sounds[Math.floor(Math.random() * 2) + 1].play();\n }\n\t\tbet += bet_amount;\n //cash -= bet_amount;\n if(cash == 0){\n money_popup = true;\n open_store();\n }\n\t\treturn true;\n\t}\n\treturn false;\n}", "function snacksupply(age, amount_per_day) {\n let ageMax = 80;\n let totalAmount = (amount_per_day * 365) * (ageMax - age);\n console.log(`You will need ${totalAmount} of snacks to last you till the age of ${ageMax}.`);\n }", "loseSevenCoins() {\n this.coins -= 7;\n }", "function onPlayerShopTransaction (data) {\n var shoppingPlayer = playerById(this.id);\n var shoppingRoom = roomById(shoppingPlayer.PC.roomid);\n\n // Player not found\n if (!shoppingPlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n // Player not found\n if (!shoppingRoom) {\n util.log('Room not found: ' + shoppingPlayer.PC.roomid)\n return\n }\n\n var shopItems = shoppingRoom['shop'];\n if(shopItems[data.itemID] == undefined){\n util.log('Shop Item Not Found: ' + data.itemID)\n return\n }\n\n if(data.count > 0){ //PLAYER IS BUYING ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n util.log('Player ' + shoppingPlayer.PC.name + ' is buying '+data.count+' '+ data.itemID +' at ' + shoppingPlayer.PC.roomid)\n\n if(shopItems[data.itemID].count < data.count){\n socket.to(shoppingPlayer.id).emit('message', {message: \"This shop no longer has that many items.\\n\", styles: [{color: '#ffffff',weight: 'bold'}]});\n return\n }\n\n var totalTransValue = Math.abs((parseInt(itemByItemID(data.itemID).baseValue) + parseInt(shopItems[data.itemID].basePriceDif)) * data.count);\n\n if(parseInt(totalTransValue) > parseInt(shoppingPlayer.PC.money)){\n socket.to(shoppingPlayer.id).emit('message', {message: \"You don't have enough money to purchase that many.\", styles: [{color: '#ffffff',weight: 'bold'}]});\n util.log('PLAYER ' + shoppingPlayer.PC.name + ' CANNOT AFFORD '+data.count+' '+ data.itemID +' AT ' + shoppingPlayer.PC.roomid)\n return\n }\n\n shoppingPlayer.PC.money = parseInt(shoppingPlayer.PC.money) - totalTransValue;\n\n addItemToCharacter(data.itemID, this.id, data.count);\n removeItemFromShop(data.itemID, shoppingPlayer.PC.roomid, data.count);\n\n socket.to(shoppingPlayer.id).emit('message', {message: \"You purchase \"+ data.count+\" \"+itemByItemID(data.itemID).name+\".\", styles: [{color: '#ffffff',weight: 'bold'}]});\n this.broadcast.to('room'+shoppingPlayer.PC.roomid).emit('message', {message: shoppingPlayer.PC.name + \" makes a purchase.\", styles: [{color: '#ffffff', weight: 'Bold'}]});\n\n } else if (data.count < 0 ) { //PLAYER IS SELLING ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n util.log('Player ' + shoppingPlayer.PC.name + ' is selling '+Math.abs(data.count)+' '+ data.itemID +' at ' + shoppingPlayer.PC.roomid)\n\n if(shoppingPlayer.PC.inventory[data.itemID] < Math.abs(data.count) || shoppingPlayer.PC.inventory[data.itemID] == undefined){\n socket.to(shoppingPlayer.id).emit('message', {message: \"You no longer have that many items.\", styles: [{color: '#ffffff',weight: 'bold'}]});\n return\n }\n\n var totalTransValue = Math.abs((parseInt(itemByItemID(data.itemID).baseValue) + parseInt(shopItems[data.itemID].basePriceDif)) * data.count);\n\n shoppingPlayer.PC.money = parseInt(shoppingPlayer.PC.money) + totalTransValue;\n\n removeItemFromCharacter(data.itemID, this.id, Math.abs(data.count));\n\n addItemToShop(data.itemID, shoppingPlayer.PC.roomid, Math.abs(data.count));\n\n socket.to(shoppingPlayer.id).emit('message', {message: \"You sell \"+ Math.abs(data.count)+\" \"+itemByItemID(data.itemID).name+\".\", styles: [{color: '#ffffff',weight: 'bold'}]});\n this.broadcast.to('room'+shoppingPlayer.PC.roomid).emit('message', {message: shoppingPlayer.PC.name + \" makes a sale.\", styles: [{color: '#ffffff', weight: 'Bold'}]});\n\n }\n\n\n\n}", "function buyItem(user){\n return user\n}", "function redistribute_wealth(gasPrice) {\n\n\tfor (var i = 1; i < global_keystore.getAddresses().length; i++) {\n\n\t\tconsole.log('send 1 eth from', global_keystore.getAddresses()[0], 'to', global_keystore.getAddresses()[i]);\n\n\n\t\tvar options = {\n\t\t\tfrom: global_keystore.getAddresses()[0],\n\t\t\tto: global_keystore.getAddresses()[i],\n\t\t\tvalue: 1 * 1e18,\n\t\t\tgas: 3141590,\n\t\t\tgasPrice: gasPrice,\n\t\t\tnonce: Math.floor(Math.random(999999)) + new Date().getTime(),\n\t\t};\n\n\t\t//console.log('transaction',options);\n\t\tvar result = web3.eth.sendTransaction(options,\n\t\t\tfunction(err, result) {\n\t\t\t\tif (err != null) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tconsole.log(\"ERROR: Transaction didn't go through. See console.\");\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Transaction Successful!\");\n\t\t\t\t\tconsole.log(result);\n\t\t\t\t\t//monitorBalances(newMember);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n}", "payChips(chips) {\n this.chips -= chips;\n }", "function enemyBuyOptionv() {\n if(enemyCash>400){\n enemyBuyV();\n }\n}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "INCREMENT (state, amount) {\n state.count = state.count + amount\n }", "INCREMENT (state, amount) {\n state.count = state.count + amount\n }", "playerReceivedDeal(position) {\n var player = this.players[position];\n if (player) { player.handSize++; }\n }", "function buyInsurance(fromaddr,password,value){\n web3.personal.unlockAccount(fromaddr,password,5);\n contract.payInsurance({from:\tfromaddr,value:web3.toWei(value, \"ether\"),\tgas:300000});\n}", "function buyStorage() {\n var packMod = 1 + game.portal.Packrat.level * game.portal.Packrat.modifier;\n var Bs = {\n 'Barn': 'food',\n 'Shed': 'wood',\n 'Forge': 'metal'\n };\n for (var B in Bs) {\n var jest = 0;\n var owned = game.resources[Bs[B]].owned;\n var max = game.resources[Bs[B]].max * packMod;\n max = calcHeirloomBonus(\"Shield\", \"storageSize\", max);\n if(game.global.mapsActive && game.unlocks.imps.Jestimp) {\n jest = simpleSeconds(Bs[B], 45);\n jest = scaleToCurrentMap(jest);\n }\n if ((game.global.world==1 && owned > max * 0.55) || (game.global.world >= 2 && game.global.world < 10 && owned > max * 0.4) || (owned + jest > max * 0.5)) {\n // debug('Buying ' + B + '(' + Bs[B] + ') at ' + Math.floor(game.resources[Bs[B]].owned / (game.resources[Bs[B]].max * packMod * 0.99) * 100) + '%');\n if (canAffordBuilding(B) && game.triggers[B].done) {\n safeBuyBuilding(B);\n if (getPageSetting('ManualGather')) setGather('buildings');\n }\n }\n }\n}", "function purchase(shirts, pants, shoes, discount) {\n\n if (!isLoaded) {\n if (typeof discount != 'number') {\n console.log('please enter number');\n return;\n }\n\n if (shirts <= stockShirts.quantity) {\n console.log('shirts are available');\n } else {\n console.log('shirts are not available');\n return;\n }\n\n if (pants <= stockPants.quantity) {\n console.log('pants are available');\n } else {\n console.log('pants are not available');\n return;\n }\n\n if (shoes <= stockShoes.quantity) {\n console.log('shoes are available');\n } else {\n console.log('shoes are not available');\n return;\n }\n\n if (discount > 0 && discount <= 100) {\n\n console.log('discount valid');\n\n }\n\n printBill(shirts, pants, shoes, discount);\n } else {\n console.log('Issue with stock loading, Unable to process purchase');\n }\n}", "function buyItem() {\n\n}", "addShipments(item, amount) {\n this.shipments[item] = amount + this.shipments[item] || amount;\n return this.shipments;\n }" ]
[ "0.5645975", "0.5639223", "0.5607249", "0.5585898", "0.55709535", "0.55418587", "0.5501198", "0.54871213", "0.54459745", "0.54241574", "0.5391087", "0.536751", "0.53550285", "0.5311168", "0.5310351", "0.53002954", "0.5289543", "0.5285286", "0.5278841", "0.52735656", "0.5268188", "0.5262559", "0.52590543", "0.5251483", "0.52510726", "0.52483237", "0.5239623", "0.523787", "0.5226972", "0.52076644", "0.5175728", "0.51755166", "0.5170743", "0.51705134", "0.5158328", "0.5157609", "0.5145912", "0.5141062", "0.51360184", "0.5135528", "0.5133946", "0.5126714", "0.5119051", "0.5117249", "0.51118165", "0.5109945", "0.5106122", "0.51014286", "0.5094973", "0.5092632", "0.5082662", "0.5067579", "0.5056139", "0.5052124", "0.50471514", "0.5045654", "0.50379324", "0.50369847", "0.50367427", "0.5022399", "0.5021901", "0.50168514", "0.5008691", "0.50080854", "0.5007066", "0.50003505", "0.49975282", "0.49960488", "0.4991553", "0.49887142", "0.4988398", "0.49852204", "0.49825296", "0.4980234", "0.49779382", "0.49755403", "0.4973569", "0.49637115", "0.49612784", "0.4956346", "0.49499527", "0.49498114", "0.49418613", "0.49299243", "0.4929602", "0.49273694", "0.49272993", "0.49272993", "0.49272993", "0.49272993", "0.49272993", "0.49272993", "0.49240187", "0.49240187", "0.4920314", "0.49144965", "0.49124536", "0.4909649", "0.49038947", "0.49026582" ]
0.5022208
60
Deducts a Shop User an amount of Simbits. Can't deduct if their balance isn't enough to deduct from
function deduct(memberObj, amount){ let shopUser = getShopUser(memberObj); shopUser.balance -= amount; data.budget += amount; fs.writeFileSync("./data/shop/data.json", JSON.stringify(data), (err) => console.log(err)); return `${memberObj} has had ${amount} Simbits deducted from them and added back to the budget.` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculDeductible () {\n for (var i = 0; i < deliveries.length; i++) {\n if (deliveries[i].options.deductibleReduction == true) {\n deliveries[i].price += deliveries[i].volume\n deliveries[i].commission.convargo += deliveries[i].volume\n }\n }\n}", "async deposit_ammo_usdc_clp(amount) {\n if (amount != 0) {\n const user_gs_farm_0 = await this.state.gfarmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"2\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n\n if (this.state.GMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n const allowed = await this.state.gfarmContracts[0].methods\n .approve(this.state.gmasterChefAddress, allow)\n .send({\n from: this.state.account,\n });\n\n //* Fee GS\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.gMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "function withdraw(account, amount) {\n account.total -= amount;\n}", "function buyShovel(){\nif (cash >= clickUpgrades.shovel.price){ \n cash = cash - clickUpgrades.shovel.price,\n clickUpgrades.shovel.quantity+=1,\n clickUpgrades.shovel.price+=1,\n cashPC = cashPC + clickUpgrades.shovel.multiplier\n} else {\n alert('not enough cash')\n}\nupdate()\n}", "async cashOut(req, res){\n\t\tvar userId = Mongoose.Types.ObjectId(req.user._id)\n\t\ttry {\n\t\t\tvar user = await UserModel.update({_id: userId}, {$set: {'totalPrizeMoney.amount': 0}}, {multi: false})\n\t\t} catch(err) {\n\t\t\tHelper.notifyError(err, `Error in cashing out user`)\n\t\t\treturn res.status(510).send({\n\t\t\t\terr: err.message,\n\t\t\t\tmessage: 'Something bad happened. Please try again'\n\t\t\t})\n\t\t}\n\t\treturn res.status(200).send({\n\t\t\tmessage: 'Operation Successful'\n\t\t})\n\t}", "function debitObligatoire(sum) {\n\t$('#btnBuy').attr('disabled', 'disabled');\n\t$('#btnFinTour').attr('disabled', 'disabled');\n\t$('#btnSell').attr('disabled', 'disabled');\n\t$('#btnUpgrade').attr('disabled', 'disabled');\n\n\tif (sentJson.account < sum)\n\t\tif((propertiesValue()+sentJson.account) > sum) {\n\t\t\t$('#listSell').empty();\n\t\t\t$('#listSell').append('Que voulez vous vendre?');\n\t\t\tproposeVente(sum);\n\t\t} else\n\t\t\treturn gameOver();\n\telse\n\t\tdebit(sum);\n\n\tgetMyInfos();\n\treturn 0;\n\n}", "async function buyItem(id, guildId, cost ){\n try {\n const user = await Users.findOne({ where: {user_id: id, guild_id: guildId }});\n if(user){\n if(user.balance >=cost){\n user.balance = user.balance - Number(cost);\n user.save();\n }else{\n return 0 ;\n }\n }else{\n return 0 ;\n }\n } catch (e) {\n console.log(e);\n }\n }", "async deposit_pug_ewt_clp(amount) {\n if (amount != 0) {\n const user_farm_0 = await this.state.farmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"20000\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n if (this.state.pMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n const allowed = await this.state.farmContracts[0].methods\n .approve(this.state.pmasterChefAddress, allow)\n .send({ from: this.state.account });\n\n //TODO: 2\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.pMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "function deductible(rentals)\n{\n for (var i = 0; i < rentals.length; i++)\n {\n if (rentals[i].options.deductibleReduction == true)\n {\n rentals[i].price += 4 * getDays(rentals[i].pickupDate, rentals[i].returnDate);\n }\n }\n}", "deposite(atm){\n if(atm > 0){\n let deposite = new transaction(atm,\"diposite\");\n this.transactions.push(deposite) } else {\n console.log('Negative Balance')\n }\n}", "withdrawal(amount)\n {\n this.accountBalance -= amount;\n }", "function voucher_sell_subtract_amount(userId, voucherValue, res){ \n \n keystone.list('seller distributor').model.findOne()\n .where({idnumber : userId, usertype : 'Seller'})\n .exec(function(err, response){\n if(err){return res.jsonp({status : 'voucher sell subtract error : '+error, new_credit : 'no_value_change'})}\n if(response == null){ return res.jsonp({status : 'voucher sell subtract : null', new_credit : 'no_value_change'})};\n //subtract creitd and save\n response.credits = response.credits - voucherValue;\n response.save( function(err, success){\n if(err){return res.jsonp({status : 'voucher sold for R'+voucherValue, new_credit : 'no_value_change'})} \n \n if(success != null){\n // update credit status\n res.jsonp({status : 'voucher sold for R'+voucherValue, new_credit : success.credits});\n return null;\n \n }\n //if the was error updating db, \n res.jsonp({status : 'voucher sold for R'+voucherValue, new_credit : 'no_value_change'}); \n \n \n });\n\n });\n \n\n }", "async withdraw_ammo_usdc_clp(e) {\n if (this.state.depo_clp_ammo_usdc_amount_precision > 0) {\n const user_farm_0_gs = await this.state.gMasterChef.methods\n .userInfo(0, this.state.account)\n .call();\n const maxAmount = this.state.web3.utils.fromWei(user_farm_0_gs.amount);\n const withdraw = new this.state.web3.utils.BN(\n this.state.web3.utils.toWei(maxAmount)\n );\n const ammoAddress = this.state.ammoAddress;\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"20000\");\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n\n const currentGSBalance = await this.state.gs.methods\n .balanceOf(this.state.account)\n .call();\n\n e.preventDefault();\n if (this.state.gMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n //* FEE (G$) withdraw\n await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n\n await this.state.gMasterChef.methods\n .withdraw(0, withdraw)\n .send({ from: this.state.account });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, withdraw: \", e);\n }\n }\n } else {\n return;\n }\n }", "function deductRewards(userAddress, token,superNodeAddress,userStartTime) {\n // Balance before deduction\n console.log(\" Account \" + userAddress + \" before deduction balance: \" + linkgearPOS.balanceOf(userAddress));\n\n // deduct rewards\n result = linkgearPOS.deductRewards(userAddress, token,superNodeAddress,userStartTime) \n\n if (result) {\n str = JSON.stringify(linkgearPOS.gegeweb3().eth.getTransaction(result), null, 4);\n console.log(str);\n }\n \n // Balance after deduction\n console.log(\"If blockNumber is null, the transaction is not mined yet\");\n console.log(\" Account \" + userAddress + \" after rewards balance: \" + linkgearPOS.balanceOf(userAddress));\n}", "function applyDeductible() {\n rentals.forEach(element => {\n if (element.options.deductibleReduction) {\n var returnDate = new Date(element.returnDate);\n var pickup = new Date(element.pickupDate)\n var duration = parseInt(dayDiff(pickup, returnDate));\n if (duration == 0)\n duration += 1\n element.price += 4 * duration\n element.virtuo += 4 * duration\n }\n });\n}", "static async debitTransaction(req, res) {\n if (req.userData.type !== 'staff' || req.userData.isAdmin === true) {\n return res.status(401).json({\n status: 401,\n error: 'Unauthorized token, you have to login as staff to carry out this transaction',\n });\n }\n try {\n const table = new Model();\n const response = await table.query('SELECT * FROM accounts WHERE accountnumber = $1', [req.params.accountNumber]);\n if (typeof response === 'undefined') {\n return res.status(400).json({\n status: 400,\n error: 'Invalid account number',\n });\n }\n if (response.rowCount === 0) {\n return res.status(404).json({\n status: 404,\n error: 'Account number not found',\n });\n }\n if (response.rows[0].status === 'dormant') {\n return res.status(404).json({\n status: 404,\n error: `The user account is ${response.rows[0].status} , you can't perform this transaction`,\n });\n }\n const accountEmail = response.rows[0].owneremail;\n const oldBalance = response.rows[0].balance;\n if (oldBalance < +req.body.amount) {\n return res.status(400).json({\n status: 400,\n error: 'Insufficient fund',\n });\n }\n const newBalance = oldBalance - +req.body.amount;\n const transaction = {\n createdOn: new Date(),\n type: 'debit',\n accountNumber: req.params.accountNumber,\n cashier: req.userData.id,\n amount: req.body.amount,\n oldBalance,\n newBalance,\n };\n const query = `INSERT INTO transactions ( createdOn, type, accountnumber, cashier, amount, oldBalance, newBalance)\n VALUES($1, $2, $3, $4, $5, $6, $7) RETURNING *`;\n const values = Object.values(transaction);\n const data = await table.query(query, values);\n const { ...transactionData } = data.rows[0];\n await table.query('UPDATE accounts SET balance = $1 WHERE accountnumber = $2', [transactionData.newbalance, transactionData.accountnumber]);\n // mail composer\n Mail.composer(accountEmail, transactionData.type, transactionData.amount, transactionData.newbalance);\n return res.status(200).json({\n status: 200,\n data: [{\n transactionId: transactionData.id,\n accountNumber: transactionData.accountnumber,\n amount: transactionData.amount,\n cashier: transactionData.cashier,\n transactionType: transactionData.type,\n accountBalance: transactionData.newbalance.toFixed(2),\n }],\n });\n } catch (error) {\n return res.status(400).json({\n status: 400,\n error: 'Something went wrong',\n });\n }\n }", "function calculateDrop(balance, sumBalance)\r\n{\r\n // const initialTokens = new BigNumber(INITIAL_TOKENS);\r\n // const bal = new BigNumber(balance);\r\n // const percentage = bal.dividedBy(sumBalance);\r\n // const amount = percentage.multipliedBy(initialTokens);\r\n //\r\n // return utils.bigNumberify(amount.toString());\r\n return utils.bigNumberify(AIRDROP_QTY);\r\n}", "buyNow(wish) {\n return this.model.findById(wish.user_id).then(data => {\n return data.decrement('balance', { by: wish.price });\n });\n }", "async function giveBal(guild, client, message, args)\n{\n\tcmd = args.shift();\n\n\t//Start to check whether or not the next arg is a valid Discord user\n\tnextArg = cmd;\n\tnextArg = nextArg.substring(2, nextArg.length - 1);\n\n\tif(nextArg.charAt(0) == \"!\")\n\t\tnextArg = nextArg.substring(1, nextArg.length);\n\n\t\t//\n\ttaggedUser = await client.fetchUser(nextArg).catch(err =>{});\n\n\t//Main body\n\tamount = args.shift();\n\tif((taggedUser != undefined) && (amount * 0 == 0) && (amount > 0))\n\t{\n\t\tvar memberInfo = await sqlHand.getData(client, `./SQL/guild_data/${guild.id}/members/member_data.sqlite`, \"data\", \"id\", message.author.id);\n\n\t\tmemberInfo.bal += Math.floor(amount * 1);\n\t\tmemberInfo.totalBal += Math.floor(amount * 1);\n\n\t\tmessage.channel.send(message.author + \" has successfully given <@\" + nextArg + \">, **\" + Math.floor(amount * 1) + \" Quarters!**\");\n\t\tfor(_n = 0; _n < notifier.length; _n++)\n\t\t{\n\t\t\tlet adminProf = message.guild.members.find(member => member.id == notifier[_n]);\n\t\t\tif(adminProf == null || adminProf == undefined) continue;\n\t\t\tadminProf.send(\"========================\\n\" + message.author.username + \"#\" + message.author.discriminator + \" has successfully given \" + taggedUser.username + \"#\" + taggedUser.discriminator + \", **\" + Math.floor(amount * 1) + \" Quarters!**\\n\\n**Guild Name:** \" + message.guild.name + \"\\n**Guild ID:** \" + message.guild.id + \"\\n========================\");\n\t\t}\n\n\t\tawait sqlHand.setData(client, `./SQL/guild_data/${guild.id}/members/member_data.sqlite`, config.usersSQLSetter, memberInfo);\n\t}\n\n\tif(amount < 0)\n\t\tmessage.channel.send(message.author + \", you can't give negative quarters.\");\n\n\tif(taggedUser == undefined)\n\t\tmessage.channel.send(message.author + \", you've tagged an invalid user, please try again.\");\n\tmessage.channel.stopTyping();\n}", "function money() {\n let commands = {\n atm: 'wallet',\n purse: 'wallet',\n wallet(target, room, user) {\n if (!this.canBroadcast()) return;\n Economy.get((target || user.userid), function(amount) {\n let currency = Wulu.Economy.currency_name;\n if (amount !== 1) currency += 's';\n this.sendReplyBox(`${target || user.name} has ${amount} ${currency}.`);\n room.update();\n }.bind(this));\n },\n\n 'generatemoney': 'givemoney',\n givemoney(target, room, user) {\n if (!user.can('givemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/givemoney [user], [amount] - Give a user a certain amount of money.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.give(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was given ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has given you ${amount} ${currency}. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n takemoney(target, room, user) {\n if (!user.can('takemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/takemoney [user], [amount] - Take a certain amount of money from a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.take(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was losted ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has taken ${amount} ${currency} from you. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n transfer: 'transfermoney',\n transfermoney(target, room, user) {\n if (!target || target.indexOf(',') < 0) return this.sendReply('/transfer [user], [amount] - Transfer a certain amount of money to a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let targetName = this.targetUsername;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${targetName} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n let self = this;\n Economy.get(user.userid, function(userAmount) {\n if (amount > userAmount) return self.sendReply('You cannot transfer more money than what you have.');\n Economy.give(targetName, amount, function(targetTotal) {\n Economy.take(user.userid, amount, function(userTotal) {\n let targetCash = targetTotal !== 1 ? currency_name + 's' : currency_name;\n let userCash = userTotal !== 1 ? currency_name + 's' : currency_name;\n self.sendReply(`You have successfully transferred ${amount} ${currency} to ${targetName}. You now have ${userTotal} ${userCash}.`);\n self.sendReply(`${user.name} has transferred ${amount} ${currency} to you. You now have ${targetTotal} ${targetCash}.`);\n });\n });\n });\n },\n\n moneyladder: 'richestuser',\n richladder: 'richestuser',\n richestusers: 'richestuser',\n richestuser(target, room) {\n if (!this.canBroadcast()) return;\n let self = this;\n let display = `<center><u><b>Richest Users</b></u></center><br>\n <table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n <tbody>\n <tr>\n <th>Rank</th>\n <th>Username</th>\n <th>Money</th>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n User.find().sort({money: -1}).limit(10).exec(function(err, users) {\n if (err) return;\n users.forEach((user, index) => {\n display += `<tr>\n <td>${index + 1}</td>\n <td>${user.name}</td>\n <td>${user.money}</td>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n });\n display += '</tbody></table>';\n self.sendReply('|raw|' + display);\n room.update();\n });\n }\n };\n\n Object.merge(CommandParser.commands, commands);\n}", "function userAcctBalance(acct){\n for (let i = 0; i < acct.length; i++) {\n acct[i].balance = +(acct[i].price * acct[i].share).toFixed(2);\n }\n}", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n }\n }", "sell(amount, bank) {\n if (amount <= this.shares) {\n this.totSharesSold += amount;\n this.shares -= amount;\n bank.deposit(amount * this.cost);\n }\n }", "function calculate(){\n \n //get the element which is the ID is budget\n const allBudget = document.getElementById('budget')\n let totalPrice = 0;\n //get the element which the classname is itemPrice\n const getPrice = document.getElementsByClassName('itemPrice')\n \n \n\n for(let i = 0; i < getPrice.length; i++){\n\n //first it will get the whole string in the textContent\n let getNumber = getPrice[i].textContent\n //then it will get only the number in the textCOntent\n let eachPrice = getNumber.match(/\\d+/);\n //convert the string to number\n totalPrice += parseInt(eachPrice)\n\n }\n //calculate the diffrent between user budget and all user item\n let result = allBudget.value - totalPrice\n\n //if the user budget is not enough to buy the item, it will alert user need more money\n\n if(result < 0){\n\n alert('You need more money, RM' + Math.abs(result).toFixed(2))\n //else it will call user buy the item .\n }else{\n\n alert('Buy now')\n\n }\n\n }", "function buy50() {\n const credit = 6000;\n addCredit(credit);\n return credit;\n}", "function handleExcess(origBalance,newBalance,id,qty){\r\n\tif(origBalance<=200){\r\n\t\tvar shelfId = alasql('SELECT * FROM shelves WHERE warehouseid = ? AND productcode = ? ',[findValue('whouse',id),findValue('code',id)])[0].id;\r\n\t\talasql('UPDATE shelves SET quantity = ? WHERE warehouseid = ? AND productcode = ? ',[ newBalance, findValue('whouse',id), findValue('code',id) ] );\r\n\t}else{\r\n\t\tvar rows = alasql('SELECT * FROM shelves WHERE warehouseid = ? AND productcode = ? ORDER BY id DESC',[ findValue('whouse',id), findValue('code',id) ]);\r\n\t\tfor(var i=0;i<rows.length && qty>0;i++){\r\n\t\t\tif(rows[i].quantity>qty){\r\n\t\t\t\talasql('UPDATE shelves SET quantity = ? WHERE id = ? AND warehouseid = ? AND productcode = ? ',[ rows[i].quantity - qty, rows[i].id, rows[i].warehouseid , rows[i].productcode ] );\r\n\t\t\t}else{\r\n\t\t\t\talasql('DELETE FROM shelves WHERE id = ? AND warehouseid = ? AND productcode = ?', [rows[i].id,rows[i].warehouseid, rows[i].productcode]);\r\n\t\t\t}\r\n\t\t\tqty -= rows[i].quantity;\r\n\t\t}\r\n\t}\t\r\n}", "function updatebalance(connection, serviceCharge, user, result, res) {\n let { bonus, deposit, winnings } = result[0];\n\n if (deposit + winnings + 0.1 * bonus < serviceCharge) {\n connection.end();\n return res.send(\"Insufficient Balance\");\n }\n\n let tempServiceCharge = serviceCharge;\n const tempBonus = bonus - +(0.1 * tempServiceCharge).toFixed(2);\n\n bonus = tempBonus >= 0 ? tempBonus : 0;\n if (tempBonus < 0) {\n tempServiceCharge = +(\n 0.9 * tempServiceCharge +\n Math.abs(tempBonus)\n ).toFixed(2);\n bonus = 0;\n } else {\n tempServiceCharge -= 0.1 * tempServiceCharge;\n tempServiceCharge = +tempServiceCharge.toFixed(2);\n }\n\n if (deposit >= tempServiceCharge) {\n //If whole fee can be recovered using deposit plus bonus money\n deposit -= tempServiceCharge;\n } else {\n tempServiceCharge -= deposit;\n winnings = +(winnings - +tempServiceCharge.toFixed(2)).toFixed(2);\n console.log(winnings);\n deposit = 0;\n }\n\n const balance = deposit + winnings + bonus;\n\n var sql = `UPDATE wallet SET bonus = ${bonus}, deposit = ${deposit}, winnings = ${winnings} WHERE username = '${user}'`;\n connection.query(sql, function (error) {\n if (error) {\n connection.end();\n res.send(error);\n } else {\n connection.end();\n res.send({\n status: \"Success\",\n \"Updated Balance\": balance,\n });\n }\n });\n}", "function deposit(account, amount){\n\taccount.balance += amount;\n}", "function pettycashDropAmount(){\nvar amount = document.getElementById('pcamount');\nvar balance = document.getElementById('pcprebalance');\nvar drop = document.getElementById('pcdraw');\ndocument.getElementById('pcdraw').value=amount.value-balance.value;\nif(drop.value<0) { drop.value=amount.value; balance.value=0; }\n}", "processTransaction(product) {\n product.quantity--\n vm.totalMoney += product.price\n vm.currentTransaction -= product.price\n }", "withdraw(amount) {\n this.balance -= amount;\n if (this.balance < 0) {\n this.balance -= 35;\n console.log(`Notice of OVERDRAFT. You have been charged a $35 fee. Your new account balance is: ${this.balance}`)\n }\n }", "function buy5() {\n const credit = 500;\n addCredit(credit);\n return credit;\n}", "transactionInspection(item, amount, player) {\n if (!player || !this.faction.isContraband(item, player))\n return true;\n // the relative level of severity of trading in this item\n const contraband = data_1.default.resources[item].contraband || 0;\n // FastMath.abs() is used because amount is negative when selling to market,\n // positive when buying from market. Fine is per unit of contraband.\n const fine = FastMath.abs(contraband * amount * this.inspectionFine(player));\n const rate = this.inspectionRate(player);\n for (let i = 0; i < contraband; ++i) {\n if (util.chance(rate)) {\n const totalFine = Math.min(player.money, fine);\n const csnFine = util.csn(totalFine);\n const csnAmt = util.csn(amount);\n // fine the player\n player.debit(totalFine);\n // decrease standing\n player.decStanding(this.faction.abbrev, contraband);\n // confiscate contraband\n let verb;\n if (amount < 0) {\n player.ship.cargo.set(item, 0);\n verb = 'selling';\n }\n else {\n this.stock.dec(item, amount);\n verb = 'buying';\n }\n // trigger notification\n const msg = `Busted! ${this.faction.abbrev} agents were tracking your movements and observed you ${verb} ${csnAmt} units of ${item}. `\n + `You have been fined ${csnFine} credits and your standing wtih this faction has decreased by ${contraband}.`;\n window.game.notify(msg, true);\n return false;\n }\n }\n return true;\n }", "moneyInSafe() {\n let money = this.bank.money;\n money += this.moneyOfPlayers;\n money += this.moneyInCustoms;\n return money;\n }", "function decrease() {\n var holdCount2 = count - 1;\n if(holdCount2 >= 0){\n setCount(holdCount2);\n var holdItem2 = props;\n window.localStorage.setItem(JSON.stringify(holdItem2), holdCount2);\n cartContext.setCartTotal(calTotal());\n }else{\n console.log(\"You can't order negative amount of products\");\n }\n \n }", "function formationFee() {\n if(turn == \"player\"){\n if(playerCash < 200){\n playerCash -= (0.1*playerCash);\n }else{\n playerCash -= 200;\n }\n updateCash();\n playerUpdate(\"Eek! you just had to pay some shitty fee sorry.\")\n }else if (turn == \"enemy\"){\n if(enemyCash < 200){\n enemyCash -= (0.1*playerCash);\n }else{\n enemyCash -= 200;\n }\n updateCash();\n enemyUpdate(\"Muahaha looks like the enemy has some fee payments due.\")\n }\n}", "buy(time, value, deposit) {\n this.mortgage = this.cmhc_insurance\n - (deposit - this.deposit_needed)\n + (value * (1 - this.deposit_amount));\n\n this.paid_off = this.bought + (this.mortgage_term * 12);\n this.rate(time);\n }", "function optionDeductible()\n{\n for(var j=0;j<rentals.length;j++)\n {\n var timeDay= get_date(rentals[j].id);\n var option_deductible=4*timeDay;\n var rentalPriceDeduitOption;\n\n if(rentals[j].options.deductibleReduction==true)\n {\n rentalPriceDeduitOption=rentals[j].price+ option_deductible;\n\n console.log(rentals[j].driver.firstName+ ''+ rentals[j].driver.lastName + '\\n' +'rental price (deduit option) is : ' + rentalPriceDeduitOption+ '.');\n\n rentals[j].price=rentalPriceDeduitOption;\n }\n else\n {\n rentalPriceDeduitOption=rentals[j].price;\n\n console.log(rentals[j].driver.firstName+ ''+ rentals[j].driver.lastName + '\\n' +'rental price (without deduit option) is : ' + rentalPriceDeduitOption+ '.')\n }\n }\n}", "deposit_for(value) {\n this.deposit_amount = this.opts.mortgage_deposit(value);\n this.cmhc_insurance = this.opts.mortgage_insurance(value, this.deposit_amount);\n return this.deposit_needed = value * (this.deposit_amount + this.opts.property_transaction_fees);\n }", "function sellEggs() {\n gameData.cash = gameData.cash + gameData.eggs * gameData.cost;\n gameData.lifetimeCash += gameData.eggs * gameData.cost;\n gameData.eggsSold += gameData.eggs;\n gameData.eggs = 0;\n duckUpdate();\n}", "function purchase(shirts, pants, shoes, discount) {\n\n if (!isLoaded) {\n if (typeof discount != 'number') {\n console.log('please enter number');\n return;\n }\n\n if (shirts <= stockShirts.quantity) {\n console.log('shirts are available');\n } else {\n console.log('shirts are not available');\n return;\n }\n\n if (pants <= stockPants.quantity) {\n console.log('pants are available');\n } else {\n console.log('pants are not available');\n return;\n }\n\n if (shoes <= stockShoes.quantity) {\n console.log('shoes are available');\n } else {\n console.log('shoes are not available');\n return;\n }\n\n if (discount > 0 && discount <= 100) {\n\n console.log('discount valid');\n\n }\n\n printBill(shirts, pants, shoes, discount);\n } else {\n console.log('Issue with stock loading, Unable to process purchase');\n }\n}", "function doDebitCredit(numLoops, action, desc, transct) {\n for(var i = 0; i < numLoops; i++) {\n var amnt = parseInt(prompt(desc));\n\n if(isNaN(amnt)){\n return;\n }\n\n action(amnt);\n\n var li = document.createElement('li');\n li.textContent = '$' + amnt + ' ' + transct + '. Current balance: $' + bank.balance;\n li.setAttribute('class', transct);\n transact.appendChild(li);\n }\n}", "charge(payee,atm){\nif(this.balance()>= atm){\n let charge = new transaction((amt * -1), payee)\n this.transactions.push(charge)\n} else {\n console.log(\"insufficient funds\")\n}\n}", "function decreaseValue(brand, totalPrice, price, sign, OneOrHalf) {\n if (getFromStorage('userID')) {\n let quantity1 = 'quantity_'+brand+'_'+(OneOrHalf?'1kg':'halfkg');\n var value = parseInt(document.getElementById(quantity1).value, 10);\n value = isNaN(value) ? 0 : value;\n if (value < 1)\n return;\n value--;\n document.getElementById(quantity1).value = value;\n updateTotalPrice(totalPrice, price, sign);\n updateCartItems(brand, value, OneOrHalf);\n } else {\n alert('you need to login first');\n }\n}", "function tempTransfer() {\r\n supplies[MONEY] = supplies[MONEY] - ((price[OXEN_COST] * tempSupplies[OXEN]) + (price[CLOTHING_COST] * tempSupplies[CLOTHING]) + (price[FOOD_COST] * tempSupplies[FOOD]) + (price[BAIT_COST] * tempSupplies[BAIT]) + (price[WAGON_COST] * tempSupplies[PARTS]));\r\n var i;\r\n for (i = 0; i < supplies.length; i++) supplies[i] += tempSupplies[i];\r\n for (i = 0; i < parts.length; i++) parts[i] += tempParts[i];\r\n tempSupplies = [0, 0, 0, 0, 0, 0];\r\n tempParts = [0, 0, 0];\r\n}", "buy(amount, bank) {\n if (bank.withdraw(amount * this.cost)) {\n this.totSharesBought += amount;\n this.shares += amount;\n }\n }", "function amountAfterCommission(pdName){\n var pdTotal = betting.productTotal(pdName);\n //commission appled for each product\n var cRate = cms.get(pdName);\n return pdTotal - ( pdTotal * cRate / 100);\n\n}", "withdraw(moneyVal) {\n\t\tthis.money -= moneyVal;\n\t\t(this._tracker).push({\"withdraw\": moneyVal});\n\t\treturn this.money\n\t}", "function withdraw (account, amount) {\n // Only accept a number\n if (typeof amount === \"number\") {\n return account.balance -= amount;\n } else {\n console.log(\"Error: not a number\");\n }\n}", "function registerPayment (debt) {\n var paymentValue = $(\"#paymentValue\"+debt.user).val()\n \n if (!paymentValue || isNaN(paymentValue)) {\n alert(\"Please insert a valid number\");\n return;\n }\n \n if(debt.value > 0) {\n Payments.insert({\n creator: Meteor.userId()\n , payer: Meteor.userId()\n , payee: debt.user\n , amount: paymentValue\n , confirmed: false\n , used: false\n }, function(error, result){\n paymentValue.val(\"\")\n });\n } else {\n Payments.insert({\n creator: Meteor.userId()\n , payer: debt.user\n , payee: Meteor.userId()\n , amount: paymentValue\n , confirmed: false\n , used: false\n }, function(error, result){\n paymentValue.val(\"\")\n });\n }\n}", "function buyProduct() {\n const amount = Number(currentBalance.innerText);\n const askPrice = Number(askPriceText.innerText);\n\n // Check If User can Afford\n if (amount >= askPrice) {\n currentBalance.innerText = amount - askPrice;\n alert(\"You are now the proud owner of \" + productTitle.innerText + \"!\")\n } else {\n alert(\"Not enough money\")\n }\n}", "function userPurchase() {\n var banckAccountBalance = prompt(\"How much money do you have ?\");\n\n\n // prompt user to select phones\n function postProducts() {\n //get user money\n function getBanckAccountBalance() {\n return banckAccountBalance;\n }\n\n let minMoney = 100\n if (banckAccountBalance < minMoney) {\n alert('Sorry. you do not haave enough cash to bu our products. We therefore do not want to display our products to you.');\n console.log('User do not have enough money.');\n\n } else if (banckAccountBalance >= minMoney) {\n alert(\n \"Have a look at our list of products\\n#Iphone X: $600\\n#Nokia C9: $1,200\\n#Samsung Galaxy S20: $3,000\\n#Earphone black: $200\\n#Iphone charger: $300\\n\\nPlease remember our choice and write it down in the next window.\"\n );\n\n // prompt user to select phones\n function getUserToBuy() {\n var answer1 = prompt('write yes or no.\\nWant to buy #Iphone X ?');\n var answer2 = prompt('select yes or no.\\n#want to buy #Nokia C9 ?');\n var answer3 = prompt('select yes or no\\nWant to buy Samsung Galaxy S20 ?');\n var answer4 = prompt('select yes or no\\nWant to buy #Earphone black ?');\n var answer5 = prompt('select yes or no\\nWant to buy #Iphone charger ?');\n\n if (answer1 == 'no' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes') {\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n\n var result = answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result);\n\n } else if (answer1 == 'yes' && answer2 == 'no' && answer3 == 'yes' && answer4 == 'yes') {\n let answer1 = 600;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'no' && answer4 == 'yes') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes' && answer5 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n var result = answer1 + answer2 + answer3 + answer4;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n }\n\n return getUserToBuy();\n\n } else {\n return console.log('something went wrong!');\n\n }\n }\n\n postProducts();\n\n\n\n // for(let i = 100; i <= banckAccountBalance; i++){\n\n // }\n\n\n\n}", "function deductCapacity(prefix, total, apps, belowCapacities, op, capacities) {\n log('debug', 'deduct capacity '+total+' from '+apps.toString()+'-'+op);\n if(total == 0) return ;\n for(var appi = 0; appi < apps.length; appi++) {\n var app = apps[appi];\n var spare = belowCapacities == null ? capacities[app][op] :capacities[app][op]-belowCapacities[app][op];\n\n if(total > spare && spare != 0) {\n log('debug', 'deduct capacity '+spare+' from '+app+'-'+op);\n var newCapacity = capacities[app][op]-spare;\n setCapacity(prefix, app, op, newCapacity, capacities);\n total -= spare;\n }\n else {\n log('debug', 'deduct capacity '+total+' from '+app+'-'+op);\n var newCapacity = capacities[app][op]-total;\n setCapacity(prefix, app, op, newCapacity, capacities);\n break ;\n }\n }\n}", "function vigor_pricing(borrow, user, gstats) {\n const user_debt = user.debt.amount + borrow; // the total amount the user will be borrowing\n\n const ivol = user.volcol * gstats.scale; // market determined implied volaility\n\n // market determined implied percentage loss that the user collateral portfolio would experience in a stress event.\n const istresscol = -1.0 * (Math.exp((Math.log((user.stresscol / -1.0) + 1.0)) * gstats.scale) - 1.0);\n\n const payoff = Math.max( 0.0,\n 1.0 * (user.debt.amount / Math.pow(10.0,4)) - user.valueofcol * (1.0 - istresscol)\n );\n const T = 1.0;\n const d = ((Math.log(user.valueofcol / (user_debt / Math.pow(10.0,4)))) + (-Math.pow(ivol,2)/2.0) * T) / (ivol * Math.sqrt(T));\n\n // annualized rate borrowers pay in periodic premiums to insure their collateral\n var tesprice = Math.min(Math.max( mintesprice * gstats.scale,\n ((payoff * erfc(d / Math.sqrt(2.0)) / 2.0) / (user_debt / Math.pow(10.0, 4)))) * calibrate, maxtesprice);\n\n tesprice /= 1.6 * (user.creditscore / 800.0); // credit score of 500 means no discount or penalty.\n\n return tesprice;\n}", "placeSalary(amount) {\n if (this.state.amount< 0.76){\n alert(\"Below minimum wage!\")\n }\n else{\n this.state.clearContract.placeSalary({\n from: this.web3.eth.accounts[0],\n value: amount\n }, (err, txHash) => {\n console.log(txHash)\n })\n }\n }", "function withdraw (account, amount) {\n if (typeof amount === 'number') {\n account.balance -= amount;\n } else {\n console.log('withdraw failed, amount is not a number')\n }\n}", "function calculDebitCredit () {\n for (var i = 0; i < deliveries.length; i++) {\n for (var j = 0; j < actors.length; j++) {\n if (deliveries[i].id == actors[j].deliveryId) {\n actors[j].payment[0].amount = deliveries[i].price;\n actors[j].payment[1].amount = deliveries[i].price - deliveries[i].commission.insurance - deliveries[i].commission.treasury - deliveries[i].commission.convargo;\n actors[j].payment[2].amount = deliveries[i].commission.insurance;\n actors[j].payment[3].amount = deliveries[i].commission.treasury;\n actors[j].payment[4].amount = deliveries[i].commission.convargo;\n }\n }\n }\n}", "function enemyBuyOptionu() {\n if(enemyCash>300){\n enemyBuyU();\n }\n}", "sellCoin(account, amount, coinBlindedHashes, response) {\n\n if (coinBlindedHashes.length !== NUM_COINS_REQUIRED) {\n throw new Error(\"Client hasn't prepared the right number of coins\");\n } //1) Verify that the user prepared the right number of coins.\n\n let selectedNum = utils.randInt(coinBlindedHashes.length); //2) Randomly select a coin.\n\n //3) Call the 'response' callback function with the selected number.\n let [blindingFactors, coins] = response(selectedNum);\n\n // console.log(\"COINS\" + blindingFactors);\n\n // for(let factor in blindingFactors){\n // console.log(blindingFactors[factor] + \"\\n\");\n // console.log(selectedNum);\n // }\n\n let blindingFactorsSansSelected = blindingFactors.slice();\n blindingFactorsSansSelected[selectedNum] = undefined;\n\n let coinsSansSelected = coins.slice();\n coinsSansSelected[selectedNum] = undefined;\n\n\n\n for (let coin in coinsSansSelected) {\n if (coinsSansSelected[coin] !== undefined) {\n // let verify = coinsSansSelected[coin].verifyUnblinded(blindingFactorsSansSelected[coin]);\n if (!coinsSansSelected[coin].verifyUnblinded(blindingFactorsSansSelected[coin])) {\n console.log(`A coin does not match its blinding factor`);\n }\n // The coin matches its blinding factor\n\n // That each pair of identity strings matches up with the purchaser's identity\n for (let i = 0; i < COIN_RIS_LENGTH; i++) {\n\n let identStr = utils.decryptOTP({\n key: coinsSansSelected[coin].leftIdent[i],\n ciphertext: coinsSansSelected[coin].rightIdent[i],\n returnType: \"string\",\n });\n\n if (!identStr.startsWith(\"IDENT\")) {\n //console.log(\"UMMM: \" + coinsSansSelected[coin].IDENT_STR);\n //console.log(\"WE ARE HERE: \" + identStr.split(':')[1]);\n throw new Error(\"can't match purchaser's identity\");\n } //does it match purchaser's id\n\n }\n }\n }\n\n // If all coins seem valid, deduct money from the purchaser's account, \n this.withdraw({account,amount});\n\n //sign the blinded hash\n\n //and return it to the user.\n return blindSignatures.sign({\n blinded: coinBlindedHashes[selectedNum],\n key: this.key,\n });\n\n\n }", "static charge(name) {\n\t\t// This finds the student to be charged\n Db.findStudent(name, (err, result) => {\n if (err) throw err;\n console.log(\"countdown\", result[0].classCountdown);\n\t\t\t\n\t\t\t// This checks to see if there are available classes left. For speed of simulation purposes I've preset classCountdown to be 10 classes per billing period even though in real life it's ~16.\n\n\t\t\t// Anyway if classCountdown is below 0 and money is less than the monthly fee stop from learning and go work. if classCountdown is below 0 and there is enough money then deduct $150 and reset countdown to 10.\n if (result[0].classCountdown <= 0) {\n if (result[0].money < 150) {\n return \"You need to earn more money\";\n } else {\n let sql = mysql.format(\"UPDATE shiftup SET classCountdown = 10, money = money - 150 WHERE name = ?;\",[name]);\n connection.query(sql, function(err, result) {\n if (err) throw err;\n console.log(\"final countdown complete\");\n })\n }\n\t\t\t\n\t\t\t// if classCountdown is greater than 10 just remove 1 from classCountdown.\n } else {\n let sql = mysql.format(\"UPDATE shiftup SET classCountdown = classCountdown - 1 WHERE name = ?;\",[name]);\n connection.query(sql, function(err, result) {\n if (err) throw err;\n console.log(\"charged successfully\");\n })\n }\n })\n }", "deposit(amount) {\n this.balance += amount;\n this.trans.push(`$${amount} deposited`);\n return this.balance;\n }", "function transaction() {\n // * CURRENT transaction\n if (AccountType === \"CURRENT\") {\n Accounts[AccountID].current += TransactionValue;\n\n // * SAVINGS transaction\n } else if (AccountType === \"SAVINGS\") {\n // (1) - if withdrawal is made from SAVINGS but the required sum does not exist, only the total available amount is transferred\n // i.e. SAVINGS does not drop below 0\n if (TransactionValue < 0 && Accounts[AccountID].savings < Math.abs(TransactionValue)) {\n Accounts[AccountID].savings -= Accounts[AccountID].savings;\n // (2) - regular SAVINGS transaction\n } else {\n Accounts[AccountID].savings += TransactionValue;\n }\n }\n }", "function bonAppetit(bill, k, b) {\n//k -> item which Anna wont eat\n//b -> amount calculated by Brian to pay\n//bill -> array\n\n let itemsInBill = bill.length;\n let removeAnnasShare = bill[k];\n let costAsPerBrian = b;\n\n let totalFoodBill = 0;\n for(let food of bill) {\n totalFoodBill += food;\n }\n\n let actualBill = totalFoodBill - removeAnnasShare; \n \n let costPerPerson = actualBill / 2; \n \n if (costPerPerson < costAsPerBrian) {\n console.log(costAsPerBrian - costPerPerson);\n }\n else\n console.log(\"Bon Appetit\");\n\n}", "function deleteCard() {\n var customerMgr = require('dw/customer/CustomerMgr');\n var registeredUsers = customerMgr.queryProfiles(\"\", \"customerNo ASC\");\n for each(var user in registeredUsers) {\n var wallet = user.getWallet();\n var creditCardsSaved = wallet.getPaymentInstruments('CREDIT_CARD');\n for each(var card in creditCardsSaved) {\n var paymentTokenID = card.creditCardToken;\n if (!paymentTokenID) {\n Transaction.wrap(function () {\n wallet.removePaymentInstrument(card);\n });\n }\n }\n }\n}", "async withdraw_pug_ewt_clp(e) {\n if (this.state.depo_clp_pug_ewt_amount_precision > 0) {\n const user_farm_0 = await this.state.pMasterChef.methods\n .userInfo(0, this.state.account)\n .call();\n const maxAmount = this.state.web3.utils.fromWei(user_farm_0.amount);\n const withdraw = new this.state.web3.utils.BN(\n this.state.web3.utils.toWei(maxAmount)\n );\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"200000\");\n\n const ammoAddress = this.state.ammoAddress;\n const currentAmmoBalance = await this.state.ammo.methods\n .balanceOf(this.state.account)\n .call();\n const fee = new this.state.web3.utils.BN(\"50000000000000000000\");\n\n e.preventDefault();\n if (this.state.pMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n //* FEE (PUG)\n await this.state.pug.methods.transfer(gFeeAddress, fee).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n\n await this.state.pMasterChef.methods\n .withdraw(0, withdraw)\n .send({ from: this.state.account });\n\n window.location.reload();\n } catch (e) {\n console.log(\"Error, withdraw: \", e);\n }\n }\n } else {\n return;\n }\n }", "function buy (msg, name, amt){\n //check for invalid inputs\n if (amt <= 0){\n msg.reply(\"Error: Please enter a number greater than zero.\");\n return;\n }\n\n //get list of currencies\n getList(msg).then((data) => {\n\n //holds price of desired currency\n var price;\n //holds the final total of desired currency\n var total;\n //get current market price of coin per dollar\n switch(name){\n case 'btc':\n price = amt * data.BTC.USD;\n break;\n case 'eth':\n price = amt * data.ETH.USD;\n break;\n case 'etc':\n price = amt * data.ETC.USD;\n break;\n case 'doge':\n price = amt * data.DOGE.USD;\n break;\n //if currency not found\n default:\n msg.channel.send(\"Error: Currency not found\");\n return;\n break;\n } //end switch\n //round purchase amt\n var price = Math.round(price*100)/100\n //make sure player has enough money\n if (price > player[msg.member.id].money){\n msg.reply(\"Error: Not enough money :\\(\");\n return;\n }\n\n //take the money\n player[msg.member.id].money = player[msg.member.id].money - price\n //add the appropriate coin\n switch(name){\n case 'btc':\n player[msg.member.id].btc = player[msg.member.id].btc + amt;\n total = player[msg.member.id].btc;\n break;\n case 'eth':\n player[msg.member.id].eth = player[msg.member.id].eth + amt;\n total = player[msg.member.id].eth;\n break;\n case 'etc':\n player[msg.member.id].etc = player[msg.member.id].etc + amt;\n total = [msg.member.id].etc;\n break;\n case 'doge':\n player[msg.member.id].doge = player[msg.member.id].doge + amt;\n total = player[msg.member.id].doge;\n break;\n //if currency not found\n default:\n msg.channel.send(\"Error: Currency not found\");\n return;\n break;\n }\n //update the JSON file\n fs.writeFile(\"./src/players.json\", JSON.stringify(player), (err)=> {\n if (err) console.log(err);\n });\n\n //success message\n msg.reply(\"Congratulations! You have bought \" + amt + \" \" + name + \" for a total of $\" + price + \"\\nCurrent total: \" + total + \"\\nMoney: $\" + player[msg.member.id].money);\n });\n}", "function DepositWithdrawal() {\n \n var ss = SpreadsheetApp.getActiveSpreadsheet(); \n var ui = SpreadsheetApp.getUi();\n var transactionType = \"\";\n \n //Get User ID, Coin, Quantity. Abort if user presses cancel at any tie\n //Verify against close sheet, which forces user to close before making a deposit or withdrawal\n var userID = getAndValidateInput(\"User ID\", \"E_USERS\"); \n if(userID == false) return;\n \n var coin = getAndValidateInput(\"Coin Ticker\", \"C_BALANCE_TICKERS\");\n if(coin == false) return;\n \n var quantity = getAndValidateNumber(\"Quantity (negative quantity for a withdrawal)\");\n if(quantity == \"cancel\") return;\n \n if(quantity > 0) \n transactionType = \"Deposit\"; \n else \n transactionType = \"Withdrawal\";\n \n //Check Coin Balance to ensure we have enough to withdraw\n if(transactionType == \"Withdrawal\"){\n var balance = checkBalance(coin);\n if(balance < Math.abs(quantity)) {\n ui.alert(\"Insufficient Balance (\" + balance + \") of \" + coin + \" for requested withdrawal (\" + Math.abs(quantity) + \"). Transaction Aborted.\");\n return;\n }\n }\n \n //Refresh before getting prices/fund value\n RefreshDataFeed();\n \n //Close Value. Uses Value from Close sheet, but allows manual entry if the user selects 'No' at prompt\n var closesCoin = getClosePriceDate(coin, \"C_PRICE_TICKERS\");\n var closePrice = closesCoin[0];\n var closeDate = closesCoin[1];\n var closePriceLive = parseFloat(getLivePrice(coin)).toFixed(2);\n var closePriceResponse = ui.alert(\"Would you like to use \" + coin + \" close price of $\" + parseFloat(closePrice).toFixed(2) + \" USD\" + \" captured on \" + closeDate + \" (Live Price: $\" + closePriceLive + \" USD)\", ui.ButtonSet.YES_NO_CANCEL);\n\n //Cancel or Manual Entry of Close Price\n if(closePriceResponse == ui.Button.CANCEL) return;\n else if(closePriceResponse == ui.Button.NO)\n {\n var closePrice = getAndValidateNumber(\"Close Price (USD) of \" + coin);\n if(closePrice == \"cancel\") return;\n }\n \n //Transaction Value\n var transactionValue = closePrice * quantity;\n \n //Check if equity value of user is enough for size of withdrawal\n var equityUSD = parseFloat(getEquityValue(userID)).toFixed(2);\n if(transactionType == \"Withdrawal\" && equityUSD < Math.abs(transactionValue)){\n ui.alert(\"Insufficient Equity ($\" + equityUSD + \" USD) for requested withdrawal ($\" + parseFloat(Math.abs(transactionValue)).toFixed(2) + \" USD). Transaction Aborted.\");\n return;\n }\n \n \n //Gets the last 'Close' fund Value. Ignores fund Value from Deposits and Withdrawals \n var fundValue = (getClosePriceDate(\"USD\", \"C_TOTALS_TICKERS\"))[0];\n var liveFundValue = ss.getRangeByName(\"H_TOTAL_USD\").getValue();\n var warning = \"\";\n \n if(liveFundValue/fundValue > 1.05 || fundValue/liveFundValue > 1.05 || liveFundValue == 0) {\n warning = \"WARNING: Check difference between Live Fund Value and Close Fund Value. \\n\";\n }\n var fundValueResponse = ui.alert(warning + \"Would you like to use Close Fund Value (before transaction) of $\" + parseFloat(fundValue).toFixed(2) + \" USD\" + \" captured on \" + closeDate + \". (Live Fund Value is $\" + parseFloat(liveFundValue).toFixed(2) +\")\", ui.ButtonSet.YES_NO_CANCEL);\n \n //Cancel or Manual Entry of Fund Value\n if(fundValueResponse == ui.Button.CANCEL) return;\n else if(fundValueResponse == ui.Button.NO)\n {\n fundValue = getAndValidateNumber(\"Fund Value (USD)\");\n if(fundValue == \"cancel\") return;\n }\n \n //Check Fund Value after transaction and ensure it's not negative\n var newFundValue = fundValue + transactionValue;\n \n if(newFundValue < 0) {\n ui.alert(\"ERROR: Fund value (USD) after withdrawal is \" + newFundValue + \". Withdrawal not valid.\");\n return;\n }\n \n\n \n //Confirm Transaction Details\n var response = ui.prompt(\"Please confirm details: \\n\\n\" \n + \"** \" + transactionType + \" ** \\n\\n\" \n + \"User ID: \" + userID + \"\\n\"\n + \"Coin: \" + coin + \"\\n\"\n + \"Quantity: \" + Math.abs(quantity) + \"\\n\" \n + \"Close Price: $\" + Math.abs(closePrice) + \" USD\\n\" \n + transactionType + \" Value: $\" + Math.abs(transactionValue).toFixed(2) + \" USD\\n\"\n + \"Fund Value (Before Transaction): $\" + parseFloat(fundValue).toFixed(2) + \" USD\\n\"\n + \"Fund Value (After Transaction): $\" + parseFloat(newFundValue).toFixed(2) + \" USD\\n\\n\" \n\n\n + \"If correct, type 'confirm' and click 'OK' to complete transaction.\", ui.ButtonSet.OK_CANCEL);\n \n if(response.getSelectedButton() == \"OK\" && response.getResponseText() == \"confirm\") { \n //Get GoogleID of user, timestamp and record in info\n var adminEmail = Session.getEffectiveUser().getEmail();\n \n \n //Add to Table\n var dwID = AddDepositWithdrawal(userID,coin,quantity,transactionType,closePrice, transactionValue, fundValue, newFundValue,adminEmail); \n \n //Add Trade\n AddTradeDW(coin,quantity,dwID);\n \n //Update Equity\n updateEquitySplits(fundValue, userID, transactionValue);\n \n //Go through close process to record the current state of the fundtfa\n Close(transactionType, dwID);\n \n //ui.alert(transactionType + \" Complete\");\n }\n else ui.alert(\"Transaction Cancelled\");\n\n}", "async function fundNocust() {\n await nocustManager.deposit(\n BOB_PUB, // Account from which to make a deposit (its private key needs to be in the Web3 instance)\n web3.utils.toWei('0.1','ether'), // Amount to deposit\n web3.utils.toWei('10','gwei'), // Gas price, 10 Gwei\n 150000 // Gas Limit\n );\n}", "function buyPart(item) {\n let protoBotCopy = protoBot\n let shopCopy = shop\n \n if(item.purchased == false){\n \n\n for (let i=0; i < shopCopy.length; i++){\n if(i == item.id - 1){\n \n shopCopy[i].purchased = true\n \n setShop(shopCopy)\n \n } \n }\n \n protoBotCopy.items.push(item)\n if(item.cost < balance){\n let cost = item.cost\n\n setBalance(balance - cost)\n setProtoBot(protoBotCopy)\n \n } else return alert('you do not have enough money')\n } else return alert('Item is already purchased')\n \n}", "function Merchant() {\n\tEquipBest(); // ensure the best gear is equiped before stating\n\tfeedback = OPC.name + \" visits the merchant:<br>\";\n// sell the items in the backpack\n\tmerchNoBuyList = [torch,5,rations,5,lantern,1,oil,4]; // these things will not be sold from the backpack\n\tbackpackTally = [lantern,0,oil,0,rations,0,torch,0]; // track how many of each item are in the backpack\n\tfor(iMS = 0; iMS < OPC.backpack.length; iMS ++) {\n\t\tif(merchNoBuyList.includes(OPC.backpack[iMS])) { // check if current item is on the No Buy List\n\t\t\tbackpackTally[backpackTally.indexOf(OPC.backpack[iMS]) + 1] ++;\n\t\t\tif(backpackTally[backpackTally.indexOf(OPC.backpack[iMS]) + 1] <= merchNoBuyList[merchNoBuyList.indexOf(OPC.backpack[iMS]) + 1]) { // count is less than the sell point\n\t\t\t\tcontinue; // move on\n\t\t\t}\n\t\t}\n\t\t// give half the cash value\n\t\tfeedback += \"<br>\";\n\t\tswitch (OPC.backpack[iMS][0]) { // get the purchase value from the item array\n\t\t\tcase \"a\": // 7 - armour\n\t\t\t\tcopperValue = OPC.backpack[iMS][7];\n\t\t\t\tbreak;\n\t\t\tcase \"l\": // 4 - light sources\n\t\t\tcase \"s\": // 4 - shields\n\t\t\t\tcopperValue = OPC.backpack[iMS][4];\n\t\t\t\tbreak;\n\t\t\tcase \"m\": // 3 - misc.\n\t\t\t\tcopperValue = OPC.backpack[iMS][3];\n\t\t\t\tbreak;\n\t\t\tcase \"w\": // 5 - weapons\n\t\t\t\tcopperValue = OPC.backpack[iMS][6];\n\t\t\t\tbreak;\n\t\t}\n\t\tcopperValue = Math.ceil(copperValue / 2); // sell value is half purchase value \n\t\tOPC.copper += copperValue; // add half the copper to the OPC stock\n\t\tfeedback += OPC.backpack[iMS][1] + \" sold for \" + copperValue + \" cp.\";\n\t\tcopperValue = 0; // reset the copperValue\n\t\tOPC.backpack.splice(iMS, 1); // remove the item\n\t\tiMS --; // cycle the tracker back to account for the removed item\n\t}\n\tfeedback += \"<br>\";\n// restock items in the backpack\n\tmerchRestockItem = [torch,5,oil,4,rations,5]; // these things will be restocked to a set amount\n\tOPC.backpack.sort(); // sort the backpack alphabetically to group like things together\n\tfor(iMR = 0; iMR < merchRestockItem.length; iMR += 2) {\n\t\tif(OPC.backpack.includes(merchRestockItem[iMR])) {\n\t\t\titemAmount = (OPC.backpack.lastIndexOf(merchRestockItem[iMR]) - OPC.backpack.indexOf(merchRestockItem[iMR])) + 1; // calculate the number of an item\n\t\t}\n\t\telse {\n\t\t\titemAmount = 0;\n\t\t}\n\t\tif(itemAmount < merchRestockItem[iMR + 1]) { // if there are not enough\n\t\t\tfor(itemAmount; itemAmount < merchRestockItem[iMR + 1]; itemAmount ++) { // for loop to buy items while there is enough money\n\t\t\t\tfeedback += \"<br>\";\n\t\t\t\tswitch (merchRestockItem[iMR][0]) {\n\t\t\t\t\tcase \"a\": // 7 - armour\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][7];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"l\": // 4 - light sources\n\t\t\t\t\tcase \"s\": // 4 - shields\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][4];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"m\": // 3 - misc.\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][3];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"w\": // 5 - weapons\n\t\t\t\t\t\titemCost = merchRestockItem[iMR][6];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(OPC.copper >= itemCost) { // is there enough money? (set up for torches)\n\t\t\t\t\tOPC.copper -= itemCost; // remove copper\n\t\t\t\t\tOPC.backpack.push(merchRestockItem[iMR]); // add item to backpack\n\t\t\t\t\tfeedback += merchRestockItem[iMR][1] + \" purchased for \" + itemCost + \" cp.\";\n\t\t\t\t}\n\t\t\t\telse { // if there is not enough money\n\t\t\t\t\tbreak; // end to purchasing loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfeedback += \"<br>\" + OPC.name + \" leaves the merchant.\";\n\tdocument.getElementById(\"opc-feedback\").innerHTML=feedback;\n\tEquipBest();\n//\tOPC.goal = \"travel\";\n\tOPC.encounter = \"\";\n\tWriteOPC();\n\t/*\n\t- equiup best just in case\n\t- sell things in the backpack that are not on a keep list\n\t- purchase things from the store to restock supplies; this will be based on what light source is available\n\t- create a list of items that are in stock\n\t- add some way to track currency (cp) which should be reflected in carry capacity\n\t*/\n}", "function payMoney(pmcData, body, sessionID) {\n item.resetOutput();\n let output = item.getOutput();\n let tmpTraderInfo = trader_f.traderServer.getTrader(body.tid, sessionID);\n let currencyTpl = getCurrency(tmpTraderInfo.data.currency);\n\n // delete barter things(not a money) from inventory\n if (body.Action === 'TradingConfirm') {\n for (let index in body.scheme_items) {\n let item = undefined;\n\n for (let element of pmcData.Inventory.items) {\n if (body.scheme_items[index].id === element._id) {\n item = element;\n }\n }\n\n if (item !== undefined) {\n if (!isMoneyTpl(item._tpl)) {\n output = move_f.removeItem(pmcData, item._id, output, sessionID);\n body.scheme_items[index].count = 0;\n } else {\n currencyTpl = item._tpl;\n break;\n }\n }\n }\n }\n\n // find all items with currency _tpl id\n const moneyItems = itm_hf.findMoney(\"tpl\", pmcData, currencyTpl);\n\n // prepare a price for barter\n let barterPrice = 0;\n \n for (let item of body.scheme_items) {\n barterPrice += item.count;\n }\n\n // prepare the amount of money in the profile\n let amountMoney = 0;\n \n for (let item of moneyItems) {\n amountMoney += item.upd.StackObjectsCount;\n }\n\n // if no money in inventory or amount is not enough we return false\n if (moneyItems.length <= 0 || amountMoney < barterPrice) {\n return false;\n }\n\n let leftToPay = barterPrice;\n\n for (let moneyItem of moneyItems) {\n let itemAmount = moneyItem.upd.StackObjectsCount;\n\n if (leftToPay >= itemAmount) {\n leftToPay -= itemAmount;\n output = move_f.removeItem(pmcData, moneyItem._id, output, sessionID);\n } else {\n moneyItem.upd.StackObjectsCount -= leftToPay;\n leftToPay = 0;\n output.data.items.change.push(moneyItem);\n }\n\n if (leftToPay === 0) {\n break;\n }\n }\n\n // set current sale sum\n // convert barterPrice itemTpl into RUB then convert RUB into trader currency\n let saleSum = pmcData.TraderStandings[body.tid].currentSalesSum += fromRUB(inRUB(barterPrice, currencyTpl), getCurrency(tmpTraderInfo.data.currency));\n\n pmcData.TraderStandings[body.tid].currentSalesSum = saleSum;\n trader_f.traderServer.lvlUp(body.tid, sessionID);\n output.data.currentSalesSums[body.tid] = saleSum;\n\n // save changes\n logger.logSuccess(\"Items taken. Status OK.\");\n item.setOutput(output);\n return true;\n}", "function roboteggCollectorOn () {\n if (gameData.roboteggcollectorNum >= 0 && gameData.cash >= gameData.roboteggcollectorCost) {\n gameData.roboteggcollectorNum++;\n gameData.cash -= gameData.roboteggcollectorCost;\n gameData.roboteggcollectorCost = 10 * Math.pow(1.2, gameData.roboteggcollectorNum + 1); \n duckUpdate();\n }\n}", "function buy20() {\n const credit = 2300;\n addCredit(credit);\n return credit;\n}", "function decTotal(res, mysql, complete, p_id, cust_id){\n var sql = \"UPDATE Shopping_cart SET total = total - (SELECT price FROM Product WHERE p_id=?) WHERE cust_id=?;\";\n var inserts = [p_id, cust_id];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n complete();\n });\n }", "function updateBalance(){\r\n //new array that only have transaction amount\r\n const transactionAmounts = transactions.map( transaction => transaction.amount);\r\n \r\n const totalBalance = transactionAmounts.reduce( (acc, amount) => ( acc += amount), 0 );\r\n\r\n // let debitBalance = 0;\r\n \r\n //calculate credit balance\r\n const creditBalance = transactionAmounts.filter(amount => amount>0).reduce((acc,amount) => (acc+=amount),0\r\n );\r\n //calculate debit balance\r\n const debitBalance = transactionAmounts.filter(amount => amount<0).reduce((acc,amount) => (acc+=amount),0);\r\n \r\n //update all values in the DOM\r\n balance.innerText = `$${totalBalance}`;\r\n moneyCredit.innerText = `$${creditBalance}`;\r\n moneyDebit.innerText= `$${debitBalance}`;\r\n}", "withdraw() {\n let number = prompt(\"How much do you want to withdraw??\");\n this.balance = (this.balance - number);\n this.balance = parseInt(this.balance);\n return this.balance;\n\n }", "function checkCashRegister(price, cash, cid) {\n //all money values are multiplied by 100 to deal with precision errors involved with decimals\n const denomination = [10000, 2000, 1000, 500, 100, 25, 10, 5, 1];\n\n function transaction(price, cash, cid) {\n let changeNeeded = (cash - price) * 100;\n //money will be pushed to the second value in each array\n let moneyProvided = [\n [\"ONE HUNDRED\", 0],\n [\"TWENTY\", 0],\n [\"TEN\", 0],\n [\"FIVE\", 0],\n [\"ONE\", 0],\n [\"QUARTER\", 0],\n [\"DIME\", 0],\n [\"NICKEL\", 0],\n [\"PENNY\", 0],\n ];\n //take the cid, reverse it (like in Roman Numerals exercise), multiply values by 100\n let availCash = [...cid].reverse().map((el) => [el[0], el[1] * 100]);\n //get the total sum of all cash and divide by 100\n let sumOfCash = availCash.reduce((a, b) => a + b[1], 0) / 100;\n //if sumOfCash is exact change needed return\n if (sumOfCash === changeNeeded / 100) {\n return { status: \"CLOSED\", change: [...cid] };\n }\n //else, run this function\n else {\n for (let i = 0; i < availCash.length; i++) {\n //if denomination values are less than changeNeeded and availableCash values are greater than 0, run the while loop\n while (denomination[i] <= changeNeeded && availCash[i][1] > 0) {\n //1. moneyProvided array is increased by denomination value\n moneyProvided[i][1] += denomination[i];\n //2. changeNeeded is decreased by same denomination value\n changeNeeded -= denomination[i];\n //3. availCash is also decreased by same denomination value\n availCash[i][1] -= denomination[i];\n }\n }\n\n //clean up the moneyProvided array by\n let change = moneyProvided\n //1. resetting the money values by dividing by 100\n .map((el) => [el[0], el[1] / 100])\n //2. filtering out all non-empty dollar and value arrays\n .filter((el) => el[1] !== 0);\n //calculate the total of the change array\n let changeTotal = change.reduce((a, b) => a + b[1], 0);\n //if the total change is less than the change needed\n if (changeTotal < changeNeeded) {\n return { status: \"INSUFFICIENT_FUNDS\", change: [] };\n }\n return { status: \"OPEN\", change };\n }\n }\n\n //this is where the transaction function is called\n let answer = transaction(price, cash, cid);\n //here the final answer is provided if the 2 if statements don't catch it first\n console.log(answer);\n}", "transfer(amount, destination) {\n this.withdraw(amount);\n destination.deposit(amount);\n }", "function keepBuyingPhone() {\n let balance = getBalance();\n let amt = checkForAccessory(); //value is phoneprice + amt OR just phoneprice\n while (balance > amt) {\n return output.textContent = calcSum(balance, amt); //output calcSum func\n balance = balance - amt; //subtract amt from balance each time\n } \n}", "async execute(client, message, args) {\n var userID = message.author.id + message.guild.id\n var bank = db.fetch(`bank_${userID}`)\n if(!args.length) return message.channel.send('You ain\\'t gonna withdraw anything, m8?')\n if(args[0] > bank) return message.channel.send('Bruh you think you have that much money in your bank?')\n\n db.add(`money_${userID}`, args[0])\n db.subtract(`bank_${userID}`, args[0])\n var bal = db.fetch(`money_${userID}`)\n var withdrawEmbed = new MessageEmbed()\n .setColor(\"GREEN\")\n .setDescription(`**You have withdrawn \\`${args[0]}\\`**.\\n\\n**Your balance**\\n$${bal}`)\n\n message.channel.send(withdrawEmbed)\n }", "withdraw(amount) {\n if (this.checkWithdrawal(amount) === true) {\n this.balance -= amount;\n this.trans.push(`$${amount} withdrawn`);\n return this.balance;\n }else {\n return (\"Error: Not enough money to withdraw that amount.\");\n }\n }", "async function depositAccount(address, amount, client) {\n await walletSend(await ensureGiver(client), address, amount);\n}", "function depositCash() {\n\n let deposit = prompt('How much would you like to deposit today?');\n let depositAmount = parseInt(deposit,10);\n balance +=depositAmount;\n alert (`Your new balance is ${balance}`);\n chooseService();\n return balance;\n}", "function depositeWithdraw (getId,newAmount) {\n // add new deposite to previous deposite\n var previous = document.getElementById(getId);\n var previousAmountText = previous.innerText;\n var previousAmount = parseFloat(previousAmountText);\n // total deposite\n var total = newAmount + previousAmount;\n previous.innerText = total;\n}", "function Buy(i) {\n //checking if there is enough gold to buy resource\n if (goldAmount >= prices[i]) {\n //increasing amount of resource\n amounts[i]++;\n //decreasing amount of gold by price\n goldAmount -= prices[i];\n }\n else\n {\n //no money alert\n alert(\"You don't have money\");\n }\n}", "function updateTotalCookPerSecChain(){\n updateTotalCookPerSec();\n \n if(dist[item]){\n updateTotalDistribution();\n }\n else{\n updateTotalProduction();\n }\n \n updateTimeToGet();\n updateEfficiency();\n}", "async makeDeposit({response,request,auth}){\n\n const { reference } = request.all() \n \n const validation = await validateAll( {reference},{reference:'required'});\n \n if (validation.fails()){\n return response.status(400).json({message:validation.messages()})\n }\n \n const paymentVerification = await Paystack.transaction.verify({reference})\n \n var {status,amount,gatewayresponse} = paymentVerification.data\n \n amount = parseFloat(amount)/100\n \n const user = await auth.getUser();\n \n const {id:user_id} = user \n \n const client_deposit = {user_id,amount,reference}\n \n if(status == \"success\"){\n // regiter Deposit in Deposit table\n const newDeposit = await Deposit.create({...client_deposit})\n \n const client_details = await user.client().fetch(); \n \n var {balance:amount_from_db} = client_details\n \n amount_from_db += amount\n \n //update the client amount\n await Client\n .query()\n .where ('user_id',user_id)\n .update({balance:parseFloat(amount_from_db)})\n \n \n return response.status(200).json({message:\"Top Up Successful\"})\n }\n else {\n return response.status(200).json({message:gatewayresponse})\n }\n \n }", "function withDraw(account, amount){\n\taccount.balance -= amount;\n}", "function airdropDeposit() {\n\t//First check that the erc20Instance is defined. \n\tif(erc20InstanceDefined()) {\n\t\t//Next take the user's input to see how many tokens the user wants to deposit. \n\t\tvar tokensToDeposit = $(\"#value-of-airdrop-deposit\").val();\n\t\t//Now check if the user's input is a positive number. \n\t\tif(isPositiveNumber(\"#value-of-airdrop-deposit\")) {\n\t\t\t//If it is a positive number then multiply it by (10**erc20Decimals) to give the number\n\t\t\t//the correct number of zeros at the end.\n\t\t\ttokensToDeposit = tokensToDeposit * (10**erc20Decimals);\n\t\t} else {\n\t\t\t//If the input is not a positive number, then warn the user and exit the funciton. \n\t\t\talert(\"PLEASE ENTER THE TOTAL AMOUNT OF TOKENS YOU WANT TO DEPOSIT ON THE AIRDROP CONTRACT\");\n\t\t\treturn;\n\t\t}\n\t\t//Now check that the user has enough tokens in his or her MetaMask wallet to fascilitate the \n\t\t//deposit. \n\t\tif(tokensToDeposit > erc20Balance) {\n\t\t\t//If the user does not have enough tokens then alert the user and exit the function. \n\t\t\talert(\"YOU DO NOT HAVE ENOUGH TOKENS IN YOUR WALLET FOR THIS DEPOSIT\");\n\t\t\treturn;\n\t\t}\n\t\t//Now invoke the transfer() function of the erc20 token and have the user sign the transaction \n\t\t//to have the tokens transferred from his or her MetaMask to the airdrop contract address. \n\t\terc20Instance.transfer(airdropAddress, tokensToDeposit, {from: web3.eth.accounts[0], gasPrice: 5e10}, (error, result)=>{\n\t\t\tif(!error) {\n\t\t\t\t$(\"#tx-msg\").html(\"Check the status of your token deposit \");\n\t\t\t\t$(\"a.tx-link\").attr(\"href\", \"https://ropsten.etherscan.io/tx/\"+result);\n\t\t\t\t$(\"#txModal\").modal('show');\n\t\t\t} else {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t})\n\t} \n}", "function depositInto(purse, payment) {\n const oldPurseAmount = purseKeeper.getAmount(purse);\n const paymentAmount = paymentKeeper.getAmount(payment);\n // Also checks that the union is representable\n const newPurseAmount = assay.with(oldPurseAmount, paymentAmount);\n\n // ///////////////// commit point //////////////////\n // All queries above passed with no side effects.\n // During side effects below, any early exits should be made into\n // fatal turn aborts.\n paymentKeeper.remove(payment);\n purseKeeper.updateAmount(purse, newPurseAmount);\n\n return paymentAmount;\n }", "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "function bankingCashCounter()\n{\n try {\n var queue = new access.Queue;\n var bankAmount = 5000;\n var flag = true;\n var num = read.questionInt(\"Enter total number of people in a queue : \");\n if (num > 0) {\n /*\n *loop to deposit or withdraw the amount\n */\n for (let i = 1; i <= num; i++) {\n var choice = read.questionInt(\"Person \"+i+\"\\nEnter 1 to deposit amount \\nEnter 2 to withdraw amount \\n\");\n if (choice == 1) {\n var amount = read.questionFloat(\"Enter the total amount to deposit : \");\n if(amount>0)\n {\n queue.enqueue(Number(amount));\n flag = true;\n if (flag) {\n /* var count = 0;\n for (let j = 1; j <= num; j++) {\n count += queue.dequeue();\n }*/\n var total = bankAmount + amount;\n if (amount > 0) {\n console.log(\"Balance is : \" + total);\n }\n else {\n console.log(\"Insufficient balance\");\n \n }\n if (total < bankAmount) {\n /*\n *checks if minimum balance is maintained in the account\n */\n console.log(\"Maintain minimum balance \" + bankAmount + \" in the bank account\");\n }\n else {\n console.log(\"Minimum balance is maintained in the bank\");\n }\n }\n }\n else{\n console.log(\"Enter amount greater than 0\"); \n }\n /*\n *invoking enqueue function to deposit the amount\n */\n \n }\n else if (choice == 2) {\n var amount = read.questionInt(\"Enter the total amount to withdraw : \");\n if(amount>0)\n {\n queue.enqueue(Number(-amount));\n flag = true;\n if (flag) {\n var count = 0;\n for (let j = 1; j <= num; j++) {\n count += queue.dequeue();\n }\n var total = bankAmount + count;\n if (count > 0) {\n console.log(\"Balance is : \" + total);\n }\n else {\n console.log(\"Insufficient balance\");\n \n }\n if (total < bankAmount) {\n /*\n *checks if minimum balance is maintained in the account\n */\n console.log(\"Maintain minimum balance \" + bankAmount + \" in the bank account\");\n }\n else {\n console.log(\"Minimum balance is maintained in the bank\");\n }\n }\n }\n else{\n console.log(\"Enter amount greater than 0\"); \n }\n /*\n *invoking enqueue function to withdraw the amount\n */\n \n }\n else {\n console.log(\"Enter choice either 1 or 2\");\n flag = false;\n return;\n }\n }\n }\n else {\n console.log(\"Enter positive number\");\n return;\n }\n /* if (flag) {\n var count = 0;\n for (let j = 1; j <= num; j++) {\n count += queue.dequeue();\n }\n var total = bankAmount + count;\n if (count > 0) {\n console.log(\"Balance is : \" + total);\n }\n else {\n console.log(\"Insufficient balance\");\n \n }\n if (total < bankAmount) {\n /*\n *checks if minimum balance is maintained in the account\n */\n /* console.log(\"Maintain minimum balance \" + bankAmount + \" in the bank account\");\n }\n else {\n console.log(\"Minimum balance is maintained in the bank\");\n }\n }*/\n } catch (error) {\n console.log(error.message);\n }\n}", "redeemCoin({account,coin,ris}) {\n\n //When a client attempts to redeem a coin, first verify that the coin has been signed by the bank. \n //The coin's signature should be stored in a 'signature' property of the coin object. \n //The signature should match the coin's string representation (which you can get from calling `coin.toString()`).\n\n\n let cs = coin.toString();\n\n let valid = blindSignatures.verify({\n unblinded: coin.signature,\n N: coin.n,\n E: coin.e,\n message: cs,\n });\n\n // console.log(coin.signature);\n // console.log(cs +\" this is CS!!!!!!!!!!!!!!!!!!!\");\n if (!valid) {\n throw new Error('Invalid signature');\n } else if (cs === coin.signature || coin.signature === undefined) {\n throw new Error('Invalid signature 2');\n }\n\n // Every coin should have a GUID stored in its 'guid' property. \n\n let coinGUID = coin.guid;\n\n //If the coin has not been received previously, accept the coin and update the redeemer's balance.\n if (this.coinDB[coinGUID] === undefined) {\n this.deposit({account,amount:coin.amount});\n this.coinDB[coinGUID] = ris;\n console.log(`Coin #${coinGUID} has been redeemed. Have a nice day.`);\n }\n // On the other hand, if the coin has been received previously, determine who cheated.\n else {\n console.log(`Coin ${coinGUID} previously spent. Determining cheater.`);\n\n let cheater = undefined;\n for (let i = 0; i < ris.length; i++) {\n // console.log(\"KEY LENGTH\" + ris[i].length);\n // console.log(\"cipher LENGTH\" + coinGUID[i].length);\n\n let identStr = utils.decryptOTP({\n key: ris[i],\n ciphertext: this.coinDB[coinGUID][i],\n returnType: \"string\"\n });\n\n //If the coin purchaser cheated, print out the identity of the cheater. \n if (identStr.startsWith(IDENT_STR)) {\n cheater = identStr.split(':')[1];\n console.log(`${cheater} double spent coin ${coin.guid}.`);\n break;\n }\n }\n //Otherwise, identify the redeemer as the cheater.\n if (cheater === undefined) {\n console.log(\"The merchant tried to redeem the coin twice\");\n }\n // As with DigiCash, DCL will use random identity strings (RISs) to identify the cheater. \n //When accepting a coin, you must keep the RIS to identify cheaters in future double-spend attempts.\n console.log(`Sorry, but coin #${coinGUID} cannot be accepted.`);\n\n\n\n\n }\n\n\n }", "deriveTotalPaymentCost(paymentsArray, userName) {\n let totalPaymentCost = 0;\n paymentsArray.forEach(order => {\n if (order.user === userName) {\n totalPaymentCost = totalPaymentCost + order.amount;\n }\n });\n return totalPaymentCost;\n }", "function purchaseAutoUpgrades(autoUpgradeChoice) {\n let purchSing = automaticUpgrades[autoUpgradeChoice]\n let buySing = purchSing + automaticUpgrades[autoUpgradeChoice].quantity\n if (cheese >= automaticUpgrades[autoUpgradeChoice].price) {\n automaticUpgrades[autoUpgradeChoice].quantity ++\n cheese -= automaticUpgrades[autoUpgradeChoice].price\n automaticUpgrades[autoUpgradeChoice].price += 200\n console.log(automaticUpgrades[autoUpgradeChoice].quantity);\n}\ndrawAutomaticUpgrades()\n}", "withdraw({account,amount}) {\n if (this.ledger[account] === undefined) {\n throw new Error(`${account} is not a registered customer of the bank`);\n }\n if (this.ledger[account] < amount) {\n throw new Error(\"Insufficient funds\");\n }\n this.ledger[account] -= amount;\n }", "function purchase(choice){\n if (choice == 0 && balance >= 75){\n console.log(\"You have purchased Dr Pepper\");\n }\n if (choice == 1 && balance >= 75){\n console.log(\"You have purchased Coke\");\n }\n if (choice == 2 && balance >= 75){\n console.log(\"You have purchased Pepsi\");\n }\n if (choice == 3 && balance >= 150){\n console.log(\"You have purchased Flake\");\n }\n if (choice == 4 && balance >= 150){\n console.log(\"You have purchased KitKat\");\n }\n if (choice == 5 && balance >= 150){\n console.log(\"You have purchased Daim\");\n }\n if (choice == 6 && balance >= 100){\n console.log(\"You have purchased Skips\");\n }\n if (choice == 7 && balance >= 100){\n console.log(\"You have purchased Monster Munch\");\n }\n if (choice == 8 && balance >= 100){\n console.log(\"You have purchased McCoys\");\n }\n\n}", "function submitPurchase () {\n var title = $(\"#purchase\").val()\n var price = $(\"#price\").val()\n \n if (!title || title == \"\") return;\n \n if (!price || isNaN(price)) {\n alert(\"Please insert a valid number\");\n return;\n }\n \n var buyers = [];\n $('input[name=buyer]:checked').each(function() {\n buyers.push($(this).val());\n });\n \n Purchases.insert({\n creator: Meteor.userId()\n , price: price\n , title: title\n , buyers: buyers\n }, function(error, result){\n\t for (var i = 0; i < buyers.length; i++) {\n\t\tDebts.insert({\n\t\t\tpurchaseId: result\n\t\t , title: title\n\t\t , creditor: Meteor.userId()\n\t\t , debtor: buyers[i]\n\t\t , price: (price / buyers.length).toFixed(2)\n\t\t , paid: (Meteor.userId() == buyers[i])\n\t\t})\n\t }\n });\n \n $(\"#purchase\").val()\n}", "function doubleMoney() {\n data = data.map((user) => {\n return { ...user, money: user.money * 2 };\n });\n updateDOM();\n}", "function buy (id, quanityNum, quanity){\n // console.log(\"this is hte BUY function\")\n // console.log(\"this is quanity \"+quanity)\n // console.log(\"this is quanityNum \"+quanityNum)\n quanityNum -= quanity\n // console.log(\"new quanityNum =\"+quanityNum)\n var query = 'UPDATE products SET ? WHERE ?'\n connection.query(query,[{StockQuantity : quanityNum},{itemID:id}], function(err,res){\n if (err)throw err;\n console.log(\"=========================\")\n console.log(\"ORDER PLACED SUCESSFULLY!\")\n console.log(\"=========================\")\n });\n var select = 'SELECT Price FROM products WHERE ?'\n connection.query(select,{itemID : id}, function(err, res){\n if (err) throw err;\n var priceEach = res[0].Price;\n var totalPrice = priceEach * quanity\n console.log(\"Your order total is \"+totalPrice);\n return;\n });\n\n//remove items from the database Stock Quantity based on user choice, message order complete. \n\n\nreturn;\n}" ]
[ "0.6344042", "0.6142094", "0.59707654", "0.59464335", "0.58904266", "0.5883644", "0.58782816", "0.5858526", "0.5807908", "0.57528013", "0.5734093", "0.5729706", "0.5669909", "0.56642145", "0.5635661", "0.5620646", "0.5572337", "0.55587494", "0.5558613", "0.5549193", "0.5542278", "0.55239797", "0.552352", "0.55117905", "0.55088544", "0.55070364", "0.5499715", "0.54947364", "0.5483708", "0.5467637", "0.5462957", "0.54611754", "0.54312277", "0.5426162", "0.54198855", "0.54188776", "0.54147035", "0.54116595", "0.54109544", "0.539836", "0.53750145", "0.5373259", "0.53721017", "0.53645486", "0.5361326", "0.5360618", "0.5358607", "0.53531086", "0.53491604", "0.5338358", "0.53307277", "0.53240716", "0.5323926", "0.5312165", "0.53090334", "0.530213", "0.52909553", "0.5287274", "0.528629", "0.5283072", "0.5280185", "0.52794725", "0.5270647", "0.52686185", "0.5265161", "0.52580273", "0.5257235", "0.52424777", "0.5232973", "0.5223412", "0.5222641", "0.5222113", "0.5221012", "0.5218051", "0.5216658", "0.5212628", "0.52033365", "0.5194466", "0.519248", "0.5191961", "0.5188029", "0.51852816", "0.5184721", "0.518431", "0.5178929", "0.51782924", "0.5175932", "0.517586", "0.5175174", "0.5174127", "0.5174093", "0.51680577", "0.5162197", "0.51619035", "0.51602113", "0.5157301", "0.51524866", "0.51505435", "0.5148631", "0.5140623" ]
0.69656706
0
Gets an Item object from the shop
function getItemFromShop(itemName){ return data.store.find(storeItem => { return storeItem.Item === itemName; }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getItemById (itemId) {\n return Item.findOne({ \"_id\": itemId })\n}", "function getShopItemInfo(shopItem) {\n //Create an object with shop item data\n const shopItemInfo = {\n image: shopItem.querySelector('img').src,\n title: shopItem.querySelector('h5').textContent,\n price: shopItem.querySelector('p strong').textContent,\n id: shopItem.querySelector('a').getAttribute('data-id')\n }\n addIntoCart(shopItemInfo)\n}", "fetchInventoryItem(id){\r\n return Api().get('/inventory/' + id)\r\n }", "function getShops(item){\n\t\t\n\t}", "get item() {\n if (!this._item) {\n this._item = this._buildItem();\n }\n\n return this._item;\n }", "static getItem() {\n let item = JSON.parse(localStorage.getItem(CartManager.key));\n return item;\n }", "getItem(recipeSlug) {\n // items in favorites are an array so we can still use find\n return this.items.find(({ slug }) => slug === recipeSlug) || null;\n }", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "getGearItem(id) {\n // console.log(\"fetch\", id)\n return fetch(`${remoteURL}/gearItems/${id}`).then(e => e.json());\n }", "retrieveItem(key) {\n let item = null\n // Try to get the item first\n if (this.hasItem(key)) {\n item = this.getItem(key) || null // getItem returns undefined\n }\n\n if (item === null) {\n // Throw an error?\n }\n\n return item\n }", "getItem(recipeSlug) {\n return this.items.find(({ slug }) => slug === recipeSlug) || null;\n }", "function getItemFromInventory(memberObj, itemName){\n let shopUser = getShopUser(memberObj);\n return shopUser.inventory.find(invItem => {\n return invItem.Item === itemName;\n })\n}", "function itemByName (name) {\n return bot.inventory.items().filter(item => item.name === name)[0]\n}", "function getGroceryItem(id)\r\n{\r\n\tfor( var index in groceryItems) {\r\n\t\tif (id == groceryItems[index].id)\r\n\t\t\treturn groceryItems[index];\r\n\t}\r\n\treturn null;\r\n}", "fetchInventory () {\r\n return Api().get('inventory')\r\n }", "getItemById(db, site_id, item_id) {\n return db.from(\"inventory\").where({\n site_id: site_id,\n id: item_id,\n });\n }", "getItem(id) {\n const index = this.getItemIndex(id);\n if (!~index) {\n return null;\n }\n const targetItem = this.#items[index];\n return { ...targetItem }; // return a copy, so it can't be affected outside\n }", "function getCheckedOutItem(barcode) {\n return items.get(barcode).then(function (data) {\n if (!data.checkout) {\n throw {httpStatusCode: 400, code: 'ITEM_NOT_CHECKED_OUT', errno: 1101};\n }\n return data;\n });\n }", "buyItems(item){\n let shopSells = new Shop('magic shop', 'sells magic things')\n this.items.push(item);\n shopSells.sellItems(item);\n }", "function findItemById(id) {\n return db('menu')\n .where ({ id })\n .first()\n}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "fetchShop(gameId) {\n return Repository.get(`${gameId}${resource}`)\n }", "getItem(itemSlugAndId) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this._handleApiCall(`${this.gameBaseUrlPath}/item/${itemSlugAndId}`, 'Error fetching the specified item.');\n });\n }", "get item(){\n return items[this.itemID]\n }", "getItem(req, res) {\n db.items.getById(req.params.id)\n .then((result) => {\n res.json(result[0]);\n });\n }", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "getBasketItem(id) {\n for(let i = 0; i < this.basket.length; ++i) {\n if(this.basket[i].id == id) {\n return JSON.parse(JSON.stringify(this.basket[i]));\n }\n }\n }", "function getItem(name) {\n return container.get(name);\n }", "getItem(key) {\n return this.store.get(key);\n }", "get item() {\n return this._item;\n }", "function getInventory(){\n axios.get('/inventory')\n .then(res => setItems(res.data))\n .catch(err => alert(err))\n }", "function getSingleUnit(productid) {\r\n let product;\r\n shopProducts.forEach(item => {\r\n if(item.id === productid) {\r\n console.log(item);\r\n product = item;\r\n }\r\n \r\n }); \r\n\r\n return product;\r\n}", "get items() {\n // Send the request\n return this._cartRequest('cart/items', {}, 'GET');\n }", "get item () {\n\t\treturn this._item;\n\t}", "get item() {\n if (!this._item) {\n this.render();\n }\n\n return this._item;\n }", "getItemById(id) {\n return new Promise((fulfill, reject) => {\n return items().then((itemCollection) => {\n return itemCollection.findOne({\n _id: id\n }).then((item) => {\n if (!item) reject(\"Item not found\");\n fulfill(item);\n });\n });\n });\n }", "function getItemByUserId(user_id) {\n return db(\"items\").where({ user_id });\n}", "function CartItem() {\n\treturn this;\n}", "getItemById (context, id) {\n return itemGetter.getItemById(context, id);\n }", "function get_item(id, real)\n {\n return id2dom(id, real).get(0);\n }", "function findItemInCart(id) {\n for(var i=0;i < products_cart.items.length; i++){\n if(products_cart.items[i].id == id){\n return {item:products_cart.items[i],index:i};\n }\n }\n}", "async function getItemById(id) {\n await validations.isIntValid(itemsDao.getItemId(id));\n let requestedItem = await itemsDao.getItemById(id);\n return requestedItem;\n}", "function buyItem(user){\n return user\n}", "function Item (name, barcode, sellingPrice, buyingPrice) {\n this.name = name;\n this.barcode = barcode;\n this.sellingPrice = sellingPrice;\n this.buyingPrice = buyingPrice;\n}", "function getItemById(data, id){\n return data[id];\n}", "static getById(request, response) {\r\n\r\n itemsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n response.json(data); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.params.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error getting item by ID: ', request.params.id, err);\r\n });\r\n }", "function getItem(itemUid) {\n return loadData()\n .then(function(response) {\n var item = $filter('filter')(response.data, itemUid)[0];\n return item;\n });\n }", "get item() {\n\t\treturn this.__item;\n\t}", "function buyItem(user){\n return Object.assign({}, )\n}", "getProduct() {\n return __guard__(this.get('products'), (x) => x[0]);\n }", "oneShop(_,args) {return queryOneShop(args.id)}", "function ItemToProduct(item) {\n product = {\n name: item.Name,\n price: item.UnitPrice\n };\n\n return product;\n}", "function getAllItems () {\n return Item.find()\n}", "get itemObjectId() {\n return this.catalogItemObj.id;\n }", "function makeItem(id) {\n return getJSON(baseUrl + \"item/\" + id + \".json\");\n}", "function buyItem(user){\n return Object.assign({}, user, )\n}", "function Item(code, desc, price, image, category, stock, deliveryDays){\r\n this.code = code;\r\n this.description = desc;\r\n this.price = price;\r\n this.image = image;\r\n this.category = category;\r\n this.stock = stock;\r\n this.deliveryDays = deliveryDays;\r\n this.user = \"Leo\"; \r\n}", "function getItemByID(id, items) {\n for (i = 0; i < items.length; i++) {\n if (items[i].ID === id) {\n return items[i];\n }\n }\n }", "function getItemsInCart(){\n\t\t\treturn items;\n\t\t}", "function getOneProduct(){ \n var randomDisplay = Math.floor(Math.random() * SurveyItems.productList.length);\n var getItem = SurveyItems.productList[randomDisplay];\n\n return getItem; \n}", "grabItem(id) {\n\n return new TotoAPI().fetch('/supermarket/currentList/items/' + id, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({grabbed: true})\n });\n }", "function getIdOfItem(item){\n return item.id;\n}", "getItem(item) {\n // Cannot use truthiness test because index zero may be passed.\n if (item != null) {\n // Access by index\n if (typeof item === 'number') {\n return this.items[item];\n } // Access by element\n\n if (item.nodeType === 1) {\n return Widget.fromElement(item, 'menuitem', this.contentElement);\n } // Access by id\n else {\n return this.items.find(c => c.id == item);\n }\n }\n }", "function purchaseItem() {\n return\n}", "function findItemById(data, id) {\n\tlet itemData = data.getIn(['items',id]);\n\tif (itemData) {\n\t\treturn [id,itemData];\n\t}\n\treturn null;\n}", "static findOneItem (req, res) {\n let id = req.params.id\n Item.find({_id: id})\n .then((items) => {\n res.status(200).json({\n message: \"data item\",\n data: items\n })\n })\n .catch((err) => {\n res.status(400).json({\n message: err.message\n })\n \n });\n\n }", "function getItem(items, id) {\n\t\tvar i,\n\t\t\titem;\n\n\t\tfor (i in items) {\n\t\t\titem = items[i];\n\t\t\tif (item.id == id) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "function getShopItemsFromStorage() {\n \n let shopItems;\n\n //if something exists in storage get the values otherwise create an empty array\n if (localStorage.getItem('shopItems') === null) {\n shopItems = [];\n } else {\n shopItems = JSON.parse(localStorage.getItem('shopItems') )\n }\n return shopItems;\n}", "getItemId(item){return this.itemIdPath?this.get(this.itemIdPath,item):item}", "getItem(id) {\n const index = this.getItemIndex(id);\n if (!~index) {\n // ~ turns -1 into 0. It's just a short-cut. Is a bitwise operator\n return null; // so null is returned if the record is not found\n }\n const targetItem = this.#items[index];\n return { ...targetItem }; // return a copy, so it can't be affected outside\n }", "_getFreshItem() {\n\t\treturn {\n\t\t\tdescription: \"\",\n\t\t\tamount: \"\"\n\t\t};\n\t}", "async purchaseItem(itemId) {\n const purchase_result = await this.__request(`https://dragonsofmugloar.com/api/v2/${this.game.gameId}/shop/buy/${itemId}`, \"POST\");\n\n if (purchase_result) {\n const {gold, level, lives, shoppingSuccess, turn} = purchase_result;\n if (!shoppingSuccess) {\n console.log(\"Cannot buy this item!\");\n }\n await this.updateGameState(lives, gold, null, null, turn, level);\n }\n\n }", "getStorageItem(item_key) {\n return (localStorage.getItem(item_key)) ? JSON.parse(localStorage.getItem(item_key)) : null;\n }", "function retrieve_item() {\n let qty_in_store = localStorage.getItem('Qty');\n if(qty_in_store){\n qty = JSON.parse(qty_in_store);\n }\n}", "function getItem(item, id) {\n for( var i = 0; i < item.length; i++){\n\n if(id == item[i].id){\n return item[i];\n }\n }\n}", "get(id) {\n const index = this.indexOfId(id);\n if (index > -1) return this.items[index];\n }", "function findById(id) {\n return store.items.find(item => item.id === id);\n }", "function getOne() {\n\t\t$scope.server.get({\n\t\t\taction: 'log_request',\n\t\t\titemDetails: {sys_id: $scope.data.sc_cat_item.sys_id, \n\t\t\t\t\t\t\t\t\t\tname: $scope.data.sc_cat_item.name,\n\t\t\t\t\t\t\t\t\t\tsys_class_name: $scope.data.sc_cat_item.sys_class_name}\n\t\t});\n\n\t\tif ($scope.data.sys_properties.twostep && $scope.data.sc_cat_item.sys_class_name != \"sc_cat_item_producer\") {\n\t\t\t$scope.server.get({\n\t\t\t\tcart: 'cart_' + $scope.data.sc_cat_item.sys_id,\n\t\t\t\titemDetails: {sys_id: $scope.data.sc_cat_item.sys_id, quantity: $scope.data.sc_cat_item.quantity, fields: getVarData($scope.data.sc_cat_item._fields), newRecordID: $scope.data._generatedItemGUID},\n\t\t\t\taction: $scope.data.is_wishlist_item ? \"order_wishlist_item\" : \"order_item\"\n\t\t\t}).then(function(response) {\n\t\t\t\tvar orderItemModalCtrl;\n\t\t\t\tvar unregister = $scope.$on('$sp.service_catalog.cart.place_order', function(){\n\t\t\t\t\torderItemModalCtrl.close();\n\t\t\t\t});\n\n\t\t\t\tvar orderItemModal = angular.copy(response.data.orderItemModal);\n\t\t\t\torderItemModal.options.afterOpen = function(ctrl){\n\t\t\t\t\torderItemModalCtrl = ctrl;\n\t\t\t\t};\n\t\t\t\torderItemModal.options.afterClose = function() {\n\t\t\t\t\tunregister();\n\t\t\t\t\tc.orderItemModal = null;\n\t\t\t\t\torderItemModalCtrl = null;\n\t\t\t\t};\n\t\t\t\tc.orderItemModal = orderItemModal;\n\t\t\t});\n\t\t} else {\n\t\t\tpostCatalogFormRequest().then(function(response) {\n\t\t\t\tvar a = response.data.result;\n\t\t\t\t$scope.$emit(\"$$uiNotification\", a.$$uiNotification);\n\t\t\t\t$scope.$emit(\"$sp.sc_cat_item.submitted\", a);\n\t\t\t\tif ($scope.data.is_wishlist_item)\n\t\t\t\t\t$rootScope.$broadcast(\"$sp.service_catalog.wishlist.update\");\n\t\t\t\tif (a.number)\n\t\t\t\t\thandleRedirect(a.number, a.table, a.sys_id, a.redirect_to, a.redirect_portal_url);\n\t\t\t\t$scope.submitting = false;\n\t\t\t\t$scope.submitButtonMsg = $scope.m.submittedMsg;\n\t\t\t});\n\t\t}\n\t}", "function getAllItems() {\n return Item.find();\n}", "getPurchasedItems() {\n return this.purchasedItem;\n }", "getById(id) {\r\n const i = new Item(this);\r\n i.concat(`(${id})`);\r\n return i;\r\n }", "function buyItem(user){\n return Object.assign({}, user, { purchases: user.cart })\n}", "function getInventoryItem(id) {\n for (i = 0; i < inventoryItems.length; i++) {\n if (inventoryItems[i].inventoryItemId == id) \n return inventoryItems[i].inventoryItemName;\n \n}\n}", "loadEntity(itemId) {\n\n }", "function Item( name, price ) {\n this.name = name;\n this.price = price;\n this.sold = false;\n}", "get item(){ return this._item || {}; }", "async function fetchOneItem() {\n setSubHeader(\"Result after search\");\n const ul = document.getElementById(\"item-list\");\n ul.innerHTML = \"\";\n const input = document.getElementById(\"search-item\");\n\n const response = await fetch(\"/api/shoes/\" + input.value);\n const item = await response.json();\n\n if (response.ok) {\n createListItem(item);\n } else {\n createErrorItem(item);\n }\n\n input.value = \"\";\n}", "static getById(id) {\n return db\n .oneOrNone('SELECT * FROM shopping_carts WHERE id = $1', [id])\n .then((shoppingCart) => {\n if (shoppingCart) return new this(shoppingCart);\n throw new Error(`Shopping Cart ${id} not found`);\n });\n }", "function getItem(itemId) {\n $.ajax({\n url: '/products/getitem/' + itemId,\n type: 'GET',\n\n\n }).then(data => {\n\n $(\"#item\").val(data[0].Ptype);\n $(\"#size\").val(data[0].size);\n $(\"#color\").val(data[0].color);\n $(\"#imgUrl\").val(data[0].imgUrl);\n $(\"#productUrl\").val(data[0].productUrl);\n $(\"#price\").val(data[0].price);\n $(\"#occasion\").val(data[0].occasion);\n $(\"#gender\").val(data[0].gender);\n $(\"#brand\").val(data[0].brand);\n $(\"#height\").val(data[0].height)\n $(\"#edititem\").val(data[0].id);\n\n })\n }", "findOne(groceryListId, itemName, callback) {\n GroceryItem.findOne({where: {groceryListID: groceryListId, name: itemName}})\n .then((item) => {\n callback(null, item);\n })\n .catch((err) => {\n callback(err);\n })\n }", "function truckSpecificItem(truck_id, item_id){\n return db('items')\n .where('truck_id', truck_id)\n .andWhere('id', item_id)\n .first();\n}", "function findItemById(items, id) {\n\t\t\t\n\t\t\tfor (var i=0; i<items.length; i++){\n\t\t\t\tif (items[i].artid === id) { //property must match name in db here\n\t\t\t\t\treturn items[i];\t\t//return one object\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function item_info(item) {\n return parent.G.items[item.name];\n}", "getBoughtItemByTransectionId(transectionID) {\n for (let i = 0; i < window.Database.DB.bought.length; ++i) {\n if (window.Database.DB.bought[i].transaction_id == transectionID) {\n return window.Database.DB.bought[i];\n }\n }\n }", "function take_item() {\r\n\r\n\t\titem_ladle \t\t= new proto_item(0, \"Ladle\", \"This is a very dull wooden ladle its mostly for soup and acid, but mostly soup.\");\r\n\t\titem_silver_key = new proto_item(1, \"Silver Key\", \"This is a key, and it happens to be silver, who would have thought.\");\r\n\t\titem_lockbox \t= new proto_item(2, \"Lockbox\", \"This is a box shaped container, it is also locked. You need a key to open it.\");\r\n\t\titem_keycard \t= new proto_item(3, \"Keycard\", \"This is a card that can open doors, much like a real key, but however it is in the shape of a card.\");\r\n\r\n\r\n\t\tswitch (currentlocation) {\r\n\t\t\tcase 0: \r\n\t\t\t\t\tinventoryArray[0] = item_ladle\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Ladle.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\t\tinventoryArray[3] = item_card\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the card.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\t\tinventoryArray[2] = item_lockbox\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the lockbox.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\t\tinventoryArray[1] = item_silver_key\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Silver Key.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}" ]
[ "0.6840215", "0.67527175", "0.65636957", "0.65296793", "0.64509606", "0.643171", "0.64228094", "0.64165485", "0.6398271", "0.6361998", "0.63446003", "0.63249916", "0.6272496", "0.62217516", "0.6170912", "0.61449254", "0.6131862", "0.6063973", "0.60442835", "0.60430187", "0.6039112", "0.6039112", "0.6039112", "0.6039112", "0.6039112", "0.6039112", "0.6000139", "0.59805524", "0.5957533", "0.59368414", "0.59244806", "0.5908808", "0.5908583", "0.59021294", "0.58991855", "0.58942026", "0.5878492", "0.5877791", "0.5871687", "0.58690566", "0.5866063", "0.5863558", "0.5859656", "0.58548844", "0.58449715", "0.5839723", "0.5831396", "0.58246154", "0.5822972", "0.5794482", "0.5789201", "0.57657766", "0.5761275", "0.5754349", "0.5743815", "0.5738647", "0.57309365", "0.57155144", "0.57065284", "0.57059884", "0.5685762", "0.56769234", "0.56749296", "0.56743944", "0.56635165", "0.56521636", "0.56475395", "0.5644216", "0.56399703", "0.562719", "0.5621085", "0.56082225", "0.55993205", "0.5594441", "0.55908066", "0.5580917", "0.5578845", "0.55773115", "0.5571591", "0.55691534", "0.55647504", "0.5559928", "0.5557048", "0.5553875", "0.55476004", "0.5538633", "0.55290735", "0.5527263", "0.5524832", "0.5512317", "0.55024374", "0.5500513", "0.54995316", "0.5494922", "0.54888326", "0.54812694", "0.5480612", "0.5477076", "0.5473033", "0.5469203" ]
0.7789292
0
Removes an shop item object from the shop
function removeFromShop(itemObj) { let index = data.store.indexOf(itemObj); if(index > -1){ data.store.splice(index, 1); fs.writeFileSync("./data/shop/data.json", JSON.stringify(data), (err) => console.log(err)); return `${itemObj.Item} has been removed from the shop.` } else { return `${itemObj.Item} doesn't exist in the store. Please double check you've spelled it correctly.` } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItem(item){\n\n\t\t\t// Make sure cart is not empty\n\t\t\tif((!isEmpty()) && itemInCart(item) ){\n\n\t\t\t\t// remove all the items of this kind from cart count\n\t\t\t\tadjustCount(item.qty * -1);\n\t\t\t\t\n\t\t\t\t// Adjust total based on item qty\n\t\t\t\tadjustTotal((item.price*item.qty)*-1);\n\n\t\t\t\t// Remove the item from array \n\t\t\t\titems.splice(items.indexOf(item), 1);\n\t\t\t\t\n\t\t\t\t// reset item qty\n\t\t\t\t// Remember the reference to this item is coming straight from the item data copy in the controller,\n\t\t\t\t// so the item is never removed we just reuse the same reference. Meaning we\n\t\t\t\t// have to reset its qty property!\n\t\t\t\titem.qty = 0;\n\t\t\t}\n\t\t}", "function removeShopItem (e) {\n let shopItem, shopItemId;\n\n if(e.target.classList.contains('remove') ) {\n e.target.parentElement.parentElement.remove();\n shopItem = e.target.parentElement.parentElement;\n shopItemId = shopItem.querySelector('a').getAttribute('data-id');\n }\n //remove from local storage\n removeShopItemLocalStorage(shopItemId);\n}", "function minusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const index = cartList.findIndex(product => product.id == productId);\n cartList.splice(index, 1);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "function removeItem() {\n removeRequestedItem(requestedItem);\n }", "remove(item) {\n item = this.normalize(item);\n\n if (this.items.filter(i => i[0] == item[0]).length) { // item with SKU exists already\n this.items = this.items.map(\n i => {\n // when the SKU of the newly added item matches the item in the inventory, just add amount\n if (i[0] == item[0]) {\n i[1] -= item[1];\n }\n return i;\n }\n );\n }\n\n // filter out the items with quantity of 0 or less\n this.items = this.items.filter(i => i[1] > 0);\n }", "function removeShop(shop) {\n StoreHouse.getInstance().removeShop(shop);\n removeShopDB(shop); //Eliminamos el registro de la base datos\n initPopulate();\n}", "remove(item) {\n const id = this._generateId(item);\n this._container.removeChild(this._items[id].DOMElement);\n delete this._items[id];\n this._updateStorage(id);\n }", "removeItem(_item) { }", "deleteItem(item){\n delete this.inventory[item];\n }", "function removeFromCart(itemId) {\n props.removeItem(itemId);\n }", "function removeItem() {\n const productId = this.name;\n if(confirm(\"Voulez-vous supprimer le produit du panier ?\")) {\n let cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n cartList = cartList.filter(product => product.id != productId);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n }\n}", "removeItem(item) {\n // TODO: logic to remove an item from cart\n // call render method when the item is removed to update view\n if (this.items != null) {\n var updated_list = [];\n var to_compare = item.name;\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i].name != to_compare) {\n updated_list.splice(i, 1);\n }\n }\n this.store.cartItems = updated_list;\n this.items = updated_list;\n }\n this.render();\n }", "removeItem(item) {\n this.props.removeItem(this.props.partyId, item._id);\n }", "function removeItemFromBasket(userID, itemID){\n Basket.collection.deleteOne({userID: userID, itemID: itemID});\n}", "function removeItem(){\n var selectedDiv = this.closest(\"div\");\n var itemName = selectedDiv.querySelector(\".item-name\")\n cart.forEach(function (cartItem){\n if(itemName.innerHTML === cartItem.name){\n var cartItemIndex = cart.indexOf(cartItem); \n cart.splice(cartItemIndex, 1)\n }\n })\n selectedDiv.parentNode.removeChild(selectedDiv) \n}", "function RemoveItem(item){\n var index = basket.indexOf(item);\n if (index > -1) {\n console.log(\"Taking \" + item.Name + \" out of the basket!\");\n basket.splice(index, 1);\n return;\n }\n Console.log(item.Name + \" is not in the basket!\");\n}", "function removeItem(item) {\n\t\tvar cart = sessionStorage.getItem('cartItems');\n\t\tvar prdcts = JSON.parse(cart);\n\t\tfor (var i = 0; i < prdcts.productsInCart.length; i++) {\n\t\t\tif (prdcts.productsInCart[i].p_id == item) {\n\t\t\t\tconsole.log(\"match\");\n\n\t\t\t\t// Deletes the item at index i\n\t\t\t\tprdcts.productsInCart.splice(i, 1);\n\t\t\t\tsessionStorage.setItem('cartItems', JSON.stringify(prdcts));\n\t\t\t\twindow.location.reload();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t}", "function removeItemFromCart(){\n\n}", "_deleteItem() {\n this.splice('cart', this.itemNumber, 1);\n if (this.itemNumber > (this.cart.length - 1)) {\n window.history.go(-1);\n }\n console.log(this.cart);\n this.setCartItem();\n this._computeNewItemNumber(this.itemNumber)\n }", "remove(slug) {\n let item = this.getItem(slug);\n\n let itemIndex = this.items.indexOf(item);\n\n if (item) {\n this.items.splice(itemIndex, 1);\n this.update();\n }\n }", "remove(slug) {\n let item = this.getItem(slug);\n\n let itemIndex = this.items.indexOf(item);\n\n if (item) {\n this.items.splice(itemIndex, 1);\n this.update();\n }\n }", "function removeItem(event){\n const serializedItem = event.dataTransfer.getData('item');\n if (serializedItem !== null) {\n const item = Item.fromJSONString(serializedItem);\n let quan = instance.model.orderList.items[item.nr].quantity;\n // Remove the item from the order bar completely\n instance.model.undoManager.perform(\n instance.model.orderList.removeItemCommand(item.nr,quan)\n .augment(updateOrderBarCommand())\n );\n }\n}", "removeItem() {\n // Remove Item from Order's Items array:\n this.order.removeItem(this.item);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "[REMOVE_MEAL_ITEM](state, item) {\n state.meal.items = state.meal.items.filter(i => i !== item);\n }", "function eliminarItemCarrito(item){\n carrito.splice(item.numeroItem,1);\n let i = 0;\n for(item of carrito){\n carrito[i].numeroItem = i;\n i++;\n }\n\n localStorage.setItem( \"productos\", JSON.stringify(carrito));\n}", "remove(item) {\n\t\tif (this._cache[item._id]) {\n\t\t\tdelete this._cache[item._id];\n\n\t\t\tthis.emit(events.CHANGE, item, this);\n\t\t}\n\t}", "function removeItem(sku) {\n $lastPromise = $$\n .deleteCartItems({\n sku: sku\n })\n .then(onSyncd);\n\n return _this_;\n }", "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "removeFromCart(item) {\n const nameKey = item.name;\n // If the item is actually in the cart, we decrement the \"numInCart\" variable to represent\n // the fact that one fewer item is now in the cart\n if (nameKey in this.state.aggregatedItems) {\n let currAggregatedItems = this.state.aggregatedItems;\n let currPrice = currAggregatedItems[nameKey].price;\n let currNumInCart = currAggregatedItems[nameKey].numInCart;\n let currImage = currAggregatedItems[nameKey].image;\n let currShelfLife = currAggregatedItems[nameKey].shelf_life;\n let currType = currAggregatedItems[nameKey].type;\n\n currAggregatedItems[nameKey] = {\n numInCart: currNumInCart - 1,\n price: currPrice,\n image: currImage,\n type: currType,\n shelf_life: currShelfLife\n };\n // Removing the entire item from the aggregated item list if the number in cart reaches 0\n if (currNumInCart - 1 === 0) {\n delete currAggregatedItems[nameKey];\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If the \"Remove From Cart\" button was pressed on an item that wasn't even in the cart in the\n // first place, then we ignore the command and simply return\n } else {\n return;\n }\n }", "function removeItemFromCart(event) {\n if (event.target.type === 'button') {\n currentInventory.removeItem(event.target.name);\n currentInventory.saveToLocalStorage();\n renderTable();\n }\n}", "function removeitemFromCart(name) { //remove one item from cart\r\n for (var i in cart) {\r\n if (cart[i].name == name) {\r\n cart[i].count--;\r\n if (cart[i].count == 0) {\r\n cart.splice(i, 1);\r\n }\r\n break;\r\n }\r\n }\r\n savecart();\r\n}", "removeItem(item) {\n var index = this.indexOf(item);\n if (index !== -1) {\n this.splice(index, 1);\n }\n }", "function removeItem(item) {\n item.remove();\n let z = JSON.parse(localStorage.getItem(\"CartItem\"));\n arr = [];\n for (let k = 0; k < Object.keys(z).length; k++) {\n if (z[k].name == item.children[1].innerText) continue;\n else arr.push(z[k]);\n }\n localStorage.setItem(\"CartItem\", JSON.stringify(arr));\n emptyCheck();\n}", "removeProductFromBasket(state, data){ \r\n\t\t\tvar i = data.i\r\n state.basket.splice(i, 1)\r\n\t\t\tthis.dispatch(\"basket/saveBasket\")\r\n\t\t}", "function sell_item_destroy(item, cost_adjustment) {\n //U.pluck(item._2o.container()._2m.items(), item);\n return $q.all([\n change_gold(item._2o.container(), item.cost*cost_adjustment),\n Oit.destroy_item(item)\n ]);\n }", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "takeout(item) {\n var index = this.item.indexOf(item);\n if (this.open = true && index > -1) {\n this.item.splice(index, 1);\n alert(\"Item has been removed from the backpack.\");\n }\n }", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "removeItem(item) {\n \t\t\tconst newItems = this.state.inventoryItems;\n \t\t\tdelete newItems[item];\n \t\t\tthis.setState({\n \t\t\t\tinventoryItems: newItems\n \t\t\t})\n \t\t}", "remove(){\n // const index = this.items.findIndex(obj => obj.id == id);\n this.items.shift();\n }", "function removeOneItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(13, itemID.length);\n cartItems[positionInCart][3] -= 1;\n if (cartItems[positionInCart][3] === 0) {\n cartItems.splice(positionInCart, 1);\n }\n updateCartDetails();\n}", "function removeItem() {\n\t// if there are any items in the shoppingCart Array\n\tif (shoppingCart.length > 0) {\n\t\t// prompt to figure out what item they want to remove \n\t\tinquirer.prompt({\n\t\t\tmessage: \"Which Item would you like to remove?\",\n\t\t\tname: \"removeItem\",\n\t\t\ttype: \"list\",\n\t\t\t// the choices are from the current shopping list\n\t\t\tchoices: function () {\n\t\t\t\tvar returnItems = [];\n\t\t\t\tfor (var i = 0; i < shoppingCart.length; i++) {\n\t\t\t\t\treturnItems.push(shoppingCart[i].product_name);\n\t\t\t\t}\n\t\t\t\treturn returnItems;\n\t\t\t}\n\t\t})\n\t\t\t.then(function (removeQ) {\n\t\t\t\t// loop through the shopping cart to compare the .product name against the selection for the remove item, then use the hoisted function to remove the item at the iteration\n\t\t\t\tfor (var i = 0; i < shoppingCart.length; i++) {\n\t\t\t\t\tvar sC = shoppingCart[i];\n\t\t\t\t\tif (sC.product_name === removeQ.removeItem) {\n\t\t\t\t\t\t// subtract the cost of the items from the cartPrice\n\t\t\t\t\t\tcartPrice -= (sC.purchaseQTY * sC.price_customer);\n\t\t\t\t\t\tshoppingCart.remove(i);\n\t\t\t\t\t\tconsole.log(\"Removed \" + sC.purchaseQTY + \" \" + sC.product_name + \" From the Cart.\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// get more input from the user\n\t\t\t\tnextAction();\n\t\t\t})\n\t}\n\t// if there are no items in shoppingCart, redirect the user\n\telse {\n\t\tconsole.log(\"We can't remove items since your cart is empty\");\n\t\tnextAction();\n\t}\n}", "function removeItem(item) {\n if (basket.includes(item)) {\n let index = basket.indexOf(item);\n let removedItem = basket.splice(index, 1);\n return removedItem;\n } else {\n return null;\n }\n}", "function removeCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart[i].quantity--;\n if (cart[i].quantity === 0) {\n cart.splice(i, 1);\n }\n break;\n }\n }\n saveCart();\n}", "function removeItem() {\n const item = this.parentNode.parentNode\n const parent = item.parentNode\n parent.removeChild(item)\n}", "deleteItem() {\n const index = this.items.findIndex((e) => e.id === this.editItemID);\n this.items.splice(index, 1);\n this.editItemID = null;\n }", "removeItem(item) {\n var isProductInCart = false\n var itemListString = localStorage.getItem(this.DB_KEY_PRODUCT)\n var itemList = JSON.parse(itemListString)\n if (itemList != null) {\n var index = 0\n while (index < itemList.length) {\n if (itemList[index].id == item.id) {\n itemList.splice(index, 1)\n isProductInCart = true\n break\n } else {\n ++index\n }\n }\n\n if (!isProductInCart) {\n throw \"Product not present in the cart!\"\n }\n\n localStorage.setItem(this.DB_KEY_PRODUCT, JSON.stringify(itemList))\n return itemList\n }\n }", "function removeWishItem(item) {\n console.log(\"called\");\n item.remove();\n let z = JSON.parse(localStorage.getItem(\"WishlistItem\"));\n wishArr = [];\n for (let k = 0; k < Object.keys(z).length; k++) {\n if (z[k].name == item.children[1].innerText) continue;\n else wishArr.push(z[k]);\n }\n localStorage.setItem(\"WishlistItem\", JSON.stringify(wishArr));\n wishEmptyCheck();\n}", "function removeProduct(title) {\n delete cart[title];\n saveCart();\n showCart();\n}", "function deleteItemFromGame(object) {\n\tgame_menu.removeChild(object);\n\tstage.update();\n}", "function removeFromCart(item) {\n for (var i=0; i < cart.length; i++) {\n if (item === cart[i].itemName) {\n cart.splice(i,1)\n return cart\n }\n }\n return \"That item is not in your cart.\"\n}", "remove(id) {\n // if an item exists in the cart clone it to a new item\n const item = this.items[id] && new CartItem(this.items[id]);\n // if it does not exist, do nothing\n if (!item) return;\n // if the items quantity is 1 just remove all of it\n if (item.qty <= 1) return this.removeAll(id);\n // otherwise decrement the items quantity\n item.qty -= 1;\n // Update the items price\n item.price = item.product.price * item.qty;\n\n //Set the item in thee items hashmap\n this.items = {\n ...this.items,\n [id]: item\n };\n }", "function delItemFromJson(itemName, sellerName) {\n // console.log(\"======\")\n // console.log(itemName);\n // console.log(sellerName);\n for ( let i = 0; i < cart.length; i++ ) {\n if ( cart[i][\"name\"] == sellerName) {\n var order = cart[i][\"order\"];\n // console.log(order);\n for ( let j = 0; j < order.length; j++ ) {\n // console.log(order[i]);\n if (order[j][\"name\"] == itemName) {\n order.splice(j, 1);\n j--;\n }\n }\n if (order.length == 0) {\n cart.splice(i, 1);\n i--;\n }\n }\n }\n localStorage.setItem(\"cart\", JSON.stringify(cartObj));\n // console.log(cart);\n buildCartList();\n}", "function removeGroceryItem(id)\r\n{\r\n\tfor(var index in groceryItems) {\r\n\t\tif (id == groceryItems[index].id) {\r\n\t\t\tgroceryItems.splice(index, 1);\r\n\t\t\tlocalStorage.setObject(\"shoppinglist\", groceryItems);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n}", "function removeShopItemLocalStorage(id) {\n\n //get the shop items from local storage\n let shopItemsLS = getShopItemsFromStorage();\n\n //loop through the array and find the index to remove\n shopItemsLS.forEach(function(shopItemLS, index) {\n if (shopItemLS.id === id) {\n shopItemsLS.splice(index, 1);\n }\n });\n //add the rest of the array\n localStorage.setItem('shopItems', JSON.stringify(shopItemsLS) );\n}", "function removeAllCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart.splice(i, 1);\n }\n }\n saveCart();\n}", "function deleteListItem() {\n item.remove();\n }", "function removeItem(state, itemName) {\n var itemsArray = state.items;\n var index;\n for (var i = 0; i < itemsArray.length; i++) {\n //find the item with same name as item to be deleted\n if (itemsArray[i].name === itemName) {\n index = i;\n }\n }\n //deletes the item\n itemsArray.splice(index, 1);\n}", "function remove_item() {\n for (var i=0; i<selected_items.length; i++) {\n items.splice(selected_items[i],1);\n }\n $('#inventory_grid').html('');\n populate_inventory_grid();\n $('#item_action_menu').hide();\n selected_items = [];\n }", "function remove(item) {\n if (contains(item)){\n _items.splice(indexOf(item), 1);\n }\n }", "function removeFromCart(item) {\n console.log(\"Your shopping cart\" , cart )\n console.log(\"removing \" + item)\n var matchedItem = false\n for (var i = 0; i < cart.length; i++) {\n var index = cart.indexOf(cart[i])\n if (cart[i].hasOwnProperty(item) === true) {\n cart.splice(index,1)\n matchedItem = true\n console.log(\"Successfully removed \" + item)\n }\n }\n if (matchedItem === false) {\n console.log(\"That item is not in your cart.\")\n }\n console.log(\"Your updated shopping cart\", cart)\n return cart\n}", "function removeItem(itemName) {\n order.subtotal = round(order.subtotal - order.items[itemName].price);\n order.tax = round(order.subtotal * 0.1);\n order.total = round(order.subtotal + order.tax + order.delivery);\n if (order.items[itemName].count > 1) {\n order.items[itemName].count -= 1;\n } else {\n delete order.items[itemName];\n }\n let restaurantDiv = document.getElementById(\"restaurant\");\n // Generate order summary div \n restaurantDiv.replaceChild(createOrderDiv(restaurantData.menu), document.getElementById(\"restaurant\").lastChild);\n}", "function fosterRemoveItem(e){\n console.log(e.target.id)\n let itemname = e.target.id\n console.log(itemname)\n for (let item in basket){\n if (itemname == basket[item]['name']){\n basket.splice(item, 1)\n fosterStorage['foster-basket'] = JSON.stringify(basket)\n console.log(fosterStorage.getItem('foster-basket'))\n createBasket()\n }\n }\n if ((fosterStorage.getItem('foster-basket')).length > 0){\n window.location.href = \"foster_page.html\"\n }\n \n }", "function remove(item) {\n if ( contains(item) ){\n _items.splice(indexOf(item), 1);\n }\n }", "function remove(item) {\n if ( contains(item) ){\n _items.splice(indexOf(item), 1);\n }\n }", "function remove(item) {\n if ( contains(item) ){\n _items.splice(indexOf(item), 1);\n }\n }", "removeItem(item)\r\n\t{\r\n\t\tif (typeof item != 'object') {\r\n\t\t\tthrow new InvalidArgumentException('removeItem() expect the first parameter to be an object, but ' + typeof item + ' was passed instead');\r\n\t\t}\r\n\r\n\t\tif (! item.hasOwnProperty('id')) {\r\n\t\t\tthrow new InvalidCartItemException;\r\n\t\t}\r\n\r\n \t\tthis.cart = Cookie.get(this.settings.cookie_name);\r\n\r\n \t\tlet i;\r\n\r\n \t\tfor (i = 0; i < this.cart.items.length; i++) {\r\n \t\t\tif (this.cart.items[i].id == item.id) {\r\n \t\t\t\tthis.cart.items.splice(i, 1);\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tCookie.set(this.settings.cookie_name, this.cart, 2);\r\n\t}", "function removeItem(foodItem) {\n\n indexCartArray = 0;\n\n storeInventory.forEach(function () {\n\n if (storeInventory[indexCartArray].id == foodItem) {\n\n cartArray.splice(indexCartArray, 1);\n sessionStorage.setItem(\"cart\", JSON.stringify(cartArray));\n alert(storeInventory[indexCartArray].name + \" removed from cart\");\n\n }\n indexCartArray++;\n });\n\n updateQuantities();\n\n}", "function remove(item) {\r\n if ( contains(item) ){\r\n _items.splice(indexOf(item), 1);\r\n }\r\n }", "function inventoryRemove(item) {\n\titem.hide();\n\titem.moveTo(current_layer);\n\titem.draggable(false);\n\tinventory_list.splice(inventory_list.indexOf(item), 1);\n\tredrawInventory();\n}", "function onitemremove (data) {\n\tvar removeItem; \n\tremoveItem = finditembyid(data.id);\n\n\tif (!removeItem) {\n\t\treturn;\n\t}\n\n\tland.splice(land.indexOf(removeItem), 1); \n\t\n\t//destroy the phaser object \n\tremoveItem.item.destroy(true, false);\n}", "function removeItemFromCartAll(name) {\n for (var i in shoppingList) {\n if (shoppingList[i].name === name){\n shoppingList[i].count--;\n if(shoppingList[i] === 0){\n shoppingList.splice(i, 1);\n }\n break;\n }\n}\n}", "function remove(item) {\n if ( contains(item) ){\n _items.splice(indexOf(item), 1);\n }\n }", "function remove(item){if(contains(item)){_items.splice(indexOf(item),1);}}", "function removeItem(id){\r\n\tif(order.hasOwnProperty(id)){\r\n\t\torder[id] -= 1;\r\n\t\tif(order[id] <= 0){\r\n\t\t\tdelete order[id];\r\n\t\t}\r\n\t\ttemp = getCurrentRestaurant();\r\n\t\tif (temp !== undefined){\r\n\t\t\tupdateOrder(temp);\r\n\t\t}\r\n\t}\r\n}", "function removeFromCart(obj) {\n\tvar items = getTotalItemsCart();\n\tvar elem;\n\n\tif (items > 0) {\n\t\tdocument.getElementById('shopping-cart-text').innerHTML = (items-1) + ' items';\n\t\telem = obj.parentNode.parentNode.parentNode\n\t\telem.remove();\n\t}\n}", "function removeItemFromCart(uuid, isLayerPage, isWishListItem) {\n\tlayerPageFlag = isLayerPage;\n\tvar key = 'uuid=';\n\tif (isWishListItem == true) {\n\t\tkey = 'useritemid=';\n\t}\n\tif (layerPageFlag == true) {\n\t\tvar cObj = YAHOO.ebauer.utilities.asyncRequest('GET', getBaseURL() + '/ajax/removeItemFromCart.jsp?' + key + uuid, callbackRemoveItemFromCart);\n\t} else {\n\t\tvar cObj = YAHOO.ebauer.utilities.asyncRequest('GET', getBaseURL() + '/ajax/removeItemFromCart.jsp?' + key + uuid, callbackshowcheckoutpage);\n\t}\n}", "removeInventory(item) {\n this.inventory.deleteItem(item.id);\n item.owner = undefined;\n return this;\n }", "function removeFromCartHandler(itemId) {\n\t\tsetUserCart(prev => {\n\t\t\treturn prev.filter(item => item.id !== itemId);\n\t\t});\n\t}", "remove(type, id) {\n let key = this.getKey(type)\n let item = this.getItem(type, id);\n\n let itemIndex = this.items[key].indexOf(item);\n\n if (item) {\n this.items[key].splice(itemIndex, 1);\n this.update();\n }\n }", "function removeItem(id) {\n dropItem(); // drop the item\n $(`#item${id}`).remove(); // remove it\n // if it's the mug\n if (id === 2) {\n mugTaken = false;\n }\n}", "function removeFromCart(item) {\n var removed = []\n // check if the item is present in the cart\n // first go through each item in the cart until we find the item\n for(var i = 0; i < cart.length; i++){\n // if we find the item\n if(item === cart[i].itemName){\n // then we want to remove it from the cart\n removed.push(cart.splice(i,1));\n i--\n }\n }\n // check if nothing has been removed\n if(removed.length === 0){\n return \"That item is not in your cart.\"\n } else{\n return cart\n }\n}", "function deleteFromCart(item){\n item.parentElement.remove();\n showTotals();\n}", "removeItem(index) {\n this.items.splice(index, 1)\n }", "function removeCartItem(index) {\n cart = JSON.parse(localStorage.getItem(\"cart\"));\n cart.items.splice(index, 1);\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n render();\n }", "function removeItem(name) {\n let items = JSON.parse(localStorage.getItem('items'));\n if(items !== null && items.length > 1) {\n /* delete item. if there's only 1, remove all localstorage */\n if(typeof items.forEach === \"function\") {\n items.forEach(function(item, i) {\n if(item.name == name) {\n items.splice(i, 1);\n localStorage.setItem('items', JSON.stringify(items));\n }\n })\n }else {\n if(items.name == name) {\n removeAllStorage();\n }\n }\n }else {\n removeAllStorage();\n }\n updateCart();\n }", "remove(item){\n container.removeChild(item);\n }", "function removeItemFromCart(itemId) {\n let cartItems = localStorage.getItem('cartItems');\n if (cartItems) {\n let cartItemsArray = JSON.parse(cartItems);\n let itemIndex = cartItemsArray.findIndex(item => {\n return item.id === itemId;\n });\n cartItemsArray.splice(itemIndex, 1);\n localStorage.setItem('cartItems', JSON.stringify(cartItemsArray));\n sendItemsToCartUI(cartItemsArray);\n grandTotals(cartItemsArray);\n document.querySelector('.cart-items').innerText = cartItemsArray.length;\n\n }\n}", "function removeProductFromWishList(e) {\r\n console.log(e.id);\r\n //console.log(cartStoredData);\r\n console.log(wishListData);\r\n for (i = 0; i < wishListData.length; i++) {\r\n if (wishListData[i].productId == e.id) {\r\n\r\n wishListData.splice(i, 1);\r\n }\r\n }\r\n console.log(wishListData);\r\n goToWishList();\r\n alert(\"Removed Item\");\r\n}", "remove_item(name){\n this.cart = this.cart.filter((value) => {\n return value.name != name;\n });\n }", "function removeItem(cart1) {\n $(\"button.remove\").on(\"click\", function () {\n let index = parseInt(this.value);\n cart1.splice(index,1);\n generateCart(cart1);\n });\n}", "function removeItem(item){\n\t\titem.parentNode.parentNode.parentNode.parentNode.removeChild(item.parentNode.parentNode.parentNode);\n\t\tLIST[item.parentNode.id].trash = true;\n\t}", "function removeItem(id) {\n for (let i = 0; i < products.length; i++) {\n if (products[i]._id === id) {\n products.splice(i, 1);\n localStorage.setItem(\"products\", JSON.stringify(products));\n document.getElementById(id).remove();\n break;\n }\n }\n if (products.length === 0) {\n localStorage.clear();\n displayCartEmpty (productCartSummary);\n }\n displayTotal (products);\n}", "deleteItemById(db, site_id, item_id) {\n return db\n .from(\"inventory\")\n .where({\n site_id: site_id,\n id: item_id,\n })\n .del();\n }", "_removeCartItem(evt) {\n const product_id = evt.currentTarget.cartItem;\n\n const cartItem = this._findCartItem(product_id);\n\n var index = this.cartItems.indexOf(cartItem);\n\n if (index > -1) {\n this.cartItems.splice(index, 1);\n this.cartItems = [...this.cartItems];\n localStorage.setItem('shop-cart', JSON.stringify(this.cartItems));\n }\n\n this.dispatchEvent(new CustomEvent('change-cart-count', {\n bubbles: true,\n composed: true,\n detail: {}\n }));\n }", "function RemoveWeapon (Item)\n{\tif (Item.equippedWeaponVersion != null)\n\t{\n\t\tDestroy(WeaponSlot.FindChild(\"\"+Item.equippedWeaponVersion.name).gameObject);\n\t\tif (DebugMode)\n\t\t{\n\t\t\tDebug.Log(Item.name + \" has been removed as weapon\");\n\t\t}\n\t}\n}", "function removeFromCart (item) {\r\n // get the cart list\r\n const cart = JSON.parse(sessionStorage.getItem('cart'))\r\n // remove the @index = id, one item\r\n cart.splice(item.id, 1)\r\n\r\n // update cart notification\r\n if (cart.length === 0) {\r\n // hide notification and checkout div if cart is empty\r\n $('#cartCounter').css({ visibility: 'hidden' })\r\n $('#checkoutDiv').css({ visibility: 'hidden' })\r\n } else {\r\n // show animated notification and checkout div if cart is not empty\r\n $('#cartCounter').css({ visibility: 'visible' })\r\n $('#cartCounter').text(String(cart.length)).animate({ fontSize: '0em' }, 300).animate({ fontSize: '1em' }, 100)\r\n $('#checkoutDiv').css({ visibility: 'visible' })\r\n }\r\n // store cart\r\n sessionStorage.setItem('cart', JSON.stringify(cart))\r\n // display the updated cart list\r\n displayCartItems()\r\n}", "function deleteListItem(itemId) {\n console.log(`Deleting item with id ${itemId} from shopping list`);\n\n // as with `addItemToShoppingLIst`, this function also has the side effect of\n // mutating the global STORE value.\n //\n // First we find the index of the item with the specified id using the native\n // Array.prototype.findIndex() method. Then we call `.splice` at the index of \n // the list item we want to remove, with a removeCount of 1.\n const itemIndex = STORE.items.findIndex(item => item.id === itemId);\n STORE.items.splice(itemIndex, 1);\n}", "removeItem(value, silent) {\n var i,\n idx,\n self = this;\n var item = self.getItem(value);\n if (!item) return;\n value = hash_key(item.dataset.value);\n i = self.items.indexOf(value);\n\n if (i !== -1) {\n item.remove();\n\n if (item.classList.contains('active')) {\n idx = self.activeItems.indexOf(item);\n self.activeItems.splice(idx, 1);\n removeClasses(item, 'active');\n }\n\n self.items.splice(i, 1);\n self.lastQuery = null;\n\n if (!self.settings.persist && self.userOptions.hasOwnProperty(value)) {\n self.removeOption(value, silent);\n }\n\n if (i < self.caretPos) {\n self.setCaret(self.caretPos - 1);\n }\n\n self.updateOriginalInput({\n silent: silent\n });\n self.refreshState();\n self.positionDropdown();\n self.trigger('item_remove', value, item);\n }\n }", "remove() {\n this._item = null;\n this.render();\n }" ]
[ "0.7396999", "0.7288893", "0.7258435", "0.69506174", "0.69497085", "0.6946783", "0.6944789", "0.6902107", "0.69014347", "0.68973345", "0.6896371", "0.68830764", "0.68610626", "0.68413305", "0.6831908", "0.68280256", "0.6794857", "0.679483", "0.6789529", "0.6748611", "0.6748611", "0.673782", "0.6736767", "0.6728918", "0.6723614", "0.6720332", "0.6706828", "0.6690865", "0.6690058", "0.66698253", "0.6657605", "0.66549397", "0.6651679", "0.6615044", "0.66133326", "0.65986234", "0.6597762", "0.6581593", "0.6572711", "0.6567517", "0.65655375", "0.65598214", "0.6552074", "0.65497243", "0.65476006", "0.6536049", "0.65358895", "0.6535687", "0.65290177", "0.6517936", "0.65137744", "0.6513001", "0.65087074", "0.6506312", "0.6490754", "0.64902836", "0.6480069", "0.6473102", "0.6469632", "0.6458428", "0.6456745", "0.64409125", "0.644049", "0.6426019", "0.6426019", "0.6426019", "0.6413121", "0.640878", "0.6400922", "0.6397224", "0.6396015", "0.63914824", "0.63890177", "0.63872147", "0.63849425", "0.6382771", "0.637134", "0.63661754", "0.6350823", "0.6336102", "0.6333203", "0.6330042", "0.63260657", "0.6325764", "0.6322771", "0.63194495", "0.63178325", "0.63162494", "0.6316167", "0.62990826", "0.6297338", "0.62940025", "0.62853444", "0.6267354", "0.62621397", "0.62603956", "0.62577283", "0.6257628", "0.6254531", "0.6248609" ]
0.7409766
0
Gets item object if it exists in a shop user's inventory
function getItemFromInventory(memberObj, itemName){ let shopUser = getShopUser(memberObj); return shopUser.inventory.find(invItem => { return invItem.Item === itemName; }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkInventory(chosenItemId, inventory) {\n // loop through the inventory, and check if the user ID-input matches any IDs in the database\n for (let i = 0; i < product.length; i++) {\n // if it matches, then return the item\n if (inventory[i].id === chosenItemId) {\n return inventory[i];\n }\n }\n return null;\n}", "function getItemFromShop(itemName){\n return data.store.find(storeItem => {\n return storeItem.Item === itemName;\n })\n}", "static isItemFoundOnUserCart(userId, itemId) {\n return db\n .oneOrNone(`\n SELECT shopping_cart_item FROM shopping_carts\n WHERE user_id = ${userId} AND shopping_cart_item = ${itemId}; \n `)\n .then((item) => {\n if (item === null) {\n return false;\n } else {\n return true;\n } \n });\n }", "hasItem(itemName) {\n return this.inventory.inventoryHasItem(itemName);\n }", "getItem(recipeSlug) {\n // items in favorites are an array so we can still use find\n return this.items.find(({ slug }) => slug === recipeSlug) || null;\n }", "function getInventoryItem(id) {\n for (i = 0; i < inventoryItems.length; i++) {\n if (inventoryItems[i].inventoryItemId == id) \n return inventoryItems[i].inventoryItemName;\n \n}\n}", "function itemByName (name) {\n return bot.inventory.items().filter(item => item.name === name)[0]\n}", "getItem(recipeSlug) {\n return this.items.find(({ slug }) => slug === recipeSlug) || null;\n }", "function itemByItemID (id) {\n var i;\n for (i = 0; i < items.length; i++) {\n if (items[i].itemID === id) {\n return items[i]\n }\n }\n\n return false\n}", "getItemById(db, site_id, item_id) {\n return db.from(\"inventory\").where({\n site_id: site_id,\n id: item_id,\n });\n }", "function getItemByUserId(user_id) {\n return db(\"items\").where({ user_id });\n}", "function buyItem(user){\n return user\n}", "finder(productName, inventory){\n return inventory.find(product => product.productName === productName)\n }", "function findItem(item) {\n\t\tvar cart = sessionStorage.getItem('cartItems');\n\t\tvar prdcts = JSON.parse(cart);\n\t\tfor (var i = 0; i < prdcts.productsInCart.length; i++) {\n\t\t\tif (prdcts.productsInCart[i].p_id == item) {\n\t\t\t\treturn [prdcts.productsInCart[i], i];\n\t\t\t}\n\t\t}\n\t}", "function findItem() {\n var found;\n\n $rootScope.claimItems.forEach(function (item) {\n if (item.selected == true) {\n found = item;\n }\n });\n return found;\n }", "function checkIfItem() {\n // query bamazon DB for the entered item\n connection.query(\"SELECT id FROM products WHERE id=?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // if itemToBuy exists in the databse, call howManyToBuy function\n else if (res[0].id == itemToBuy) {\n // call update Quantity function\n howManyToBuy();\n }\n // if item does not exist in database, ask user to enter valid ID and go back to product list\n else {\n console.log(chalk.bgRed.yellow(\"Please enter a valid item ID!\"));\n console.log('\\n*******************');\n }\n });\n}", "function findItem() {\n var found;\n\n $rootScope.claimItems.forEach(function (item) {\n if (item.selected == true) {\n found = item;\n }\n });\n return found;\n }", "fetchInventoryItem(id){\r\n return Api().get('/inventory/' + id)\r\n }", "function getItemById (itemId) {\n return Item.findOne({ \"_id\": itemId })\n}", "function hasItem (item){\n\t\treturn true;\n}", "function checkInventory(scannedItem) {\n // change code below this line\n let result = food[scannedItem];\n return result;\n}", "function useItemInInventory (playerPC, alias) {\n alias = alias.toLowerCase();\n if(playerPC['inventory']){\n itemIDsInInventory = Object.keys(playerPC['inventory']);\n } else {\n return;\n }\n itemsInInventory = [];\n\n for(var i=0; i< itemIDsInInventory.length;i++){\n itemsInInventory.push(itemByItemID(itemIDsInInventory[i]));\n }\n\n for (var i = 0; i < itemsInInventory.length; i++) {\n if (itemsInInventory[i].name.toLowerCase() == alias || itemsInInventory[i].name.toLowerCase().search(alias) != -1) {\n if(itemsInInventory[i].use != undefined){\n return itemsInInventory[i].itemID;\n //eval(itemsInInventory[i].use);\n //return true;\n }\n\n }\n }\n\n return;\n\n}", "getItem(type, id) {\n let key = this.getKey(type)\n return this.items[key] && this.items[key].includes(id) || null;\n }", "takeItem(item) {\n if (!item) return false;\n this.inventory.addItem(item);\n return true;\n }", "function checkInventory(choiceId, inventory) {\n for (var i = 0; i < inventory.length; i++) {\n if (inventory[i].item_id === choiceId) {\n // If a matching product is found, return the product\n return inventory[i];\n }\n }\n // Otherwise return null\n return null;\n}", "function checkInventory(choiceId, inventory) {\n for (var i = 0; i < inventory.length; i++) {\n if (inventory[i].item_id === choiceId) {\n // If a matching product is found, return the product\n return inventory[i];\n }\n }\n // Otherwise return null\n return null;\n}", "fetchInventory () {\r\n return Api().get('inventory')\r\n }", "function findItemById(items, id) {\n for (let item of items) {\n if (item._id === id) {\n return item;\n }\n }\n\n return false;\n}", "function findItemInCart(id) {\n for(var i=0;i < products_cart.items.length; i++){\n if(products_cart.items[i].id == id){\n return {item:products_cart.items[i],index:i};\n }\n }\n}", "function getShopUser(memberObj){\n return data.users.find(user => {\n return user.id === memberObj.user.id.toString();\n })\n}", "function masterItemExist(Item) {\n //localStorage\n for (var i = 0; i < items.length; i++) {\n if (items[i].itemName.toLowerCase() == Item.itemName.toLowerCase()) {\n return true;\n }\n }\n ;\n return false;\n }", "productAlreadyInCart(productId) {\n \n let productFound;\n let cartArr;\n \n //Get cart from local storage\n cartArr = JSON.parse(localStorage.getItem('cartData')) || [];\n console.log(\"cart : \" + cartArr);\n \n //check if cart is not empty\n if(cartArr.length > 0) {\n\n //return product found from cart\n productFound = cartArr.find(function(cartProduct) {\n return cartProduct.productId === productId ;\n });\n }\n return productFound; \n }", "function checkInventory(choiceId, inventory) {\n\tfor (var i = 0; i < inventory.length; i++) {\n\t if (inventory[i].item_id === choiceId) {\n\t\t// If a matching product is found, return the product\n\t\treturn inventory[i];\n\t }\n\t}\n\t// Otherwise return null\n\treturn null;\n }", "function checkIfNotInCart(id) {\n var returnVar = false;\n for(var i=0;i < products_cart.items.length; i++){\n if(products_cart.items[i].id == id){\n returnVar = true;\n }\n }\n return returnVar;\n}", "function buyItem(user){\n return Object.assign({}, user, )\n}", "function checkInventory() {\n\n // Run query aqainst productstable to pull in available inventory for shoe requested\n connection.query(\"SELECT * FROM productstable WHERE item_id=?\", [userItemRequested], function(err, res) {\n if (err) throw err;\n currentInventory = res[0].stock_quantity;\n currentItemPrice = res[0].price;\n currentItemName = res[0].product_name;\n // If statement calculates if there is enough inventory then runs follow-up functions based on the result\n if (currentInventory >= userQuantityRequested) {\n enoughInventory();\n } else {\n notEnoughInventory();\n }\n });\n}", "getEquipmentInSlot(slotID){\n\n //Array of equipped item IDs\n let equippedItems = this.getEquippedItems();\n \n //let equippedSlotItem = equippedItems.filter( eachEquippedItem=>{\n\n return equippedItems.find( eachEquippedItem=>{\n return eachEquippedItem.equipment_slot_id.indexOf(slotID) >= 0\n });\n }", "static getItem(userId, itemId) {\n return Array.isArray(itemCacheByUserId[userId]) && itemCacheByUserId[userId].source_messages && itemCacheByUserId[userId].find(o => o.source_messages[0].id === itemId) || null\n }", "async isItemInTheCart(item) {\n const count = await this.name.count;\n let found = false;\n for(var i = 0; i < count; i++) {\n const title = await this.name.nth(i).innerText;\n if (title.match(item)) {\n found = true; //if the title of the item name is the same as the passed item, then it was found.\n }\n\n }\n return found\n }", "retrieveItem(key) {\n let item = null\n // Try to get the item first\n if (this.hasItem(key)) {\n item = this.getItem(key) || null // getItem returns undefined\n }\n\n if (item === null) {\n // Throw an error?\n }\n\n return item\n }", "function checkAndAddItem(item) {\n if (item in allWeapons) {\n player.weapon.push(item);\n } else {\n player.items.push(item);\n }\n}", "function specificInventory(itemID) {\n var inventory = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Inventory');\n \n if (itemID > 0 && inventory != null) {\n var values = inventory.getRange(1, 1, inventory.getLastRow(), inventory.getLastColumn()).getDisplayValues();\n for (var i=1; i<values.length; i++) {\n if (values[i][0] == itemID) {\n return values[i][3];\n }\n }\n return 'Not found in our system';\n }\n return ''; \n}", "function findItemInSlot(class_tsid, slot, bag){\r\n\tvar items = bag.getContents();\r\n\t\r\n\tvar it = items[slot];\r\n\t\r\n\tif (it) { \r\n\t\tif (it.class_tsid == class_tsid) { \r\n\t\t\treturn it;\r\n\t\t}\r\n\t\telse if (it.is_bag && !it.isHidden) { \r\n\t\t\treturn it.findFirst(class_tsid);\r\n\t\t}\r\n\t\telse { \r\n\t\t\tlog.error(\"MG Harvest potion something is wrong!\");\r\n\t\t}\r\n\t}\r\n}", "function findItemById(data, id) {\n\tlet itemData = data.getIn(['items',id]);\n\tif (itemData) {\n\t\treturn [id,itemData];\n\t}\n\treturn null;\n}", "function getSingleUnit(productid) {\r\n let product;\r\n shopProducts.forEach(item => {\r\n if(item.id === productid) {\r\n console.log(item);\r\n product = item;\r\n }\r\n \r\n }); \r\n\r\n return product;\r\n}", "function getInventory(){\n axios.get('/inventory')\n .then(res => setItems(res.data))\n .catch(err => alert(err))\n }", "function lowInventory(item) {\n connection.query(\"SELECT * FROM store WHERE Item_id = ?\", item, function (err, results) {\n if (err) throw err;\n\n if (results.length) {\n \n if (results[0].Stock_quantity < 5) {\n const nameProduct = results[0].Product_name;\n const quantity = results[0].Stock_quantity;\n \n connection.query([quantity, nameProduct, item], function (err, results) {\n if (err) throw err;\n\n console.log(\"-------------------------------------------------\");\n console.log(\" Product is \"+ nameProduct + \" only have \" + quantity + \" unit(s).\" );\n console.log(\" Please refill the stock inventory soon as possible. \" );\n console.log(\"-------------------------------------------------\");\n connection.end();\n })\n } else {\n console.log(`\\r\\n Sorry, we do not have any product in a low inventory at this time. Please try again.\\r\\n`);\n options();\n };\n }\n })\n}", "function getChosenItemQty(item){\n //get the item id out of the string\n var stock_quanity = 0;\n var id = parseInt(item.idBuy.slice(0, 1))\n for(var i = 0; i < inventory.length; i++){\n //get the items object\n if(inventory[i].id == id){\n stock_quanity = inventory[i].stock_quanity;\n }\n }\n return stock_quanity;\n }", "function productInBasket(id) {\n basketProduct = null;\n if (localStorage.BASKET) {\n var basket = JSON.parse(localStorage.BASKET);\n // checks if product id matches any product in basket\n for (var i = 0; i < basket.length; i++) {\n var product = JSON.parse(basket[i]);\n if (product.productID == id) {\n basketProduct = product;\n }\n }\n }\n return basketProduct;\n}", "function find_item (keyword) {\n for (var item in Items) {\n if (in_room(Items[item]) && Items[item].keywords.includes(keyword)) {\n return item;\n }\n }\n return null;\n}", "function buyItem(user){\n return Object.assign({}, user, { purchases: user.cart })\n}", "static async cartByUser(req, res) {\n if (!req.params.user_id) {\n return res.error('Invalid id supplied');\n }\n\n try {\n const cart = await Cart.findOne({\n user_id: req.params.user_id,\n deleted: false,\n });\n if (!cart) {\n return res.error('Item with id not found', 404);\n }\n\n return res.item_with_products(cart);\n } catch (err) {\n return res.error(err.message);\n }\n }", "function takeItem(itemId) {\n var item = null;\n if (itemId !== \"false\") {\n item = claimableObjects[currentLocation][itemId];\n // Place item into appropriate location... inventory or pokedex \n if (item.type === \"pokemon\") {\n myPokemon = instantiatePokemon(item.pokeId, \"player\");\n } else {\n inventory.push(item);\n }\n // Once an item has been claimed, all other items in the map area get locked in claimableObjects. This should \n // really only happen for pokemon in Prof Oak's lab, but those are the only items in the game at the moment.\n claimableObjects[currentLocation].forEach(function(obj) {\n obj.status = \"locked\";\n });\n claimableObjects[currentLocation][itemId].status = \"claimed\";\n // Remove item from the mapLocations object & screen\n var itemY = item.location[0];\n var itemX = item.location[1];\n mapLocations[currentLocation][0][itemY][itemX] = 1;\n $(\"#\" + item.name).remove();\n // If item required confirmation, restore game controls\n if (item.confirmText) {\n cancelOrBack();\n setGameControls(); \n }\n } else {\n cancelOrBack();\n setGameControls();\n } \n}", "function buyItem(user){\n return Object.assign({}, )\n}", "hasItem(key: string) {\n return this.getItem(key) !== null;\n }", "hasItem(key: string) {\n return this.getItem(key) !== null;\n }", "function checkInventory(toolName) {\n for (let tool of currentInventory) {\n if (tool.name == toolName) {\n return true\n }\n }\nreturn false\n}", "function getUserInventory(steamid, refresh, force, cb) {\n if (!steamid || !cb)\n throw new Error('Missing SteamID parameter or callback function');\n \n let cached;\n let cachedInv;\n // Check if the inventory is cached\n userInventoryCache.forEach(function(inventory) {\n if (inventory.steamid == steamid) {\n cached = true;\n cachedInv = inventory;\n }\n });\n \n if (cached && !refresh)\n return cb(null, cachedInv);\n \n if (!cachedInv || force)\n return doIt();\n \n // Check if they've waited long enough before refreshing\n if (cachedInv.updated < Date.now() - (1000 * App.config.refreshTimeout)) \n return doIt();\n \n // Callback the cached inventory if they haven't waited long enough\n cachedInv.cannotUpdateYet = true;\n cb(null, cachedInv);\n \n function doIt() {\n // Remove existing cached inventory if it exists\n App.utils.removeObjArr(userInventoryCache, 'steamid', steamid);\n\n let demItems = [];\n let page = 1;\n\n getIt();\n\n function getIt() {\n ET.ITrade.GetUserInventoryFromSteamId({\n steam_id: steamid,\n page: page,\n per_page: 500\n }, (err, body) => {\n if (err)\n return cb(err);\n \n if (body.status !== 1)\n return cb('An unknown error occurred fetching bot inventory');\n \n let items = body.response.items;\n items.forEach(function(item) {\n demItems.push(item);\n });\n\n if (body.total_pages > body.current_page) {\n page += 1;\n getIt();\n } else {\n nextStep(demItems);\n }\n });\n }\n\n function nextStep(demItems) {\n let localInv = [];\n demItems.forEach(function(item) {\n let banned;\n // Check if the user item is banned by us in config:\n if (App.config.bannedUserItems.length) {\n App.config.bannedUserItems.forEach(function(bannedItem) {\n if (item.name.toUpperCase().includes(bannedItem.toUpperCase()))\n banned = true;\n });\n }\n\n let price = item.suggested_price;\n // Change the price based on the rates set in config\n if (item.name == 'WAX Key') {\n price = parseFloat(((price * App.config.rates.keyUserRate) / 100).toFixed(2));\n } else {\n price = parseFloat(((price * App.config.rates.otherUserRate) / 100).toFixed(2));\n }\n\n // Check if the item price is allowed in config\n if (price >= App.config.minMax.minUser && price <= App.config.minMax.maxUser && !banned) {\n // If it's all good, push it to our local array\n localInv.push({\n name: item.name,\n id: item.id,\n category: item.category,\n color: item.color,\n img: item.image['600px'],\n price: price,\n rarity: item.rarity\n });\n }\n });\n // Callback with our local formatted inventory\n cb(null, {inventory: localInv});\n // Cache the inventory for later\n userInventoryCache.push({\n steamid: steamid,\n inventory: localInv,\n updated: Date.now(),\n cached: true\n });\n }\n }\n}", "getUnequippedItems(){\n\n //If character does not have an inventory property, character does not have any inventory yet. Return empty array\n if (!this.props.inventory) {\n return [];\n }\n\n //return items\n return this.props.inventory\n .filter( eachItem =>{\n return eachItem.is_equipped === 0;\n })\n }", "function pickUp(item){\n\tif(!item.obtained){\n\t\tuser.inventory.splice(-1, 0, item)\n\t\titem.obtained = true;\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You recieved ' + item.name + '! You put it in your inventory. You now have ' + user.inventory.length + ' out of a possible ' + maximumItems + ' items in your inventory!';\n\t\t\n\t\t//Check to see if user meets the maximum items\n\t\tif(user.inventory.length >= maximumItems){\n\t\t\tend();\n\t\t\treturn;\n\t\t}\n\t}else{\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You already have that item!';\n\t}\n}", "function checkItem(itemID, numUnits) {\n // console.log(\"Running checkItem! Looking for item #: \"+ itemID);\n connection.query('SELECT * FROM bamazon.products;', function (err, results, fields) {\n // get the information of the chosen item\n var itemIdInt = parseInt(itemID);\n var numUnitsInt = parseInt(numUnits);\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n // console.log(results[i].item_id);\n // console.log(itemIdInt);\n if (results[i].item_id === itemIdInt) {\n chosenItem = results[i];\n // console.table(chosenItem);\n }\n }\n\n if (chosenItem.stock_quantity < numUnitsInt) {\n console.log(\"Insufficient quantity in stock!\")\n prompt();\n } else {\n fulfillOrder(chosenItem, numUnitsInt);\n } \n\n });\n}", "function checkInventoryItem(agent) {\n const swag = agent.parameters.swag;\n\n agent.add(\"Here's the information: \");\n\n return admin.database().ref('inventory').once('value').then((snapshot) => {\n if (swag === 'tshirts') {\n let size = agent.parameters.size;\n if (size && size.length > 0) {\n const count = snapshot.child(`${swag}/${size}`).val();\n console.log('db read: ' + count);\n agent.add('The count of ' + size + ' tshirts is: ' + count);\n } \n } else if (swag === 'bottles') {\n let company = agent.parameters.company;\n if (company && company.length > 0) {\n const count = snapshot.child(`${swag}/${company}`).val();\n agent.add('The count of ' + company + ' bottles is: ' + count);\n }\n }\n\n return null; // empty response but updated http response\n });\n }", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function userItemChoice(inventory){\n inquirer.prompt([\n {\n type: \"input\",\n name: \"choice\",\n message: \"Enter the ID of the item you would like to purchase [exit with q]\",\n\n // include a way to check if the input is a matching id number with an if/else statement, validate?\n\n validate: function(val) {\n return !isNaN(val) || val.toLowerCase() === \"q\";\n }\n }\n ]).then(function(val) {\n\n // save user quantity input to compare with the stock\n // turn string into a number\n\n quitShopping(val.choice);\n let chosenItemId = parseInt(val.choice);\n let itemName = checkInventory(chosenItemId, inventory);\n\n // prompt customer with desired quantity if there is a matching product ID in the database from other function\n // console log if not enough\n if (itemName) {\n userQuantityChoice(itemName);\n } else {\n console.log(\"Sorry, we do not have that item\");\n // send customer back to the product list\n displayProducts();\n }\n });\n}", "function getItem(itemUid) {\n return loadData()\n .then(function(response) {\n var item = $filter('filter')(response.data, itemUid)[0];\n return item;\n });\n }", "function equipItem() {\r\n\tfor(var i = 0; i < playerBag.length; i++) {\r\n\t\tif(currItemCode == playerBag[i]) {\r\n\t\t\tcheckEquip();\r\n\t\t\tclosedVBox();\r\n\t\t\tgetArmorBonus();\r\n\t\t\t//getWeaponBonus(); <-- might use for magical weapons\r\n\t\t\tgetWeaponDmgBonus();\r\n\r\n\t\t}\r\n\t}\r\n}", "getItemById(id) {\n return new Promise((fulfill, reject) => {\n return items().then((itemCollection) => {\n return itemCollection.findOne({\n _id: id\n }).then((item) => {\n if (!item) reject(\"Item not found\");\n fulfill(item);\n });\n });\n });\n }", "function getShops(item){\n\t\t\n\t}", "containsItem(itemID){\n return this.itemStacks.some(itemStack => itemStack.itemID == itemID);\n }", "function getItemById(id){\r\n\tlet categories = Object.keys(currentRestaurant.menu);\r\n\tfor(let i = 0; i < categories.length; i++){\r\n\t\tif(currentRestaurant.menu[categories[i]].hasOwnProperty(id)){\r\n\t\t\treturn currentRestaurant.menu[categories[i]][id];\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}", "getLocal (name_or_id, is_lenient = true) {\n var env_search = ci.getItemInInventory(this.subspace.inventory, name_or_id, is_lenient);\n if (env_search != null) return env_search;\n return getInPlayer(name_or_id, is_lenient);\n }", "function pickUpItem(person, weapon){\n person.inventory.length === 0? null : person.inventory.push(weapon);\n}", "function getItemByID(id, items) {\n for (i = 0; i < items.length; i++) {\n if (items[i].ID === id) {\n return items[i];\n }\n }\n }", "function pickUpItem(item) {\n inventory.push(items[currentLocation].name);\n updateDisplay(\"Taken \" + items[currentLocation].name + \".\");\n items[currentLocation].isTaken = true;\n }", "async purchaseItem(itemId) {\n const purchase_result = await this.__request(`https://dragonsofmugloar.com/api/v2/${this.game.gameId}/shop/buy/${itemId}`, \"POST\");\n\n if (purchase_result) {\n const {gold, level, lives, shoppingSuccess, turn} = purchase_result;\n if (!shoppingSuccess) {\n console.log(\"Cannot buy this item!\");\n }\n await this.updateGameState(lives, gold, null, null, turn, level);\n }\n\n }", "function getGroceryItem(id)\r\n{\r\n\tfor( var index in groceryItems) {\r\n\t\tif (id == groceryItems[index].id)\r\n\t\t\treturn groceryItems[index];\r\n\t}\r\n\treturn null;\r\n}", "function findById(id) {\n return store.items.find(item => item.id === id);\n }", "function takeItem(word) {\n\n let pickUpItem = itemLookUp[word]\n if (pickUpItem.takeable === true && player.location.inv.includes(word)) {\n player.location.inv.splice(player.location.inv.indexOf(word), 1)\n player.inventory.push(word)\n console.log(\"You picked up \" + word)\n } else {\n console.log(\"This is not yours to take!\")\n }\n}", "function addItem(item){\r\n\tvar found = false;\r\n\tfor(var i =0; i < inventory.length; i++){\r\n\t\tif(inventory[i].name == item.name){\r\n\t\t\tinventory[i].qty += item.qty;\r\n\t\t\tfound = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(!found){\r\n\t\tinventory.push(assignItem(invMaster[item.name]));\r\n\t}\r\n}", "giveItem(itemName, recipient) {\n if (!this.inventory.inventoryHasItem(itemName)) return false;\n const item = this.inventory.removeItem(itemName);\n recipient.takeItem(item);\n return true;\n }", "function isItemExisted(arrayData,item){\n let res = false;\n for(let i = 0; i < arrayData.length;i++){\n if(arrayData[i].item_id == item.item_id){\n res = true;\n }\n }\n return res;\n}", "function useItemInRoom (id, alias) {\n\n var itemsInRoom = [];\n var roomToSearch = roomById(id);\n alias = alias.toLowerCase();\n\n if(roomToSearch['inventory']){\n itemIDsInRoom = Object.keys(roomToSearch['inventory']);\n } else {\n return;\n }\n itemsInRoom = [];\n\n for(var i=0; i< itemIDsInRoom.length;i++){\n itemsInRoom.push(itemByItemID(itemIDsInRoom[i]));\n }\n\n for (var i = 0; i < itemsInRoom.length; i++) {\n if (itemsInRoom[i].name.toLowerCase() == alias || itemsInRoom[i].name.toLowerCase().search(alias) != -1) {\n if(itemsInRoom[i].use != undefined){\n //eval(itemsInRoom[i].use);\n return itemsInRoom[i].itemID;\n return true;\n }\n }\n }\n\n return;\n\n}", "getItemById(items, targetId, idProp) {\n var results = $.grep(items, (item) => {\n return item['_id' || idProp] === targetId\n })\n return (results && results[0]) || null\n }", "function checkInventory(itemID, itemQuantity) {\n connection.query(\"SELECT stock_quantity FROM products WHERE item_id = ?\",\n [itemID], \n function(err, response){\n if (err) {\n console.log(err)\n } else {\n //displays quantity\n // console.log(response[0].stock_quantity);\n var stockQuantity = response[0].stock_quantity;\n if (itemQuantity > stockQuantity) {\n console.log(chalk.bold.red(\"Insufficient Quantity!\"))\n productsForSale();\n } else {\n fulfillOrder(itemID, itemQuantity);\n }\n }\n })\n }", "function findItemById(items, id) {\n\t\t\t\n\t\t\tfor (var i=0; i<items.length; i++){\n\t\t\t\tif (items[i].artid === id) { //property must match name in db here\n\t\t\t\t\treturn items[i];\t\t//return one object\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function IsItemInCart()\n{\n\t\tvar i;\t\n\t\n for (i=0;i<cart.length;i++){\n\t\t\tif(cart[i].car_num === current_car && cart[i].color === current_color && cart[i].mirror === isMirror){ return i;}\n\t\t}\n\n\treturn -1;\n\n}", "function isProductAlreadyInCart() {\n if (!Storage.has('products')) {\n return false;\n } \n let products = Storage.get('products');\n if (products.includes(getProductId())) { \n return true;\n }\n return false;\n}", "getEquippedItems(){\n\n //If character does not have an inventory property, character does not have any inventory yet. Return empty array\n if (!this.props.inventory) {\n return [];\n }\n \n let items = this.props.inventory;\n\n return items\n .filter( eachItem =>{\n return eachItem.is_equipped === 1;\n });\n }", "function checkAndAddItem(item) {\n console.log(`${player.name} takes the ${item.name}.`);\n // check if item is a weapon, add to player's weapon list\n if (allWeapons.includes(item)) {\n player.equip.weapon.push(item);\n } else if (allArmor.includes(item)) {\n // check if item is armor, add to player's armor\n player.equip.armor[item.name] = item;\n player.HP += item.bonus;\n } else {\n // else, add to player's items\n player.items.push(item);\n }\n}", "function buyItem(itemDetail) {\n if (state.User && state.User.id) {\n console.log(itemDetail);\n console.log(state.User.id);\n console.log(state.searchSaved);\n let payload = {\n title: itemDetail.title,\n image_url: itemDetail.image,\n purchase_url: itemDetail.link,\n price: itemDetail.price ? itemDetail.price.raw : null,\n itemName: props.itemToSearch,\n UserId: state.User.id,\n };\n dispatch({ type: LOADING });\n if (state.searchSaved) {\n API.saveProducts(payload)\n .then((response) => {\n //console.log(\"Product saved: \", response);\n dispatch({ type: STOP_LOADING });\n addToast(`Product ${response.data.title} Saved`, {\n appearance: \"success\",\n autoDismiss: true,\n });\n })\n .catch((err) => {\n //console.log(\"Unable to save product\")\n dispatch({ type: STOP_LOADING });\n addToast(` Unable to save Product`, {\n appearance: \"error\",\n autoDismiss: true,\n });\n });\n } else {\n let searchSavePayload = {\n UserId: state.User.id,\n image_url: state.CurrentSearch.image_url,\n itemNames: state.CurrentSearch.items,\n };\n console.log(\"payload to save search: \", searchSavePayload);\n API.saveSearch(searchSavePayload)\n .then((searchresponse) => {\n //console.log(\"Search saved\", searchresponse.data);\n dispatch({ type: SEARCH_SAVED, searchSaved: true });\n addToast(`Search Saved`, {\n appearance: \"success\",\n autoDismiss: true,\n });\n API.saveProducts(payload)\n .then((response) => {\n //console.log(\"Product saved: \", response);\n addToast(`Product ${response.data.title} Saved`, {\n appearance: \"success\",\n autoDismiss: true,\n });\n })\n .catch((err) => {\n //console.log(\"Unable to save product\")\n dispatch({ type: STOP_LOADING });\n addToast(` Unable to save Product`, {\n appearance: \"error\",\n autoDismiss: true,\n });\n });\n })\n .catch((err) => {\n console.log(\"Save not successfull\");\n dispatch({ type: STOP_LOADING });\n addToast(` Unable to save your search`, {\n appearance: \"error\",\n autoDismiss: true,\n });\n });\n }\n }\n }", "async function getItemById(id) {\n await validations.isIntValid(itemsDao.getItemId(id));\n let requestedItem = await itemsDao.getItemById(id);\n return requestedItem;\n}", "function checkItemInCart() {\n\t\tlet itemCount = c.cart.item_count;\n\t\tconst items = c.cart.items;\n\n\t\tif (itemCount > 0) {\n\t\t\titems.forEach((item) => {\n\t\t\t\tif (item.handle === c.product.handle) {\n\t\t\t\t\titemCount -= 1;\n\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\tif (item.properties._giveaway) {\n\t\t\t\t\t\tc.inCart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tobserveCart();\n\t}", "function checkItemID(dept, itemIdToUpdateStock, itemQuantity) {\n connection.query(\n \"SELECT * FROM products WHERE department_name = ?\",\n [dept],\n function(err, results) {\n if (err) throw err;\n var choiceArray = [];\n for (let i = 0; i < results.length; i++) {\n choiceArray.push(results[i].item_id);\n }\n console.log(\"The item to update is \" + itemIdToUpdateStock);\n if (choiceArray.includes(itemIdToUpdateStock)) {\n console.log(\n \"Item to update is associated with the \" +\n dept +\n \" department\"\n );\n updateStock(dept, itemQuantity, itemIdToUpdateStock);\n } else {\n console.log(\n \"Item_ID: \" +\n itemIdToUpdateStock +\n \" is not associated with the current department. Please restart and try again.\"\n );\n start();\n }\n }\n );\n }", "getBasketItem(id) {\n for(let i = 0; i < this.basket.length; ++i) {\n if(this.basket[i].id == id) {\n return JSON.parse(JSON.stringify(this.basket[i]));\n }\n }\n }", "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}", "function inventoryContainsItem(itemIndex) {\n for (var key in inventory) {\n if (inventory[key] == gameObjects[itemIndex % gameObjects.length]) {\n return true;\n }\n }\n\n return false;\n }", "has(item) {\n if (this.isEmpty()) {\n return false\n } else {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i] === item) {\n return true\n }\n }\n return false\n }\n }", "function selectItem() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter the ID for the product you'd like to buy\",\n name: \"productID\"\n },\n {\n type: \"input\",\n message: \"How many units of the product would you like to buy?\",\n name: \"quantity\"\n }\n ]).then(function(inquirerResponse){\n var productID = parseInt(inquirerResponse.productID);\n var qty = inquirerResponse.quantity;\n isAvailable(productID, qty);\n })\n}", "function checkProductsInCart(id) {\n for (var i = 0; i < $scope.cartItems.length; i++) {\n if ($scope.cartItems[i].productId === id) {\n return $scope.cartItems[i];\n }\n }\n return null;\n }", "function checkProductsInCart(id) {\n for (var i = 0; i < $scope.cartItems.length; i++) {\n if ($scope.cartItems[i].productId === id) {\n return $scope.cartItems[i];\n }\n }\n return null;\n }" ]
[ "0.7176266", "0.71692055", "0.70616436", "0.7025029", "0.65179", "0.6476265", "0.645627", "0.6286752", "0.62667966", "0.62543756", "0.62536126", "0.6217274", "0.61803204", "0.6179814", "0.6120193", "0.6112549", "0.61096394", "0.6108419", "0.6080318", "0.60705066", "0.6056833", "0.6033108", "0.6007668", "0.59470856", "0.59433854", "0.59433854", "0.5936528", "0.59246457", "0.59156036", "0.58748436", "0.58660257", "0.5864793", "0.5852513", "0.5838077", "0.5831742", "0.582951", "0.5807631", "0.5806324", "0.57980675", "0.5782691", "0.5775673", "0.57431924", "0.57166785", "0.56907123", "0.5684568", "0.5681596", "0.56768894", "0.5666103", "0.5663296", "0.5650459", "0.5641733", "0.56405985", "0.5632724", "0.5623934", "0.56225574", "0.56225574", "0.5615836", "0.56099975", "0.55995333", "0.55884516", "0.5578398", "0.55760807", "0.5572657", "0.55594534", "0.5553132", "0.5546667", "0.5545897", "0.5543937", "0.5542179", "0.5536604", "0.5524239", "0.5516765", "0.55141234", "0.55110204", "0.55051726", "0.55025166", "0.5496668", "0.5494327", "0.54919463", "0.54864115", "0.5483402", "0.54780287", "0.5476937", "0.547645", "0.54750115", "0.54715526", "0.54698986", "0.54687744", "0.5467411", "0.5465074", "0.5462887", "0.545912", "0.5452076", "0.5450262", "0.5438957", "0.5434449", "0.54317474", "0.54292685", "0.5425805", "0.5425805" ]
0.7557776
0
The redeeming process. Removes an inventory item from a shop user's inventory
function redeem(memberObj, itemObj){ let shopUser = getShopUser(memberObj); inventoryQuantityProcess(memberObj, itemObj); return `One ${itemObj.Item} has successfully redeemed and removed from ${memberObj}'s inventory.`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(item) {\n item = this.normalize(item);\n\n if (this.items.filter(i => i[0] == item[0]).length) { // item with SKU exists already\n this.items = this.items.map(\n i => {\n // when the SKU of the newly added item matches the item in the inventory, just add amount\n if (i[0] == item[0]) {\n i[1] -= item[1];\n }\n return i;\n }\n );\n }\n\n // filter out the items with quantity of 0 or less\n this.items = this.items.filter(i => i[1] > 0);\n }", "function inventoryQuantityProcess(memberObj, itemObj){\n let shopUser = getShopUser(memberObj);\n if(itemObj.quantity == 1) {\n let index = shopUser.inventory.indexOf(itemObj);\n\n if(index > -1){\n shopUser.inventory.splice(index, 1);\n \n return fs.writeFileSync(\"./data/shop/data.json\", JSON.stringify(data), (err) => console.log(err));\n }\n } else {\n itemObj.quantity -= 1;\n\n return fs.writeFileSync(\"./data/shop/data.json\", JSON.stringify(data), (err) => console.log(err));\n }\n}", "function removeInventory() {\n const removeItem = document.getElementById(\"removeInventory\").value\n inventory.splice((removeItem - 1),1)\n updateInventory()\n}", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "function minusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const index = cartList.findIndex(product => product.id == productId);\n cartList.splice(index, 1);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "function removeRequest() {\n\tinquirer.prompt([{\n\t\tname: \"ID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the item ID of the you would like to remove?\"\n//once the manager enters the ID to delete the item than delete that particular item from the table.......\t\n\t}]).then(function (deleteItem) {\n\t\tconnection.query(\"DELETE FROM products WHERE ?\", {\n\t\t\titem_id: deleteItem.ID,\n\n\t\t}, function (err, res) {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log(res);\n\t\t\tconsole.log(\"=====================================\");\n\t\t\tconsole.log(\"The item is deleted from Invetory..!!\");\n\t\t\tconsole.log(\"=====================================\");\n\n\n\t\t});\n\t\t//once the item is deleted display the most updated table............\n\t\tdisplayInventory();\n\t});\n}", "function removeItem(foodItem) {\n\n indexCartArray = 0;\n\n storeInventory.forEach(function () {\n\n if (storeInventory[indexCartArray].id == foodItem) {\n\n cartArray.splice(indexCartArray, 1);\n sessionStorage.setItem(\"cart\", JSON.stringify(cartArray));\n alert(storeInventory[indexCartArray].name + \" removed from cart\");\n\n }\n indexCartArray++;\n });\n\n updateQuantities();\n\n}", "deleteItem(item){\n delete this.inventory[item];\n }", "function DropItem(itemId: int) {\n\t\tinventoryItemCount--;\n\t\n\t}", "function removeItem() {\n\t// if there are any items in the shoppingCart Array\n\tif (shoppingCart.length > 0) {\n\t\t// prompt to figure out what item they want to remove \n\t\tinquirer.prompt({\n\t\t\tmessage: \"Which Item would you like to remove?\",\n\t\t\tname: \"removeItem\",\n\t\t\ttype: \"list\",\n\t\t\t// the choices are from the current shopping list\n\t\t\tchoices: function () {\n\t\t\t\tvar returnItems = [];\n\t\t\t\tfor (var i = 0; i < shoppingCart.length; i++) {\n\t\t\t\t\treturnItems.push(shoppingCart[i].product_name);\n\t\t\t\t}\n\t\t\t\treturn returnItems;\n\t\t\t}\n\t\t})\n\t\t\t.then(function (removeQ) {\n\t\t\t\t// loop through the shopping cart to compare the .product name against the selection for the remove item, then use the hoisted function to remove the item at the iteration\n\t\t\t\tfor (var i = 0; i < shoppingCart.length; i++) {\n\t\t\t\t\tvar sC = shoppingCart[i];\n\t\t\t\t\tif (sC.product_name === removeQ.removeItem) {\n\t\t\t\t\t\t// subtract the cost of the items from the cartPrice\n\t\t\t\t\t\tcartPrice -= (sC.purchaseQTY * sC.price_customer);\n\t\t\t\t\t\tshoppingCart.remove(i);\n\t\t\t\t\t\tconsole.log(\"Removed \" + sC.purchaseQTY + \" \" + sC.product_name + \" From the Cart.\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// get more input from the user\n\t\t\t\tnextAction();\n\t\t\t})\n\t}\n\t// if there are no items in shoppingCart, redirect the user\n\telse {\n\t\tconsole.log(\"We can't remove items since your cart is empty\");\n\t\tnextAction();\n\t}\n}", "function removeItem() {\n removeRequestedItem(requestedItem);\n }", "function removeItem() {\n //prompt user for the item they want to remove\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Please enter the [id] for the item you would like to remove: \",\n name: \"id\",\n validate: function (value) {\n //validate that the id they entered matches an id for an item in their cart\n var isValid = false;\n for (var index in cart) {\n if (cart[index].id == parseInt(value)) {\n isValid = true;\n }\n }\n return (isValid) ? isValid : \"Please enter a valid [ID]\";\n }\n }\n ]).then(function (value) {\n var restock = 0;\n\n //grab the quantity of the item that is in the cart\n for (var index in cart) {\n if (cart[index].id == parseInt(value.id)) {\n restock = cart[index].quantity;\n }\n }\n //put that quantity back in stock\n for (var i in stock) {\n if (stock[i].ItemID == value.id) {\n stock[i].StockQuantity += restock;\n }\n }\n //remove the selected item object from the cart array\n cart = cart.filter(function (obj) {\n return value.id.indexOf(obj.id) === -1;\n });\n\n //display stock,cart, and prompt user\n displayStock();\n shoppingCart();\n promptOptions();\n });\n}", "async function removeItem(req, res) {\n res.json(await inventoryDB.removeItem(req.body));\n}", "function refundItem() {}", "removeInventory(item) {\n this.inventory.deleteItem(item.id);\n item.owner = undefined;\n return this;\n }", "drop(currentPlayer, itemName, channel){\n let item = this.utils.resolveNamable(itemName, currentPlayer.inventory.items)\n if(item){\n currentPlayer.inventory.items = currentPlayer.inventory.items.filter(\n currentItem => currentItem !== item)\n this.maps[currentPlayer.position].userItems.push(item)\n let forDeletion = getPasses(item)\n currentPlayer.passes = currentPlayer.passes.filter(instance => {\n return !forDeletion.includes(instance)\n })\n\n channel.send(`Item ${item.name.name} dropped.`).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\n }\n }", "function inventoryRemove(item) {\n\titem.hide();\n\titem.moveTo(current_layer);\n\titem.draggable(false);\n\tinventory_list.splice(inventory_list.indexOf(item), 1);\n\tredrawInventory();\n}", "function remove_item() {\n for (var i=0; i<selected_items.length; i++) {\n items.splice(selected_items[i],1);\n }\n $('#inventory_grid').html('');\n populate_inventory_grid();\n $('#item_action_menu').hide();\n selected_items = [];\n }", "function C001_BeforeClass_Sidney_GiveRope() {\n\tPlayerRemoveInventory(\"Rope\", 2);\n}", "removeHearthFromInventory(item) {\n for (let i = 0; i < this.inventory.length; i++) {\n if (this.inventory[i].item === item) {\n this.inventory.splice(i, 1);\n }\n }\n console.log(\"This is the new hearth list\", this.inventory);\n }", "function removeOrderMenuItem(itemId) {\n const dataToSend = JSON.stringify({orderMenuItemId: itemId});\n post(\"/api/authTable/removeItemFromOrder\", dataToSend, function (data) {\n if (data === \"success\") {\n const parent = document.getElementById(\"order\");\n const child = document.getElementById(\"ordermenuitem-\" + itemId);\n parent.removeChild(child);\n\n // Remove it from the basket array\n for (let i = 0; i < basket.length; i++) {\n if (basket[i].id === itemId) {\n basket.splice(i, 1);\n }\n }\n\n // Recalculate the price\n calculateTotal();\n }\n })\n}", "function itemDie(itemIdx){\r\n\tif(items[itemIdx].name == \"apple\"){\r\n\t\tdropItem(\"apple\");\r\n\t}\r\n\titems.splice(itemIdx, 1);\r\n}", "function clearInventory() {\n while (inventory != 0) {\n inventory.pop()\n }\n }", "removeFromCart(item) {\n const nameKey = item.name;\n // If the item is actually in the cart, we decrement the \"numInCart\" variable to represent\n // the fact that one fewer item is now in the cart\n if (nameKey in this.state.aggregatedItems) {\n let currAggregatedItems = this.state.aggregatedItems;\n let currPrice = currAggregatedItems[nameKey].price;\n let currNumInCart = currAggregatedItems[nameKey].numInCart;\n let currImage = currAggregatedItems[nameKey].image;\n let currShelfLife = currAggregatedItems[nameKey].shelf_life;\n let currType = currAggregatedItems[nameKey].type;\n\n currAggregatedItems[nameKey] = {\n numInCart: currNumInCart - 1,\n price: currPrice,\n image: currImage,\n type: currType,\n shelf_life: currShelfLife\n };\n // Removing the entire item from the aggregated item list if the number in cart reaches 0\n if (currNumInCart - 1 === 0) {\n delete currAggregatedItems[nameKey];\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If the \"Remove From Cart\" button was pressed on an item that wasn't even in the cart in the\n // first place, then we ignore the command and simply return\n } else {\n return;\n }\n }", "removeItem(item) {\n \t\t\tconst newItems = this.state.inventoryItems;\n \t\t\tdelete newItems[item];\n \t\t\tthis.setState({\n \t\t\t\tinventoryItems: newItems\n \t\t\t})\n \t\t}", "function deleteInventoryItem(itemId)\n\t{\n\t\titemId = 6; //TEST CODE REMOVE\n\n\t\t$.ajax({\n \tmethod: \"DELETE\",\n \turl: \"/api/inventory/\" + itemId\n \t\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\t\n\t });\n\n\t}", "function purchaseItem(itemName, quantity){\n connection.query( \"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\",\n [quantity, itemName.id],\n function (err, res) {\n console.log(\"You purchased \" + quantity + \" \" + itemName.product_name);\n displayProducts();\n }\n );\n}", "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "function RemoveItem(item){\n var index = basket.indexOf(item);\n if (index > -1) {\n console.log(\"Taking \" + item.Name + \" out of the basket!\");\n basket.splice(index, 1);\n return;\n }\n Console.log(item.Name + \" is not in the basket!\");\n}", "function removeItemFromCart(){\n\n}", "function Purge(inventory) {\n return inventory.splice(2, inventory.length);\n}", "function removeItemFromCart(event) {\n if (event.target.type === 'button') {\n currentInventory.removeItem(event.target.name);\n currentInventory.saveToLocalStorage();\n renderTable();\n }\n}", "function removeItem(item){\n\n\t\t\t// Make sure cart is not empty\n\t\t\tif((!isEmpty()) && itemInCart(item) ){\n\n\t\t\t\t// remove all the items of this kind from cart count\n\t\t\t\tadjustCount(item.qty * -1);\n\t\t\t\t\n\t\t\t\t// Adjust total based on item qty\n\t\t\t\tadjustTotal((item.price*item.qty)*-1);\n\n\t\t\t\t// Remove the item from array \n\t\t\t\titems.splice(items.indexOf(item), 1);\n\t\t\t\t\n\t\t\t\t// reset item qty\n\t\t\t\t// Remember the reference to this item is coming straight from the item data copy in the controller,\n\t\t\t\t// so the item is never removed we just reuse the same reference. Meaning we\n\t\t\t\t// have to reset its qty property!\n\t\t\t\titem.qty = 0;\n\t\t\t}\n\t\t}", "takeout(item) {\n var index = this.item.indexOf(item);\n if (this.open = true && index > -1) {\n this.item.splice(index, 1);\n alert(\"Item has been removed from the backpack.\");\n }\n }", "function removeItem(itemName) {\n order.subtotal = round(order.subtotal - order.items[itemName].price);\n order.tax = round(order.subtotal * 0.1);\n order.total = round(order.subtotal + order.tax + order.delivery);\n if (order.items[itemName].count > 1) {\n order.items[itemName].count -= 1;\n } else {\n delete order.items[itemName];\n }\n let restaurantDiv = document.getElementById(\"restaurant\");\n // Generate order summary div \n restaurantDiv.replaceChild(createOrderDiv(restaurantData.menu), document.getElementById(\"restaurant\").lastChild);\n}", "removeOne(item) {\n const newItems = this.state.inventoryItems;\n // let price = newItems[item].price;\n if (newItems[item].quantity === 0) {\n console.log(\"can't go negative\")\n } else {\n newItems[item].quantity = newItems[item].quantity - 1;\n }\n this.setState({\n inventoryItems: newItems\n })\n }", "function removeItem() {\n const productId = this.name;\n if(confirm(\"Voulez-vous supprimer le produit du panier ?\")) {\n let cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n cartList = cartList.filter(product => product.id != productId);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n }\n}", "function removeCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart[i].quantity--;\n if (cart[i].quantity === 0) {\n cart.splice(i, 1);\n }\n break;\n }\n }\n saveCart();\n}", "removeItem(item) {\n this.props.removeItem(this.props.partyId, item._id);\n }", "function sell_item_destroy(item, cost_adjustment) {\n //U.pluck(item._2o.container()._2m.items(), item);\n return $q.all([\n change_gold(item._2o.container(), item.cost*cost_adjustment),\n Oit.destroy_item(item)\n ]);\n }", "function removeItemAndCommand(itemName, itemAction) {\r\n var itemPosition = inventory.indexOf(itemName) - 1;\r\n var actionPosition = availableActions.indexOf(itemAction) - 1;\r\n if (inventory.includes(itemName)) {\r\n inventory.splice(itemPosition, 3);\r\n inventoryAside.innerHTML = inventory.join(\" \");\r\n availableActions.splice(actionPosition, 3);\r\n commandsFooter.innerHTML = availableActions.join(\" \");\r\n }\r\n}", "function removeOneItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(13, itemID.length);\n cartItems[positionInCart][3] -= 1;\n if (cartItems[positionInCart][3] === 0) {\n cartItems.splice(positionInCart, 1);\n }\n updateCartDetails();\n}", "function removeFromCartHandler(itemId) {\n\t\tsetUserCart(prev => {\n\t\t\treturn prev.filter(item => item.id !== itemId);\n\t\t});\n\t}", "function enoughInventory() {\n console.log(\"\");\n console.log(\"Thank you for your purcase of the \", currentItemName);\n var totalPrice = userQuantityRequested * currentItemPrice;\n console.log(\"Your total price is: \", totalPrice);\n console.log(\"Your items will be shipped out tommorrow.\");\n decreaseInventory();\n\n}", "function fosterRemoveItem(e){\n console.log(e.target.id)\n let itemname = e.target.id\n console.log(itemname)\n for (let item in basket){\n if (itemname == basket[item]['name']){\n basket.splice(item, 1)\n fosterStorage['foster-basket'] = JSON.stringify(basket)\n console.log(fosterStorage.getItem('foster-basket'))\n createBasket()\n }\n }\n if ((fosterStorage.getItem('foster-basket')).length > 0){\n window.location.href = \"foster_page.html\"\n }\n \n }", "removePowerupFrom(item) {\n item.beginAction = this.previousBeginAction;\n item.endAction = this.previousEndAction;\n this.remove();\n }", "async clearItemsByUserSelection() {\n const invalidItemTypes = getCharacterUpdatePolicyTypes();\n\n // collect all items belonging to one of those inventory item categories\n let ownedItems = this.actor.getEmbeddedCollection(\"OwnedItem\");\n let toRemove = ownedItems.filter((item) => invalidItemTypes.includes(item.type)).map((item) => item._id);\n await this.actor.deleteEmbeddedEntity(\"OwnedItem\", toRemove);\n return toRemove;\n }", "function delItemFromJson(itemName, sellerName) {\n // console.log(\"======\")\n // console.log(itemName);\n // console.log(sellerName);\n for ( let i = 0; i < cart.length; i++ ) {\n if ( cart[i][\"name\"] == sellerName) {\n var order = cart[i][\"order\"];\n // console.log(order);\n for ( let j = 0; j < order.length; j++ ) {\n // console.log(order[i]);\n if (order[j][\"name\"] == itemName) {\n order.splice(j, 1);\n j--;\n }\n }\n if (order.length == 0) {\n cart.splice(i, 1);\n i--;\n }\n }\n }\n localStorage.setItem(\"cart\", JSON.stringify(cartObj));\n // console.log(cart);\n buildCartList();\n}", "function remove_inventory(){ \n//take the top item from the list \n\n\tproducts.shift(); \n\t// you dont need to do \"var anything\" because you dont need to assign the variable\n\n\tprinting(); \n\n}", "remove(pmcData, body) {\n let toDo = [body];\n \n //Find the item and all of it's relates\n if (toDo[0] === undefined || toDo[0] === null || toDo[0] === \"undefined\") {\n logger.logError(\"item id is not valid\");\n return;\n }\n \n let ids_toremove = itm_hf.findAndReturnChildren(pmcData, toDo[0]); //get all ids related to this item, +including this item itself\n \n for (let i in ids_toremove) { //remove one by one all related items and itself\n for (let a in pmcData.Inventory.items) {\t//find correct item by id and delete it\n if (pmcData.Inventory.items[a]._id === ids_toremove[i]) {\n for (let insurance in pmcData.InsuredItems) {\n if (pmcData.InsuredItems[insurance].itemId == ids_toremove[i]) {\n pmcData.InsuredItems.splice(insurance, 1);\n }\n }\n }\n }\n }\n }", "function removeEducationItem(itemId) {\n\tvar index;\n\n\tfor(var i=0; i<educationData.items.length; i++) {\n\t\tif(educationData.items[i].id == itemId) {\n\t\t\teducationData.items[i].saved = false;\n\t\t\tindex = _savedItems.indexOf(educationData.items[i]);\n\t\t\t_savedItems.splice(index,1);\n\t\t\trenderRemoveMsgModal();\n\t\t\trenderEducationCards();\n\t\t}\n\t}\n}", "giveItem(itemName, recipient) {\n if (!this.inventory.inventoryHasItem(itemName)) return false;\n const item = this.inventory.removeItem(itemName);\n recipient.takeItem(item);\n return true;\n }", "function deleteItem() {\n inventory[clickedEventId] = {};\n player[clickedEventId] = {};\n document.getElementById(clickedEventId).style.backgroundImage = \"none\";\n updateUI();\n updateInventory();\n updateEquipment();\n}", "function removeCartItem(e, itemId) {\n let price = parseInt();\n let qty = parseInt();\n let cartItems = localStorage.getItem(\"productsInCart\");\n cartItems = JSON.parse(cartItems);\n\n price = cartItems[itemId].price;\n qty = cartItems[itemId].qty;\n\n delete cartItems[itemId];\n\n let totalCost = localStorage.getItem(\"totalCost\");\n totalCost -= parseInt(price) * parseInt(qty);\n document.getElementById(\"sub-total\").innerHTML = \"&#8377; \" + totalCost;\n document.getElementById(\"cart-total\").innerHTML = \"&#8377; \" + totalCost;\n\n let cartNumbers = localStorage.getItem(\"cartNumbers\");\n cartNumbers -= 1;\n\n $('div.icon-header-noti').attr(\"data-notify\", cartNumbers);\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\n localStorage.setItem(\"totalCost\", JSON.stringify(totalCost));\n localStorage.setItem(\"cartNumbers\", JSON.stringify(cartNumbers));\n\n $(e).closest('.table_row').remove();\n\n\n}", "function removeFromCart(itemId) {\n props.removeItem(itemId);\n }", "_deleteItem() {\n this.splice('cart', this.itemNumber, 1);\n if (this.itemNumber > (this.cart.length - 1)) {\n window.history.go(-1);\n }\n console.log(this.cart);\n this.setCartItem();\n this._computeNewItemNumber(this.itemNumber)\n }", "function removeWeapon(w){\n\n\tif (w.name in armory){\n \tarmory[w.name].weapon.wquantity -= 1;\n\t}\n\n}", "function removeProductFromWishList(e) {\r\n console.log(e.id);\r\n //console.log(cartStoredData);\r\n console.log(wishListData);\r\n for (i = 0; i < wishListData.length; i++) {\r\n if (wishListData[i].productId == e.id) {\r\n\r\n wishListData.splice(i, 1);\r\n }\r\n }\r\n console.log(wishListData);\r\n goToWishList();\r\n alert(\"Removed Item\");\r\n}", "function removeItemFromCart(itemId) {\n let cartItems = localStorage.getItem('cartItems');\n if (cartItems) {\n let cartItemsArray = JSON.parse(cartItems);\n let itemIndex = cartItemsArray.findIndex(item => {\n return item.id === itemId;\n });\n cartItemsArray.splice(itemIndex, 1);\n localStorage.setItem('cartItems', JSON.stringify(cartItemsArray));\n sendItemsToCartUI(cartItemsArray);\n grandTotals(cartItemsArray);\n document.querySelector('.cart-items').innerText = cartItemsArray.length;\n\n }\n}", "function C010_Revenge_SidneyJennifer_StealItems() {\n\t\n\t// Backup and remove the player inventory\n\tPlayerSaveAllInventory();\n\tPlayerRemoveAllInventory();\n\tC010_Revenge_SidneyJennifer_ItemStolen = true;\n\tCurrentTime = CurrentTime + 50000;\n\t\n}", "[REMOVE_MEAL_ITEM](state, item) {\n state.meal.items = state.meal.items.filter(i => i !== item);\n }", "function removeitemFromCart(name) { //remove one item from cart\r\n for (var i in cart) {\r\n if (cart[i].name == name) {\r\n cart[i].count--;\r\n if (cart[i].count == 0) {\r\n cart.splice(i, 1);\r\n }\r\n break;\r\n }\r\n }\r\n savecart();\r\n}", "function removeFromCart(itemKey) {\n for (let i = 0; i < itemsDb.length; i++) {\n // we need to remove items from itemsDb based on the unique time-id we created. \n // This value is stored as the third index = [2]. Example: [\"username\", {all item properties}, \"item-1557239902725\"] \n if (itemsDb[i][2] == itemKey) {\n // We remove the item from our Db array. \n itemsDb.splice(i, 1);\n }\n }\n // We load in the items that are now left in itemsDb.\n localStorage.setItem('cart', JSON.stringify(itemsDb));\n var container = document.getElementById(\"cartContainer\");\n container.innerHTML = '';\n createCartItems();\n window.location.reload();\n}", "function removeItemFromBasket(userID, itemID){\n Basket.collection.deleteOne({userID: userID, itemID: itemID});\n}", "function useBagItem(itemIndex){\n //determine which type of items can be consumed through a new attribute and what they do.\n var tempBagItem = bagInventory[itemIndex];\n\n var attributeNumber = parseInt(tempBagItem.Attribute);\n var itemType = tempBagItem.ItemType;\n var itemUsed = false;\n switch (itemType) {\n case 'healing':\n playerHeal(attributeNumber);\n itemUsed = true;\n break;\n default:\n //do nothing if it doesn't fall under one of the above\n break;\n }\n\n //when consumed delete the item from inventory.\n if(itemUsed){\n removeBagItem(itemIndex);\n }\n\n}", "takeDamage(damage, index, user) {\n //Deal damage and check if hp of item\n // is 0 if so, remove from array\n this.array[index].hp -= damage;\n if(this.array[index].hp <= 0){\n this.remove(index);\n user.scoreUpdate(400);\n }\n }", "function pickUp(item){\n\tif(!item.obtained){\n\t\tuser.inventory.splice(-1, 0, item)\n\t\titem.obtained = true;\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You recieved ' + item.name + '! You put it in your inventory. You now have ' + user.inventory.length + ' out of a possible ' + maximumItems + ' items in your inventory!';\n\t\t\n\t\t//Check to see if user meets the maximum items\n\t\tif(user.inventory.length >= maximumItems){\n\t\t\tend();\n\t\t\treturn;\n\t\t}\n\t}else{\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You already have that item!';\n\t}\n}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function unequipItem() {\n var unequipSlot = clickedEventId.replace('equip', '');\n player.armor -= player[unequipSlot].armor;\n // Finding an empty inventory slot\n for (var g = 1; g < 27; g++) {\n inventorySpace = \"i\" + g;\n if (jQuery.isEmptyObject(inventory[inventorySpace])) {\n // Removing Affixes\n for (var i = 0; i < item.affixes.length; i++) {\n var upperCase = item.affixes[i].name;\n var affix = upperCase.toLowerCase();\n player[affix] -= item.affixes[i].value;\n }\n inventory[inventorySpace] = player[unequipSlot];\n imageIcon = player[unequipSlot].type + player[unequipSlot].quality; // The Lower case for image.png\n document.getElementById(clickedEventId).style.backgroundImage = \"none\";\n document.getElementById(inventorySpace).style.backgroundImage = 'url(itemIcons/' + player[unequipSlot].type + '/' + imageIcon + '.png)';\n // Adding the tooltip onto the inventory slot\n $(inventorySpace).attr(\"title\", \"\" + player[unequipSlot].quality + \" \" + player[unequipSlot].type + \"\\nArmor: \" + player[unequipSlot].armor);\n player[unequipSlot] = {};\n break;\n }\n }\n updateUI();\n updateInventory();\n updateEquipment();\n}", "removeItem() {\n // Remove Item from Order's Items array:\n this.order.removeItem(this.item);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "function removeItem(){\n var selectedDiv = this.closest(\"div\");\n var itemName = selectedDiv.querySelector(\".item-name\")\n cart.forEach(function (cartItem){\n if(itemName.innerHTML === cartItem.name){\n var cartItemIndex = cart.indexOf(cartItem); \n cart.splice(cartItemIndex, 1)\n }\n })\n selectedDiv.parentNode.removeChild(selectedDiv) \n}", "function onitemremove (data) {\n\tvar removeItem; \n\tremoveItem = finditembyid(data.id);\n\n\tif (!removeItem) {\n\t\treturn;\n\t}\n\n\tland.splice(land.indexOf(removeItem), 1); \n\t\n\t//destroy the phaser object \n\tremoveItem.item.destroy(true, false);\n}", "function removeItem(name, quantity = 0) {\n for (let i = 0; i < cart.length; i++) {\n if (cart[i].name === name) {\n if (quantity > 0) {\n cart[i].quantity -= quantity;\n }\n\n // Removes item if there 0 items\n if (cart[i].quantity < 1 || quantity === 0) {\n cart.splice(i, 1);\n }\n\n showItems();\n\n //? Why does this need to be here?\n return;\n }\n }\n}", "function discardProduct(userInfo, productId) {\n /*let productId = $(this).attr('data-productId');*/\n console.log(productId);\n delete userInfo.cart[productId];\n marketService.updateUser(userInfo).then(\n ()=>{\n showView('Cart');\n loadMyCart();\n }\n )\n }", "function remove(id) {\n var indexOfItemToRemove = getIndex(id);\n var toRemove = context.cart[indexOfItemToRemove].quantity * 3;\n context.cart.splice(indexOfItemToRemove, 1);\n var newCartTotal = (context.cartTotal - toRemove);\n context.setCartTotal(newCartTotal);\n context.setCart(context.cart);\n context.updateCart(context.userName, context.cart);\n context.updateTotalPrice(context.cart);\n }", "function removeCartItem() {\n const removeId = event.target.dataset.id;\n\n if (confirm(\"Are you sure you want to remove this item?\")) {\n let updatedCartItems = currentCartItems.filter(function (item) {\n if (removeId !== item.id) {\n return true;\n }\n });\n currentCartItems = updatedCartItems;\n saveToStorage(cartKey, updatedCartItems);\n displayCartItems();\n calculateCartTotal();\n createMenu();\n displayMessage(\n \"alert-success\",\n \"The item was successfully removed.\",\n \".message-container\"\n );\n }\n}", "function RemoveWeapon (Item)\n{\tif (Item.equippedWeaponVersion != null)\n\t{\n\t\tDestroy(WeaponSlot.FindChild(\"\"+Item.equippedWeaponVersion.name).gameObject);\n\t\tif (DebugMode)\n\t\t{\n\t\t\tDebug.Log(Item.name + \" has been removed as weapon\");\n\t\t}\n\t}\n}", "function C001_BeforeClass_Sidney_Untie() {\n\tActorRemoveInventory(\"Rope\");\n\tPlayerAddInventory(\"Rope\", 1);\n}", "function removeItem(id){\r\n\tif(order.hasOwnProperty(id)){\r\n\t\torder[id] -= 1;\r\n\t\tif(order[id] <= 0){\r\n\t\t\tdelete order[id];\r\n\t\t}\r\n\t\ttemp = getCurrentRestaurant();\r\n\t\tif (temp !== undefined){\r\n\t\t\tupdateOrder(temp);\r\n\t\t}\r\n\t}\r\n}", "function removeOneItem(itemName) {\r\n var itemPosition = inventory.indexOf(itemName) - 1;\r\n if (inventory.includes(itemName)) {\r\n inventory.splice(itemPosition, 3);\r\n inventoryAside.innerHTML = inventory.join(\" \");\r\n }\r\n}", "function untickItem(UntickItem){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList == null){\n boughtList = [];\n }\n else{\n boughtList = JSON.parse(boughtList);\n boughtList = convertObjArrayToItemArray(boughtList);\n }\n var chosenList = localStorage.getItem(\"chosenList\");\n var shoppingList = localStorage.getItem(chosenList);\n if(shoppingList != null){\n shoppingList = JSON.parse(shoppingList);\n shoppingList = convertObjArrayToItemArray(shoppingList);\n }\n for (var i = 0; i < boughtList.length; i++){\n if(UntickItem[0] == boughtList[i].name){\n var tempUntickItem = boughtList[i];\n boughtList.splice(i, 1);\n shoppingList.push(tempUntickItem);\n }\n }\n localStorage.setItem(chosenBoughtList, JSON.stringify(boughtList));\n localStorage.setItem(chosenList, JSON.stringify(shoppingList));\n}", "function inventory(item_update, quantity_update) {\n\t//UPDATE [table] SET [column] = '[updated-value]' WHERE [column] = [value];\n\tconnection.query(\n\t\t\"UPDATE products SET ? WHERE ?\",\n\t\t[\n\t\t{\n\t\t\tstock_quantity: quantity_update\n\t\t},\n\t\t{\n\t\t\titem_id: item_update\n\t\t}\n\t\t],\n\t\tfunction(error) {\n\t\t\tif (error) throw err;\n\t\t\tinquirer.prompt([{\n\t\t\t\tname: \"anything_else\",\n\t\t\t\ttype: \"confirm\",\n\t\t\t\tmessage: \"Continue to Purhcase?\",\n\t\t\t\tdefault: true\n\t\t\t}]).then(function(res){\n\t\t\t\tif(res.anything_else){\n\t\t\t\t\trun();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//if nothing else then end session\n\t\t\t\t\tconsole.log(\"Good Bye! Thanks for coming\");\n\t\t\t\t\tconnection.end();\n\t\t\t\t}\n\t\t\t})\n\t\t})\n}", "function removeItem(event){\n const serializedItem = event.dataTransfer.getData('item');\n if (serializedItem !== null) {\n const item = Item.fromJSONString(serializedItem);\n let quan = instance.model.orderList.items[item.nr].quantity;\n // Remove the item from the order bar completely\n instance.model.undoManager.perform(\n instance.model.orderList.removeItemCommand(item.nr,quan)\n .augment(updateOrderBarCommand())\n );\n }\n}", "function removeQuantityProduct(obj, unity, id) {\n obj.products.forEach(el => {\n if(el.id === id){\n el.quantity -= unity;\n }\n });\n \n localStorage.setItem('allProducts', JSON.stringify(obj));\n}", "'SELL_STOCK' (state, {shrimpId, quantity, shrimpPrice}) {\n \n // Checks to see which items are already in the array\n const record = state.shrimpInventoryData.find(element => element.id == shrimpId);\n \n // Detracts from quantity\n if (record.quantity > quantity) {\n \n record.quantity -= quantity;\n \n }\n \n // Removes the item from the array if amount sold is the amount available\n else {\n \n state.shrimpInventoryData.splice(state.shrimpInventoryData.indexOf(record), 1);\n \n }\n \n // Updates funds when items are sold\n state.funds += shrimpPrice * quantity;\n \n }", "deleteItemById(db, site_id, item_id) {\n return db\n .from(\"inventory\")\n .where({\n site_id: site_id,\n id: item_id,\n })\n .del();\n }", "removeLineItemInCart(lineItemId) {\n const state = store.getState().home.cart; // state from redux store\n const checkoutId = state.checkout.id\n state.client.checkout.removeLineItems(checkoutId, [lineItemId]).then(res => {\n store.dispatch({ type: 'REMOVE_LINE_ITEM_IN_CART', payload: { checkout: res } });\n });\n }", "function removeItem(cart1) {\n $(\"button.remove\").on(\"click\", function () {\n let index = parseInt(this.value);\n cart1.splice(index,1);\n generateCart(cart1);\n });\n}", "function removeFromShop(itemObj) {\n let index = data.store.indexOf(itemObj);\n\n if(index > -1){\n data.store.splice(index, 1);\n\n fs.writeFileSync(\"./data/shop/data.json\", JSON.stringify(data), (err) => console.log(err));\n\n return `${itemObj.Item} has been removed from the shop.`\n } else {\n return `${itemObj.Item} doesn't exist in the store. Please double check you've spelled it correctly.`\n }\n}", "\"groceryLists.removeItem\"(_id, item) {\n if (!this.userId) {\n throw new Meteor.Error(\"Not authorized\");\n }\n \n GroceryLists.update(\n {\n $or: [ \n { _id: _id, userId: this.userId }, \n { _id: _id, collaborator: { $in: [this.userId] } } ]\n },\n {\n $pull: {\n items: {\n _id: item\n }\n },\n $set: {\n lastUpdated: new Date().getTime()\n }\n }\n );\n }", "function removeAllCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart.splice(i, 1);\n }\n }\n saveCart();\n}", "function deleteItem(eId) {\n //e.g eid=trash-2 where 2 is product id\n let id = eId.split(\"-\");\n removePrice(id[1]);\n removeFromStorage(id[1]);\n let mainDiv = document.getElementById(`main-div-${id[1]}`);\n mainDiv.parentNode.removeChild(mainDiv);\n dom.cartBadge.dispatchEvent(new Event(`updateBadge`));\n updateDomPrice();\n }", "function removeItemFromCart(uuid, isLayerPage, isWishListItem) {\n\tlayerPageFlag = isLayerPage;\n\tvar key = 'uuid=';\n\tif (isWishListItem == true) {\n\t\tkey = 'useritemid=';\n\t}\n\tif (layerPageFlag == true) {\n\t\tvar cObj = YAHOO.ebauer.utilities.asyncRequest('GET', getBaseURL() + '/ajax/removeItemFromCart.jsp?' + key + uuid, callbackRemoveItemFromCart);\n\t} else {\n\t\tvar cObj = YAHOO.ebauer.utilities.asyncRequest('GET', getBaseURL() + '/ajax/removeItemFromCart.jsp?' + key + uuid, callbackshowcheckoutpage);\n\t}\n}", "function deleteItem(eId) {\n document.getElementById(eId).remove();\n n = Number (eId.slice(-1)) -1;\n //remove the cost of the product deleted from the cart\n total -= itemCost[n];\n //updating the cost of products in the cart\n document.getElementById(\"total\").innerHTML = \"Total: \" + total.toFixed(2) +\"$\";\n}", "removeItemFromCart(itemId, variantId, e) {\n e.preventDefault()\n if (itemId) { removeCartItem(itemId) }\n this.props.dispatchRemoveItemFromCart(variantId)\n }" ]
[ "0.7013096", "0.68041146", "0.6792574", "0.6783351", "0.6760429", "0.67308116", "0.6706836", "0.6693642", "0.66435033", "0.66217846", "0.65953696", "0.65835863", "0.6571048", "0.6560019", "0.6497578", "0.6494628", "0.6487814", "0.6482277", "0.64687467", "0.6376041", "0.63317287", "0.6329008", "0.63238", "0.6323059", "0.6314787", "0.6277811", "0.62745893", "0.62628293", "0.62619513", "0.6257283", "0.62502635", "0.6224841", "0.6221377", "0.6214694", "0.6208255", "0.6205345", "0.61936533", "0.6181323", "0.6165132", "0.61569995", "0.61486757", "0.6138115", "0.61380315", "0.61341965", "0.6128697", "0.61149293", "0.61144537", "0.6073638", "0.6070675", "0.6069738", "0.60665387", "0.6055672", "0.6054211", "0.6048979", "0.60467595", "0.6033459", "0.6007693", "0.6006801", "0.6001677", "0.5990537", "0.5983816", "0.5976869", "0.5973271", "0.59644485", "0.59620625", "0.59615594", "0.5956836", "0.5948726", "0.5948726", "0.5948726", "0.5948726", "0.5948726", "0.5948726", "0.5948265", "0.59476423", "0.594265", "0.5937193", "0.5936798", "0.592432", "0.5902799", "0.590173", "0.5900975", "0.5890129", "0.5871823", "0.58701855", "0.5863365", "0.5863075", "0.5862034", "0.5846988", "0.58460945", "0.5830871", "0.5830589", "0.5817457", "0.5814308", "0.58109367", "0.5809814", "0.5809343", "0.579065", "0.5789944", "0.57785225" ]
0.7110339
0
The process of removing ONE item from a shop user inventory. Will delete completely if quantity is at 0, reduce quantity by 1 else.
function inventoryQuantityProcess(memberObj, itemObj){ let shopUser = getShopUser(memberObj); if(itemObj.quantity == 1) { let index = shopUser.inventory.indexOf(itemObj); if(index > -1){ shopUser.inventory.splice(index, 1); return fs.writeFileSync("./data/shop/data.json", JSON.stringify(data), (err) => console.log(err)); } } else { itemObj.quantity -= 1; return fs.writeFileSync("./data/shop/data.json", JSON.stringify(data), (err) => console.log(err)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(item) {\n item = this.normalize(item);\n\n if (this.items.filter(i => i[0] == item[0]).length) { // item with SKU exists already\n this.items = this.items.map(\n i => {\n // when the SKU of the newly added item matches the item in the inventory, just add amount\n if (i[0] == item[0]) {\n i[1] -= item[1];\n }\n return i;\n }\n );\n }\n\n // filter out the items with quantity of 0 or less\n this.items = this.items.filter(i => i[1] > 0);\n }", "function removeOneItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(13, itemID.length);\n cartItems[positionInCart][3] -= 1;\n if (cartItems[positionInCart][3] === 0) {\n cartItems.splice(positionInCart, 1);\n }\n updateCartDetails();\n}", "function removeItem(foodItem) {\n\n indexCartArray = 0;\n\n storeInventory.forEach(function () {\n\n if (storeInventory[indexCartArray].id == foodItem) {\n\n cartArray.splice(indexCartArray, 1);\n sessionStorage.setItem(\"cart\", JSON.stringify(cartArray));\n alert(storeInventory[indexCartArray].name + \" removed from cart\");\n\n }\n indexCartArray++;\n });\n\n updateQuantities();\n\n}", "function minusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const index = cartList.findIndex(product => product.id == productId);\n cartList.splice(index, 1);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "function removeItem(item){\n\n\t\t\t// Make sure cart is not empty\n\t\t\tif((!isEmpty()) && itemInCart(item) ){\n\n\t\t\t\t// remove all the items of this kind from cart count\n\t\t\t\tadjustCount(item.qty * -1);\n\t\t\t\t\n\t\t\t\t// Adjust total based on item qty\n\t\t\t\tadjustTotal((item.price*item.qty)*-1);\n\n\t\t\t\t// Remove the item from array \n\t\t\t\titems.splice(items.indexOf(item), 1);\n\t\t\t\t\n\t\t\t\t// reset item qty\n\t\t\t\t// Remember the reference to this item is coming straight from the item data copy in the controller,\n\t\t\t\t// so the item is never removed we just reuse the same reference. Meaning we\n\t\t\t\t// have to reset its qty property!\n\t\t\t\titem.qty = 0;\n\t\t\t}\n\t\t}", "removeOne(item) {\n const newItems = this.state.inventoryItems;\n // let price = newItems[item].price;\n if (newItems[item].quantity === 0) {\n console.log(\"can't go negative\")\n } else {\n newItems[item].quantity = newItems[item].quantity - 1;\n }\n this.setState({\n inventoryItems: newItems\n })\n }", "function removeItem(name, quantity = 0) {\n for (let i = 0; i < cart.length; i++) {\n if (cart[i].name === name) {\n if (quantity > 0) {\n cart[i].quantity -= quantity;\n }\n\n // Removes item if there 0 items\n if (cart[i].quantity < 1 || quantity === 0) {\n cart.splice(i, 1);\n }\n\n showItems();\n\n //? Why does this need to be here?\n return;\n }\n }\n}", "function removeCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart[i].quantity--;\n if (cart[i].quantity === 0) {\n cart.splice(i, 1);\n }\n break;\n }\n }\n saveCart();\n}", "function removeItem(cart1) {\n $(\"button.remove\").on(\"click\", function () {\n let index = parseInt(this.value);\n cart1.splice(index,1);\n generateCart(cart1);\n });\n}", "function removeInventory() {\n const removeItem = document.getElementById(\"removeInventory\").value\n inventory.splice((removeItem - 1),1)\n updateInventory()\n}", "function removeItem() {\n\t// if there are any items in the shoppingCart Array\n\tif (shoppingCart.length > 0) {\n\t\t// prompt to figure out what item they want to remove \n\t\tinquirer.prompt({\n\t\t\tmessage: \"Which Item would you like to remove?\",\n\t\t\tname: \"removeItem\",\n\t\t\ttype: \"list\",\n\t\t\t// the choices are from the current shopping list\n\t\t\tchoices: function () {\n\t\t\t\tvar returnItems = [];\n\t\t\t\tfor (var i = 0; i < shoppingCart.length; i++) {\n\t\t\t\t\treturnItems.push(shoppingCart[i].product_name);\n\t\t\t\t}\n\t\t\t\treturn returnItems;\n\t\t\t}\n\t\t})\n\t\t\t.then(function (removeQ) {\n\t\t\t\t// loop through the shopping cart to compare the .product name against the selection for the remove item, then use the hoisted function to remove the item at the iteration\n\t\t\t\tfor (var i = 0; i < shoppingCart.length; i++) {\n\t\t\t\t\tvar sC = shoppingCart[i];\n\t\t\t\t\tif (sC.product_name === removeQ.removeItem) {\n\t\t\t\t\t\t// subtract the cost of the items from the cartPrice\n\t\t\t\t\t\tcartPrice -= (sC.purchaseQTY * sC.price_customer);\n\t\t\t\t\t\tshoppingCart.remove(i);\n\t\t\t\t\t\tconsole.log(\"Removed \" + sC.purchaseQTY + \" \" + sC.product_name + \" From the Cart.\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// get more input from the user\n\t\t\t\tnextAction();\n\t\t\t})\n\t}\n\t// if there are no items in shoppingCart, redirect the user\n\telse {\n\t\tconsole.log(\"We can't remove items since your cart is empty\");\n\t\tnextAction();\n\t}\n}", "function removeItem() {\n const productId = this.name;\n if(confirm(\"Voulez-vous supprimer le produit du panier ?\")) {\n let cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n cartList = cartList.filter(product => product.id != productId);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n }\n}", "function DropItem(itemId: int) {\n\t\tinventoryItemCount--;\n\t\n\t}", "function removeCartItem(e, itemId) {\n let price = parseInt();\n let qty = parseInt();\n let cartItems = localStorage.getItem(\"productsInCart\");\n cartItems = JSON.parse(cartItems);\n\n price = cartItems[itemId].price;\n qty = cartItems[itemId].qty;\n\n delete cartItems[itemId];\n\n let totalCost = localStorage.getItem(\"totalCost\");\n totalCost -= parseInt(price) * parseInt(qty);\n document.getElementById(\"sub-total\").innerHTML = \"&#8377; \" + totalCost;\n document.getElementById(\"cart-total\").innerHTML = \"&#8377; \" + totalCost;\n\n let cartNumbers = localStorage.getItem(\"cartNumbers\");\n cartNumbers -= 1;\n\n $('div.icon-header-noti').attr(\"data-notify\", cartNumbers);\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\n localStorage.setItem(\"totalCost\", JSON.stringify(totalCost));\n localStorage.setItem(\"cartNumbers\", JSON.stringify(cartNumbers));\n\n $(e).closest('.table_row').remove();\n\n\n}", "removeFromCart(item) {\n const nameKey = item.name;\n // If the item is actually in the cart, we decrement the \"numInCart\" variable to represent\n // the fact that one fewer item is now in the cart\n if (nameKey in this.state.aggregatedItems) {\n let currAggregatedItems = this.state.aggregatedItems;\n let currPrice = currAggregatedItems[nameKey].price;\n let currNumInCart = currAggregatedItems[nameKey].numInCart;\n let currImage = currAggregatedItems[nameKey].image;\n let currShelfLife = currAggregatedItems[nameKey].shelf_life;\n let currType = currAggregatedItems[nameKey].type;\n\n currAggregatedItems[nameKey] = {\n numInCart: currNumInCart - 1,\n price: currPrice,\n image: currImage,\n type: currType,\n shelf_life: currShelfLife\n };\n // Removing the entire item from the aggregated item list if the number in cart reaches 0\n if (currNumInCart - 1 === 0) {\n delete currAggregatedItems[nameKey];\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If the \"Remove From Cart\" button was pressed on an item that wasn't even in the cart in the\n // first place, then we ignore the command and simply return\n } else {\n return;\n }\n }", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "deleteItem(item){\n delete this.inventory[item];\n }", "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "function RemoveItem(item){\n var index = basket.indexOf(item);\n if (index > -1) {\n console.log(\"Taking \" + item.Name + \" out of the basket!\");\n basket.splice(index, 1);\n return;\n }\n Console.log(item.Name + \" is not in the basket!\");\n}", "function removerItem(item) {\r\n\tif (qtd[item] > 0) {\r\n\t\tqtd[item] -= 1;\r\n\t\tvar quantidade = document.getElementById('quantidade' + item);\r\n\t\tvar total = document.getElementById('total' + item);\r\n\t\tquantidade.innerHTML = qtd[item];\r\n\t\tvalorTotal[item] = valorProduto[item] * qtd[item];\r\n\t\ttotal.innerHTML = valorTotal[item];\r\n\t\tvalorCompra();\r\n\t}\r\n}", "removeItem(item, count){\n if(this.inventory[item] == null || count > this.inventory[item] || count < 0)\n {\n console.log(\"%cCannot remove \" + count + \" \" + item, \"color:red\");\n return false;\n }\n else if(this.inventory[item] - count == 0) {\n console.log(\"removing \" + item);\n delete this.inventory[item];\n return true;\n }\n else{\n console.log(\"removing \" + count + \" \" + item);\n this.inventory[item] -= count;\n return true;\n }\n }", "function removeItem(itemName) {\n order.subtotal = round(order.subtotal - order.items[itemName].price);\n order.tax = round(order.subtotal * 0.1);\n order.total = round(order.subtotal + order.tax + order.delivery);\n if (order.items[itemName].count > 1) {\n order.items[itemName].count -= 1;\n } else {\n delete order.items[itemName];\n }\n let restaurantDiv = document.getElementById(\"restaurant\");\n // Generate order summary div \n restaurantDiv.replaceChild(createOrderDiv(restaurantData.menu), document.getElementById(\"restaurant\").lastChild);\n}", "_deleteItem() {\n this.splice('cart', this.itemNumber, 1);\n if (this.itemNumber > (this.cart.length - 1)) {\n window.history.go(-1);\n }\n console.log(this.cart);\n this.setCartItem();\n this._computeNewItemNumber(this.itemNumber)\n }", "function removeItem(event){\n const serializedItem = event.dataTransfer.getData('item');\n if (serializedItem !== null) {\n const item = Item.fromJSONString(serializedItem);\n let quan = instance.model.orderList.items[item.nr].quantity;\n // Remove the item from the order bar completely\n instance.model.undoManager.perform(\n instance.model.orderList.removeItemCommand(item.nr,quan)\n .augment(updateOrderBarCommand())\n );\n }\n}", "function removeOrderMenuItem(itemId) {\n const dataToSend = JSON.stringify({orderMenuItemId: itemId});\n post(\"/api/authTable/removeItemFromOrder\", dataToSend, function (data) {\n if (data === \"success\") {\n const parent = document.getElementById(\"order\");\n const child = document.getElementById(\"ordermenuitem-\" + itemId);\n parent.removeChild(child);\n\n // Remove it from the basket array\n for (let i = 0; i < basket.length; i++) {\n if (basket[i].id === itemId) {\n basket.splice(i, 1);\n }\n }\n\n // Recalculate the price\n calculateTotal();\n }\n })\n}", "function inventoryRemove(item) {\n\titem.hide();\n\titem.moveTo(current_layer);\n\titem.draggable(false);\n\tinventory_list.splice(inventory_list.indexOf(item), 1);\n\tredrawInventory();\n}", "function removeItemFromCart(itemId) {\n let cartItems = localStorage.getItem('cartItems');\n if (cartItems) {\n let cartItemsArray = JSON.parse(cartItems);\n let itemIndex = cartItemsArray.findIndex(item => {\n return item.id === itemId;\n });\n cartItemsArray.splice(itemIndex, 1);\n localStorage.setItem('cartItems', JSON.stringify(cartItemsArray));\n sendItemsToCartUI(cartItemsArray);\n grandTotals(cartItemsArray);\n document.querySelector('.cart-items').innerText = cartItemsArray.length;\n\n }\n}", "function removeItem() {\n var parentRow = event.target.parentNode.parentNode;\n parentRow.remove();\n totalAmount();\n}", "function removeItem() {\n removeRequestedItem(requestedItem);\n }", "function removeItemFromCart(event) {\n if (event.target.type === 'button') {\n currentInventory.removeItem(event.target.name);\n currentInventory.saveToLocalStorage();\n renderTable();\n }\n}", "function remove(id) {\n var indexOfItemToRemove = getIndex(id);\n var toRemove = context.cart[indexOfItemToRemove].quantity * 3;\n context.cart.splice(indexOfItemToRemove, 1);\n var newCartTotal = (context.cartTotal - toRemove);\n context.setCartTotal(newCartTotal);\n context.setCart(context.cart);\n context.updateCart(context.userName, context.cart);\n context.updateTotalPrice(context.cart);\n }", "function removeitemFromCart(name) { //remove one item from cart\r\n for (var i in cart) {\r\n if (cart[i].name == name) {\r\n cart[i].count--;\r\n if (cart[i].count == 0) {\r\n cart.splice(i, 1);\r\n }\r\n break;\r\n }\r\n }\r\n savecart();\r\n}", "async function removeItem(req, res) {\n res.json(await inventoryDB.removeItem(req.body));\n}", "function removeItemFromBasket(userID, itemID){\n Basket.collection.deleteOne({userID: userID, itemID: itemID});\n}", "function remove_item() {\n for (var i=0; i<selected_items.length; i++) {\n items.splice(selected_items[i],1);\n }\n $('#inventory_grid').html('');\n populate_inventory_grid();\n $('#item_action_menu').hide();\n selected_items = [];\n }", "function removeAllCartItem(productId) {\n for (var i in cart) {\n if (cart[i].productId === parseInt(productId)) {\n cart.splice(i, 1);\n }\n }\n saveCart();\n}", "function removeItem() {\n //prompt user for the item they want to remove\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Please enter the [id] for the item you would like to remove: \",\n name: \"id\",\n validate: function (value) {\n //validate that the id they entered matches an id for an item in their cart\n var isValid = false;\n for (var index in cart) {\n if (cart[index].id == parseInt(value)) {\n isValid = true;\n }\n }\n return (isValid) ? isValid : \"Please enter a valid [ID]\";\n }\n }\n ]).then(function (value) {\n var restock = 0;\n\n //grab the quantity of the item that is in the cart\n for (var index in cart) {\n if (cart[index].id == parseInt(value.id)) {\n restock = cart[index].quantity;\n }\n }\n //put that quantity back in stock\n for (var i in stock) {\n if (stock[i].ItemID == value.id) {\n stock[i].StockQuantity += restock;\n }\n }\n //remove the selected item object from the cart array\n cart = cart.filter(function (obj) {\n return value.id.indexOf(obj.id) === -1;\n });\n\n //display stock,cart, and prompt user\n displayStock();\n shoppingCart();\n promptOptions();\n });\n}", "function removeFromCart(event) {\n\tlet storedCart = JSON.parse(localStorage.getItem('cart'));\n\tlet buttonName = event.target.dataset.name;\n\t//LOOP FOR SEARCHING SELECTED ITEM TO DELETE, EMPTYING ITS QUANTITY PROP BEFORE SPLICING IT OUT\n\tfor (let i = 0; i < storedCart.length; i += 1) {\n\t\tif (storedCart[i].label === buttonName) {\n\t\t\tstoredCart[i].qty = 0;\n\t\t\tstoredCart.splice(i, 1);\n\t\t\tlocalStorage.setItem('cart', JSON.stringify(storedCart));\n\t\t}\n\t}\n\n\tif (storedCart.length === 0) {\n\t\tcartCounter.innerHTML = 0;\n\t}\n\tshopcartOverlay.innerHTML = '';\n\n\tdisplayCart();\n}", "cartMinusOne(product, id) {\r\n if (product.quantity == 1) {\r\n this.cartRemoveItem(id);\r\n } else {\r\n product.quantity = product.quantity - 1;\r\n }\r\n }", "function deleteInventoryItem(itemId)\n\t{\n\t\titemId = 6; //TEST CODE REMOVE\n\n\t\t$.ajax({\n \tmethod: \"DELETE\",\n \turl: \"/api/inventory/\" + itemId\n \t\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\t\n\t });\n\n\t}", "function removeItemFromCart(){\n\n}", "function removeCartItem() {\n const removeId = event.target.dataset.id;\n\n if (confirm(\"Are you sure you want to remove this item?\")) {\n let updatedCartItems = currentCartItems.filter(function (item) {\n if (removeId !== item.id) {\n return true;\n }\n });\n currentCartItems = updatedCartItems;\n saveToStorage(cartKey, updatedCartItems);\n displayCartItems();\n calculateCartTotal();\n createMenu();\n displayMessage(\n \"alert-success\",\n \"The item was successfully removed.\",\n \".message-container\"\n );\n }\n}", "function removeQuantityProduct(obj, unity, id) {\n obj.products.forEach(el => {\n if(el.id === id){\n el.quantity -= unity;\n }\n });\n \n localStorage.setItem('allProducts', JSON.stringify(obj));\n}", "function removeItem(){\n var selectedDiv = this.closest(\"div\");\n var itemName = selectedDiv.querySelector(\".item-name\")\n cart.forEach(function (cartItem){\n if(itemName.innerHTML === cartItem.name){\n var cartItemIndex = cart.indexOf(cartItem); \n cart.splice(cartItemIndex, 1)\n }\n })\n selectedDiv.parentNode.removeChild(selectedDiv) \n}", "removeItem(item) {\n \t\t\tconst newItems = this.state.inventoryItems;\n \t\t\tdelete newItems[item];\n \t\t\tthis.setState({\n \t\t\t\tinventoryItems: newItems\n \t\t\t})\n \t\t}", "function handleRemoveItem(index) {\n\t\t\t\tconst delReset = items.reduce((total, id, price, unid, value) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tid- 0,\n\t\t\t\t\t\ttotal = 0,\n\t\t\t\t\t\tunid = 0,\n\t\t\t\t\t\tprice = 0,\n\t\t\t\t\t\tvalue = 0\n\t\t\t\t\t\t)\n\t\t\t\t}, 0);\n\t\t\t\tconst copy = [...items];\n\t\t\t\tcopy.splice(index, 1);\n\t\t\t\tsetItems(copy);\n\n\t\t\t\treturn (\n\t\t\t\t\tsetTotalItemCount(delReset),\n\t\t\t\t\tsetTotalItemTotal(delReset));\n\t\t\t}", "function removeItemsFromCart(productId, quantity){\n let newCart = shoppingCart.filter(product => {\n if(product.id === productId){\n product.quantity -= quantity;\n if(product.quantity <= 0){\n return false;\n }\n }\n return true;\n })\n return newCart;\n}", "function deleteItem(eId) {\n document.getElementById(eId).remove();\n n = Number (eId.slice(-1)) -1;\n //remove the cost of the product deleted from the cart\n total -= itemCost[n];\n //updating the cost of products in the cart\n document.getElementById(\"total\").innerHTML = \"Total: \" + total.toFixed(2) +\"$\";\n}", "function decreaseQuantity(quantity){\n return quantity - 1;\n}", "function removeRequest() {\n\tinquirer.prompt([{\n\t\tname: \"ID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the item ID of the you would like to remove?\"\n//once the manager enters the ID to delete the item than delete that particular item from the table.......\t\n\t}]).then(function (deleteItem) {\n\t\tconnection.query(\"DELETE FROM products WHERE ?\", {\n\t\t\titem_id: deleteItem.ID,\n\n\t\t}, function (err, res) {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log(res);\n\t\t\tconsole.log(\"=====================================\");\n\t\t\tconsole.log(\"The item is deleted from Invetory..!!\");\n\t\t\tconsole.log(\"=====================================\");\n\n\n\t\t});\n\t\t//once the item is deleted display the most updated table............\n\t\tdisplayInventory();\n\t});\n}", "function removeShoppingCartItem(event){\n const buttonClicked = event.target;\n buttonClicked.closest('.shoppingCartItem').remove();\n //invocamos la funcion q actualizara el total//\n updateShoppingCartTotal();\n}", "function removeFromCartHandler(itemId) {\n\t\tsetUserCart(prev => {\n\t\t\treturn prev.filter(item => item.id !== itemId);\n\t\t});\n\t}", "function eliminarItemCarrito(e) {\n let padre = e.target.parentNode; //Nodo padre\n let nombre = padre.children[1].firstElementChild.innerHTML; //Nombre del producto\n\n try {\n let unidadesXBorrar = Number(prompt(\"¿Cuantas unidades quiere borrar?\")); //Unidades a borrar\n\n //Quitamos las unidades\n for (let item of listaCarrito) {\n if (item.nombre == nombre) {\n item.unidades -= unidadesXBorrar; //Quitamos las unidades, si es menor o igual que cero significa que queremos quitar todas\n if (isNaN(item.unidades) == true) { //Comprobamos primero que sea un número valido\n throw Error(\"Introduzca un valor válido.\"); \n }\n if (item.unidades <= 0) {\n listaCarrito.splice(listaCarrito.indexOf(item), 1);\n }\n else {\n item.total = item.precio * item.unidades;\n }\n break;\n }\n }\n\n //Finalmente actualizamos el carrito\n actualizarCarrito(listaCarrito);\n }\n catch(error) {\n alert(error);\n }\n}", "removeItem(item) {\n return -1;\n }", "function handleRemove(){\r\n //making sure it does not remove if there are 0 items\r\n if (quantity.innerHTML !== \"0\"){\r\n quantity.innerHTML = parseInt(quantity.innerHTML)-1;\r\n }\r\n //disabling the \"agree\" button when there are no items\r\n if (quantity.innerHTML === \"0\"){\r\n agree.disabled = true;\r\n } \r\n }", "function removeItem(element){\n var product_id = $(element).data('id');\n confirm = confirm(\"Are you sure you want to remove this product from the cart?\");\n if(confirm) {\n var row = document.getElementById(`${product_id}`);\n row.remove();\n // $(`${product_id}`).detach();\n delete products[product_id];\n total = Object.keys(products).length\n localStorage.setItem('cart', JSON.stringify(products));\n localStorage.setItem('total', JSON.stringify(total));\n }\n }", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n }); \n}", "function removeFromCart(item) {\n for (var i=0; i < cart.length; i++) {\n if (item === cart[i].itemName) {\n cart.splice(i,1)\n return cart\n }\n }\n return \"That item is not in your cart.\"\n}", "function removeitem(event) {\r\n // save the element that caused this function to be called in variable \"button\"\r\n var button = event.target\r\n // remove the parent element of the parent element containing the button and all its data (the whole row in cart with image, title, price, quantity box, remove button)\r\n button.parentElement.parentElement.remove()\r\n // call the \"updatecart()\" function to update the total price after removing the item in our cart\r\n updatecart()\r\n}", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n });\n}", "function removeFromCart(itemId) {\n props.removeItem(itemId);\n }", "function clearItem(index, numItem) {\n let row = document.querySelector(\"#itemRow\" + index);\n let sub = document.querySelector(\"#subTotal\" + index);\n const counterNum = document.querySelector(\"#counterNum\");\n\n sessionStorage.removeItem(index);\n row.style.display = \"none\";\n sub.innerHTML = 0;\n totalAmount();\n counterNum.innerHTML = counterNum.innerHTML - products[index].numItems;\n sessionStorage.setItem(\"cartCounter\", counterNum.innerHTML);\n cartVisible();\n}", "removeItem(_item) { }", "function removeItem(removeButton)\r\n{\r\n /* Remove row from DOM and recalc cart total */\r\n var productRow = $(removeButton).parent().parent();\r\n productRow.slideUp(fadeTime, function() {\r\n productRow.remove();\r\n recalculateCart();\r\n });\r\n}", "function removeItem(i) {\n\tcart.splice(i, 1); // on supprime le ième item du panier \n\tlocalStorage.clear(); // on le retire du localstorage\n\t// On met à jour le nouveau panier après suppression de l'article\n\tlocalStorage.setItem(\"cart\", JSON.stringify(cart));\n\t// Panier vide si le nbre d'items est nul \n\tcartNumber();\n\tlet cartnum = document.getElementById(\"cart_number\").textContent;\n\tif (cartnum == 0) {\n\t\tclearCart();\n\t}\n\t// On met à jour de la page pour affichage de la suppression Sau client\n\twindow.location.reload();\n}", "_removeCartItem(evt) {\n const product_id = evt.currentTarget.cartItem;\n\n const cartItem = this._findCartItem(product_id);\n\n var index = this.cartItems.indexOf(cartItem);\n\n if (index > -1) {\n this.cartItems.splice(index, 1);\n this.cartItems = [...this.cartItems];\n localStorage.setItem('shop-cart', JSON.stringify(this.cartItems));\n }\n\n this.dispatchEvent(new CustomEvent('change-cart-count', {\n bubbles: true,\n composed: true,\n detail: {}\n }));\n }", "function delItemFromJson(itemName, sellerName) {\n // console.log(\"======\")\n // console.log(itemName);\n // console.log(sellerName);\n for ( let i = 0; i < cart.length; i++ ) {\n if ( cart[i][\"name\"] == sellerName) {\n var order = cart[i][\"order\"];\n // console.log(order);\n for ( let j = 0; j < order.length; j++ ) {\n // console.log(order[i]);\n if (order[j][\"name\"] == itemName) {\n order.splice(j, 1);\n j--;\n }\n }\n if (order.length == 0) {\n cart.splice(i, 1);\n i--;\n }\n }\n }\n localStorage.setItem(\"cart\", JSON.stringify(cartObj));\n // console.log(cart);\n buildCartList();\n}", "function minusQtty(i) {\n if (cart[i].qtty == 1) {\n cart.splice(i, 1);\n createRows();\n } else {\n cart[i].qtty -= 1;\n document.getElementsByClassName(\"cart-quantity\")[i].innerHTML = cart[i].qtty;\n\n /* Update total items in the cart*/\n totalShoppingItems--;\n document.getElementById(\"total-qtty\").innerHTML = totalShoppingItems;\n }\n}", "removeCartProduct(product) {\n // this.flashMessageService.show('Product removed from cart!', {cssClass:'alert-danger', timeout: 3000});\n this.productAddedToCart = this.getProductFromCart();\n let cartItem = this.productAddedToCart.find(p => p.product_Name == product.product_Name);\n\n if (cartItem) {\n let json = JSON.parse(localStorage.getItem(\"product\"));\n\n for (let i = 0; i < json.length; i++) {\n if (json[i].product_Name == product.product_Name) {\n json[i].product_Quantity--;\n\n if (json[i].product_Quantity <= 0) {\n console.log(product.product_Name);\n console.log(\"Prodct removed from cart\");\n json.splice(i, 1);\n }\n }\n\n localStorage.setItem(\"product\", JSON.stringify(json));\n }\n\n if (this.cartItemCount > 0) {\n this.cartItemCount = JSON.parse(localStorage.getItem(\"cartItemCount\"));\n this.cartItemCount--;\n console.log(\"cartItemCount:\", this.cartItemCount);\n localStorage.setItem(\"cartItemCount\", JSON.stringify(this.cartItemCount));\n\n if (this.cartItemCount <= 0) {\n this.clearCart();\n }\n }\n }\n }", "function changeQuantityHandler(itemId, quantity) {\n\t\tsetUserCart(prev => {\n\t\t\tconst prevCopy = [...prev];\n\t\t\tconst foundItem = prevCopy.findIndex(\n\t\t\t\tfoundItem => foundItem.id === itemId\n\t\t\t);\n\t\t\tprevCopy.splice(foundItem, 1, {\n\t\t\t\t...prev[foundItem],\n\t\t\t\tquantity: quantity,\n\t\t\t});\n\t\t\treturn prevCopy;\n\t\t});\n\t}", "function removeItem(item) {\n\t\tvar cart = sessionStorage.getItem('cartItems');\n\t\tvar prdcts = JSON.parse(cart);\n\t\tfor (var i = 0; i < prdcts.productsInCart.length; i++) {\n\t\t\tif (prdcts.productsInCart[i].p_id == item) {\n\t\t\t\tconsole.log(\"match\");\n\n\t\t\t\t// Deletes the item at index i\n\t\t\t\tprdcts.productsInCart.splice(i, 1);\n\t\t\t\tsessionStorage.setItem('cartItems', JSON.stringify(prdcts));\n\t\t\t\twindow.location.reload();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t}", "decrement(itemData) {\n if (itemData.quantity == 0) return;\n itemData.quantity -= 1\n this.props.setItemQuantity(itemData);\n }", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n\tvar detalle = {\n\t\tid: productRow.children('.id').text()\n\t}\n\n\ttoastr[\"success\"](\"Elemento eliminado!\");\n\t\n\tdocument.getElementById(\"contador\").innerHTML = (parseInt(document.getElementById(\"contador\").textContent)-1).toString();\n\n\t\n \tproductRow.slideUp(fadeTime, function() {\n\t$.ajax({\n\t\ttype: \"GET\",\n url: \"/cart/delete\",\n data: detalle,\n\t});\n productRow.remove();\n recalculateCart();\n });\n}", "function UseItem(num) { // Return 1 if the item is depleted.\r\n if (GameState.Items[num][0] == \"Potion\") {\r\n GameState.Items[num][1]--;\r\n\tRestoreHP(5);\r\n }\r\n else if (GameState.Items[num][0] == \"Hi-Potion\") {\r\n GameState.Items[num][1]--;\r\n\tRestoreHP(10);\r\n }\r\n if (GameState.Items[num][1] <= 0) {\r\n GameState.Items.splice(num,1);\r\n\treturn 1;\r\n }\r\n}", "function deleteItem(element, e) {\n e.currentTarget.id = \"Changed the items in the cart by removing the \" + element.desc;\n props.logClick(e, 8);\n let update;\n if (element.quantity >= 2) {\n update = elements.map(el => el.id === element.id ? {...el, quantity: element.quantity - 1} : el);\n }\n else {\n update = [...elements.filter((el) => el.id !== element.id)];\n }\n setElements([...update]);\n setDeleted(true);\n }", "function deleteItem(e){\n var productRow = e.currentTarget.parentNode.parentNode;\n body.removeChild(productRow);\n getTotalPrice();\n }", "function remove_item() {\n for (let i = 0; i < img.length; i++) {\n let remove = document.getElementsByClassName(\"remove\")[i];\n console.log(remove)\n remove.addEventListener(\"click\", () => {\n const cart_prod = document.getElementsByClassName(\"cart_prod\")[i]\n let item_to_be_removed = document.getElementsByClassName(\"added_item\")[i]\n console.log(item_to_be_removed)\n item_to_be_removed.parentNode.removeChild(item_to_be_removed)\n //function to change the total\n total = total - total\n document.getElementsByClassName(\"total\")[0].innerHTML = total\n })\n\n }\n }", "removeItem(item) {\n var index = this.indexOf(item);\n if (index !== -1) {\n this.splice(index, 1);\n }\n }", "function emptyTrash(item_id){\n let removedItem = document.querySelector(\"#item_\" + item_id + \" > .item-text > .prod-title\").innerHTML;\n let removedPrice = document.querySelector(\"#item_\" + item_id + \" > .item-text > .cart-item-price\").innerHTML;\n sum -= removedPrice;\n document.getElementById(\"total\").innerHTML = parseFloat(sum.toFixed(2));\n document.querySelector(\"#item_\" + item_id).remove();\n alert(\"Voulez-vous supprimer l'article: \" + removedItem + \" ?\");\n allRemoved(); // s'il n'y a plus d'articles dans le panier appeler la fonction allRemoved()\n}", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n updateSumItems();\n });\n}", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n updateSumItems();\n });\n}", "removeInventory(item) {\n this.inventory.deleteItem(item.id);\n item.owner = undefined;\n return this;\n }", "function deleteItem(i) {\n cart[i].qtty = 1;\n cart.splice(i, 1);\n createRows();\n}", "function purchaseItem(itemName, quantity){\n connection.query( \"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\",\n [quantity, itemName.id],\n function (err, res) {\n console.log(\"You purchased \" + quantity + \" \" + itemName.product_name);\n displayProducts();\n }\n );\n}", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n });\n}", "function deleteFromCart(item){\n item.parentElement.remove();\n showTotals();\n}", "function remove_inventory(){ \n//take the top item from the list \n\n\tproducts.shift(); \n\t// you dont need to do \"var anything\" because you dont need to assign the variable\n\n\tprinting(); \n\n}", "function removeOnClick(itemName) {\n var i;\n let newCart = JSON.parse(localStorage.getItem(\"Cart\"));\n //look through cart and find name of item to be removed\n for (i = 0; i < newCart.length; i++) {\n if (newCart[i][\"ITEM NAME\"] === itemName) {\n var index = i;\n if (index > -1) {\n newCart.splice(index, 1);\n console.log(newCart);\n }\n }\n }\n localStorage.setItem(\"Cart\", JSON.stringify(newCart));\n generateCart();\n showTotal();\n //location.reload();\n}", "function removeItemFromCart(prodid, qty, qtyTd, clckEle) {\n\t$.ajax(\n\t\t{\n\t\t\turl: 'php_scripts/actions.php',\n\t\t\ttype: 'POST',\n\t\t\tdata: 'prodId='+prodid+'&action=remove-item-from-cart',\n\t\t\tdataType: 'JSON',\n\t\t\tsuccess: function(data) {\n\t\t\t\t//check the quantity first, if greater than 1 than decrement by 1\n\t\t\t\tif(qty > 1) {\n\t\t\t\t\tqtyTd.children('.cart-item-quantity').text(qty-1);\n\t\t\t\t} else {\n\t\t\t\t\t//remove row from ui\n\t\t\t\t\t//parent is tr, qtyele is td\n\t\t\t\t\tqtyTd.parent().remove();\n\t\t\t\t}\n\t\t\t\tupdateTotalPriceInCart(clckEle, '-');\n\t\t\t\t//show success message\n\t\t\t\tshortTimeMesg('Successfully removed an item from cart', 'short-time-msg-success');\n\t\t\t\tclckEle.removeClass('item-removing');\n\t\t\t},\n\t\t\terror: function(response) {\n\t\t\t\t//log js errors\n\t\t\t\tshortTimeMesg('Alert! Item did not removed. Try Again!', 'short-time-msg-failure');\n\t\t\t\tclckEle.removeClass('item-removing');\n\t\t\t}\n\t\t}\n\t);\t\n}", "function removeCartItem(event) {\n\tvar buttonClicked = event.target;\n\tbuttonClicked.parentElement.parentElement.remove();\n\tupdateCartTotal()\n}", "function removeFromCart(obj) {\n\tvar items = getTotalItemsCart();\n\tvar elem;\n\n\tif (items > 0) {\n\t\tdocument.getElementById('shopping-cart-text').innerHTML = (items-1) + ' items';\n\t\telem = obj.parentNode.parentNode.parentNode\n\t\telem.remove();\n\t}\n}", "function removeOneItem(itemName) {\r\n var itemPosition = inventory.indexOf(itemName) - 1;\r\n if (inventory.includes(itemName)) {\r\n inventory.splice(itemPosition, 3);\r\n inventoryAside.innerHTML = inventory.join(\" \");\r\n }\r\n}", "function deleteItem(){\n // first, determine all the selected rows \n var removeBox = getSelectedRowBoxes(); \n\n // delete the Product objects that corresponds to those rows \n // from the Producsts array \n // looop through backwards\n for (var i = removeBox.length -1; i >= 0; i--){\n //Get the id on the row that the checkbox is in \n var prodId = parseInt(removeBox[i].parentNode.parentNode.id); \n\n // Delete the product that cooresponds thay row\n // Dete the Product at the index (id = index) \n delete products[prodId]; \n products.splice(prodId, 1); \n };\n\n\n //Rerender the HTML list, using displayInventory\n displayInventory(); \n saveData(); \n\n}", "removeProduct(state, action) {\n const newItem = action.payload;\n // console.log(action.payload);\n const existingItem = state.cartItems.find(\n (item) => item.title === newItem.title\n );\n if (existingItem) {\n // find_index\n const itemIndex = state.cartItems.findIndex(\n (item) => item.title === newItem.title\n );\n // console.log(itemIndex);\n // select item\n const selectedItem = state.cartItems[itemIndex];\n //\n const newQty = selectedItem.quantity - 1;\n const newTotal = selectedItem.total - selectedItem.price;\n\n if (newQty > 0) {\n state.cartItems[itemIndex] = {\n ...newItem, // keeps other items in the object\n quantity: newQty,\n total: newTotal,\n };\n } else {\n state.cartItems.splice([itemIndex], 1);\n }\n // console.log(\"updated existing\", current(state));\n }\n // console.log(\"updated existing\", current(state));\n }", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function () {\n productRow.remove();\n });\n }", "function eliminarItemCarrito(item){\n carrito.splice(item.numeroItem,1);\n let i = 0;\n for(item of carrito){\n carrito[i].numeroItem = i;\n i++;\n }\n\n localStorage.setItem( \"productos\", JSON.stringify(carrito));\n}", "[REMOVE_ITEM](state, payload) {\n const newSet = state.cartItems.filter((s) => s.id !== payload);\n state.cartItems = newSet;\n let storeCartAmt = 0;\n state.cartItems.forEach((cartItem) => {\n storeCartAmt += cartItem.quantity;\n });\n\n state.noOfItems = storeCartAmt;\n state.totalPrice = getTotal();\n\n }", "function removeProduct(product) {\n $cart.removeChild(product)\n $cart = document.querySelector('#cart tbody');\n calculateAll()\n}", "function Purge(inventory) {\n return inventory.splice(2, inventory.length);\n}", "function removeItem(id){\r\n\tif(order.hasOwnProperty(id)){\r\n\t\torder[id] -= 1;\r\n\t\tif(order[id] <= 0){\r\n\t\t\tdelete order[id];\r\n\t\t}\r\n\t\ttemp = getCurrentRestaurant();\r\n\t\tif (temp !== undefined){\r\n\t\t\tupdateOrder(temp);\r\n\t\t}\r\n\t}\r\n}" ]
[ "0.762449", "0.73512983", "0.71952987", "0.7138613", "0.71305656", "0.7071512", "0.7050945", "0.7002176", "0.69745976", "0.6967367", "0.69345516", "0.6904968", "0.67896813", "0.67762643", "0.6746823", "0.67459285", "0.66755944", "0.6673889", "0.6655034", "0.6631984", "0.6628607", "0.66285115", "0.66261417", "0.6603688", "0.65682995", "0.655903", "0.65534943", "0.6552423", "0.6539727", "0.6532254", "0.65079373", "0.65047795", "0.65008444", "0.6495145", "0.6493533", "0.6470911", "0.6461673", "0.6461348", "0.6457656", "0.6456419", "0.6449711", "0.6436589", "0.6433591", "0.6430356", "0.6423616", "0.64174706", "0.6381323", "0.6354213", "0.63519037", "0.6351202", "0.63336354", "0.6327633", "0.63242394", "0.6320062", "0.63049644", "0.6303283", "0.63023084", "0.6301461", "0.62879413", "0.62852633", "0.6281318", "0.6276125", "0.62595344", "0.6257662", "0.62554127", "0.62542474", "0.6247764", "0.6247289", "0.62436867", "0.6242695", "0.6239365", "0.623585", "0.6228826", "0.62264675", "0.62169784", "0.62129754", "0.62121564", "0.6206713", "0.6206238", "0.6204131", "0.6204131", "0.6196795", "0.61961794", "0.6194332", "0.6193869", "0.61901695", "0.6182306", "0.6181958", "0.6178062", "0.61774975", "0.6161859", "0.6158193", "0.61517304", "0.6149946", "0.614797", "0.6143948", "0.6142831", "0.6138884", "0.612786", "0.61261415" ]
0.7058083
6
The function is memoized so that no extra lifecycles are needed as per
prefetch() { if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client) var { pathname } = window.location; var { href: parsedHref } = this.formatUrls(this.props.href, this.props.as); var href = (0, _url.resolve)(pathname, parsedHref); _router.default.prefetch(href); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoize(fn){\n const cache={}\n return function(...args){\n if(cache[args]) return cache[args]\n \n const result = fn.apply(this,args)\n cache[args]=result\n \n return result\n }\n }", "function memoizedAddTo80() {\n let cache = {};\n\n return function (n) {\n if (n in cache) {\n console.log('Cached value');\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = 80 + n;\n return cache[n];\n }\n };\n}", "function CacheEl() {\n \n }", "function memoizedAddTo80() {\n let cache = {};\n return function(n) {\n if (n in cache) {\n return cache[n];\n } else {\n // console.log('long time');\n cache[n] = n + 80;\n return cache[n];\n }\n }\n}", "function memoize(fn) {\nconst cache = {};\n return function(...args) {\n if (cache[args]) {\n return cache[args];\n }\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "transient private protected internal function m182() {}", "function advanceMemoizedAddTo80(){\n let functionChache = {}; // We put cache inside the function to avoide polutting global scope and keep it priivate\n\n // We return a function and use cache from HOF to trigger closure\n return function(n){\n if (n in functionChache){\n return functionChache[n]; \n } else {\n console.log('long time advanced memo')\n functionChache[n] = n + 80;\n return functionChache[n]\n }\n }\n}", "transient private internal function m185() {}", "function cacheToMemory(){\n // need to implement\n}", "function memoization() {\n const cache = {};\n return function (n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log(\"not cached\");\n cache[n] = n * n;\n return cache[n];\n }\n };\n}", "function memoizeFunction(fn) {\n var memo = {}, counter = 0;\n\n return function(key) {\n if (hasOwn(memo, key)) {\n return memo[key];\n }\n // istanbul ignore if\n if (counter === INTERNAL_MEMOIZE_LIMIT) {\n memo = {};\n counter = 0;\n }\n counter++;\n return memo[key] = fn(key);\n };\n }", "transient protected internal function m189() {}", "function memoizedAddTo80(n) {\n let cache = {};\n return function() {}\n if (n in cache) {\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = n + 80;\n return cache[n];\n\n }\n}", "function memorize(f) {\n\tif (!f.cache) f.cache = {};\n\treturn function() {\n\t\tvar cacheId = [].slice.call(arguments).join('');\n\t\treturn f.cache[cacheId] ?\n\t\t\t\tf.cache[cacheId] :\n\t\t\t\tf.cache[cacheId] = f.apply(window, arguments);\n\t};\n}", "function memoize(fn) {\n\n\t// storage object that holds all previous\n\t// calls to fn() and their respective results\n\tconst cache = {};\n\n\t// return super-charged function\n\t// ...args => don't know how many arguments will be\n\t// sent to this function, but take them and put in an array []\n\treturn function(...args) {\n\t\tif (cache[args]) {\n\t\t\treturn cache[args];\n\t\t}\n\n\t\t// never called that function with those arguments before\n\t\tconst result = fn.apply(this, args);\n\t\tcache[args] = result;\n\t\t\n\t\t// console.log('cache =', cache);\n\t\treturn result;\n\t}\n}", "private internal function m248() {}", "function memoized(fn) {\n m = {};\n return function (x) {\n var args = [].slice.call(arguments),\n strKey = args.join('-');\n\n v = m[strKey];\n if ('u' === (typeof v)[0])\n m[strKey] = v = fn.apply(null, args);\n return v;\n }\n }", "lastUsed() { }", "function memoizedAddTo80(n) {\n let cache = {};\n return function(n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = n + 80;\n return cache[n];\n \n }\n\n }\n}", "function memoizedAddTo80(n) {\n let cache = {};\n return function(n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = n + 80;\n return cache[n];\n \n }\n\n }\n}", "function memoizedAddTo80(n) {\n let cache = {};\n return function(n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = n + 80;\n return cache[n];\n \n }\n\n }\n}", "function memoizedAddTo80(n) {\n let cache = {};\n return function(n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = n + 80;\n return cache[n];\n \n }\n\n }\n}", "_memoize (...args) {\n var param = stringify(args);\n\n return (param in this._cache) ?\n this._cache[param] :\n this._cache[param] = this.f.apply(null, args);\n }", "function memoize(func) {\n var ran = false, memo;\n return function () {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n }", "static transient final private internal function m43() {}", "private public function m246() {}", "function memoize(name, fn) {\n\tlet cache;\n\treturn function() {\n\t\tif (cache === undefined) {\n\t\t\tcache = fn();\n\t\t}\n\t\treturn cache;\n\t};\n}", "function Cache() {}", "function memoize(fn) {\n\tconst cache = {}\n\n\treturn (...args) => {\n\t\tif (cache[args]) {\n\t\t\treturn cache[args]\n\t\t}\n\n\t\tconst result = fn.apply(this, args)\n\t\tcache[args] = result\n\n\t\treturn result\n\t}\n}", "async initCache() {\n return await reusePromiseForever(this, this._initCache);\n }", "static init() {\n this.memoryStore = {}\n this.ready = false\n\n return new Promise((resolve, reject) => {\n localforage.iterate((value, key) => {\n this.memoryStore[key] = value\n }).then(() => {\n this.ready = true\n\n resolve()\n })\n .catch((err) => {\n reject(err)\n })\n })\n }", "function memoize(fn){\n const cache = {};\n return function(...args){\n if(cache[args]){\n return cache[args];\n }\n const result = fn.apply(this,args);\n cache[args] = result;\n return result;\n };\n}", "transient private public function m183() {}", "function MapCache() {\n }", "transient final protected internal function m174() {}", "memoizeRestaurantRetrieval(func, callback) {\n let cache = {};\n\n return function(collection) {\n if (cache[collection.id]) {\n callback(cache[collection.id], collection);\n } else {\n func(collection.id, (results) => {\n cache[collection.id] = results;\n callback(cache[collection.id], collection);\n });\n }\n };\n }", "function memoize (fn) {\n return function memoized (...args) {\n let hash = JSON.stringify(args);\n let cache = memoized.cache;\n // if result exists, return it. otherwise compute and store in cache.\n return cache[hash] || (cache[hash] = fn.call(...args));\n }\n memoized.cache = {}; // initialize empty cache\n}", "tinyMemoize(_class, methodName) {\n const method = _class.prototype[methodName]\n const memoAttrName = `_memo_${methodName}`\n _class.prototype[methodName] = function _tinyMemoized() {\n if (!(memoAttrName in this)) {\n const res = method.call(this)\n this[memoAttrName] = res\n Promise.resolve(res).catch(() => {\n delete this[memoAttrName]\n })\n }\n return this[memoAttrName]\n }\n }", "clearCache() {\n\t /*\n\t * Tracks specific objects such as accounts that can trigger additional\n\t * fetching that should only happen if we're actually interested in the account\n\t */\n\t this.subbed_accounts = new Set();\n\t this.subbed_witnesses = new Set();\n\t this.subbed_committee = new Set();\n\n\t this.objects_by_id = new Map();\n\t this.accounts_by_name = new Map();\n\t this.assets_by_symbol = new Map();\n\t this.account_ids_by_key = __WEBPACK_IMPORTED_MODULE_0_immutable___default.a.Map();\n\t this.account_ids_by_account = __WEBPACK_IMPORTED_MODULE_0_immutable___default.a.Map();\n\n\t this.balance_objects_by_address = new Map();\n\t this.get_account_refs_of_keys_calls = new Set();\n\t this.get_account_refs_of_accounts_calls = new Set();\n\t this.account_history_requests = new Map(); ///< tracks pending history requests\n\t this.witness_by_account_id = new Map();\n\t this.committee_by_account_id = new Map();\n\t this.objects_by_vote_id = new Map();\n\t this.fetching_get_full_accounts = new Map();\n\t this.get_full_accounts_subscriptions = new Map();\n\t clearTimeout(this.timeout);\n\t this.dispatched = false;\n\t }", "transient private protected public internal function m181() {}", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function ensureMemoized(clientInstance) {\n if (clientInstance.__hasBeenMemoized === true) {\n return clientInstance;\n }\n \n // Look for async methods on the client instance\n let proto = Object.getPrototypeOf(clientInstance);\n Object.getOwnPropertyNames(proto).forEach(propName => {\n let prop = proto[propName];\n if (typeof prop === 'function' && propName.endsWith('Async')) {\n let newFn = memoize(prop.bind(clientInstance), { normalizer: normalizeAsyncServiceCall, primitive: true });\n newFn = wrapMemoizedServiceCallWithInvalidation(newFn);\n proto[propName] = newFn;\n }\n });\n \n clientInstance.__hasBeenMemoized = true;\n return clientInstance;\n}", "rewriteCache() {\n this.cache = {\n levels: [],\n levelCount: 0,\n rows: [],\n nodeInfo: new WeakMap()\n };\n\n rangeEach(0, this.data.length - 1, (i) => {\n this.cacheNode(this.data[i], 0, null);\n });\n }", "function memoize(fn) {\n var cache = {};\n return function (arg) {\n var cachedValue = cache[arg];\n\n // when value is not present in cache, compute it\n if (cachedValue === undefined) {\n cachedValue = cache[arg] = fn(arg);\n }\n return cachedValue;\n }\n }", "static transient final protected internal function m47() {}", "function _____SHARED_functions_____(){}", "transient final private internal function m170() {}", "function memoize(fn) {\n const cache = {};\n return (...args) => {\n if (cache[args]) {\n return cache[args];\n }\n\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "function memoizedAddTo80(n){\n // in is a way to check if property exists in a object\n if (n in cache){\n return cache[n]; // It will return if the value is cached\n } else {\n console.log('long time memo')\n cache[n] = n + 80; //If the value was not cached yet it will cahce it\n return cache[n]\n }\n}", "function cacheFn(fn) {\n var cache={};\n \n return function(arg){\n if (cache[arg]){\n return cache[arg];\n }\n else{\n cache[arg] = fn(arg);\n return cache[arg];\n }\n }\n}", "function memoize(func){\n\tvar results = {};\n\treturn function(){\n\t\tvar args = Array.prototype.slice.call(arguments);\n\t\tvar hash = args.reduce(function(hash, nextArg){\n\t\t\treturn hash+nextArg;\n\t\t}, '');\n\t\tif(results[hash] === undefined){\n\t\t\tvar result = func.apply(this, args);\n\t\t\tresults[hash] = result;\n\t\t}\n\t\tconsole.log(results);\n\t\treturn results[hash];\n\t}\n}", "memo (name /*, ...processors */) {\n let index = this.lookup(name)\n let processors = toArray(arguments, 1)\n let last = null\n let answer = null\n\n return () => {\n let next = index()\n\n if (next !== last) {\n last = next\n answer = pipeline(index(), processors, this.state)\n }\n\n return answer\n }\n }", "function memoize(fn) {\n const cache = {};\n return function(...args) {\n if(cache[args]) { // if result already exists\n return cache[args];\n }\n let result = fn.apply(this, args); // perform function\n cache[args] = result; // save result in cache\n return result; \n }\n}", "function memoize(fn) {\n const cache = {};\n \n return function(...args) {\n if(cache[args]) {\n return cache[args];\n }\n\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "static transient final protected public internal function m46() {}", "initializeCache() {\n this.cache = Array.from({length: nway},\n () => Array.from({length: size},\n () => Array.from({length: k},\n () => {\n return {\n data: '0'.repeat(bits),\n time: 0\n }\n }))); \n }", "function cacheFn(fn) {\n var cache={}\n return function(arg){\n if (cache[arg]){\n return cache[arg];\n }\n else{\n cache[arg] = fn(arg);\n return cache[arg];\n }\n }\n}", "function memoizedFactorial() {\n let cache = [1];\n function inner(n) {\n if (!cache[n]) {\n cache[n] = inner(n - 1) * n \n } \n return cache[n]\n }\n return inner\n }", "function myFunction(fn) {\n const cache = {};\n\n return (...args) => {\n const key = args.join(',');\n\n if (key in cache) {\n console.log(`${cache[key]} --> returns from cache`);\n return cache[key];\n }\n\n cache[key] = fn(...args);\n console.log(`${cache[key]} --> executes function`)\n return cache[key];\n }\n}", "function memoize(originalFunc) {\n const cache = {};\n return (...args) => {\n // Check cahce for previously calculated result\n if (cache[args]) {\n return cache[args];\n }\n // Apply the args array [n] to the originalFunc and cache the result for next call\n const result = originalFunc.apply(this, args);\n cache[args] = result;\n return result;\n\n }\n}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function memoizeAddTo80(n) {\n //instead we would do this:\n //let cache = {};\n // return function(n) {\n // if (n in cache) {\n // return cache.n;\n // } else {\n // cache[n] = n + 80\n // return cache[n]\n // }\n // }\n if (n in cache) {\n return cache.n;\n } else {\n cache[n] = n + 80\n return cache[n]\n }\n}", "transient final private protected internal function m167() {}", "constructor() {\n this.cachedDictionary = {};\n }", "static transient private public function m56() {}", "function onetime(){if(called)return value;called=1;value=fn.apply(this,arguments);fn=null;return value}//", "function memoize(f) {\r\n // Create the cache.\r\n const cache = {};\r\n // The momoized function, can have multiple parameters.\r\n return function memoized(...args) {\r\n // Create unique identifier based on the function and the parameters.\r\n const identifier = JSON.stringify(args);\r\n // If the identifier is in the cache return the result.\r\n if (identifier in cache) {\r\n return cache[identifier ];\r\n }\r\n // Otherwise, calculate it.\r\n return (cache[identifier ] = f(...args));\r\n };\r\n}", "function memorizeAddTo80(n) {\n let cache = {};\n return function (n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log('long time');\n const answer = n + 80;\n cache[n] = answer;\n return answer;\n }\n };\n}", "function memoize(cb) {\n const memo = {};\n return (n) => {\n if (!memo[n]) memo[n] = cb(n);\n return memo[n];\n };\n}", "for(ref, id) {\n const memo = keyed.get(ref) || keyed.set(ref, new MapSet);\n return memo.get(id) || memo.set(id, fixed(createCache$1()));\n }", "static private internal function m121() {}", "function MapCache(){this.__data__={};}", "function MapCache(){this.__data__={};}", "reset () {\n chainCache = {}\n }", "function memorize(fn) {\n // store function calls\n const cache = {}\n // allow it to take any number of arguments\n return function(..args) {\n // look into cache, if contains key with set of args, return corresponding value\n if (cache[args]) {\n return cache[args];\n }\n // if the function hasn't been called with current set of args, we pass\n // it to the original function (fn) and save result to cache\n newCall = fn.apply(null, args);\n cache[args] = newCall;\n return newCall;\n }\n}", "function memoize(fn) {\n // The cache object\n const cache = {};\n //we return b new function that accepts an array of arguments\n //because we want to make it generic, not for this problem only\n // ...args returns an array of the passed arguments\n return function (...args) {\n //we check if the cache has b record with these arguments\n if(cache[args]){\n //if yes - we return the result directly without b function call\n return cache[args];\n }\n // if not - we call the function fn.applu(this, args) === fn(x,y,z)\n // because args is an array.\n const result = fn.apply(this, args);\n // we record this call with new arguments\n cache[args] = result;\n //and then return the result\n return result;\n }\n}", "getSnapshotBeforeUpdate() {\n //create a backup of the current way things are\n //IMPORTANT: not very common\n }", "function memoize(fn) {\n let cached = false;\n let result;\n return (...args) => {\n if (!cached) {\n result = fn(...args);\n cached = true;\n }\n return result;\n };\n}", "function cacheFunction(cb) {\n const cache = {};\n const func = (arg) => {\n if (!cache.hasOwnProperty(arg)) {\n cache[arg] = cb(arg);\n } \n return cache[arg];\n }\n\n return func;\n}", "function proactiveStalenessCleaner() {\n console.log(\"Sweeping the cache for old entries\");\n cache.prune();\n}", "get memoize() {\n const cache = [];\n const iter = this[Symbol.iterator]();\n let iteratorExhausted = false;\n return new Seq(function* () {\n // Others are concurrently pushing to `cache`,\n // so must keep checking cache rather than using for-of.\n for (let i = 0;; i++) {\n if (i < cache.length)\n yield cache[i];\n else if (iteratorExhausted)\n break;\n else {\n const { value, done } = iter.next();\n if (done) {\n iteratorExhausted = true;\n break;\n }\n else {\n cache.push(value);\n yield value;\n }\n }\n }\n });\n }", "_cacheSet(attributes) {\n if (this.parent) {return}\n let setIfFits = (key, value) => {\n let size = (u.getSize(value))\n let indexRecord\n let oldSize = 0\n if (this.cacheIndex[key] && this.cacheIndex[key].size) {\n oldSize = this.cacheIndex[key].size\n }\n let difference = size - oldSize\n if (this.cacheSize + difference < this.maximumCacheSize) {\n this.cache[key] = value\n this.cacheIndex[key] = {\n timestamp: Date.now(),\n accessed: 0,\n size: size\n }\n this.cacheSize += difference\n return true\n } else {\n return false\n }\n }\n\n // Deletes oldest key until sufficient space cleared\n let clearSpace = (space) => {\n while (this.cacheSize + space > this.maximumCacheSize) {\n let oldestTimestamp = Date.now()\n let oldestKey\n Object.keys(this.cache).forEach((key) => {\n if (this.cache[key].timestamp < oldestTimestamp) {\n oldestTimestamp = this._cacheIndex[key].timestamp\n oldestKey = key\n }\n })\n if (Date.now() - oldestTimestamp > 15 * 1000) {\n return false\n }\n this.cacheSize -= this.cacheIndex[key].size\n delete this.cache[key]\n delete this.cacheIndex[key]\n }\n return true\n }\n\n // If path already exists and size not a problem, replace, make space and try again\n Object.keys(attributes).forEach((path) => {\n if (path !== u.LARGE_SERIALIZED_PAYLOAD){\n let setSuccessfully = setIfFits(path, attributes[path])\n if (!setSuccessfully) {\n clearSpace(u.getSize(attributes.path))\n setIfFits(path, attributes[path])\n }\n }\n })\n }", "function Intialize() {\n return;\n}", "function memoize(fn) {\n if (process.env.NODE_ENV !== \"production\") {\n return fn;\n }\n\n const cache = new LRU({ max: 2000 });\n return (...args) => {\n let invalidate = false;\n if (args.includes(MEMOIZE_INVALIDATE)) {\n args.splice(args.indexOf(MEMOIZE_INVALIDATE), 1);\n invalidate = true;\n }\n const key = JSON.stringify(args);\n\n if (cache.has(key)) {\n if (invalidate) {\n cache.del(key);\n } else {\n return cache.get(key);\n }\n }\n\n const value = fn(...args);\n if (isPromise(value)) {\n return value.then((actualValue) => {\n cache.set(key, actualValue);\n return actualValue;\n });\n }\n cache.set(key, value);\n return value;\n };\n}", "function memoize(fn, timeout, context) {\n var store = {};\n return function () {\n var key = hashCode(arguments);\n if (key && store[key]) return store[key];\n\n if (!isNaN(timeout) && timeout !== null) {\n setTimeout(function () {\n delete store[key];\n }, timeout);\n }\n\n return store[key] = fn.apply(context || this, Array.prototype.slice.call(arguments));\n };\n }", "function memoize( fn ) {\n return function () {\n var args = Array.prototype.slice.call(arguments),\n hash = \"\",\n i = args.length;\n currentArg = null;\n while (i--) {\n currentArg = args[i];\n hash += (currentArg === Object(currentArg)) ?\n JSON.stringify(currentArg) : currentArg;\n fn.memoize || (fn.memoize = {});\n }\n return (hash in fn.memoize) ? fn.memoize[hash] :\n fn.memoize[hash] = fn.apply(this, args);\n };\n}", "hasChanged() {\n return this.cacheHasChanged;\n }", "protected internal function m252() {}", "compute()\n {\n super.compute();\n this.needsRecompute = false;\n }", "compute()\n {\n super.compute();\n this.needsRecompute = false;\n }", "reset() {\n this.cache = {};\n }" ]
[ "0.5979633", "0.5847816", "0.57982284", "0.57515824", "0.57465976", "0.57324284", "0.56982774", "0.5657083", "0.5651081", "0.5646444", "0.5635349", "0.56281275", "0.56016815", "0.558982", "0.5588909", "0.55641943", "0.5555498", "0.554418", "0.5487954", "0.5487954", "0.5487954", "0.5487954", "0.54842657", "0.5473642", "0.5459964", "0.54458266", "0.54395884", "0.54201084", "0.541127", "0.540231", "0.5401553", "0.53913534", "0.53878313", "0.53570145", "0.5349896", "0.5343394", "0.5340682", "0.5340323", "0.53358734", "0.5329967", "0.5323692", "0.5323692", "0.5323692", "0.5323692", "0.5323692", "0.5323692", "0.5323692", "0.5323692", "0.5323692", "0.53223807", "0.53165054", "0.5315084", "0.5312802", "0.5311373", "0.5291149", "0.5286228", "0.5273325", "0.5238575", "0.5227836", "0.52259433", "0.52221733", "0.52188087", "0.52185374", "0.52167565", "0.52119327", "0.52111906", "0.52096444", "0.5200442", "0.5198327", "0.5198327", "0.5198327", "0.51977974", "0.5195834", "0.51903576", "0.51769245", "0.5171392", "0.5170658", "0.5163287", "0.51588166", "0.5158505", "0.51565933", "0.515174", "0.515174", "0.5142685", "0.51377094", "0.5133543", "0.5130375", "0.5130309", "0.51296765", "0.5128282", "0.5108797", "0.5105608", "0.51033556", "0.51029384", "0.5084061", "0.508396", "0.50833", "0.5081891", "0.50727046", "0.50727046", "0.50726223" ]
0.0
-1
Go back in history
back() { window.history.back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goBack() {\n history.go(-1);\n }", "function back() {\n if (history.length > 1) {\n setHistory(prev => prev.slice(0, prev.length - 1));\n }\n }", "function voltarHistory()\n\t{\n\t\twindow.history.back();\n\t}", "function goback() \n{\nhistory.go(-1);\n}", "back()\n {\n\n\n history.back();\n\n\n }", "function goBack() { // go back function\n history.go(-1);\n}", "function back() {\n if (history.length > 1) {\n\n setMode(history[history.length - 2]);\n setHistory(prev => [...prev.slice(0, -1)]);\n }\n }", "function back() {\n setMode(history.pop());\n setHistory(history);\n }", "function goBack() {\n window.history.back();\n} // nu merge, mai este si forward, merge inainte spre urmatorul url din history", "function back() {\n history.pop();\n if (history.length >= 1) { setMode(history[history.length - 1]) }\n }", "function History_MoveBack()\n{\n\t//forward to move to index\n\tthis.MoveToIndex(this.CurrentStateIndex - 1);\n}", "goBack(count) {\n history.go(-count);\n }", "goBack() {\n history.back();\n window.scroll(0,0);\n }", "function goBack() {\n return history.goBack();\n }", "function goBack() {\n window.history.back();\n }", "function goBack() {\n\t\t\t$state.go('^');\n\t\t}", "function goBack() {\r\n window.history.go(-1)\r\n}", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function back() {\n if (history.length > 1) {\n const historyCopy = [...history];\n historyCopy.pop();\n setHistory(historyCopy);\n setMode(historyCopy[historyCopy.length - 1]); \n // remove end of array\n }\n }", "function goBack(num)\n{\n parent.history.go(num);\n}", "function goBack() {\n window.history.go(-1);\n}", "function goBack(){\n // *Navigating back:\n window.history.back();\n }", "function goBack() {\n history.go(-1);\n location.reload();\n}", "function atras() {\n history.back();\n}", "function redirectToBack(){\n\t\thistory.go(-1);\n\t}", "function goBack() {\n\t\t\t$window.history.back();\n\t\t}", "function returnBack() {\n window.history.back()\n}", "function voltar(){\n history.back();\n}", "function back() {\n if (history.length > 1) {\n let update = [...history];\n update.pop();\n const newMode = update[update.length - 1]\n setMode(prev => prev = newMode)\n setHistory(prev =>prev =[...update])\n }\n }", "function goBack(){\n\tg_cache.user_history.pop();\n\tfetchUser(g_cache.user_history.pop());\n}", "goback() { this.back = true; }", "function goBackTo() {\n window.history.back()\n}", "function back () {\n\t\n\t window.history.back();\n\t \n}", "function goBack() { $window.history.back(); }", "function back() {\n if (history.length > 1) {\n setHistory(prev => {\n const newHistory = [...prev];\n newHistory.pop();\n setMode(newHistory[newHistory.length - 1]);\n return newHistory\n });\n }\n }", "function goBack() {\n $state.go('tribes.list');\n }", "function goBack() {\n PathStore.pop();\n}", "function goBack() {\r\n window.history.back();\r\n}", "function goBack(){\n\twindow.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "historyBack() {\n const fenCode = this.state.chessBoardHistory.back();\n console.log('back');\n console.log(this.state.chessBoardHistory);\n this.updateBoard(fenCode);\n }", "function onGoBack() {\n // history.goBack();\n history.push(location?.state?.from ?? \"/\");\n }", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "function back(){\n\twindow.history.back();\n}", "function navigateBack() {\n try {\n window.history.back();\n console.log(\"status pass : Navigated one step back from current position in recent history\" + url);\n } catch (err) {\n console.log(\"status fail : Broken link or no network connection\");\n }\n}", "function goBack() {\r\n window.history.back();\r\n}", "function back(){\r\n window.history.back();\r\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\r\n\twindow.history.back();\r\n}", "back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }", "back () {\n this.history.goBack()\n }", "function History_Force_MoveBack()\n{\n\t//can we go back?\n\tif (__SIMULATOR.History.CurrentStateIndex > 1)\n\t{\n\t\t//Go back\n\t\t__SIMULATOR.History.MoveBack();\n\t}\n}", "function goBack(){\n window.history.back();\n}", "goBack() {\n\t\tconst navigationState = NavigationStateUtils.pop(this.state.navigationState);\n\t\tthis.setState({ navigationState });\n\t}", "function goBack() {\n\t\t\t$state.go('^.detail', {id: vm.order._id});\n\t\t}", "navigateBack() {\r\n this.isExplicitNavigationBack = true;\r\n this.history.navigateBack();\r\n }", "function navigateOnePageBack() {\n window.history.back();\n}", "return() {\n this.location.back();\n }", "goBack() {\n history.push(\"/\");\n }", "function goBack() {\n $ionicHistory.goBack();\n }", "goBackToPreviousPage() {\n this.location.back();\n }", "goBackToPreviousPage() {\n this.location.back();\n }", "function goBack() {\n\t\t\t$state.go('^.detail', {id: vm.basket._id});\n\t\t}", "back() {\n var val = '';\n if (this._history.length > 0) {\n val = this._history[this._index];\n if (this._index > 0) {\n this._index--;\n }\n }\n return val;\n }", "function clickHandlerBack(e) {\n history.push('/profMom');\n }", "function twiceBack(){\n window.history.back().back();\n}", "back(){\n viewport.replace( _history.pop(), _options.pop() );\n }", "function volver(){ javascript:history.go(-1); }", "function previousPage()\r\n{\r\n\thistory.go(-1);\r\n}", "function _backState () {\n \t$state.go(projectHeader.backEvent.stateName, projectHeader.backEvent.paramObj)\n }", "function goBack() {\n // remove latest from directory arrays\n dirs.pop()\n // browse to our new route\n navigate()\n}", "function navBack(prevState) {\n $state.go(prevState, {}, {reload: true}); // reload to get reslove data again\n }", "function goBack() {\r\n \t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t}", "runOneStepBackwards() {\n this.stateHistory.previousState()\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }" ]
[ "0.8658206", "0.8359694", "0.83595216", "0.83213216", "0.8285847", "0.82845247", "0.82467586", "0.8236736", "0.82216424", "0.82195777", "0.82184064", "0.81998354", "0.8196878", "0.8195958", "0.8180671", "0.81693447", "0.8166096", "0.8150814", "0.8150814", "0.8150814", "0.81322634", "0.81322414", "0.81234723", "0.810743", "0.8102716", "0.8087365", "0.8082041", "0.8072883", "0.8001162", "0.7984798", "0.79501474", "0.7946065", "0.7937831", "0.7925672", "0.7921235", "0.79120475", "0.7891391", "0.7888835", "0.78887963", "0.7872749", "0.78409123", "0.783847", "0.783847", "0.78371984", "0.7806811", "0.780654", "0.779961", "0.7794538", "0.7790378", "0.777791", "0.7775649", "0.7775649", "0.7775649", "0.7775649", "0.7775649", "0.7775649", "0.7760163", "0.77422434", "0.77333295", "0.77247834", "0.77216333", "0.7716948", "0.7676856", "0.76756084", "0.76441145", "0.76279444", "0.7615886", "0.7602731", "0.7581119", "0.7581119", "0.75550854", "0.7555028", "0.7553219", "0.75279623", "0.75277406", "0.7501138", "0.74974823", "0.74957246", "0.7475438", "0.74739647", "0.74221224", "0.73818344", "0.7372583", "0.7372583" ]
0.7714336
78
Performs a `pushState` with arguments
push(url, as = url, options = {}) { return this.change('pushState', url, as, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pushState(state, title, url = this.url) {\n url = URL.resolve(this.current.window.document.URL, url);\n // TODO: check same origin\n this.addEntry(this.current.window, url, state || {});\n this.updateLocation(this.current.window, url);\n }", "function pushState(state, pathname, query) { // 72\n return history.pushState(state, appendQuery(pathname, query)); // 73\n } // 74", "pushState(state, title, url) {\n this._history.push({ state, title, url });\n this._update();\n }", "memory( method, args ) { this.history.push({method, args}); }", "function pushState(state, path) { // 57\n history.pushState(state, prependBasename(path)); // 58\n } // 59", "function history_push2(href) {\n history.pushState({},'',href);\n}", "function pushState(obj) {\n if (window.history.replaceState) {\n var encoded = btoa(JSON.stringify(grabState(obj)));\n window.history.replaceState(null, null, '#' + encoded);\n }\n}", "push(url, as, options = {}) {\n if (false) {}\n\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as, options = {}) {\n if (false) {}\n\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as, options = {}) {\n if (false) {}\n\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as, options = {}) {\n if (false) {}\n\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as, options = {}) {\n if (false) {}\n\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as = url, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as = url, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "push(url, as = url, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('pushState', url, as, options);\n }", "function pushState(state, path, query) {\n return history.pushState(state, appendQuery(path, query))\n }", "go(path, query = '', state = null) {\n this._platformStrategy.pushState(state, '', path, query);\n\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "function pushState(state, path, query) {\n return history.pushState(state, appendQuery(path, query));\n }", "function navigate(url){\r\n history.pushState(null, null, url);\r\n handleNavigation();\r\n}", "function pushState(state, path) {\n history.pushState(state, prependBasename(path));\n }", "function pushStateHandler(url) {\n history.pushState(url, null, url);\n return false;\n}", "function updateHistory(key, value) {\n var params = getQueryParams(location.search);\n params[key] = value;\n history.pushState(null, null, location.href.substring(0, location.href.indexOf(\"?\")) + buildQueryParamsString(params));\n }", "function proxy() {\n var closure = () => {\n var pushState = history.pushState;\n history.pushState = function(state, title, url) {\n pushState.apply(this, arguments);\n window.postMessage({ api: \"pushState\", url: location.href }, \"*\");\n };\n };\n return `(${closure.toString()})();`;\n }", "function pushHistory (withWhat) {\n\t// don't laugh at this ...\n\tvar withThis = withWhat\n\thistory.pushState(null, null, withThis)\n}", "go(path, query = '', state = null) {\n this._platformStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "go(path, query = '', state = null) {\n this._platformStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "go(path, query = '', state = null) {\n this._platformStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "go(path, query = '', state = null) {\n this._platformStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "go(path, query = '', state = null) {\n this._platformStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "function pushPage(href, ctx) {\n renderPage(href);\n window.history.pushState({ \"href\": href, \"ctx\": ctx }, \"\", href);\n}", "function pushURL() {\n var baseUrl = location.protocol + \"//\" + location.host + location.pathname;\n\n var searchParams = new URLSearchParams();\n\n mapX = map.getView().getCenter()[0];\n mapY = map.getView().getCenter()[1];\n mapZoom = map.getView().getZoom();\n\n searchParams.set(\"x\", mapX);\n searchParams.set(\"y\", mapY);\n if (mapZoom != undefined) {\n searchParams.set(\"zoom\", mapZoom);\n }\n if (mapCX != undefined) {\n searchParams.set(\"cx\", mapCX);\n }\n if (mapCY != undefined) {\n searchParams.set(\"cy\", mapCY);\n }\n searchParams.set(\"formula\", mapLayer);\n searchParams.set(\"style\", mapStyle);\n\n var parameter = \"?\" + searchParams.toString();\n\n var url = baseUrl + parameter;\n\n window.history.pushState({}, window.title, url);\n}", "function state (url, no_push) {\n $('#main').load(url+(url.indexOf('?')>0?'&':'?')+'_main');\n load_page_data(url);\n if (no_push !== 'no push') {\n history.pushState({}, undefined, url);\n }\n}", "function addToHistory(state, projectIndex){\n window.history.pushState({'pageName': state, 'projectIndex':projectIndex}, \"\", state);\n}", "function updatePushStateWithCurrentView() {\n\tif (!isSpa() || isNative()) {return;}\n\tlet current_view = getUrlInputParameter(\"view\");\n\tif (current_view !== null) {\n\t\twindow.history.pushState(root_history_index, null, getServerRootPath()+'?view='+current_view);\n\t\twindow.history.replaceState(root_history_index, null, location.pathname);\n\t}\n}", "pushState (section, path) {\n\n path = section ? '/' + section : '/';\n\n historyHTML5.pushState({section: section}, section, path);\n\t}", "function updateState() {\n\n\t\teditHistory.pushState();\n\t\tupdatePageBackground();\n\t}", "function updateURL () {\n var parms = QueryParams.map(input => {\n var parm = input.queryStringParm;\n return parm + \"=\" + encodeURIComponent(input.location.val());\n });\n var s = parms.join(\"&\");\n window.history.pushState(null, null, location.origin+location.pathname+\"?\"+s);\n }", "goToUrl(feed_data) {\n this.setState({url: feed_data.link});\n this.refs.navigator.push({\n name: 'webview'\n })\n }", "function request(PUSH, pager, arg1, arg2)\r\n{\r\n // (arg1,arg2) : either (url) or (page[,props])\r\n\r\n var url, req;\r\n if(Util.isString(arg1)) // url\r\n {\r\n req = null;\r\n url = arg1;\r\n }\r\n else\r\n {\r\n req = {page:arg1, props:(arg2||{})};\r\n url = pager.urlMapper.toUrl(req); // throws\r\n }\r\n\r\n if(PUSH)\r\n pager.history.pushState(null, url);\r\n else\r\n pager.history.replaceState(null, url); // state is lost\r\n\r\n toHandle(pager, url, req);\r\n}", "GoTo(route, params, query){// function used to change the path of our browser\n var path = routes[route].path(params)\n var qs = Qs.stringify(query)\n var url = path + (qs == '' ? '' : '?'+qs)\n history.pushState({},\"\",url)\n Link.onPathChange()\n }", "function push(location) {\r\n\t history.push(appendQuery(location, location.query));\r\n\t }", "pushState(state) {\n var now = Date.now()\n var expiration = now - ReferenceFrame.OPTIONS.expires\n\n // make a deep clone\n var s = JSON.parse(JSON.stringify(state))\n s.timestamp = state.timestamp || now\n\n this.states.unshift(s)\n\n while (this.states.length > 0 &&\n this.states[this.states.length-1].timestamp < expiration &&\n this.states.length > ReferenceFrame.OPTIONS.maxStates) {\n this.states.pop()\n }\n\n this._emit('pushState', s)\n\n if (ARGON.isManager && ReferenceFrame.subscribers[this.id]) {\n ReferenceFrame.emitStateToSubscribers(this)\n }\n }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function navigate (uri) {\n\t\tif (typeof uri === 'string') {\n\t\t\thistory.pushState(null, null, address ? address + uri : uri);\n\t\t}\n\t}", "function changeUrl(title, url) {\n if (typeof (history.pushState) != \"undefined\") {\n var obj = { Title: title, Url: url };\n history.pushState(obj, obj.Title, obj.Url);\n } else {\n alert(\"Browser does not support HTML5.\");\n }\n }", "function emptyState(){\n history.pushState(\" \",\" \",\"/\");\n}", "parseHistory(event, doPushState = true) {\n if (event.detail.needAddBase && this.baseUrl.length) {\n let evPath = event.detail.path;\n if (evPath[0] === \"/\")\n evPath = evPath.substring(1);\n evPath = this.baseUrl + evPath;\n event.detail.path = evPath;\n }\n if (event.detail.path.indexOf(this.baseUrl) == -1 && doPushState !== false)\n return false;\n let path = event.detail.path.replace(this.baseUrl, \"\");\n if (path[0] !== \"/\")\n path = \"/\" + path;\n this.fullUrl = path;\n let detailObj = { path: path };\n if (doPushState)\n history.pushState(detailObj, '', event.detail.path);\n var routeArray = path.split('?');\n var routeInfo = {\n fullPath: routeArray[0],\n route: routeArray[0].split('/'),\n query: {}\n };\n if (routeArray[1]) {\n var routeQuery = routeArray[1].split('&');\n routeQuery.forEach((param) => {\n let keyValue = param.split('=');\n routeInfo.query[keyValue[0]] = keyValue[1];\n });\n }\n var fromPath;\n if (this.currentRoute)\n fromPath = this.currentRoute;\n else\n fromPath = null;\n if (this.transition !== null) {\n this.transitionOut();\n }\n setTimeout(function () {\n this.beforeEachRoute(this.beforeEach, routeInfo, fromPath).then(function () {\n this.currentRoute = routeInfo;\n this.compareRoutes();\n if (this.afterEach)\n this.afterEach(routeInfo, fromPath);\n if (this.transition !== null) {\n this.transitionIn();\n }\n }.bind(this));\n }.bind(this), this.transitionDuration.leavingDuration + 10);\n }", "async navigateTo(route, pushState = true) {\n const { nodeObject } = await Navigation.extractDataFromPath(route);\n if (await Navigation.shouldPreventNavigation(nodeObject)) {\n return;\n }\n\n const windowPath = GenericHelpers.trimLeadingSlash(this.getWindowPath());\n if (windowPath === GenericHelpers.trimLeadingSlash(route)) {\n return;\n }\n\n if (LuigiConfig.getConfigValue('routing.useHashRouting')) {\n window.location.hash = route;\n return;\n }\n\n const method = pushState ? 'pushState' : 'replaceState';\n window.history[method](\n {\n path: route\n },\n '',\n route\n );\n\n // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Browser_compatibility\n // https://developer.mozilla.org/en-US/docs/Web/API/Event#Browser_compatibility\n // https://developer.mozilla.org/en-US/docs/Web/API/Event/createEvent\n let event;\n if (GenericHelpers.isIE()) {\n event = document.createEvent('Event');\n event.initEvent('popstate', true, true);\n } else {\n event = new CustomEvent('popstate');\n }\n\n window.dispatchEvent(event);\n }", "shift(url, addToHistory) {\n if (addToHistory) window.history.pushState(null, null, `/${this.clearSlashes(url)}`);\n else window.history.replaceState(null, null, `/${this.clearSlashes(url)}`);\n this.current = `${this.clearSlashes(url)}`;\n }", "function layers_add_history_state(){\n\t\t// Update the browser URl so page can be refreshed\n\t\tif (window.history.pushState) {\n\t\t\t// Newer Browsers only (IE10+, Firefox3+, etc)\n\t\t\tvar url = window.location.href.split('?')[0] + \"?url=\" + wp.customize.previewer.previewUrl();\n\t\t\twindow.history.pushState({}, \"\", url);\n\t\t}\n\t}", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }" ]
[ "0.7204924", "0.71836793", "0.69598854", "0.68663716", "0.6789066", "0.67421365", "0.67283183", "0.6669965", "0.6669965", "0.6669965", "0.6669965", "0.6669965", "0.6569138", "0.6569138", "0.6569138", "0.65368104", "0.6515619", "0.64871335", "0.6471626", "0.64703053", "0.6440764", "0.638944", "0.63713235", "0.63709927", "0.63654697", "0.63654697", "0.63654697", "0.63654697", "0.63654697", "0.63633174", "0.63152915", "0.62735736", "0.6165938", "0.61265665", "0.61189026", "0.6032977", "0.5989324", "0.59800327", "0.59589094", "0.5940752", "0.5936727", "0.59084576", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58957773", "0.58936125", "0.58786005", "0.5866897", "0.58563936", "0.5841293", "0.5834214", "0.5832608", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158", "0.5813158" ]
0.65883434
20
Performs a `replaceState` with arguments
replace(url, as = url, options = {}) { return this.change('replaceState', url, as, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "replace(url, as, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as = url, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as = url, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replace(url, as = url, options = {}) {\n ;\n ({\n url,\n as\n } = prepareUrlAs(this, url, as));\n return this.change('replaceState', url, as, options);\n }", "replaceState(state, title, url = this.url) {\n url = URL.resolve(this.current.window.document.URL, url);\n // TODO: check same origin\n this.replaceEntry(this.current.window, url, state || {});\n this.updateLocation(this.current.window, url);\n }", "function _replace(args, t) {\n var previous = _stack[_index].graph;\n // assert(_index == _stack.length - 1)\n var actionResult = _act(args, t);\n _stack[_index] = actionResult;\n return change(previous);\n }", "function o(e){window.history.replaceState(null,\"\",r.state.url),window.location.replace(e)}", "function replace(name, params) {\n navigationRef.current?.dispatch(StackActions.replace(name, params));\n}", "replace(...args) {\n const pairs = args2pairs(args)\n\n pairs.forEach(pair => that.replace.apply(that, pair))\n\n sync()\n return this\n }", "replaceState(state, title, url) {\n this._history.pop();\n this._history.push({ state, title, url });\n this._update();\n }", "function transition(newMode, replace) {\n if (!replace) {\n setHistory(prev => {\n return [...prev, newMode]\n }); \n }\n setMode(newMode);\n }", "function replace(routeName, params) {\n _navigator.dispatch(\n StackActions.replace({\n routeName,\n params,\n }),\n );\n}", "replaceHistState() {\n const params = new URLSearchParams();\n params.set('fg', this.fg);\n params.set('bg', this.bg);\n params.set('mode', this.numberType);\n params.set('showHint', false);\n params.set('directDrive', this.directDrive);\n window.history.replaceState({}, '', '?' + params.toString());\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\t\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t true ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\t\n\t return;\n\t }\n\t\n\t redirectInfo = location;\n\t }\n\t\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "replaceState(path, query = '', state = null) {\n this._platformStrategy.replaceState(state, '', path, query);\n\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "function transition(newMode, replace = false) {\n setMode(newMode);\n if (!replace) {\n setHistory(prev => ([...prev, newMode]));\n }; \n }", "function replaceParams() {\n var href = $(this).attr(\"href\") || $(this).serialize()\n href = PlaceGuide.cleanParamString(href)\n var state = href.match(/[\\?\\&]/) ? $.deparam.querystring(href) : {}\n $.bbq.pushState(state, PlaceGuide.REPLACE_EXISTING)\n return false\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\n\t return;\n\t }\n\n\t redirectInfo = location;\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t false ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\n\t return;\n\t }\n\n\t redirectInfo = location;\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function locationReplace(url) {\n window.history.replaceState(null, \"\", pjax.state.url)\n window.location.replace(url)\n}", "function locationReplace(url) {\n window.history.replaceState(null, \"\", pjax.state.url)\n window.location.replace(url)\n}", "function locationReplace(url) {\n window.history.replaceState(null, \"\", pjax.state.url)\n window.location.replace(url)\n}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\t\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t (undefined) !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\t\n\t return;\n\t }\n\t\n\t redirectInfo = location;\n\t }\n\t\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "goHandler(replacement) {\n const { toks } = this.props;\n const { focusedId } = this.state;\n const item = toks[focusedId];\n const replacementItem = Object.assign({}, item, { t: replacement });\n this.props.dispatch({\n type: 'GO',\n payload: {\n replacement: replacementItem,\n index: focusedId,\n }\n });\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\t\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\t\n\t return;\n\t }\n\t\n\t redirectInfo = location;\n\t }\n\t\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "addReplacement(replaceColorKey, replaceColorValue, replaceColorExclude, replaceColorWithValue, state, stateTitle, viewType) {\n\n var replacementDescriptor = { colorKey: replaceColorKey, \n replaceColorValue: replaceColorWithValue };\n\n if (replaceColorValue !== undefined) replacementDescriptor.colorValue = replaceColorValue;\n if (replaceColorExclude !== undefined) replacementDescriptor.colorExclude = replaceColorExclude;\n if (state !== undefined) replacementDescriptor.state = state;\n if (stateTitle !== undefined) replacementDescriptor.stateTitle = stateTitle;\n if (viewType !== undefined) replacementDescriptor.viewType = viewType;\n\n this.replacement = (this.replacement === undefined ? new Array() : this.replacement);\n this.replacement[this.replacement.length] = replacementDescriptor;\n }", "addReplacement(replaceColorKey, replaceColorValue, replaceColorExclude, replaceColorWithValue, state, stateTitle, viewType) {\n\n var replacementDescriptor = { colorKey: replaceColorKey, \n replaceColorValue: replaceColorWithValue };\n\n if (replaceColorValue !== undefined) replacementDescriptor.colorValue = replaceColorValue;\n if (replaceColorExclude !== undefined) replacementDescriptor.colorExclude = replaceColorExclude;\n if (state !== undefined) replacementDescriptor.state = state;\n if (stateTitle !== undefined) replacementDescriptor.stateTitle = stateTitle;\n if (viewType !== undefined) replacementDescriptor.viewType = viewType;\n\n this.replacement = (this.replacement === undefined ? new Array() : this.replacement);\n this.replacement[this.replacement.length] = replacementDescriptor;\n }", "function transition(mode, replace = false) {\n\n if (replace) {\n setHistory(prev => [...prev.slice(0, -1), mode])\n } else {\n setHistory(prev => [...prev, mode])\n }\n setMode(mode)\n }", "function transition(newMode, replace = false) {\n setMode(prev => prev = newMode);\n if (replace) {\n setHistory(prev => prev = [...prev.slice(0,-1), newMode]);\n }\n else {\n setHistory(prev => prev = [...prev, newMode]);\n }\n }", "replaceState(path, query = '', state = null) {\n this._platformStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "replaceState(path, query = '', state = null) {\n this._platformStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "replaceState(path, query = '', state = null) {\n this._platformStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "replaceState(path, query = '', state = null) {\n this._platformStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "replaceState(path, query = '', state = null) {\n this._platformStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\n\t return;\n\t }\n\n\t redirectInfo = location;\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function locationReplace(url) {\n window.history.replaceState(null, \"\", pjax.state.url);\n window.location.replace(url);\n }", "function runEnterHooks(routes, nextState, callback) {\n var hooks = getEnterHooks(routes);\n\n if (!hooks.length) {\n callback();\n return;\n }\n\n var redirectInfo = undefined;\n function replace(location, deprecatedPathname, deprecatedQuery) {\n if (deprecatedPathname) {\n process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n redirectInfo = {\n pathname: deprecatedPathname,\n query: deprecatedQuery,\n state: location\n };\n\n return;\n }\n\n redirectInfo = location;\n }\n\n _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n hooks[index](nextState, replace, function (error) {\n if (error || redirectInfo) {\n done(error, redirectInfo); // No need to continue.\n } else {\n next();\n }\n });\n }, callback);\n}", "replaceScreen(ref, pagename, paramdata) {\n ref.props.navigation.replace(pagename, paramdata, []);\n }", "function route(url) {\n \tvar replace = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];\n\n \tif (typeof url !== 'string' && url.url) {\n \t\treplace = url.replace;\n \t\turl = url.url;\n \t}\n \tif (history) {\n\n \t\tif (replace === true) {\n \t\t\thistory.replaceState(null, null, url);\n \t\t} else {\n \t\t\thistory.pushState(null, null, url);\n \t\t}\n \t}\n \t// routeTo(url);\n }", "function locationReplace(url) {\n window.history.replaceState(null, \"\", pjax.state.url)\n window.location.replace(url)\n }", "function runChangeHooks(routes,state,nextState,callback){var hooks=getChangeHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](state,nextState,replace,next);},callback);}", "function runChangeHooks(routes,state,nextState,callback){var hooks=getChangeHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](state,nextState,replace,next);},callback);}", "function runChangeHooks(routes,state,nextState,callback){var hooks=getChangeHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](state,nextState,replace,next);},callback);}", "function transition(newMode, replace = false) { \n const historyCopy = [...history];\n\n if (replace) {\n historyCopy.pop(); \n // .pop will remove last element or mode in this case\n }\n historyCopy.push(newMode); \n // newMode will replace the popped out mode\n setMode(newMode);\n setHistory(historyCopy);\n }", "function replaceWith(to, params, query) {\n URLStore.replace(makePath(to, params, query));\n}", "function update_url_inplace(param, newvalue) {\n var newurl = new URL(window.location);\n var params = new URLSearchParams(newurl.search);\n params.set(param, newvalue);\n\n newurl.search = params.toString();\n var updated = newurl.toString();\n history.replaceState({path: updated}, '', updated);\n}", "function update_state()\n {\n var query = { _list: me.selected_list }\n\n if (settings.selected_uid) {\n query._id = settings.selected_uid;\n }\n\n if (window.history.replaceState) {\n window.history.replaceState({}, document.title, rcmail.url('', query));\n }\n }", "function transition(mode, replace = false) { \n if(!replace) {\n setHistory(prev => [...prev, mode])\n } else {\n //If replace === true, replace last element (previous mode) with current current mode\n setHistory(prev => [...prev.slice(0, prev.length - 1), mode]);\n }\n }", "function replaceURL(url){window.location.replace=url}", "setState(_state, _args) {\n\t // This has to be handled at a higher level since we can't\n\t // replace the whole tree here however we still need a method here\n\t // so it appears on the proxy Actions class.\n\t throw new Error('Called setState on StateActions.');\n\t }", "reverse({\n name,\n imageUrl,\n location,\n club,\n github,\n personal,\n description,\n receiveNewsletter,\n clubsToPreserve\n }) {\n const oldState = {\n name,\n imageUrl,\n location,\n club,\n github,\n personal,\n description,\n receiveNewsletter,\n clubsToPreserve,\n edit: false\n };\n\n this.setState(oldState);\n }", "enterState(oldState){}", "function runChangeHooks(routes, state, nextState, callback) {\r\n\t var hooks = getChangeHooks(routes);\r\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\r\n\t hooks[index](state, nextState, replace, next);\r\n\t }, callback);\r\n\t}", "complete() {\n const { history } = this.props;\n history.replace(`/${BASE_PATH}`);\n }", "changeState(state) {\r\n if(this._config.states[state]){\r\n this._state = state;\r\n this._history.push(this._state);\r\n }else{\r\n throw new Error;\r\n }\r\n }", "function replace(input, searchValue, replaceValue) {}", "function _updateWindowState() {\n\n window.history.replaceState({},\n 'MainWindow',\n window.location.pathname + \"?\" + UrlParams.toString());\n }", "changeState(state) {\r\n if (this.config.states[state]) {\r\n this.history.push(this.currentState);\r\n this.currentState = state;\r\n this.isRedo = false;\r\n } else {\r\n throw new Error();\r\n }\r\n\r\n }", "function replace(str, search, replacements) {\n\t str = toString(str);\n\t search = toArray(search);\n\t replacements = toArray(replacements);\n\n\t var searchLength = search.length,\n\t replacementsLength = replacements.length;\n\n\t if (replacementsLength !== 1 && searchLength !== replacementsLength) {\n\t throw new Error('Unequal number of searches and replacements');\n\t }\n\n\t var i = -1;\n\t while (++i < searchLength) {\n\t // Use the first replacement for all searches if only one\n\t // replacement is provided\n\t str = str.replace(\n\t search[i],\n\t replacements[(replacementsLength === 1) ? 0 : i]);\n\t }\n\n\t return str;\n\t }", "function switchstate(arg) {\n\n\tswitch (arg) {\n\t\n\t\tcase 'my-tweets':\n\t\t\tmyTweets();\n\t\t\tbreak;\n\t\tcase 'spotify-this-song':\n\t\t\tspotifyThis(arg2)\n\t\t\tbreak;\n\t\tcase 'movie-this':\n\t\t\tif (!arg2) {\n\t\t\t\targ2 = \"Mr. Nobody\"\n\t\t\t}\n\t\t\tmovieThis(arg2);\n\t\t\tbreak;\n\t\tcase 'do-what-it-says':\n\t\t\tdoThis();\n\t\t\tbreak;\n\t}\n}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function runChangeHooks(routes, state, nextState, callback) {\n\t var hooks = getChangeHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](state, nextState, replace, next);\n\t }, callback);\n\t}", "function updateURL () {\n var newSearch = \"?\" + Object.keys(parameters).filter(function (key) {\n return Boolean(parameters[key])\n }).map(function (key) {\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(parameters[key])\n }).join(\"&\");\n history.replaceState(null, null, newSearch)\n }", "function resolve() {\n if (l.search) {\n var q = {};\n l.search.slice(1).split('&').forEach(function(v) {\n var a = v.split('=');\n q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&')\n });\n if (q.p !== undefined) {\n window.history.replaceState(null, null,\n repo + (q.p || '') +\n (q.q ? ('?' + q.q) : '') +\n l.hash\n )\n }\n }\n }", "function stateTo(path, params) {\n\t\t\t$state.go(path, params);\n\t\t}", "function i(t){\n // Hitting back or forward should override any pending PJAX request.\n k||c(r.xhr);var a,n=r.state,f=t.state;if(f&&f.container){\n // When coming forward from a separate history session, will get an\n // initial pop with a state we are already at. Skip reloading the current\n // page.\n if(k&&T==f.url)return;if(n){\n // If popping back to the same state, just skip.\n // Could be clicking back from hashchange rather than a pushState.\n if(n.id===f.id)return;\n // Since state IDs always increase, we can deduce the navigation direction\n a=n.id<f.id?\"forward\":\"back\"}var i=M[f.id]||[],s=i[0]||f.container,u=e(s),d=i[1];if(u.length){n&&\n // Cache current container before replacement and inform the\n // cache which direction the history shifted.\n w(a,n.id,[s,l(u)]);var _=e.Event(\"pjax:popstate\",{state:f,direction:a});u.trigger(_);var m={id:f.id,url:f.url,container:s,push:!1,fragment:f.fragment,timeout:f.timeout,scrollTo:!1};if(d){u.trigger(\"pjax:start\",[null,m]),r.state=f,f.title&&(document.title=f.title);var p=e.Event(\"pjax:beforeReplace\",{state:f,previousState:n});u.trigger(p,[d,m]),u.html(d),u.trigger(\"pjax:end\",[null,m])}else r(m);\n // Force reflow/relayout before the browser tries to restore the\n // scroll position.\n u[0].offsetHeight}else o(location.href)}k=!1}", "function runChangeHooks(routes, state, nextState, callback) {\n var hooks = getChangeHooks(routes);\n return runTransitionHooks(hooks.length, function (index, replace, next) {\n hooks[index](state, nextState, replace, next);\n }, callback);\n}", "function runChangeHooks(routes, state, nextState, callback) {\n var hooks = getChangeHooks(routes);\n return runTransitionHooks(hooks.length, function (index, replace, next) {\n hooks[index](state, nextState, replace, next);\n }, callback);\n}", "function runChangeHooks(routes, state, nextState, callback) {\n var hooks = getChangeHooks(routes);\n return runTransitionHooks(hooks.length, function (index, replace, next) {\n hooks[index](state, nextState, replace, next);\n }, callback);\n}" ]
[ "0.6915585", "0.6915585", "0.6915585", "0.6915585", "0.6915585", "0.6831305", "0.6831305", "0.6831305", "0.66702175", "0.66198623", "0.64779127", "0.6450049", "0.64047945", "0.63779116", "0.5861434", "0.5754697", "0.5746827", "0.5723408", "0.5712878", "0.57043463", "0.5645805", "0.56147194", "0.5609532", "0.56045294", "0.56045294", "0.56045294", "0.56022435", "0.55982983", "0.55798936", "0.55511177", "0.55511177", "0.5509154", "0.5498917", "0.54809403", "0.54809403", "0.54809403", "0.54809403", "0.54809403", "0.54668665", "0.54413116", "0.5435993", "0.5425667", "0.5424061", "0.5404274", "0.5281605", "0.5281605", "0.5281605", "0.52565706", "0.52556396", "0.5249026", "0.52448547", "0.5243386", "0.5242587", "0.5226445", "0.52148443", "0.51884", "0.51615846", "0.5137686", "0.51327336", "0.5126823", "0.5119771", "0.5102859", "0.50983447", "0.5086653", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5076899", "0.5071834", "0.5061486", "0.50584036", "0.5057272", "0.50254035", "0.50254035", "0.50254035" ]
0.69920236
8
Callback to execute before replacing router state
beforePopState(cb) { this._bps = cb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dispatchRouteChange() {\n // remove hash\n var href = location.hash.substr(1, location.hash.length - 1);\n\n routerState$.patch({\n route: href === '' ? '/' : href.split('?')[0],\n params: getUrlParams(href)\n });\n }", "function _beforeRouting(newRoute) {\n\t //application.changeRoute(newRoute);\n\t application.clearHeader();\n\t}", "routerHooks() {\n const router = this.router;\n router.afterEach((to, from) => {\n this.historyShouldChange = true;\n // get the vm instance after render\n this.Vue.nextTick(() => {\n const current = this.currentVm;\n const pendingToPushVm = resolvePushedVm(current);\n if (this.pre === null) {\n this.onInitial(pendingToPushVm);\n } else if (this.isReplace) {\n this.onReplace(pendingToPushVm);\n } else if (this.isPush) {\n this.onPush(pendingToPushVm);\n } else {\n this.onBack(pendingToPushVm);\n }\n this.pre = current;\n this.preStateId = this.stackPointer;\n if (!isPlaceHolderVm(pendingToPushVm)) {\n setCurrentVnodeKey(router, genKey(this.stackPointer, router));\n if (!this.hacked && current) {\n this.hackKeepAliveRender(current.$vnode.parent.componentInstance);\n }\n this.historyShouldChange = false;\n }\n });\n });\n }", "updateRoutesAfterLogin(val) {\n const { location } = this.props\n\n if (location.state && location.state.nextPathname) {\n this.props.router.replace(location.state.nextPathname)\n } else {\n this.props.router.replace('/')\n }\n }", "function _beforeRouting(newRoute) {\n //application.changeRoute(newRoute);\n _application2.default.clearHeader();\n}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\t\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t true ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\t\n\t return;\n\t }\n\t\n\t redirectInfo = location;\n\t }\n\t\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function onChange(prevState, nextState, replace, cb) {\n\t let lastRoute = nextState.routes[nextState.routes.length - 1];\n\t\n\t if (lastRoute.component) {\n\t let component = lastRoute.component.WrappedComponent;\n\t let location = nextState.location;\n\t let pageComponent = component.OriginalPage ? component.OriginalPage : component;\n\t\n\t Object.assign(window.__APP_CONFIG__, {\n\t pageId: location.query.pageId || pageComponent.pageConfig && pageComponent.pageConfig.pageId\n\t });\n\t }\n\t\n\t cb();\n\t}", "function runEnterHooks(routes,nextState,callback){var hooks=getEnterHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](nextState,replace,next);},callback);}", "function runEnterHooks(routes,nextState,callback){var hooks=getEnterHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](nextState,replace,next);},callback);}", "function runEnterHooks(routes,nextState,callback){var hooks=getEnterHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](nextState,replace,next);},callback);}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\t\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\t\n\t return;\n\t }\n\t\n\t redirectInfo = location;\n\t }\n\t\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\t\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t (undefined) !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\t\n\t return;\n\t }\n\t\n\t redirectInfo = location;\n\t }\n\t\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "didTransition() {\n this.controller.set('isTransitionDone', true);\n // This is needed in order to update the links in this parent route,\n // giving the \"currentRouteName\" time to resolve\n later(this, () => {\n if (this.router.currentRouteName.includes('explore')) {\n this.controller.set('isEditModeActive', false);\n }\n });\n }", "function o(e){window.history.replaceState(null,\"\",r.state.url),window.location.replace(e)}", "function updateRoute() {\n\n}", "function sync() {\n const { route, params } = currentRoute();\n store.changeRoute(route, params);\n\n // Set up listener for back/forward navigation. We do this in `sync()` to\n // avoid the route being changed by a \"popstate\" emitted by the browser on\n // document load (which Safari and Chrome do).\n if (!didRegisterPopstateListener) {\n $window.addEventListener('popstate', () => {\n // All the state we need to update the route is contained in the URL, which\n // has already been updated at this point, so just sync the store route\n // to match the URL.\n sync();\n });\n didRegisterPopstateListener = true;\n }\n }", "setRouteByGeocode() {\n const geocodeData = this.store.state.geocode.data;\n\n // make hash if there is geocode data\n console.log('router setRouteByGeocode is running - geocodeData:', geocodeData);\n if (geocodeData) {\n let address;\n\n if (geocodeData.street_address) {\n address = geocodeData.street_address;\n } else if (geocodeData.properties.street_address) {\n address = geocodeData.properties.street_address;\n }\n\n // TODO - datafetch should not know topics are a thing\n if (this.config.router.returnToDefaultTopicOnGeocode) {\n this.store.commit('setActiveTopic', this.config.defaultTopic);\n }\n\n const topic = this.store.state.activeTopic;\n // const selectedServices = this.store.state.selectedServices;\n\n // REVIEW this is only pushing state when routing is turned on. but maybe we\n // want this to happen all the time, right?\n if (!this.silent) {\n // push state\n const nextHistoryState = {\n geocode: geocodeData\n };\n let nextHash;\n // address = 'addr ' + address;\n if (topic) {\n nextHash = this.makeHash(address, topic);\n } else {\n nextHash = this.makeHash(address, '');\n }\n // console.log('nextHistoryState', nextHistoryState, 'nextHash', nextHash);\n this.history.pushState(nextHistoryState, null, nextHash);\n }\n } else {\n // wipe out hash if a geocode fails\n if (!this.silent) {\n this.history.pushState(null, null, '#');\n }\n }\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t false ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\n\t return;\n\t }\n\n\t redirectInfo = location;\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function prepRoute() {\n transitionRoute(this.path);\n }", "changeState(state) {\r\n if(this._config.states[state]){\r\n this._state = state;\r\n this._history.push(this._state);\r\n }else{\r\n throw new Error;\r\n }\r\n }", "function runChangeHooks(routes,state,nextState,callback){var hooks=getChangeHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](state,nextState,replace,next);},callback);}", "function runChangeHooks(routes,state,nextState,callback){var hooks=getChangeHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](state,nextState,replace,next);},callback);}", "function runChangeHooks(routes,state,nextState,callback){var hooks=getChangeHooks(routes);return runTransitionHooks(hooks.length,function(index,replace,next){hooks[index](state,nextState,replace,next);},callback);}", "_routePageChanged(page) {\n const routes = ['repository-list'];\n this.page = page || 'repository-list'; // defaults to home route if no page\n\n // if we are trying to access anything other than / or /repository-list return 404 page\n if (routes.indexOf(this.page) === -1){\n this.page = '404';\n }\n }", "beforeRouteUpdate(to, from, next) {\n this.stopAutoUpdate();\n next();\n }", "reset() {\r\n this._state = this._config.initial;\r\n this._history.push(this._state);\r\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\n\t return;\n\t }\n\n\t redirectInfo = location;\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replace(location, deprecatedPathname, deprecatedQuery) {\n\t if (deprecatedPathname) {\n\t process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n\t redirectInfo = {\n\t pathname: deprecatedPathname,\n\t query: deprecatedQuery,\n\t state: location\n\t };\n\n\t return;\n\t }\n\n\t redirectInfo = location;\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replace, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "routeChange() {\n\n // Validating the routes object\n if (!router.routes) return;\n if (router.routes.constructor !== Object) throw err(9);\n\n const route = router.getRoute(window.location.pathname);\n const entries = Object.entries(router.routes);\n\n // Looping through all routes in the routes-object\n for (let i = 0; i < entries.length; i++) {\n const entryRoute = router.getRoute(entries[i][0]);\n let match = true;\n\n // Checking if the current URL matches the route\n for (let a = 0; a < entryRoute.length; a++) {\n if (route[a] === undefined || (entryRoute[a] !== \"**\" && entryRoute[i] !== route[i])) {\n match = false;\n break;\n }\n }\n\n // Change content if match was found\n if (match) {\n router.page = entries[i][1];\n window.dispatchEvent(router.newRouteEvent);\n return;\n }\n }\n\n }", "_outOfRouteChain(){\n // *Changing the route chain state:\n this._isInRouteChain = false;\n }", "async function onNavigate() {\n // A promise that will resolve once route change is successful\n const routeChanged = new Promise((resolve) => {\n const onComplete = () => { resolve(); router.events.off('routeChangeComplete', onComplete); };\n router.events.on('routeChangeComplete', onComplete);\n });\n // Pause at the old state\n setFreezeUpdates(true);\n // Fade out all content\n setWillFade(true);\n await opacityControls.start({ opacity: 0, transition: { duration: 0.35, ease: 'easeInOut' } });\n setDisplayContent(false);\n // Wait for the new route to load\n await routeChanged; // TODO: handle errors\n // Check whether the light panel will change position as the result of this transition\n const orientationWillChange = orientationRef.current !== orientation;\n const lightPanelWillMove = orientationWillChange || menuOpen;\n // Without animation, close the menu and transform the light panel to stay in place\n if (menuOpen) lightPanelControls.set({ x: openOffset });\n panelsControls.set('menu-closed');\n // Record that the menu is closed\n dispatch('setMenuOpen', false);\n // Let the new page content/attributes flow in\n setFreezeUpdates(false);\n // Wait for the panel to finish sliding\n if (lightPanelWillMove) {\n await Promise.all([\n // Close the menu\n lightPanelControls.start({ x: 0 }),\n new Promise((resolve) => setLightPanelAnimCallback(() => resolve)),\n ]);\n }\n setLightPanelAnimCallback(null);\n // Fade in all content\n setDisplayContent(true);\n await opacityControls.start({ opacity: 1, transition: { duration: 0.65, ease: 'easeOut' } });\n setWillFade(false);\n }", "_routerDidTransition() {\n schedule('afterRender', this, function() {\n this._updateMessageContainers(\n this._pullAdditionsFromQueue()\n );\n });\n }", "startAgain(routerHistory) {\n console.log(\"startAgain() from lostHeart() has been called\");\n routerHistory.replace(\"/loading\");\n // this.setState(state => {\n // state.currentVerbIdx = 0\n // }\n // );\n // this.setState(state => {\n // state.hearts = INITIAL_HEARTS\n // }\n // );\n }", "function runEnterHooks(routes, nextState, callback) { // 40\n var hooks = getEnterHooks(routes); // 41\n // 42\n if (!hooks.length) { // 43\n callback(); // 44\n return; // 45\n } // 46\n // 47\n var redirectInfo = undefined; // 48\n function replaceState(state, pathname, query) { // 49\n redirectInfo = { pathname: pathname, query: query, state: state };\n } // 51\n // 52\n _AsyncUtils.loopAsync(hooks.length, function (index, next, done) { // 53\n hooks[index](nextState, replaceState, function (error) { // 54\n if (error || redirectInfo) { // 55\n done(error, redirectInfo); // No need to continue. // 56\n } else { // 57\n next(); // 58\n } // 59\n }); // 60\n }, callback); // 61\n} // 62", "function runEnterHooks(routes, nextState, callback) {\n var hooks = getEnterHooks(routes);\n\n if (!hooks.length) {\n callback();\n return;\n }\n\n var redirectInfo = undefined;\n function replace(location, deprecatedPathname, deprecatedQuery) {\n if (deprecatedPathname) {\n process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;\n redirectInfo = {\n pathname: deprecatedPathname,\n query: deprecatedQuery,\n state: location\n };\n\n return;\n }\n\n redirectInfo = location;\n }\n\n _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n hooks[index](nextState, replace, function (error) {\n if (error || redirectInfo) {\n done(error, redirectInfo); // No need to continue.\n } else {\n next();\n }\n });\n }, callback);\n}", "hashChange(event) {\n\t\t// This support the abort a cicle\n\t\tif (this.engineIsRunning === true) {\n\t\t\tthis.engineIsRunning = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.currentUrl = event ? event.newURL : window.location.href;\n\t\tthis.previousUrl = event ? event.oldURL : window.location.href;\n\t\t// Save the old routes if user abort and need restore it\n\t\tthis.oldRoutesBkp = this.cloneRoutes({source: this.oldRoutes});\n\t\t// Save a copy of currentRoutes as oldRoutes\n\t\tthis.oldRoutes = this.cloneRoutes({source: this.currentRoutes});\n\t\t// Clean current routes\n\t\tthis.currentRoutes = getEmptyRouteObjetc();\n\t\tthis.engine();\n\t}", "redirect(path, newState, callback) {\n if (newState) {\n this.setState({\n redirectPath: path,\n }, callback);\n this.props.setGlobalState({...newState});\n }\n\n else {\n this.setState({\n redirectPath: path,\n }, callback);\n }\n return null;\n }", "onRouterChanged() {\n hideAll();\n }", "callback(route){\n this.setState({route});\n }", "_handleRouteChange(route) {\n this.setState({\n route: route,\n });\n }", "_createState(route, options){\n\n\t}", "reset() {\r\n this.currentState = this.config.initial;\r\n this.history.push(this.currentState);\r\n }", "static syncStateToHash() {\n //removing leading '#'\n let newHash = window.location.hash;\n if (newHash.startsWith('#')) {\n newHash = newHash.substr(1);\n }\n\n //if application state is already synced\n if (currentHash === newHash) {\n restored = true;\n return restored;\n }\n\n restored = false;\n if (newHash.startsWith('/app/') && newHash.length > 5) {\n UiService.setIsLoading(true);\n statePartiallySynced = false;\n CommonUtil.delay(50).then(() => restoreLodgementState(newHash.substr(5))\n .then(\n () => {\n restored = true;\n currentHash = newHash;\n console.info(`LocationService: updating state to match hash: #${newHash}`);\n if (statePartiallySynced) { //could not fully sync sate to hash - maybe rename this event\n EventService.fire('application_content_change');\n }\n UiService.setIsLoading(false);\n }\n )\n );\n } else {\n LodgementService.selectTab(0);\n restored = true;\n currentHash = newHash;\n console.info(`LocationService: updating state to match hash: #${newHash}`);\n }\n return restored;\n }", "navigateToRouteWithState(descriptor) {\r\n this.history.push(descriptor);\r\n }", "_isActiveChanged(isActive) {\n console.log('isActive', isActive);\n if (!isActive) {\n // route is not active\n return;\n }\n // route is active\n }", "onNavigate({ linked: RouteCtr, params, query, uriFragment }) {\n // Create a new route each time we navigate\n const newRoute = new RouteCtr({ router: this });\n\n // Remove unnecessary pieces from the routeData\n const routeData = { params, query, uriFragment };\n\n // Store the route we're trying to transition to. This lets us know if\n // the user transitions away at a later time.\n this._transitioningTo = newRoute;\n\n // Give the route a way to bail out of transitioning even if it isn't\n // navigating to a new route (which the above would catch)\n newRoute._bail = false;\n newRoute.bail = () => { newRoute._bail = true; };\n\n // Convenience method for pulling relevant filters\n function getFilters(obj, type) {\n return _.result(obj, 'filters').reduce((arr, filter) => {\n const fn = filter[type];\n return fn ? [...arr, fn.bind(obj)] : arr;\n }, []);\n }\n\n // Gather filter chains\n const promiseChain = [\n // Router \"before\" filters\n ...getFilters(this, 'before'),\n\n // Route \"before\" filters\n ...getFilters(newRoute, 'before'),\n\n // Route fetch method\n newRoute.fetch.bind(newRoute),\n\n // Exit previous route\n () => (this.currentRoute ? this.currentRoute.exit() : undefined),\n\n // Store reference to this new route\n () => { this.currentRoute = newRoute; },\n\n // Route show method\n newRoute.show.bind(newRoute),\n\n // Route \"after\" filters\n ...getFilters(newRoute, 'after'),\n\n // Router \"after\" filters\n ...getFilters(this, 'after'),\n\n // Finally trigger a navigate event on the router & remove reference\n // to the route-in-progress\n () => {\n this.trigger('navigate', routeData);\n delete this._transitioningTo;\n return this;\n },\n ];\n\n // Start the crazy promise chain\n return promiseChain.reduce((p, fn) => p.then(() => {\n // Anytime the developer has an opportunity to navigate again,\n // we need to check if they have. If they have, then we stop.\n // We need to do this check after every step.\n if (this._transitioningTo !== newRoute || newRoute._bail) {\n return this;\n }\n return fn(routeData); // eslint-disable-line consistent-return\n }), Promise.resolve())\n\n // If there are errors at any time, then we look for an `error`\n // method of the Route. If it exists, we execute it; otherwise, we\n // use the Router's `error` callback.\n .catch((e) => {\n const handler = newRoute.error || this.error;\n return handler(e, routeData);\n });\n }", "stateChanged(state) {\n let subpageObj = state.app.page.subpage;\n this._subpage = subpageObj ? subpageObj.name : \"\";\n this._authenticated = state.admin.authStatus;\n this._authRes = state.admin.actionResults.auth;\n }", "componentDidMount() {\n this.context.router.addTransitionHook(this.routerWillLeave);\n }", "hashChange () {\n const validRoutes = ['/home', '/inventory', '/new-item']\n const defaultRoute = '/home/'\n const newRoute = window.location.hash.replace(/^#/, '').trim()\n const isValidRoute = validRoutes.includes(newRoute)\n\n if (isValidRoute) {\n this.setState({route: newRoute})\n } else {\n window.location.hash = defaultRoute\n }\n }", "function router() {\n\tele(\"error\").innerText = \"\";\n\tele(\"content\").innerHTML = \"\";\n\tif (!state.isSignedIn) return;\n\n\tconst view = (hash) => {\n\t\tif (hash.startsWith(\"#sheet/\")) {\n\t\t\treturn editSheetView(hash.substr(\"#sheet/\".length));\n\t\t} else {\n\t\t\treturn listView()\n\t\t}\n\t}\n\tif (location.hash === \"\") {\n\t\tconst hash = localStorage.getItem(\"lastLocation\") || \"\";\n\t\tif (hash !== \"\") {\n\t\t\tlocation.hash = hash\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tlocalStorage.setItem(\"lastLocation\", location.hash);\n\t}\n\tloadInc();\n\tview(location.hash).catch(uncaughtErrorHandler).finally(() => {\n\t\tloadDec();\n\t});\n}", "function dispatch() {\n\n var hash = current();\n\n // Only when hash actually changed from\n // last activation and router is currently\n // enabled.\n\n if (last === hash) {\n\n return;\n }\n\n dispatchHash(hash);\n}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replaceState(state, pathname, query) {\n\t redirectInfo = { pathname: pathname, query: query, state: state };\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replaceState, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replaceState(state, pathname, query) {\n\t redirectInfo = { pathname: pathname, query: query, state: state };\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replaceState, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replaceState(state, pathname, query) {\n\t redirectInfo = { pathname: pathname, query: query, state: state };\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replaceState, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replaceState(state, pathname, query) {\n\t redirectInfo = { pathname: pathname, query: query, state: state };\n\t }\n\n\t _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n\t hooks[index](nextState, replaceState, function (error) {\n\t if (error || redirectInfo) {\n\t done(error, redirectInfo); // No need to continue.\n\t } else {\n\t next();\n\t }\n\t });\n\t }, callback);\n\t}", "complete() {\n const { history } = this.props;\n history.replace(`/${BASE_PATH}`);\n }", "function onBeforeEnter() {\n console.log('\\n\\n\\n====================\\n' + $state.current.url + '\\n====================\\n');\n if (!Util.hasPreviousStates(noLoadingStates)) {\n Util.loading(vm.Model);\n initPromise = init();\n } else {\n Util.freeze(false);\n }\n console.log(\"$state.params :::\\n\", $state.params);\n }", "_onLoginChange() {\n //get a local up-to-date record of the logged-in state\n //see https://facebook.github.io/react/docs/component-api.html\n let userLoggedInState = this._getLoginState();\n this.setState(userLoggedInState);\n\n //get any nextTransitionPath - NB it can only be got once then it self-nullifies\n let transitionPath = RouterStore.nextTransitionPath || '/';\n\n //trigger router change\n //console.log(\"&*&*&* App onLoginChange event: loggedIn=\", userLoggedInState.userLoggedIn,\n // \"nextTransitionPath=\", transitionPath);\n\n if(userLoggedInState.userLoggedIn){\n router.transitionTo(transitionPath);\n }else{\n router.transitionTo('/login');\n }\n }", "function handleAppRouteChangeRequests(payload) {\n set(payload.payload.route, payload.payload.data);\n }", "enterState(oldState){}", "function respondToState(){\n\t\t_oldUrl = _currentUrl;\n\t\tif(_useAPI) _currentUrl = cleanUrl(window.location.pathname || \"\");\n\t\telse _currentUrl = cleanUrl(window.location.hash || \"\");\n\t\t//Remove slash in beginning\n\t\tif(_currentUrl == \"/\") _currentUrl = \"\";\n\t\telse if(_currentUrl.indexOf(\"/\") == 0) _currentUrl = _currentUrl.substr(1);\n\t\t//Add slash in end\n\t\tif(_currentUrl.substr(_currentUrl.length-1) != \"/\") _currentUrl = _currentUrl+\"/\";\n\t\tif(_allowCookies || _firstTime) track(); //Track first page. After that only when cookies have been accepted.\n\t\tsetCanonical();\n\t\treadParameters();\n\t\tif(!_firstTime && _oldUrl == _currentUrl){\n\t\t\t//console.log(\"Same url firing statechange\", _oldUrl);\n\t\t\twindow.dispatchEvent(GLBCustomEvent(\"subPageChange\", 0));\n\t\t\treturn;\n\t\t}\n\t\t_firstTime = false;\n\t\tsetTitle();\n\t\t//Pages listening can animIn/Out\n\t\twindow.dispatchEvent(GLBCustomEvent(\"pageChange\", 0));\n\t}", "beforeRouteUpdate(to, from, next) {\n this.initForm(to)\n next()\n }", "during_setup(e) {\n\t\tlet state = e.state;\n\t\tif (state === undefined) state = this.old_state;\n\t\tthis.enter(state);\n\t}", "navigate(path) {\n window.history.pushState(null, path, path);\n router.routeChange();\n }", "liveReload() {\n Ember.debug('You should override this method for map layer reload');\n }", "function changeRoute(uri) {\n switch(uri) {\n case '/login':\n displayLogin();\n window.history.pushState(currentRoute, 'Minimal JWT - Login', '/login');\n break;\n case '/secret':\n displaySecretView();\n window.history.pushState(currentRoute, 'Minimal JWT - Secret', '/secret');\n break;\n default:\n throw new Error('Unknown route');\n }\n currentRoute = uri;\n}", "preStateChange(action){return;}", "execute() {\n // Routing using Backbone.History to a subroute of an active route was\n // breaking nprogress and the route listeners. This ensures that ALL\n // navigation is treated the same.\n this._isActive = false;\n\n Router.prototype.execute.apply(this, arguments);\n }", "function runEnterHooks(routes, nextState, callback) {\r\n\t var hooks = getEnterHooks(routes);\r\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\r\n\t hooks[index](nextState, replace, next);\r\n\t }, callback);\r\n\t}", "function runEnterHooks(routes, nextState, callback) {\n var hooks = getEnterHooks(routes);\n\n if (!hooks.length) {\n callback();\n return;\n }\n\n var redirectInfo = undefined;\n function replaceState(state, pathname, query) {\n redirectInfo = { pathname: pathname, query: query, state: state };\n }\n\n _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n hooks[index](nextState, replaceState, function (error) {\n if (error || redirectInfo) {\n done(error, redirectInfo); // No need to continue.\n } else {\n next();\n }\n });\n }, callback);\n}", "function runEnterHooks(routes, nextState, callback) {\n var hooks = getEnterHooks(routes);\n\n if (!hooks.length) {\n callback();\n return;\n }\n\n var redirectInfo = undefined;\n function replaceState(state, pathname, query) {\n redirectInfo = { pathname: pathname, query: query, state: state };\n }\n\n _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {\n hooks[index](nextState, replaceState, function (error) {\n if (error || redirectInfo) {\n done(error, redirectInfo); // No need to continue.\n } else {\n next();\n }\n });\n }, callback);\n}", "ROUTE_CHANGED (state, { to, from }) {\n console.log('route changed from', from.name, 'to', to.name)\n }", "_routeChanged(route, basePath) {\n if (typeof route.path === \"string\") {\n if (typeof basePath === \"string\") {\n if (route.path.startsWith(basePath)) {\n return;\n }\n }\n // reload the page which since route changed will load that page\n window.location.reload();\n }\n }", "function updateRoute() {\n\tlet route = window.location.hash.substr(1);\n\tSTORE.dispatch({ type: \"routing\", route });\n}", "_update() {\n window.location.pathname = this._current().url;\n }", "function handleAuthorizedState() {\n\n TransitionEvents.broadcastStateChangePermissionAccepted();\n $location.replace();\n\n // Overwrite notify option to broadcast it later\n TransitionProperties.options = angular.extend({}, TransitionProperties.options, {notify: false});\n\n $state\n .go(TransitionProperties.toState.name, TransitionProperties.toParams, TransitionProperties.options)\n .then(function () {\n TransitionEvents.broadcastStateChangeSuccess();\n });\n }", "goToNextPage(routerHistory) {\n routerHistory.replace(\"/irregularverbs/memorize\");\n }", "function pre(fun) {\n preRouteHook = fun;\n }", "routeChange(a, b, callback) {\n this.setState({\n title: a.routes[0].title\n });\n console.log(a.routes[0].title);\n callback();\n\n }", "onFindPokemonSuccess(payload) {\n payload.history.pushState(null, '/pokemon/' + payload._id); // pour naviguer à la page (via le form de recherche) \n }", "done() {\n this.post(); \n navigateToRoute({});\n }", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}", "function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\t return runTransitionHooks(hooks.length, function (index, replace, next) {\n\t hooks[index](nextState, replace, next);\n\t }, callback);\n\t}" ]
[ "0.6493267", "0.634981", "0.6302787", "0.62859064", "0.62746507", "0.61022764", "0.6086716", "0.604224", "0.604224", "0.604224", "0.6034733", "0.6025055", "0.6016213", "0.6009035", "0.59987426", "0.5981339", "0.5973961", "0.5965341", "0.5963855", "0.59628415", "0.5958349", "0.5958349", "0.5958349", "0.59574556", "0.59460837", "0.5939785", "0.5936351", "0.5900742", "0.5892575", "0.58540696", "0.5844685", "0.58425313", "0.58282757", "0.58233696", "0.5797443", "0.5794411", "0.5785038", "0.57822245", "0.57797563", "0.57794243", "0.5769996", "0.5767651", "0.57508457", "0.57398707", "0.57349133", "0.5727572", "0.5717265", "0.571071", "0.5710154", "0.57010597", "0.5696379", "0.5691713", "0.5691713", "0.5691713", "0.5691713", "0.56900954", "0.5678059", "0.56766325", "0.56736505", "0.5656099", "0.5645658", "0.5624805", "0.56158787", "0.5615443", "0.5605881", "0.5594202", "0.55807847", "0.5561417", "0.55604637", "0.55558604", "0.55558604", "0.5552632", "0.5548701", "0.55446106", "0.5532999", "0.5522497", "0.55217767", "0.5498656", "0.5497219", "0.5493939", "0.5491382", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315", "0.54902315" ]
0.0
-1
Prefetch `page` code, you may wait for the data during `page` rendering. This feature only works in production!
prefetch(url) { return new _Promise((resolve, reject) => { const { pathname, protocol } = url_1.parse(url); if (!pathname || protocol) { if (true) { throw new Error(`Invalid href passed to router: ${url} https://err.sh/zeit/next.js/invalid-href-passed`); } return; } // Prefetch is not supported in development mode because it would trigger on-demand-entries if (true) return; // @ts-ignore pathname is always defined const route = toRoute(pathname); this.pageLoader.prefetch(route).then(resolve, reject); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadAndRenderItems() {\n pageData().then(render)\n }", "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var href = this.getHref();\n\n _router.default.prefetch(href);\n\n prefetched[href] = true;\n }", "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var href = this.getHref();\n\n _router.default.prefetch(href);\n\n prefetched[href] = true;\n }", "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n const {\n pathname\n } = window.location;\n const {\n href: parsedHref\n } = this.formatUrls(this.props.href, this.props.as);\n const href = (0, _url.resolve)(pathname, parsedHref);\n\n _router.default.prefetch(href);\n }", "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n const {\n pathname\n } = window.location;\n const {\n href: parsedHref\n } = this.formatUrls(this.props.href, this.props.as);\n const href = (0, _url.resolve)(pathname, parsedHref);\n\n _router.default.prefetch(href);\n }", "async fetchAndRender(page) {\n // Scroll smoothly to the top\n window.scroll({\n top: 0,\n behavior: \"smooth\",\n });\n\n const { articlesData, paginationData } = await request.get(\n `/api/articles?page=${page}`\n );\n\n // Re-render the pagination and the articles\n new Articles(articlesData).render();\n new Pagination(paginationData).render();\n }", "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var {\n pathname\n } = window.location;\n var {\n href: parsedHref\n } = this.formatUrls(this.props.href, this.props.as);\n var href = (0, _url.resolve)(pathname, parsedHref);\n\n _router.default.prefetch(href);\n }", "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var {\n pathname\n } = window.location;\n var {\n href: parsedHref\n } = this.formatUrls(this.props.href, this.props.as);\n var href = (0, _url.resolve)(pathname, parsedHref);\n\n _router.default.prefetch(href);\n }", "function pageLoad (){\n fetch(quoteAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n quoteData = data;\n renderNewQuote();\n });\n\n fetch(fontAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n fontData = data;\n renderNewFont ();\n });\n}", "loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "loadPage(rawPath) {\n const pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\"findPath\"])(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = _objectSpread(_objectSpread({}, pageResources), {}, {\n staticQueryResults\n });\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "prefetch(options) {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n const paths = this.getPaths(); // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n\n _router.default.prefetch(paths[\n /* href */\n 0], paths[\n /* asPath */\n 1], options).catch(err => {\n if (true) {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n\n prefetched[paths.join( // Join on an invalid URI character\n '%')] = true;\n }", "prefetch(url, asPath = url, options = {}) {\n return new Promise((resolve, reject) => {\n const {\n pathname,\n protocol\n } = url_1.parse(url);\n\n if (!pathname || protocol) {\n if (true) {\n throw new Error(`Invalid href passed to router: ${url} https://err.sh/zeit/next.js/invalid-href-passed`);\n }\n\n return;\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n Promise.all([this.pageLoader.prefetchData(url, asPath), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](toRoute(pathname))]).then(() => resolve(), reject);\n });\n }", "prefetch(url, asPath = url, options = {}) {\n return new Promise((resolve, reject) => {\n const {\n pathname,\n protocol\n } = url_1.parse(url);\n\n if (!pathname || protocol) {\n if (true) {\n throw new Error(`Invalid href passed to router: ${url} https://err.sh/zeit/next.js/invalid-href-passed`);\n }\n\n return;\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n Promise.all([this.pageLoader.prefetchData(url, asPath), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](toRoute(pathname))]).then(() => resolve(), reject);\n });\n }", "function getPage(page,el){if(page===undefined){handleComing();return}fetch(page).then(function(res){return res.text()}).then(function(data){return displayFetch(el,data)});// give clicked element and the data from the server to display.\n}// if it does give the data to the function below for display.", "fetch (params) {\n // input parameters\n let pageId = params.pageId\n let service = params.service\n let path = params.path\n let postParams = params.hasOwnProperty('params') ? params.params : ''\n let method = params.hasOwnProperty('method') ? params.method.toLowerCase() : 'get'\n let collectionType = params.collectionType\n let storeType = params.hasOwnProperty('storeType') ? params.storeType : ''\n let onComplete = params.hasOwnProperty('onComplete') ? params.onComplete : function () { window.alert('implement onComplete') }\n let onCached = params.hasOwnProperty('onCached') ? params.onCached : function (data) { window.alert('implement onCached') }\n let onMetaStore = params.hasOwnProperty('onMetaStore') ? params.onMetaStore : function () { return {} }\n let onElementsStore = params.hasOwnProperty('onElementsStore') ? params.onElementsStore : function (response) { return response.data.data }\n\n // try to get data from the cache (store is used as a cache)\n let data = this.store.getters.getPageData(pageId, collectionType, storeType)\n\n // on cache miss get the fresh data\n if (data.elements.length === 0) {\n let pThis = this\n\n this.backend[method]({\n service: service,\n path: path,\n data: postParams,\n\n callback: function (response) {\n pThis.store.commit('exportDataForPage', {\n elements: onElementsStore(response), // callback: on storing the elements\n meta: onMetaStore(response), // callback: on storing the page metadata\n pageId: pageId,\n collectionType: collectionType,\n storeType: storeType\n })\n\n // callback: on complete\n onComplete(response)\n }\n })\n\n return\n }\n\n // callback: on cached version\n onCached(data)\n }", "prefetch(options) {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var paths = this.getPaths(); // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n\n _router.default.prefetch(paths[\n /* href */\n 0], paths[\n /* asPath */\n 1], options).catch(err => {\n if (true) {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n\n prefetched[paths.join( // Join on an invalid URI character\n '%')] = true;\n }", "prefetch(options) {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var paths = this.getPaths(); // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n\n _router.default.prefetch(paths[\n /* href */\n 0], paths[\n /* asPath */\n 1], options).catch(err => {\n if (true) {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n\n prefetched[paths.join( // Join on an invalid URI character\n '%')] = true;\n }", "prefetch(options) {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var paths = this.getPaths(); // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n\n _router.default.prefetch(paths[\n /* href */\n 0], paths[\n /* asPath */\n 1], options).catch(err => {\n if (true) {\n // rethrow to show invalid URL errors\n throw err;\n }\n });\n\n prefetched[paths.join( // Join on an invalid URI character\n '%')] = true;\n }", "loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_3__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n if (page.error) {\n return {\n error: page.error,\n status: page.status\n };\n }\n\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component || component instanceof Error) {\n finalResult.status = PageResourceStatus.Error;\n finalResult.error = component;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n }).catch(() => {\n throw new Error(`We couldn't load \"${\"\"}/page-data/sq/d/${staticQueryHash}.json\"`);\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = _objectSpread(_objectSpread({}, pageResources), {}, {\n staticQueryResults\n });\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n\n if (finalResult.error) {\n return {\n error: finalResult.error,\n status: finalResult.status\n };\n }\n\n return payload;\n }) // when static-query fail to load we throw a better error\n .catch(err => {\n return {\n error: err,\n status: PageResourceStatus.Error\n };\n });\n });\n inFlightPromise.then(() => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n if (page.error) {\n return {\n error: page.error,\n status: page.status\n };\n }\n\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component || component instanceof Error) {\n finalResult.status = PageResourceStatus.Error;\n finalResult.error = component;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n }).catch(() => {\n throw new Error(`We couldn't load \"${\"\"}/page-data/sq/d/${staticQueryHash}.json\"`);\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n\n if (finalResult.error) {\n return {\n error: finalResult.error,\n status: finalResult.status\n };\n }\n\n return payload;\n }) // when static-query fail to load we throw a better error\n .catch(err => {\n return {\n error: err,\n status: PageResourceStatus.Error\n };\n });\n });\n inFlightPromise.then(() => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n if (page.error) {\n return {\n error: page.error,\n status: page.status\n };\n }\n\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component || component instanceof Error) {\n finalResult.status = PageResourceStatus.Error;\n finalResult.error = component;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n }).catch(() => {\n throw new Error(`We couldn't load \"${\"\"}/page-data/sq/d/${staticQueryHash}.json\"`);\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n\n if (finalResult.error) {\n return {\n error: finalResult.error,\n status: finalResult.status\n };\n }\n\n return payload;\n }) // when static-query fail to load we throw a better error\n .catch(err => {\n return {\n error: err,\n status: PageResourceStatus.Error\n };\n });\n });\n inFlightPromise.then(() => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n if (page.error) {\n return {\n error: page.error,\n status: page.status\n };\n }\n\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component || component instanceof Error) {\n finalResult.status = PageResourceStatus.Error;\n finalResult.error = component;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n }).catch(() => {\n throw new Error(`We couldn't load \"${\"\"}/page-data/sq/d/${staticQueryHash}.json\"`);\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n\n if (finalResult.error) {\n return {\n error: finalResult.error,\n status: finalResult.status\n };\n }\n\n return payload;\n }) // when static-query fail to load we throw a better error\n .catch(err => {\n return {\n error: err,\n status: PageResourceStatus.Error\n };\n });\n });\n inFlightPromise.then(() => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }", "async function pageFunction(context) {\n // jQuery is handy for finding DOM elements and extracting data from them.\n // To use it, make sure to enable the \"Inject jQuery\" option.\n const $ = context.jQuery;\n const pageTitle = $('title').first().text();\n const date = $('#article .articleMeta .dateTime').text();\n const perex = $('.perex').text();\n const text = $('#article .body').text();\n \n\n // Print some information to actor log\n context.log.info(`URL: ${context.request.url}, TITLE: ${pageTitle}`);\n \n // Return an object with the data extracted from the page.\n // It will be stored to the resulting dataset.\n return {\n url: context.request.url,\n pageTitle,\n date,\n perex,\n text\n \n };\n}", "function prefetchData() {\n\t\tpaymentsClient.prefetchPaymentData(getRequest());\n\t}", "prefetch(url) {\n return new _Promise((resolve, reject) => {\n const {\n pathname,\n protocol\n } = url_1.parse(url);\n\n if (!pathname || protocol) {\n if (true) {\n throw new Error(`Invalid href passed to router: ${url} https://err.sh/zeit/next.js/invalid-href-passed`);\n }\n\n return;\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n } // @ts-ignore pathname is always defined\n\n\n const route = toRoute(pathname);\n this.pageLoader.prefetch(route).then(resolve, reject);\n });\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n const pages = await this.pageLoader.getPageList();\n parsed = this._resolveHref(parsed, pages);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (false) {}\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);\n await Promise.all([this.pageLoader.prefetchData(url, asPath, this.locale, this.defaultLocale), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n const pages = await this.pageLoader.getPageList();\n parsed = this._resolveHref(parsed, pages);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);\n await Promise.all([this.pageLoader.prefetchData(url, asPath, this.locale, this.defaultLocale), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "async loadPage (page, data, skipPush) {\n // Close some menus and tooltips.\n this.tooltip.style.left = '-10000px'\n this.page.noteBox.style.display = 'none'\n this.page.noteIndicator.style.display = 'none'\n this.page.profileBox.style.display = 'none'\n // Parse the request.\n const url = new URL(`/${page}`, window.location.origin)\n const requestedHandler = handlerFromPath(page)\n // Fetch and parse the page.\n const response = await window.fetch(url)\n if (!response.ok) return false\n const html = await response.text()\n const doc = Doc.noderize(html)\n const main = idel(doc, 'main')\n const delivered = main.dataset.handler\n // Append the request to the page history.\n if (!skipPush) {\n const path = delivered === requestedHandler ? url.toString() : `/${delivered}`\n window.history.pushState({ page: page, data: data }, delivered, path)\n }\n // Insert page and attach handlers.\n document.title = doc.title\n this.main.replaceWith(main)\n this.main = main\n this.attach(data)\n return true\n }", "loadPage(rawPath){const pagePath=Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\"findPath\"])(rawPath);if(this.pageDb.has(pagePath)){const page=this.pageDb.get(pagePath);return Promise.resolve(page.payload);}if(this.inFlightDb.has(pagePath)){return this.inFlightDb.get(pagePath);}const inFlight=Promise.all([this.loadAppData(),this.loadPageDataJson(pagePath)]).then(allData=>{const result=allData[1];if(result.status===PageResourceStatus.Error){return{status:PageResourceStatus.Error};}let pageData=result.payload;const{componentChunkName}=pageData;return this.loadComponent(componentChunkName).then(component=>{const finalResult={createdAt:new Date()};let pageResources;if(!component){finalResult.status=PageResourceStatus.Error;}else{finalResult.status=PageResourceStatus.Success;if(result.notFound===true){finalResult.notFound=true;}pageData=Object.assign(pageData,{webpackCompilationHash:allData[0]?allData[0].webpackCompilationHash:``});pageResources=toPageResources(pageData,component);finalResult.payload=pageResources;_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].emit(`onPostLoadPageResources`,{page:pageResources,pageResources});}this.pageDb.set(pagePath,finalResult);// undefined if final result is an error\nreturn pageResources;});})// prefer duplication with then + catch over .finally to prevent problems in ie11 + firefox\n.then(response=>{this.inFlightDb.delete(pagePath);return response;}).catch(err=>{this.inFlightDb.delete(pagePath);throw err;});this.inFlightDb.set(pagePath,inFlight);return inFlight;}", "loadPage(rawPath){const pagePath=Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\"findPath\"])(rawPath);if(this.pageDb.has(pagePath)){const page=this.pageDb.get(pagePath);return Promise.resolve(page.payload);}if(this.inFlightDb.has(pagePath)){return this.inFlightDb.get(pagePath);}const inFlight=Promise.all([this.loadAppData(),this.loadPageDataJson(pagePath)]).then(allData=>{const result=allData[1];if(result.status===PageResourceStatus.Error){return{status:PageResourceStatus.Error};}let pageData=result.payload;const{componentChunkName}=pageData;return this.loadComponent(componentChunkName).then(component=>{const finalResult={createdAt:new Date()};let pageResources;if(!component){finalResult.status=PageResourceStatus.Error;}else{finalResult.status=PageResourceStatus.Success;if(result.notFound===true){finalResult.notFound=true;}pageData=Object.assign(pageData,{webpackCompilationHash:allData[0]?allData[0].webpackCompilationHash:``});pageResources=toPageResources(pageData,component);finalResult.payload=pageResources;_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].emit(`onPostLoadPageResources`,{page:pageResources,pageResources});}this.pageDb.set(pagePath,finalResult);// undefined if final result is an error\nreturn pageResources;});})// prefer duplication with then + catch over .finally to prevent problems in ie11 + firefox\n.then(response=>{this.inFlightDb.delete(pagePath);return response;}).catch(err=>{this.inFlightDb.delete(pagePath);throw err;});this.inFlightDb.set(pagePath,inFlight);return inFlight;}", "prefetch(url) {\n return new Promise((resolve, reject) => {\n const {\n pathname,\n protocol\n } = url_1.parse(url);\n\n if (!pathname || protocol) {\n if (true) {\n throw new Error(`Invalid href passed to router: ${url} https://err.sh/zeit/next.js/invalid-href-passed`);\n }\n\n return;\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n } // @ts-ignore pathname is always defined\n\n\n const route = toRoute(pathname);\n this.pageLoader.prefetch(route).then(resolve, reject);\n });\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n\n if (false) {}\n\n const pages = await this.pageLoader.getPageList();\n parsed = resolveDynamicRoute(parsed, pages, false);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n }\n\n let route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);\n let resolvedAs = asPath;\n\n if (false) {} // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n await Promise.all([this.pageLoader._isSsg(url).then(isSsg => {\n return isSsg ? this._getStaticData(this.pageLoader.getDataHref(url, resolvedAs, true, typeof options.locale !== 'undefined' ? options.locale : this.locale)) : false;\n }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n\n if (false) {}\n\n const pages = await this.pageLoader.getPageList();\n parsed = this._resolveHref(parsed, pages, false);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (false) {}\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);\n await Promise.all([this.pageLoader._isSsg(url).then(isSsg => {\n return isSsg ? this._getStaticData(this.pageLoader.getDataHref(url, asPath, true, typeof options.locale !== 'undefined' ? options.locale : this.locale)) : false;\n }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "render() {\n return this.props.ready ? (\n this.renderPage()\n ) : (\n <Loader active>Getting data</Loader>\n );\n }", "prefetch(url, asPath = url, options = {}) {\n return new Promise((resolve, reject) => {\n const {\n pathname,\n protocol\n } = url_1.parse(url);\n\n if (!pathname || protocol) {\n if (true) {\n throw new Error(`Invalid href passed to router: ${url} https://err.sh/zeit/next.js/invalid-href-passed`);\n }\n\n return;\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n const route = delBasePath(toRoute(pathname));\n Promise.all([this.pageLoader.prefetchData(url, delBasePath(asPath)), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]).then(() => resolve(), reject);\n });\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Fetching Data</Loader>;\n }", "function fetchPage(page) {\n /*fetchPage nome da função (parametros que quero receber (page)) */\n /* const cria uma constante (content) pode ser qualquer nome */\n const content = $(\"#mainContent\");\n fetch(page)\n /* Função do js (pegar) */\n .then((resp) => resp.text())\n .then((rawPage) => content.html(rawPage)); /* pegar page */\n}", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n\n if (false) {}\n\n const pages = await this.pageLoader.getPageList();\n parsed = this._resolveHref(parsed, pages, false);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);\n await Promise.all([this.pageLoader._isSsg(url).then(isSsg => {\n return isSsg ? this._getStaticData(this.pageLoader.getDataHref(url, asPath, true, typeof options.locale !== 'undefined' ? options.locale : this.locale)) : false;\n }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n\n if (false) {}\n\n const pages = await this.pageLoader.getPageList();\n parsed = this._resolveHref(parsed, pages, false);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname);\n await Promise.all([this.pageLoader._isSsg(url).then(isSsg => {\n return isSsg ? this._getStaticData(this.pageLoader.getDataHref(url, asPath, true, typeof options.locale !== 'undefined' ? options.locale : this.locale)) : false;\n }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "function loadPage() {\n getAPIData(`https://pokeapi.co/api/v2/pokemon?limit=25`).then(\n //?limit=25&offset=800\n async (data) => {\n for (const pokemon of data.results) {\n await getAPIData(pokemon.url).then((pokeData) => {\n populatePokeCard(pokeData)\n })\n }\n },\n )\n }", "load() {\r\n // load item id, then load page data from new pages api\r\n return this.getItem(\"Id\", \"CommentsDisabled\").then(item => {\r\n return (new SharePointQueryable(this, `_api/sitepages/pages(${item.Id})`)).get().then(pageData => {\r\n this.commentsDisabled = item.CommentsDisabled;\r\n return this.fromJSON(pageData);\r\n });\r\n });\r\n }", "function fetchPage (page) {\n return self.podcastPage({\n uuid: params.uuid,\n page: page\n })()\n .then(function (result) {\n // console.log('|fetchPage-%d|: %d', page, result.length);\n return result\n })\n }", "prefetch(url, asPath = url, options = {}) {\n return new Promise((resolve, reject) => {\n const {\n pathname,\n protocol\n } = (0, _url2.parse)(url);\n\n if (!pathname || protocol) {\n if (true) {\n throw new Error(`Invalid href passed to router: ${url} https://err.sh/vercel/next.js/invalid-href-passed`);\n }\n\n return;\n } // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n\n if (true) {\n return;\n }\n\n const route = delBasePath(toRoute(pathname));\n Promise.all([this.pageLoader.prefetchData(url, delBasePath(asPath)), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]).then(() => resolve(), reject);\n });\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n\n if (false) {}\n\n const pages = await this.pageLoader.getPageList();\n let resolvedAs = asPath;\n\n if (false) {} else {\n parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n }\n }\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname); // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n if (false) {}\n\n await Promise.all([this.pageLoader._isSsg(route).then(isSsg => {\n return isSsg ? this._getStaticData(this.pageLoader.getDataHref(url, resolvedAs, true, typeof options.locale !== 'undefined' ? options.locale : this.locale)) : false;\n }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "async prefetch(url, asPath = url, options = {}) {\n let parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);\n let {\n pathname\n } = parsed;\n\n if (false) {}\n\n const pages = await this.pageLoader.getPageList();\n let resolvedAs = asPath;\n\n if (false) {} else {\n parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n url = (0, _utils.formatWithValidation)(parsed);\n }\n }\n\n const route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(pathname); // Prefetch is not supported in development mode because it would trigger on-demand-entries\n\n if (true) {\n return;\n }\n\n await Promise.all([this.pageLoader._isSsg(route).then(isSsg => {\n return isSsg ? this._getStaticData(this.pageLoader.getDataHref(url, resolvedAs, true, typeof options.locale !== 'undefined' ? options.locale : this.locale)) : false;\n }), this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route)]);\n }", "async function pageLoaded() {\n loadRegisteData();\n prepareHandles();\n}", "defaultPageData() {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "function loadPageContent(page_id) {\n getStudents(page_id)\n .then(function (data) {\n setBody(data);\n setPagination(data, page_id);\n });\n}", "serverPrefetch () {\n return this.fetchEntries() // works\n }", "async function initializePage() {\r\n // Bind the tab functionality\r\n initializeTabs();\r\n\r\n // Load the page data\r\n const response = await requestPageData(getComicAndPageFromActiveUrl().pageSlug);\r\n await navigateToPage(response.slug, false);\r\n\r\n await preloadRandomComics();\r\n }", "fetchNextPage() {\n\n // if fetch function has been passed in,\n // fetch data\n if (this.props.fetchNextPage) {\n this.props.fetchNextPage();\n }\n }", "async fetch(cb) {\n const { articlesData } = await request.get(\"/api/articles?page=1\");\n\n this.articles = articlesData;\n\n cb();\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "function pagePreload(){\n setWebcrawlerID();\n setChildsAndParents();\n startHTTPStatus();\n pageLoad();\n}", "requestPage() {\n let index = this.pages.length;\n\n // Prevent multiple requests while the new page is still loading and\n // not yet injected into the DOM.\n if (!this.lockRequest) {\n this.lockRequest = true;\n\n // Request the page and inject it into the DOM afterwards.\n $.ajax({\n url : `/page/${index}/`,\n method : 'post',\n dataType : 'text'\n }).done((response) => {\n // Inject the HTML.\n let $page = $(response).appendTo(this.$el);\n\n // Keep track of the page in the list.\n this.insertPage($page);\n\n // Make sure the lock is cleared.\n this.lockRequest = false;\n });\n }\n }", "function preLoad() {\n // load something and continue on only when finished\n}", "function pageFullyLoaded () {}", "async getPage(url = 'api/posts'){\n const res = await api.get(url)\n AppState.posts = res.data.posts\n AppState.propost = res.data\n AppState.newer = res.data.newer\n AppState.older = res.data.older\n // AppState.posts = res.data.posts\n \n // AppState.page++\n \n \n}" ]
[ "0.7043598", "0.69597477", "0.69597477", "0.6868784", "0.6868784", "0.67919433", "0.6769896", "0.6769896", "0.6579662", "0.6304017", "0.6304017", "0.6301481", "0.6300077", "0.62954915", "0.62954915", "0.6271136", "0.62579906", "0.6233454", "0.6233454", "0.6233454", "0.62127614", "0.62078196", "0.62078196", "0.62078196", "0.61889035", "0.6173736", "0.6149141", "0.6147778", "0.6136627", "0.61302847", "0.61287373", "0.61287373", "0.6102817", "0.6098642", "0.609222", "0.60914284", "0.60849893", "0.60846573", "0.608404", "0.60762584", "0.60762584", "0.6068348", "0.60488945", "0.6039679", "0.60385305", "0.60315156", "0.60315156", "0.60315156", "0.60315156", "0.6027027", "0.60204726", "0.6001214", "0.5979406", "0.5978693", "0.59469235", "0.5922029", "0.590406", "0.5891687", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5888995", "0.5887966", "0.58873653", "0.5887125", "0.5875397", "0.5874888", "0.5863876", "0.58605915" ]
0.60669357
44